All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target-ppc: Update slb array with correct index values.
@ 2013-08-11 18:28 Aneesh Kumar K.V
  2013-08-19  7:37 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 28+ messages in thread
From: Aneesh Kumar K.V @ 2013-08-11 18:28 UTC (permalink / raw)
  To: kvm-ppc

From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>

Without this, a value of rb=0 and rs=0, result in us replacing the 0th index

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 target-ppc/kvm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 30a870e..5d4e613 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -1034,8 +1034,18 @@ int kvm_arch_get_registers(CPUState *cs)
         /* Sync SLB */
 #ifdef TARGET_PPC64
         for (i = 0; i < 64; i++) {
-            ppc_store_slb(env, sregs.u.s.ppc64.slb[i].slbe,
-                               sregs.u.s.ppc64.slb[i].slbv);
+            target_ulong rb  = sregs.u.s.ppc64.slb[i].slbe;
+            /*
+             * KVM_GET_SREGS doesn't retun slb entry with slot information
+             * same as index. So don't depend on the slot information in
+             * the returned value.
+             */
+            rb &= ~0xfff;
+            /*
+             * use the array index as the slot
+             */
+            rb |= i;
+            ppc_store_slb(env, rb, sregs.u.s.ppc64.slb[i].slbv);
         }
 #endif
 
-- 
1.8.1.2


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

end of thread, other threads:[~2013-08-22 16:36 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-11 18:28 [PATCH] target-ppc: Update slb array with correct index values Aneesh Kumar K.V
2013-08-19  7:37 ` Aneesh Kumar K.V
2013-08-19  8:21   ` Alexander Graf
2013-08-19  8:21     ` Alexander Graf
2013-08-20 13:57     ` Aneesh Kumar K.V
2013-08-20 13:57       ` Aneesh Kumar K.V
2013-08-21  7:02       ` Alexander Graf
2013-08-21  7:02         ` Alexander Graf
2013-08-21  9:07         ` Aneesh Kumar K.V
2013-08-21  9:19           ` Aneesh Kumar K.V
2013-08-21  5:11     ` Paul Mackerras
2013-08-21  5:11       ` Paul Mackerras
2013-08-21  7:37       ` Alexander Graf
2013-08-21  7:37         ` Alexander Graf
2013-08-21  7:42         ` Alexander Graf
2013-08-21  7:42           ` Alexander Graf
2013-08-21  9:25         ` Paul Mackerras
2013-08-21  9:25           ` Paul Mackerras
2013-08-21 10:03           ` Alexander Graf
2013-08-21 10:03             ` Alexander Graf
2013-08-21 15:59             ` Aneesh Kumar K.V
2013-08-21 15:59               ` Aneesh Kumar K.V
2013-08-21 23:32               ` Alexander Graf
2013-08-21 23:32                 ` Alexander Graf
2013-08-22 13:20                 ` Aneesh Kumar K.V
2013-08-22 13:32                   ` Aneesh Kumar K.V
2013-08-22 16:36                   ` Alexander Graf
2013-08-22 16:36                     ` Alexander Graf

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.