qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 6/6] cpu-exec: Move TB chaining into tb_find_


From: Sergey Fedorov
Subject: Re: [Qemu-devel] [PATCH v6 6/6] cpu-exec: Move TB chaining into tb_find_fast()
Date: Fri, 29 Apr 2016 16:58:25 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 29/04/16 16:54, Alex Bennée wrote:
> Sergey Fedorov <address@hidden> writes:
>> diff --git a/cpu-exec.c b/cpu-exec.c
>> index f49a436e1a5a..5f23c0660d6e 100644
>> --- a/cpu-exec.c
>> +++ b/cpu-exec.c
>> @@ -320,7 +320,9 @@ found:
>>      return tb;
>>  }
>>
>> -static inline TranslationBlock *tb_find_fast(CPUState *cpu)
>> +static inline TranslationBlock *tb_find_fast(CPUState *cpu,
>> +                                             TranslationBlock **last_tb,
>> +                                             int tb_exit)
>>  {
>>      CPUArchState *env = (CPUArchState *)cpu->env_ptr;
>>      TranslationBlock *tb;
>> @@ -331,11 +333,24 @@ static inline TranslationBlock *tb_find_fast(CPUState 
>> *cpu)
>>         always be the same before a given translated block
>>         is executed. */
>>      cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
>> +    tb_lock();
>>      tb = cpu->tb_jmp_cache[tb_jmp_cache_hash_func(pc)];
>>      if (unlikely(!tb || tb->pc != pc || tb->cs_base != cs_base ||
>>                   tb->flags != flags)) {
>>          tb = tb_find_slow(cpu, pc, cs_base, flags);
>>      }
>> +    if (cpu->tb_flushed) {
>> +        /* Ensure that no TB jump will be modified as the
>> +         * translation buffer has been flushed.
>> +         */
>> +        *last_tb = NULL;
>> +        cpu->tb_flushed = false;
>> +    }
>> +    /* See if we can patch the calling TB. */
>> +    if (*last_tb && qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
> This should be !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)

Probably, it's mine rebase conflict resolution mistake. Nice catch, thanks!

Kind regards,
Sergey

>
>> +        tb_add_jump(*last_tb, tb_exit, tb);
>> +    }
>> +    tb_unlock();
>>      return tb;
>>  }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]