Skip to content

Commit 8bb9b9c

Browse files
committed
Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD
2 parents 7099e2e + ccec445 commit 8bb9b9c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

arch/powerpc/kvm/book3s_hv_rmhandlers.S

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,20 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
13701370
std r6, VCPU_ACOP(r9)
13711371
stw r7, VCPU_GUEST_PID(r9)
13721372
std r8, VCPU_WORT(r9)
1373+
/*
1374+
* Restore various registers to 0, where non-zero values
1375+
* set by the guest could disrupt the host.
1376+
*/
1377+
li r0, 0
1378+
mtspr SPRN_IAMR, r0
1379+
mtspr SPRN_CIABR, r0
1380+
mtspr SPRN_DAWRX, r0
1381+
mtspr SPRN_TCSCR, r0
1382+
mtspr SPRN_WORT, r0
1383+
/* Set MMCRS to 1<<31 to freeze and disable the SPMC counters */
1384+
li r0, 1
1385+
sldi r0, r0, 31
1386+
mtspr SPRN_MMCRS, r0
13731387
8:
13741388

13751389
/* Save and reset AMR and UAMOR before turning on the MMU */

0 commit comments

Comments
 (0)