diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2021-03-12 12:50:47 +0000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-03-29 13:22:10 +1100 |
commit | b5efec00b671c5d7e9cb9e73a1d4925dd6ce8dcd (patch) | |
tree | 99a5ab07a508cab6ee4943fd8b8d689b7c7c8e1a /arch/powerpc/include/asm/interrupt.h | |
parent | a2b3e09ae41c71d27d9b8da9baf31e0d9a97b864 (diff) | |
download | linux-b5efec00b671c5d7e9cb9e73a1d4925dd6ce8dcd.tar.gz linux-b5efec00b671c5d7e9cb9e73a1d4925dd6ce8dcd.tar.bz2 linux-b5efec00b671c5d7e9cb9e73a1d4925dd6ce8dcd.zip |
powerpc/32s: Move KUEP locking/unlocking in C
This can be done in C, do it.
Unrolling the loop gains approx. 15% performance.
From now on, prepare_transfer_to_handler() is only for
interrupts from kernel.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/4eadd873927e9a73c3d1dfe2f9497353465514cf.1615552867.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/include/asm/interrupt.h')
-rw-r--r-- | arch/powerpc/include/asm/interrupt.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h index 861e6eadc98c..857375309255 100644 --- a/arch/powerpc/include/asm/interrupt.h +++ b/arch/powerpc/include/asm/interrupt.h @@ -33,8 +33,10 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup if (!arch_irq_disabled_regs(regs)) trace_hardirqs_off(); - if (user_mode(regs)) + if (user_mode(regs)) { + kuep_lock(); account_cpu_user_entry(); + } #endif /* * Book3E reconciles irq soft mask in asm @@ -89,6 +91,8 @@ static inline void interrupt_exit_prepare(struct pt_regs *regs, struct interrupt exception_exit(state->ctx_state); #endif + if (user_mode(regs)) + kuep_unlock(); /* * Book3S exits to user via interrupt_exit_user_prepare(), which does * context tracking, which is a cleaner way to handle PREEMPT=y |