All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] throwing away translated code on CPU reset
Date: Sat, 14 Jan 2012 15:48:50 +0100	[thread overview]
Message-ID: <20120114144850.GD711@hall.aurel32.net> (raw)
In-Reply-To: <CAFEAcA9atCC11RiuORHAF7Nf6xnXBCDCM=GM7jDfOW9bsm7KYg@mail.gmail.com>

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
aurelien@aurel32.net                 http://www.aurel32.net

  parent reply	other threads:[~2012-01-14 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 14:00 [Qemu-devel] throwing away translated code on CPU reset Peter Maydell
2012-01-12 14:18 ` Andreas Färber
2012-01-13  7:55 ` 陳韋任
2012-01-13  9:08   ` Peter Maydell
2012-01-14 14:48 ` Aurelien Jarno [this message]
2012-01-15 16:43   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120114144850.GD711@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=agraf@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.