summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-03-08 12:46:50 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-03-08 12:46:50 +0100
commit8bb9b9ccff5b7ce5084b5111244a92fd1d0daf16 (patch)
treec4d42efe0fdde7dc07e469939bc1f17c7886f213 /arch
parent7099e2e1f4d9051f31bbfa5803adf954bb5d76ef (diff)
parentccec44563b18a0ce90e2d4f332784b3cb25c8e9c (diff)
downloadlinux-stable-8bb9b9ccff5b7ce5084b5111244a92fd1d0daf16.tar.gz
linux-stable-8bb9b9ccff5b7ce5084b5111244a92fd1d0daf16.tar.bz2
linux-stable-8bb9b9ccff5b7ce5084b5111244a92fd1d0daf16.zip
Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 6ee26de9a1de..25ae2c9913c3 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1370,6 +1370,20 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
std r6, VCPU_ACOP(r9)
stw r7, VCPU_GUEST_PID(r9)
std r8, VCPU_WORT(r9)
+ /*
+ * Restore various registers to 0, where non-zero values
+ * set by the guest could disrupt the host.
+ */
+ li r0, 0
+ mtspr SPRN_IAMR, r0
+ mtspr SPRN_CIABR, r0
+ mtspr SPRN_DAWRX, r0
+ mtspr SPRN_TCSCR, r0
+ mtspr SPRN_WORT, r0
+ /* Set MMCRS to 1<<31 to freeze and disable the SPMC counters */
+ li r0, 1
+ sldi r0, r0, 31
+ mtspr SPRN_MMCRS, r0
8:
/* Save and reset AMR and UAMOR before turning on the MMU */