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

Jinjie Ruan ruanjinjie at huawei.com
Fri Aug 7 02:58:19 PDT 2026



在 2026/8/3 20:33, Vladimir Murzin 写道:
> On 7/28/26 13:25, Jinjie Ruan wrote:
>>> @@ -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()

Make sense

Reviewed-by: Jinjie Ruan <ruanjinjie at huawei.com>


> 
> Cheers
> Vladimir
> 




More information about the linux-arm-kernel mailing list