[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: |
Sergey Fedorov |
Subject: |
Re: [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState |
Date: |
Wed, 6 Apr 2016 13:11:06 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 05/04/16 18:44, Paolo Bonzini wrote:
>
> 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.
>
Yes, I'm going to do something like this in a separate patch series or
just append it back to the "TCG misc clean-up" patch series when
re-spinning it.
Kind regards,
Sergey
- [Qemu-devel] [RFC v2 00/11] Base enabling patches for MTTCG, Alex Bennée, 2016/04/05
- [Qemu-devel] [RFC v2 05/11] tcg: protect TBContext with tb_lock., Alex Bennée, 2016/04/05
- [Qemu-devel] [RFC v2 09/11] tcg: add kick timer for single-threaded vCPU emulation, Alex Bennée, 2016/04/05
- [Qemu-devel] [RFC v2 06/11] target-arm/psci.c: wake up sleeping CPUs, Alex Bennée, 2016/04/05
- [Qemu-devel] [RFC v2 02/11] cpus: make all_vcpus_paused() return bool, Alex Bennée, 2016/04/05
- [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG, Alex Bennée, 2016/04/05
- [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState, Alex Bennée, 2016/04/05
- [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