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

Jinjie Ruan <[email protected]>
Newsgroups org.infradead.lists.linux-arm-kernel
Message-ID <[email protected]>

在 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 <[email protected]>


> 
> Cheers
> Vladimir
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.