Commit bc403203 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fix from Michael Ellerman:

 - Fix KVM PR on 32-bit, which was broken by some MMU code refactoring.

Thanks to: Alexander Graf, and Matt Evans.

* tag 'powerpc-5.18-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context()
parents 79dc4fc2 ee834849
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -122,11 +122,27 @@

	/* 0x0 - 0xb */

	/* 'current->mm' needs to be in r4 */
	tophys(r4, r2)
	lwz	r4, MM(r4)
	tophys(r4, r4)
	/* This only clobbers r0, r3, r4 and r5 */
	/* switch_mmu_context() needs paging, let's enable it */
	mfmsr   r9
	ori     r11, r9, MSR_DR
	mtmsr   r11
	sync

	/* switch_mmu_context() clobbers r12, rescue it */
	SAVE_GPR(12, r1)

	/* Calling switch_mmu_context(<inv>, current->mm, <inv>); */
	lwz	r4, MM(r2)
	bl	switch_mmu_context

	/* restore r12 */
	REST_GPR(12, r1)

	/* Disable paging again */
	mfmsr   r9
	li      r6, MSR_DR
	andc    r9, r9, r6
	mtmsr	r9
	sync

.endm