Skip to contentSkip to conversation

arm64: entry: add missing noinstr

PATCH Applied Mark Rutland 2 participants 2 messages Jul 14, 2021 – Jul 15, 2021 arm64

lore
Share & tools
lore

Mark Rutland

author reviewer
#0 lore raw

PATCH 1/1 arm64: entry: add missing noinstr

We intend that all the early exception handling code is marked as noinstr, but we forgot this for __el0_error_handler_common(), which is called before we have completed entry from user mode. If it were instrumented, we could run into problems with RCU, lockdep, etc.

Mark it as noinstr to prevent this.

The few other functions in entry-common.c which do not have noinstr are called once we've completed entry, and are safe to instrument.

Fixes bb8e93a287a5f5f1 ("arm64: entry: convert SError handlers to C")
Cc Catalin Marinas <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Joey Gouly <[email protected]>
Cc James Morse <[email protected]>
Cc Will Deacon <[email protected]>
---
 arch/arm64/kernel/entry-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi Catalin, Will,

This is an oversight with my recent entry rework. Could you please take this for rc2?

Thanks,
Mark.

arch/arm64/kernel/entry-common.c +1 -1
index 12ce14a98b7c..db8b2e2d02c2 100644
@@ -604,7 +604,7 @@ asmlinkage void noinstr el0t_64_fiq_handler(struct pt_regs *regs)
 	__el0_fiq_handler_common(regs);
 }
 
-static void __el0_error_handler_common(struct pt_regs *regs)
+static void noinstr __el0_error_handler_common(struct pt_regs *regs)
 {
 	unsigned long esr = read_sysreg(esr_el1);
 
Signature · 7 lines
2.11.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 8 lines · Mark Rutland

We intend that all the early exception handling code is marked as noinstr, but we forgot this for __el0_error_handler_common(), which is called before we have completed entry from user mode. If it were instrumented, we could run into problems with RCU, lockdep, etc.

Mark it as noinstr to prevent this.

[...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: entry: add missing noinstr

      https://git.kernel.org/arm64/c/31a7f0f6c8f3

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel