Richard Henderson <r...@twiddle.net> writes:

> On 01/27/2017 02:39 AM, Alex Bennée wrote:
>> +    for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) {
>>
>> -        tlb_debug("%d\n", mmu_idx);
>> +        if (test_bit(mmu_idx, &mmu_idx_bitmask)) {
>> +            tlb_debug("%d\n", mmu_idx);
>>
>> -        memset(env->tlb_table[mmu_idx], -1, sizeof(env->tlb_table[0]));
>> -        memset(env->tlb_v_table[mmu_idx], -1, sizeof(env->tlb_v_table[0]));
>> +            memset(env->tlb_table[mmu_idx], -1, sizeof(env->tlb_table[0]));
>> +            memset(env->tlb_v_table[mmu_idx], -1, 
>> sizeof(env->tlb_v_table[0]));
>> +        }
>
> Perhaps it doesn't matter since NB_MMU_MODES is so small but
>
>    for (; idxmap != 0; idxmap &= idxmap - 1) {
>      int mmu_idx = ctz32(idxmap);
>      ...
>    }

Perhaps but if it is OK with you I'll skip this optimisation for now? We
are basically in the slow path by this point and for clarity I'd prefer
to keep it as is.

--
Alex Bennée

Reply via email to