All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, ehabkost@redhat.com,
	crosthwaite.peter@gmail.com, kbastian@mail.uni-paderborn.de,
	green@moxielogic.com, laurent@vivier.eu, jcmvbkbc@gmail.com,
	maria.klimushenkova@ispras.ru, dovgaluk@ispras.ru,
	edgar.iglesias@gmail.com, shorne@gmail.com, yongbok.kim@mips.com,
	aurelien@aurel32.net, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH] icount: fix cpu_restore_state_from_tb for non-tb-exit cases
Date: Tue, 10 Apr 2018 09:35:41 +0200	[thread overview]
Message-ID: <3c1eeffa-6fbb-1edf-296a-6bc7fabab26d@redhat.com> (raw)
In-Reply-To: <20180409091320.12504.35329.stgit@pasha-VirtualBox>

On 09/04/2018 11:13, Pavel Dovgalyuk wrote:
> @@ -29,6 +29,7 @@ void cpu_loop_exit_noexc(CPUState *cpu)
>  {
>      /* XXX: restore cpu registers saved in host registers */
>  
> +    cpu->can_do_io = !use_icount;
>      cpu->exception_index = -1;
>      siglongjmp(cpu->jmp_env, 1);
>  }
> @@ -65,14 +66,16 @@ void cpu_reloading_memory_map(void)
>  
>  void cpu_loop_exit(CPUState *cpu)
>  {
> +    cpu->can_do_io = !use_icount;
>      siglongjmp(cpu->jmp_env, 1);
>  }
>  
>  void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
>  {
>      if (pc) {
> -        cpu_restore_state(cpu, pc);
> +        cpu_restore_state(cpu, pc, true);
>      }
> +    cpu->can_do_io = !use_icount;
>      siglongjmp(cpu->jmp_env, 1);
>  }

This is incorrect, "cpu->can_do_io" is 1 when not in tcg_qemu_tb_exec.
In fact, in cpu_exec we have "cpu->can_do_io = 1;" immediately after
siglongjmp, so I propose adding the same "cpu->can_do_io = 1;"
assignment to cpu_exec_step_atomic.

In any case, please change the two siglongjmp of
cpu_loop_exit_{noexc,restore} to cpu_loop_exit, instead of duplicating
that cpu->can_do_io assignment.

Thanks,

Paolo

  parent reply	other threads:[~2018-04-10  7:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09  9:13 [Qemu-devel] [PATCH] icount: fix cpu_restore_state_from_tb for non-tb-exit cases Pavel Dovgalyuk
2018-04-10  0:51 ` Richard Henderson
2018-04-10  7:35 ` Paolo Bonzini [this message]
2018-04-10  9:39   ` Richard Henderson

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=3c1eeffa-6fbb-1edf-296a-6bc7fabab26d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=aurelien@aurel32.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dovgaluk@ispras.ru \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=green@moxielogic.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=laurent@vivier.eu \
    --cc=maria.klimushenkova@ispras.ru \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=shorne@gmail.com \
    --cc=yongbok.kim@mips.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 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.