qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Richard Henderson <rth@twiddle.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Max Filippov <jcmvbkbc@gmail.com>
Subject: Re: [Qemu-devel] Shifts, ppc[64], xtensa
Date: Wed, 19 Sep 2012 19:51:16 +0200	[thread overview]
Message-ID: <20120919175116.GC29951@hall.aurel32.net> (raw)
In-Reply-To: <505A011C.1020106@twiddle.net>

On Wed, Sep 19, 2012 at 10:30:04AM -0700, Richard Henderson wrote:
> On 09/19/2012 10:11 AM, Peter Maydell wrote:
> > Can you elaborate? If we're emitting a native branch insn
> > and we're potentially changing the value in memory several
> > times during retranslate I would have thought it still applied.
> 
> For brcond, we always apply the relocation before we ever try to execute the TB.
> 
> For goto_tb, we expect the contents of the patch to contain valid insns from the
> start.  We never apply a "null" relocation there.  Perhaps this should be considerd
> a bug in cpu_gen_code, but that's where we are.
> 

There is no cache problem in that case, because the cache are
synchronized just after the value is modified (see exec-all.h).

That said it is not a valid reason to not keep the value during
re-translation, as it means the TB will exit instead of linking to 
the next one. The consequences are only the performance.

The real problem in the PPC case is that changing the jump address is 
not atomic. In some rare cases (but given the number of executed TB in
system mode, it should be considered as probable), this might cause a 
jump to the wrong address. This is especially true when doing TB 
unlinking. That's one of the reason we are not doing direct jump on MIPS
for example (that should be something possible, but with a lot of
constraints on the size and location of the code gen buffer).

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

  reply	other threads:[~2012-09-19 17:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 19:52 [Qemu-devel] Shifts, ppc[64], xtensa malc
2012-09-18 23:20 ` Max Filippov
2012-09-19 12:49   ` malc
2012-09-19 15:00     ` Max Filippov
2012-09-19  0:10 ` Richard Henderson
2012-09-19 12:46   ` malc
2012-09-19 12:57 ` Peter Maydell
2012-09-19 17:00   ` Richard Henderson
2012-09-19 17:02     ` Richard Henderson
2012-09-19 17:11     ` Peter Maydell
2012-09-19 17:30       ` Richard Henderson
2012-09-19 17:51         ` Aurelien Jarno [this message]
2012-09-19 18:01           ` Richard Henderson
2012-09-19 18:30             ` Peter Maydell
2012-09-19 18:35               ` Richard Henderson
2012-09-19 19:53               ` Richard Henderson
2012-09-19 20:05                 ` Peter Maydell
2012-09-19 21:21                   ` Richard Henderson
2012-09-20  0:29                 ` Max Filippov
2012-09-20 14:03                   ` Richard Henderson
2012-09-20 14:22                     ` Max Filippov
2012-09-20 22:53                   ` malc

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=20120919175116.GC29951@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=jcmvbkbc@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).