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: Aurelien Jarno
Subject: Re: [Qemu-devel] throwing away translated code on CPU reset
Date: Sat, 14 Jan 2012 15:48:50 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

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.

What should be ensured on the other hand, is that hflag is correctly
updated during or after the reset. This is the case for at least PowerPC
and MIPS.


-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net



reply via email to

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