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

Re: [RFC PATCH v2 34/45] arm64: nmi: Add handling of superpriority interrupts as NMIs

flat view

From: Vladimir Murzin <hidden>
Date: 2026-08-03 12:33:39

On 7/28/26 13:25, Jinjie Ruan wrote:
quoted
@@ -924,6 +967,20 @@ static void noinstr el0_interrupt(struct pt_regs *regs,
 	 */
 	arm64_debug_exc_context(NOIRQ_CONTEXT);
 	arm64_exit_to_user_mode(regs, arm64_exc_hwstate_of_context(NOIRQ_CONTEXT));
+}
+
+static void noinstr el0_interrupt(struct pt_regs *regs,
+				  void (*handler)(struct pt_regs *))
+{
+	if (regs->pc & BIT(55))
+		arm64_apply_bp_hardening();
It seems only after enter_from_user_mode() or irqentry_nmi_enter(), it
is safe to call normal kernel code.
I do not think there is issue with that. Here is call chain:

arm64_apply_bp_hardening()           // always_inline
  -> alternative_has_cap_unlikely()  // always_inline
     -> cpucap_is_possible()         // always_inline
  -> fn()
      - qcom_link_stack_sanitisation // noinstr
      - call_hvc_arch_workaround_1   // noinstr
      - call_smc_arch_workaround_1   // noinstr

That's also in line with el0_ia(), el0_pc() and el0_softstp()
which call arm64_apply_bp_hardening() before enter_from_user_mode()

Cheers
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