Patchwork Use the lower four bytes while restoring guest readable SPRGs.

login
register
mail settings
Submitter Sethi Varun-B16395
Date April 4, 2012, 8:48 a.m.
Message ID <1333529335-27711-1-git-send-email-b16395@freescale.com>
Download mbox | patch
Permalink /patch/150656/
State New
Headers show

Comments

Sethi Varun-B16395 - April 4, 2012, 8:48 a.m.
From: Varun Sethi <Varun.Sethi@freescale.com>

While restoring the hardware copies of guest SPRG4-7 registers we must use the
the lower 4 bytes of the 64 bit sotware copies maintained by KVM.

Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
---
 arch/powerpc/kvm/booke_interrupts.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S
index c8c4b87..feda1bb 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -419,13 +419,13 @@  lightweight_exit:
 	 * written directly to the shared area, so we
 	 * need to reload them here with the guest's values.
 	 */
-	lwz	r3, VCPU_SHARED_SPRG4(r5)
+	lwz	r3, (VCPU_SHARED_SPRG4 + 4)(r5)
 	mtspr	SPRN_SPRG4W, r3
-	lwz	r3, VCPU_SHARED_SPRG5(r5)
+	lwz	r3, (VCPU_SHARED_SPRG5 + 4)(r5)
 	mtspr	SPRN_SPRG5W, r3
-	lwz	r3, VCPU_SHARED_SPRG6(r5)
+	lwz	r3, (VCPU_SHARED_SPRG6 + 4)(r5)
 	mtspr	SPRN_SPRG6W, r3
-	lwz	r3, VCPU_SHARED_SPRG7(r5)
+	lwz	r3, (VCPU_SHARED_SPRG7 + 4)(r5)
 	mtspr	SPRN_SPRG7W, r3
 
 #ifdef CONFIG_KVM_EXIT_TIMING