[PATCH v3] ARM: entry: Convert IRQ handling to generic IRQ entry

Yoshifumi SHU envzhu at gmail.com
Thu Oct 1 06:59:11 PDT 2026


Hi Linus,

I took a look at the Cortex-M (V7M) part. 

Since V7M now selects GENERIC_IRQ_ENTRY as well, a call to
arm_rseq_user_enter() is required near the V7M interrupt entry path for
rseq to work correctly. It corresponds to the arm_rseq_user_exit() call
you added in entry-common.S:no_work_pending, which V7M reaches via
v7m_ret_to_user_from_irq.

A minimal fix would be:

diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S
index 49a3a34e2913..e8102413461f 100644
--- a/arch/arm/kernel/entry-v7m.S
+++ b/arch/arm/kernel/entry-v7m.S
@@ -87,6 +87,10 @@ ENDPROC(__irq_entry)
 __pendsv_entry:
 	v7m_exception_entry
 
+#ifdef CONFIG_RSEQ
+	bl	arm_rseq_user_enter
+#endif
+
 	ldr	r1, =BASEADDR_V7M_SCB
 	mov	r0, #V7M_SCB_ICSR_PENDSVCLR
 	str	r0, [r1, V7M_SCB_ICSR]	@ clear PendSV


This actually calls arm_rseq_user_enter() in PendSV rather than in
__irq_entry. I think this is fine because the rseq.event.user_irq flag
set by this function is only checked on the return path to user space,
specifically, during rseq handling inside do_work_pending() on V7M.

However, applying this fix highlights the ongoing maintenance burden and
motivates converting the V7M IRQ entry to use the generic IRQ entry. I'd
like to take on this conversion work.

I already have a rough idea of how to implement it (it is somewhat
complicated). I hope to implement the prototype within a week or two. I
will send it out as a separate RFC on top of your patch series.

As a quick test for your patch series, I confirmed that Buildroot boots
successfully with and without the rseq change above on QEMU MPS3-AN547
(Cortex-M55 / Arm v8.1-M). I will run more comprehensive tests on real
hardware, like kselftests including rseq.
 
Best regards,
Yoshifumi



More information about the linux-arm-kernel mailing list