qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PPC: KVM: store SLB slot number
@ 2014-01-31  2:24 Alexey Kardashevskiy
  2014-01-31  5:14 ` [Qemu-devel] [Qemu-ppc] " Aneesh Kumar K.V
  2014-01-31  7:11 ` [Qemu-devel] " Alexander Graf
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2014-01-31  2:24 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Kardashevskiy, qemu-ppc, Paul Mackerras, Alexander Graf,
	Aneesh Kumar K . V

When ppc_store_slb() is called from kvm_arch_get_registers(), it stores
a SLB in CPUPPCState::slb[slot]. However it drops the slot number from
ESID so when kvm_arch_put_registers() puts SLBs back to KVM, they do not
have correct "index" field anymore. This broke migration with LPCR_AIR
enabled as now the guest is handling interrupts in virtual mode and unable
to reconstruct correct SLBs anymore.

This adds "index" field for valid SLBs when putting them to KVM.

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

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 26e854a..380f933 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -819,6 +819,9 @@ int kvm_arch_put_registers(CPUState *cs, int level)
 #ifdef TARGET_PPC64
         for (i = 0; i < ARRAY_SIZE(env->slb); i++) {
             sregs.u.s.ppc64.slb[i].slbe = env->slb[i].esid;
+            if (env->slb[i].esid & SLB_ESID_V) {
+                sregs.u.s.ppc64.slb[i].slbe |= i;
+            }
             sregs.u.s.ppc64.slb[i].slbv = env->slb[i].vsid;
         }
 #endif
-- 
1.8.4.rc4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-31  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-31  2:24 [Qemu-devel] [PATCH] PPC: KVM: store SLB slot number Alexey Kardashevskiy
2014-01-31  5:14 ` [Qemu-devel] [Qemu-ppc] " Aneesh Kumar K.V
2014-01-31  7:11 ` [Qemu-devel] " Alexander Graf

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).