Skip to content

Commit c44dc63

Browse files
npigginmpe
authored andcommitted
powerpc/64s/kuap: Restore AMR in fast_interrupt_return
Interrupts that use fast_interrupt_return actually do lock AMR, but they have been ones which tend to come from userspace (or kernel bugs) in radix mode. With kuap on hash, segment interrupts are taken in kernel often, which quickly breaks due to the missing restore. Fixes: 890274c ("powerpc/64s: Implement KUAP for Radix MMU") Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 53459dc commit c44dc63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/powerpc/kernel/entry_64.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,17 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
472472
#ifdef CONFIG_PPC_BOOK3S
473473
/*
474474
* If MSR EE/RI was never enabled, IRQs not reconciled, NVGPRs not
475-
* touched, AMR not set, no exit work created, then this can be used.
475+
* touched, no exit work created, then this can be used.
476476
*/
477477
.balign IFETCH_ALIGN_BYTES
478478
.globl fast_interrupt_return
479479
fast_interrupt_return:
480480
_ASM_NOKPROBE_SYMBOL(fast_interrupt_return)
481+
kuap_check_amr r3, r4
481482
ld r4,_MSR(r1)
482483
andi. r0,r4,MSR_PR
483484
bne .Lfast_user_interrupt_return
485+
kuap_restore_amr r3
484486
andi. r0,r4,MSR_RI
485487
li r3,0 /* 0 return value, no EMULATE_STACK_STORE */
486488
bne+ .Lfast_kernel_interrupt_return

0 commit comments

Comments
 (0)