qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@axis.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] env fields as TCG variables
Date: Tue, 16 Sep 2008 21:11:12 +0200	[thread overview]
Message-ID: <20080916191112.GA3992@edgar.se.axis.com> (raw)
In-Reply-To: <f43fc5580809161137t819cb9ehd94b8c2be1b253@mail.gmail.com>

On Tue, Sep 16, 2008 at 09:37:41PM +0300, Blue Swirl wrote:
> I wonder if the following bug scenario is possible.
> 
> Some of the env fields are accessible as TCG variables, like cpu_fsr
> for Sparc floating point status register (%fsr), stored in the env
> structure field env->fsr. When cpu_fsr is used in the generated code,
> a host CPU register is allocated for this task. But env->fsr can be
> modified directly in op_helper.c code. Isn't it then possible that the
> register (which stores cpu_fsr) and the structure field in memory
> (env->fsr) get out of sync?
> 
> If this is true, no code outside the generated code should ever modify
> or even read env fields that are also available as TCG variables. Or
> do I miss something?

Hello,

IIRC:
TCG writebacks before calling helpers. There used to be a bug with
qemu_ld/qemu_st like the one you described but it was fixed a long
time ago. I ran into that one with CRIS and avoided it for a while
by calling a dummy helper before load/stores.

Best regards

  reply	other threads:[~2008-09-16 19:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 18:37 [Qemu-devel] env fields as TCG variables Blue Swirl
2008-09-16 19:11 ` Edgar E. Iglesias [this message]
2008-09-16 19:31   ` Blue Swirl
2008-09-16 19:41     ` Edgar E. Iglesias
2008-09-16 20:07       ` Edgar E. Iglesias

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=20080916191112.GA3992@edgar.se.axis.com \
    --to=edgar.iglesias@axis.com \
    --cc=blauwirbel@gmail.com \
    --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 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).