qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] tcg: reworking tb_invalidated_flag


From: Sergey Fedorov
Subject: Re: [Qemu-devel] tcg: reworking tb_invalidated_flag
Date: Thu, 31 Mar 2016 16:14:13 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 30/03/16 21:13, Paolo Bonzini wrote:
>
> On 30/03/2016 19:08, Sergey Fedorov wrote:
>> The second approach is to make 'tb_invalidated_flag' per-CPU. This
>> would be conceptually similar to what we have, but would give us thread
>> safety. With this approach, we need to be careful to correctly clear and
>> set the flag.
> You can just ensure that setting and clearing it is done under tb_lock.

So it could remain sitting in 'tcg_ctx.tb_ctx'. I'm just wondering what
could be real benefits for making it per-CPU then?

> Because TranslationBlocks live in tcg_ctx.tb_ctx.tbs you need
> special code to exit all CPUs at tb_flush time, otherwise you risk that
> a tb_alloc reuses a TranslationBlock while it is in use by a VCPU.

Looks like no matter which approach we use, it's ultimately necessary to
ensure all CPUs have exited from translated code before the translation
buffer may be safely flushed.

Kind regards,
Sergey



reply via email to

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