qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] throwing away translated code on CPU reset


From: Peter Maydell
Subject: Re: [Qemu-devel] throwing away translated code on CPU reset
Date: Sun, 15 Jan 2012 16:43:14 +0000

On 14 January 2012 14:48, Aurelien Jarno <address@hidden> wrote:
> On Thu, Jan 12, 2012 at 02:00:38PM +0000, Peter Maydell wrote:
>> When doing TCG code translation, the target-foo translate.c
>> code is allowed to bake assumptions into the generated code from
>> the current values of various fields in the CPUState. This then
>> imposes the requirement that if the field is changed then tb_flush
>> must be called to throw away the now-incorrect generated code.
>>
>> However, cpu_reset() changes (unsurprisingly) lots of fields in
>> the CPUState, but it doesn't call tb_flush()...
>>
>> So should cpu_reset() implementations be changed to call tb_flush()
>> as well as tlb_flush(), or is this supposed to work in some other
>> way?
>
> We use the hflags to determine in which conditions the cached code has
> been generated, so that we only used the cache code if the CPU is in the
> same mode. I therefore don't think there is a real need to flush the
> cached code.

This only applies for things which are encoded in tb->flags.
Look at handling of eg env->cp15.c1_coproc or env->teecr for
env changes that do need a flush.

Perhaps this just indicates that CPUs using this approach for
some env fields should be calling tb_flush() but not those
that do not. It looks as if that's just ARM at the moment. Hmm.

-- PMM



reply via email to

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