diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-03-21 10:08:20 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-03-21 10:08:20 +0800 |
commit | 8cea869f71490e9e08b53e34dec030da2518bb3e (patch) | |
tree | 70f29f8bb38cf5218bac5e64931912ce1a7476cd /arch/powerpc/kvm/book3s_hv_rmhandlers.S | |
parent | 5af6a242945e39bf6ea39716d4eba316b735dce8 (diff) | |
parent | 70e00db9eb8ffc4dcaf5f035ec6a4440ba428794 (diff) |
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-androidlsk-v3.14-16.03-androidlinux-linaro-lsk-v3.14-android
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_rmhandlers.S')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_rmhandlers.S | 14 |
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 b3bad672e5d9..87fa70f8472a 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S @@ -1148,6 +1148,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 */ |