aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/kvm_book3s_asm.h1
-rw-r--r--arch/powerpc/kernel/asm-offsets.c1
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S7
3 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h
index 412b2f389474..192917d2239c 100644
--- a/arch/powerpc/include/asm/kvm_book3s_asm.h
+++ b/arch/powerpc/include/asm/kvm_book3s_asm.h
@@ -79,6 +79,7 @@ struct kvmppc_host_state {
79 ulong vmhandler; 79 ulong vmhandler;
80 ulong scratch0; 80 ulong scratch0;
81 ulong scratch1; 81 ulong scratch1;
82 ulong scratch2;
82 u8 in_guest; 83 u8 in_guest;
83 u8 restore_hid5; 84 u8 restore_hid5;
84 u8 napping; 85 u8 napping;
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 2ea5cc033ec8..d3de01066f7d 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -576,6 +576,7 @@ int main(void)
576 HSTATE_FIELD(HSTATE_VMHANDLER, vmhandler); 576 HSTATE_FIELD(HSTATE_VMHANDLER, vmhandler);
577 HSTATE_FIELD(HSTATE_SCRATCH0, scratch0); 577 HSTATE_FIELD(HSTATE_SCRATCH0, scratch0);
578 HSTATE_FIELD(HSTATE_SCRATCH1, scratch1); 578 HSTATE_FIELD(HSTATE_SCRATCH1, scratch1);
579 HSTATE_FIELD(HSTATE_SCRATCH2, scratch2);
579 HSTATE_FIELD(HSTATE_IN_GUEST, in_guest); 580 HSTATE_FIELD(HSTATE_IN_GUEST, in_guest);
580 HSTATE_FIELD(HSTATE_RESTORE_HID5, restore_hid5); 581 HSTATE_FIELD(HSTATE_RESTORE_HID5, restore_hid5);
581 HSTATE_FIELD(HSTATE_NAPPING, napping); 582 HSTATE_FIELD(HSTATE_NAPPING, napping);
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index bde28da69610..be4fa04a37c9 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -754,15 +754,14 @@ kvmppc_interrupt_hv:
754 * guest CR, R12 saved in shadow VCPU SCRATCH1/0 754 * guest CR, R12 saved in shadow VCPU SCRATCH1/0
755 * guest R13 saved in SPRN_SCRATCH0 755 * guest R13 saved in SPRN_SCRATCH0
756 */ 756 */
757 /* abuse host_r2 as third scratch area; we get r2 from PACATOC(r13) */ 757 std r9, HSTATE_SCRATCH2(r13)
758 std r9, HSTATE_HOST_R2(r13)
759 758
760 lbz r9, HSTATE_IN_GUEST(r13) 759 lbz r9, HSTATE_IN_GUEST(r13)
761 cmpwi r9, KVM_GUEST_MODE_HOST_HV 760 cmpwi r9, KVM_GUEST_MODE_HOST_HV
762 beq kvmppc_bad_host_intr 761 beq kvmppc_bad_host_intr
763#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE 762#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
764 cmpwi r9, KVM_GUEST_MODE_GUEST 763 cmpwi r9, KVM_GUEST_MODE_GUEST
765 ld r9, HSTATE_HOST_R2(r13) 764 ld r9, HSTATE_SCRATCH2(r13)
766 beq kvmppc_interrupt_pr 765 beq kvmppc_interrupt_pr
767#endif 766#endif
768 /* We're now back in the host but in guest MMU context */ 767 /* We're now back in the host but in guest MMU context */
@@ -782,7 +781,7 @@ kvmppc_interrupt_hv:
782 std r6, VCPU_GPR(R6)(r9) 781 std r6, VCPU_GPR(R6)(r9)
783 std r7, VCPU_GPR(R7)(r9) 782 std r7, VCPU_GPR(R7)(r9)
784 std r8, VCPU_GPR(R8)(r9) 783 std r8, VCPU_GPR(R8)(r9)
785 ld r0, HSTATE_HOST_R2(r13) 784 ld r0, HSTATE_SCRATCH2(r13)
786 std r0, VCPU_GPR(R9)(r9) 785 std r0, VCPU_GPR(R9)(r9)
787 std r10, VCPU_GPR(R10)(r9) 786 std r10, VCPU_GPR(R10)(r9)
788 std r11, VCPU_GPR(R11)(r9) 787 std r11, VCPU_GPR(R11)(r9)