qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Pavel Dovgalyuk" <dovgaluk@ispras.ru>
To: "'Paolo Bonzini'" <pbonzini@redhat.com>,
	"'Pavel Dovgalyuk'" <pavel.dovgaluk@gmail.com>,
	<qemu-devel@nongnu.org>
Cc: kwolf@redhat.com, peter.maydell@linaro.org,
	pavel.dovgaluk@ispras.ru, quintela@redhat.com,
	ciro.santilli@gmail.com, jasowang@redhat.com,
	crosthwaite.peter@gmail.com, armbru@redhat.com,
	mreitz@redhat.com, alex.bennee@linaro.org,
	maria.klimushenkova@ispras.ru, mst@redhat.com, kraxel@redhat.com,
	boost.lists@gmail.com, thomas.dullien@googlemail.com,
	artem.k.pisarenko@gmail.com, dgilbert@redhat.com,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block
Date: Thu, 25 Jul 2019 08:55:35 +0300	[thread overview]
Message-ID: <000601d542ad$947a5c00$bd6f1400$@ru> (raw)
In-Reply-To: <968ae3fd-0482-24f2-b24d-459152ff226d@redhat.com>

> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> > From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> >
> > Most of IO instructions can be executed only at the end of the block in
> > icount mode. Therefore translator can set cpu_can_io flag when translating
> > the last instruction.
> > But when the blocks are chained, then this flag is not reset and may
> > remain set at the beginning of the next block.
> > This patch resets the flag before "chaining" the translation blocks.
> >
> > Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> > ---
> >  accel/tcg/tcg-runtime.c |    2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
> > index 8a1e408e31..fe6b83d0fc 100644
> > --- a/accel/tcg/tcg-runtime.c
> > +++ b/accel/tcg/tcg-runtime.c
> > @@ -151,6 +151,8 @@ void *HELPER(lookup_tb_ptr)(CPUArchState *env)
> >      target_ulong cs_base, pc;
> >      uint32_t flags;
> >
> > +    /* We are going to jump to the next block. can_do_io should be reset */
> > +    cpu->can_do_io = !use_icount;
> >      tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, curr_cflags());
> >      if (tb == NULL) {
> >          return tcg_ctx->code_gen_epilogue;
> >
> 
> This only fixes indirect jumps though.
> 
> I think you do not need this patch if you remove the assignment in
> cpu_tb_exec, and compile a "move 0 to cpu->can_do_io" in gen_tb_start
> instead.

"move 0 to cpu->can_do_io" only for icount mode?
And we'll also need to set can_do_io to 1 somewhere, because it
is checked in non-icount mode too.

Pavel Dovgalyuk



  reply	other threads:[~2019-07-25  5:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 02/14] block: implement bdrv_snapshot_goto for blkreplay Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 03/14] replay: disable default snapshot for record/replay Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 04/14] replay: update docs for record/replay with block devices Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 05/14] replay: don't drain/flush bdrv queue while RR is working Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 06/14] replay: finish record/replay before closing the disks Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers Pavel Dovgalyuk
2019-07-24 14:28   ` Paolo Bonzini
2019-07-25  6:00     ` Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block Pavel Dovgalyuk
2019-07-24 14:35   ` Paolo Bonzini
2019-07-25  5:55     ` Pavel Dovgalyuk [this message]
2019-07-25  6:27       ` Paolo Bonzini
2019-07-24 14:35 ` [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Paolo Bonzini
2019-07-25  8:44   ` Kevin Wolf
2019-07-25  8:46     ` Pavel Dovgalyuk
2019-07-31  5:41     ` Pavel Dovgalyuk

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='000601d542ad$947a5c00$bd6f1400$@ru' \
    --to=dovgaluk@ispras.ru \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=artem.k.pisarenko@gmail.com \
    --cc=boost.lists@gmail.com \
    --cc=ciro.santilli@gmail.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=maria.klimushenkova@ispras.ru \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pavel.dovgaluk@gmail.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=thomas.dullien@googlemail.com \
    /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).