[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 2/3] tcg-runtime: light re-factor of lookup_t
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH v1 2/3] tcg-runtime: light re-factor of lookup_tb_ptr |
Date: |
Wed, 14 Jun 2017 17:07:53 +0100 |
User-agent: |
mu4e 0.9.19; emacs 25.2.50.3 |
Richard Henderson <address@hidden> writes:
> On 06/14/2017 07:02 AM, Alex Bennée wrote:
>> Just a little precursor re-factoring before I was going to add a trace
>> point:
>>
>> - single return point, defaulting to tcg_ctx.code_gen_epilogue
>
> Why? Any if you're going to do that, why not init ret = epilogue and
> avoid the null test at the end?
That would be better. I think the NULL is left over from my originall
debugging when I had added a trace point and wanted to see when the
lookup had failed.
>
>> - move cs_base, pc and flags inside the jump cache hit scope
>
> Funny story. While looking at this again, I notice that there's no
> reason to avoid, and every reason not to avoid, calling
> tb_htable_lookup when tb_jmp_cache is empty. So I'm now doing
>
> tb = atomic_rcu_read(...);
> cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
>
> if (!(tb && tb->pc == addr && ...)) {
> tb = tb_htable_lookup(...);
> ...
OK I can fix on the next iteration.
>> - calculate the tb_jmp_cache hash once
>
> I did look once and the compiler is doing the CSE. But it does look cleaner.
>
>
> r~
--
Alex Bennée
[Qemu-devel] [PATCH v1 2/3] tcg-runtime: light re-factor of lookup_tb_ptr, Alex Bennée, 2017/06/14
[Qemu-devel] [PATCH v1 1/3] vl: Fix broken thread=xxx option of the --accel parameter, Alex Bennée, 2017/06/14
Re: [Qemu-devel] [PATCH v1 0/3] Fixes for TCG hangs, Philippe Mathieu-Daudé, 2017/06/14
Re: [Qemu-devel] [PATCH v1 0/3] Fixes for TCG hangs, no-reply, 2017/06/14