Skip to content

Commit

Permalink
Merge tag 'powerpc-5.18-5' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/powerpc/linux

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()
  • Loading branch information
Linus Torvalds committed May 15, 2022
2 parents 79dc4fc + ee83484 commit bc40320
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions arch/powerpc/kvm/book3s_32_sr.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bc40320

Please sign in to comment.