[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUStat
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState |
Date: |
Tue, 5 Apr 2016 17:44:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 05/04/2016 17:32, Alex Bennée wrote:
> + cpu->tb_invalidated_flag = false;
> tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base, orig_tb->flags,
> max_cycles | CF_NOCACHE
> | (ignore_icount ? CF_IGNORE_ICOUNT : 0));
> - tb->orig_tb = tcg_ctx.tb_ctx.tb_invalidated_flag ? NULL : orig_tb;
> + tb->orig_tb = cpu->tb_invalidated_flag ? NULL : orig_tb;
> cpu->current_tb = tb;
Based on discussion, it's safest to save the old value at the beginning
of the hunk, and "OR" it into cpu->tb_invalidated_flag here.
> /* if no translated code available, then translate it now */
> + cpu->tb_invalidated_flag = false;
Please remove this...
> tb = tb_gen_code(cpu, pc, cs_base, flags, 0);
>
> #ifdef CONFIG_USER_ONLY
> @@ -509,12 +509,11 @@ int cpu_exec(CPUState *cpu)
> tb = tb_find_fast(cpu);
> /* Note: we do it here to avoid a gcc bug on Mac OS X when
> doing it in tb_find_slow */
> - if (tcg_ctx.tb_ctx.tb_invalidated_flag) {
> + if (cpu->tb_invalidated_flag) {
> /* as some TB could have been invalidated because
> - of memory exceptions while generating the code, we
> + of a tb_flush while generating the code, we
> must recompute the hash index here */
> next_tb = 0;
> - tcg_ctx.tb_ctx.tb_invalidated_flag = 0;
... and leave the zeroing here.
Paolo
> }
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, (continued)
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Sergey Fedorov, 2016/04/12
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, KONRAD Frederic, 2016/04/12
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Sergey Fedorov, 2016/04/12
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Pavel Dovgalyuk, 2016/04/12
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Sergey Fedorov, 2016/04/12
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Alex Bennée, 2016/04/12
- Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Sergey Fedorov, 2016/04/12
Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Sergey Fedorov, 2016/04/12
[Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState, Alex Bennée, 2016/04/05
- Re: [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState,
Paolo Bonzini <=
[Qemu-devel] [RFC v2 03/11] docs: new design document multi-thread-tcg.txt (DRAFTING), Alex Bennée, 2016/04/05
[Qemu-devel] [RFC v2 11/11] tcg: enable thread-per-vCPU, Alex Bennée, 2016/04/05
[Qemu-devel] [RFC v2 07/11] tcg: cpus rm tcg_exec_all(), Alex Bennée, 2016/04/05
[Qemu-devel] [RFC v2 10/11] tcg: drop global lock during TCG code execution, Alex Bennée, 2016/04/05
[Qemu-devel] [RFC v2 04/11] tcg: comment on which functions have to be called with tb_lock held, Alex Bennée, 2016/04/05