From: Paolo Bonzini <pbonzini@redhat.com>
To: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>, qemu-devel@nongnu.org
Cc: fred.konrad@greensocs.com, zealot351@gmail.com,
maria.klimushenkova@ispras.ru, mark.burton@greensocs.com,
batuzovk@ispras.ru
Subject: Re: [Qemu-devel] [PATCH] kvmvapic: patch_instruction fix
Date: Thu, 30 Oct 2014 12:15:40 +0100 [thread overview]
Message-ID: <54521DDC.8040809@redhat.com> (raw)
In-Reply-To: <20141030093100.7176.716.stgit@PASHA-ISP>
On 10/30/2014 10:31 AM, Pavel Dovgalyuk wrote:
> When QEMU works in icount mode cpu_restore_state function performs two actions:
> restoring the program counter and updating icount to the correct value.
> kvmvapic's patch_instruction function is called by cpu_report_tpr_access
> function which also invokes cpu_restore_state. It results to calling
> cpu_restore_state twice - in cpu_report_tpr_access and in patch_instruction.
> When icount is disabled second call is safe. But when icount is enabled,
> cpu_restore_state modifies instructions counter twice, which leads to incorrect
> behavior. This patch removes useless cpu_restore_state call from kvmvapic.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---
> hw/i386/kvmvapic.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
> index f9da050..28547a7 100644
> --- a/hw/i386/kvmvapic.c
> +++ b/hw/i386/kvmvapic.c
> @@ -405,7 +405,6 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
> }
>
> if (!kvm_enabled()) {
> - cpu_restore_state(cs, cs->mem_io_pc);
> cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base,
> ¤t_flags);
> }
>
Thanks, applying.
Paolo
prev parent reply other threads:[~2014-10-30 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 9:31 [Qemu-devel] [PATCH] kvmvapic: patch_instruction fix Pavel Dovgalyuk
2014-10-30 11:15 ` Paolo Bonzini [this message]
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=54521DDC.8040809@redhat.com \
--to=pbonzini@redhat.com \
--cc=Pavel.Dovgaluk@ispras.ru \
--cc=batuzovk@ispras.ru \
--cc=fred.konrad@greensocs.com \
--cc=maria.klimushenkova@ispras.ru \
--cc=mark.burton@greensocs.com \
--cc=qemu-devel@nongnu.org \
--cc=zealot351@gmail.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.