qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Actual TB code doesn't look like what was intended (TCG issue)?
Date: Fri, 24 Jun 2011 11:32:22 +0100	[thread overview]
Message-ID: <BANLkTi=aVTySrPUu4jZAmPV-D8pYSmYEWg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin4PSNA=utfRUJBR+2_Du0WXnS-Cg@mail.gmail.com>

On 24 June 2011 11:08, Max Filippov <jcmvbkbc@gmail.com> wrote:
>> Here are my rules of thumb for generating code where the code
>> generated might change based on some bit of CPU state:
>>
>> When you are generating code, if the code you generate will
>> change based on the contents of something in the CPUState struct,
>> then the bit of CPUState you are looking at has to be one of:
>>  (1) encoded in the TB flags (or tb->pc or tb->cs_base)
>>      (and gen_intermediate_code_internal() must read and
>>      use the value in tb->tb_flags, not the one in env)
>
> So if changing a bit of context does not cause TB invalidation then it
> must be captured in cpu_get_tb_cpu_state and
> gen_intermediate_code_internal must use that captured value?

Yes. (The other option is to arrange to not change the code you
generate based on that bit of context, for instance you can generate
code which loads an env field and passes it to a helper function.)

-- PMM

  reply	other threads:[~2011-06-24 10:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24  2:44 [Qemu-devel] Actual TB code doesn't look like what was intended (TCG issue)? Max Filippov
2011-06-24  7:46 ` Peter Maydell
2011-06-24  8:34   ` Max Filippov
2011-06-24  9:42     ` Peter Maydell
2011-06-24 10:08       ` Max Filippov
2011-06-24 10:32         ` Peter Maydell [this message]
2011-06-24 17:06       ` Max Filippov
2011-06-24  8:14 ` Laurent Desnogues
2011-06-24  8:35   ` Max Filippov
2011-06-24  9:38     ` Laurent Desnogues
2011-06-24  9:48       ` Max Filippov

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='BANLkTi=aVTySrPUu4jZAmPV-D8pYSmYEWg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=jcmvbkbc@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).