Thread (122 messages) 122 messages, 5 authors, 2026-09-02

Re: [RFC PATCH v2 15/45] arm64: entry: replace DAIF helpers with entry helpers

flat view

From: Vladimir Murzin <hidden>
Date: 2026-08-03 12:23:27

On 7/28/26 10:53, Jinjie Ruan wrote:
quoted
@@ -526,21 +545,32 @@ static __always_inline void __el1_irq(struct pt_regs *regs,
 
 	state = arm64_enter_from_kernel_mode(regs);
 
+	arm64_unmask_exc_context(NONMI_CONTEXT);
+
 	irq_enter_rcu();
 	do_interrupt_handler(regs, handler);
 	irq_exit_rcu();
 
-	arm64_exit_to_kernel_mode_preempt(regs, state);
+	/*
+	 * If pseudo-NMIs are enabled and the interrupted context had
+	 * IRQs unmasked, the interrupt handler will have cleared DAIF
+	 * and switched to PMR masking in order to handle
+	 * NMIs. Otherwise it would keep IF.  In both cases on return
+	 * we effectivly have NOIRQ_CONTEXT - keep track of it
+	 */
+	arm64_debug_exc_context(NOIRQ_CONTEXT);
+	arm64_exit_to_kernel_mode(regs, state, arm64_exc_hwstate_of_context(NOIRQ_CONTEXT));
 }
Is this a typo?

arm64_exit_to_kernel_mode_preempt(regs,
arm64_exc_hwstate_of_context(NOIRQ_CONTEXT));
Oops! Seems lost that while splitting the patch. Nice catch!
otherwise LGTM
Reviewed-by: Jinjie Ruan <redacted>
Thanks
Vladimir


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help