aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorGravatar Rohan McLure <rmclure@linux.ibm.com> 2023-02-06 13:18:00 +1100
committerGravatar Michael Ellerman <mpe@ellerman.id.au> 2023-02-10 22:19:56 +1100
commit4f8e09106f6e457c6e9a4ce597fa9ae2bda032c3 (patch)
treeee70b0e9769afebd9b7bb37ba1cc89c20c08c643 /arch/powerpc/kernel
parentpowerpc/kcsan: Memory barriers semantics (diff)
downloadlinux-4f8e09106f6e457c6e9a4ce597fa9ae2bda032c3.tar.gz
linux-4f8e09106f6e457c6e9a4ce597fa9ae2bda032c3.tar.bz2
linux-4f8e09106f6e457c6e9a4ce597fa9ae2bda032c3.zip
powerpc/kcsan: Prevent recursive instrumentation with IRQ save/restores
Instrumented memory accesses provided by KCSAN will access core-local memories (which will save and restore IRQs) as well as restoring IRQs directly. Avoid recursive instrumentation by applying __no_kcsan annotation to IRQ restore routines. Signed-off-by: Rohan McLure <rmclure@linux.ibm.com> [mpe: Resolve merge conflict with IRQ replay recursion changes] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20230206021801.105268-5-rmclure@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/irq_64.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/irq_64.c b/arch/powerpc/kernel/irq_64.c
index 9dc0ad3c533a..c788c55512ed 100644
--- a/arch/powerpc/kernel/irq_64.c
+++ b/arch/powerpc/kernel/irq_64.c
@@ -94,7 +94,7 @@ static inline bool irq_happened_test_and_clear(u8 irq)
return false;
}
-static void __replay_soft_interrupts(void)
+static __no_kcsan void __replay_soft_interrupts(void)
{
struct pt_regs regs;
@@ -171,7 +171,7 @@ static void __replay_soft_interrupts(void)
local_paca->irq_happened &= ~PACA_IRQ_REPLAYING;
}
-void replay_soft_interrupts(void)
+__no_kcsan void replay_soft_interrupts(void)
{
irq_enter(); /* See comment in arch_local_irq_restore */
__replay_soft_interrupts();
@@ -179,7 +179,7 @@ void replay_soft_interrupts(void)
}
#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_PPC_KUAP)
-static inline void replay_soft_interrupts_irqrestore(void)
+static inline __no_kcsan void replay_soft_interrupts_irqrestore(void)
{
unsigned long kuap_state = get_kuap();
@@ -203,7 +203,7 @@ static inline void replay_soft_interrupts_irqrestore(void)
#define replay_soft_interrupts_irqrestore() __replay_soft_interrupts()
#endif
-notrace void arch_local_irq_restore(unsigned long mask)
+notrace __no_kcsan void arch_local_irq_restore(unsigned long mask)
{
unsigned char irq_happened;