qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH] spapr: fix H_SET_MODE to sync LPCR with KVM
Date: Fri, 17 Jan 2014 17:13:16 +1100	[thread overview]
Message-ID: <1389939196-24323-1-git-send-email-aik@ozlabs.ru> (raw)

The kvm_cpu_exec() only puts registers to KVM if the @kvm_vcpu_dirty flag
has been set.

This adds registers sync which also sets @kvm_vcpu_dirty so we store new
LPCR to KVM before continuing with the KVM_RUN ioctl.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/ppc/spapr_hcall.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index f755a53..b61d744 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -682,6 +682,7 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, sPAPREnvironment *spapr,
             CPU_FOREACH(cs) {
                 PowerPCCPU *cp = POWERPC_CPU(cs);
                 CPUPPCState *env = &cp->env;
+                kvm_cpu_synchronize_state(cs);
                 env->spr[SPR_LPCR] &= ~LPCR_ILE;
             }
             ret = H_SUCCESS;
@@ -691,6 +692,7 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, sPAPREnvironment *spapr,
             CPU_FOREACH(cs) {
                 PowerPCCPU *cp = POWERPC_CPU(cs);
                 CPUPPCState *env = &cp->env;
+                kvm_cpu_synchronize_state(cs);
                 env->spr[SPR_LPCR] |= LPCR_ILE;
             }
             ret = H_SUCCESS;
-- 
1.8.4.rc4

             reply	other threads:[~2014-01-17  6:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17  6:13 Alexey Kardashevskiy [this message]
2014-01-20 14:41 ` [Qemu-devel] [PATCH] spapr: fix H_SET_MODE to sync LPCR with KVM Alexander Graf

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=1389939196-24323-1-git-send-email-aik@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).