All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lindsay via <qemu-devel@nongnu.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, cota@braap.org, richard.henderson@linaro.org
Subject: Re: Detecting Faulting Instructions From Plugins
Date: Fri, 5 Feb 2021 10:42:55 -0500	[thread overview]
Message-ID: <YB1nf/M613d0B+Pm@strawberry.localdomain> (raw)
In-Reply-To: <87v9b6o8bu.fsf@linaro.org>

On Feb 05 15:03, Alex Bennée wrote:
> Aaron Lindsay <aaron@os.amperecomputing.com> writes:
> > Assuming you're right that TCG is detecting "a io_readx/io_writex when
> > ->can_do_io is not true", could we detect this case when it occurs and
> > omit the instruction callbacks for the re-translation of the single
> > instruction (allow the initial callback to stand instead of trying to
> > turn back time, in a way, to prevent it)? Maybe there would have be some
> > bookkeeping in the plugin infrastructure side rather than entirely
> > omitting the callbacks when re-translating, in case that translation got
> > re-used in a case which didn't hit the same behavior and shouldn't be
> > skipped?
> 
> They are happening in two separate phases. The translation phase has no
> idea what the runtime condition will be. Once we get to runtime it's too
> late - and we trigger a new translation phase.

I believe I understand why we can't catch the initial translation. To
make sure I'm communicating well, my current understanding is that the
timeline for this case goes something like:

1) translate large block of instructions, including ldr
2) attempt to execute ldr, calling instruction callback
3) notice that access is to IO, trigger re-translation of single
   ldr instruction
4) execute block with single ldr instruction to completion, calling both
   instruction and memory callbacks

I was wondering if it would be possible to inform the re-translation in
step 3 that it's for a re-translated IO access so that it could
ultimately cause the second of the duplicate instruction callbacks to be
omitted during execution in 4.

-Aaron


  parent reply	other threads:[~2021-02-05 15:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-30  3:23 Detecting Faulting Instructions From Plugins Aaron Lindsay
2021-01-30 18:55 ` Aaron Lindsay
2021-02-01 12:07   ` Alex Bennée
2021-02-04 21:31 ` Aaron Lindsay
2021-02-05 11:19   ` Alex Bennée
2021-02-05 14:26     ` Aaron Lindsay via
2021-02-05 15:03       ` Alex Bennée
2021-02-05 15:33         ` Aaron Lindsay via
2021-02-05 15:42         ` Aaron Lindsay via [this message]
2021-02-05 16:41           ` Alex Bennée
2021-02-11 17:27           ` Alex Bennée
2021-02-11 18:35             ` Aaron Lindsay via

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=YB1nf/M613d0B+Pm@strawberry.localdomain \
    --to=qemu-devel@nongnu.org \
    --cc=aaron@os.amperecomputing.com \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=richard.henderson@linaro.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.