[PATCH 2/3] arm64: entry: sdei: save and restore PMR for pseudo-NMI

Ada Couprie Diaz ada.coupriediaz at arm.com
Wed Nov 18 07:43:33 PST 2026


Hi Vladimir,

On 18/11/2026 09:58, Vladimir Murzin wrote:
> Hi Ada,
>
> On 11/17/26 17:48, Ada Couprie Diaz wrote:
>> If using pseudo-NMI, PMR must be saved and restored on exception
>> entry/exit. We do so, and set it to a known value reflecting that DAIF
>> is masking all interrupts, in the regular entry path.
>>
>> Do the same for SDEI, as it can interrupt the kernel at any point
>> and does not mandate firmware to touch PMR, but does mandate masking DAIF.
>> This avoids potentially returning with a different PMR than interrupted,
>> and SDEI having the DAIF/PMR pair in a unexpected state compared to
>> the rest of the kernel.
>>
> I think we need to save/restore PMR into/from pt_regs similarly to regular
> entry path, otherwise regs_irqs_disabled() is still broken, like it was
> pointed in the thread [1] (and Sashiko has raised the same concern on
> FEAT_NMI series)
>
> Cheers
> Vladimir
>
> [1] https://lore.kernel.org/all/auzM-l40BLsT3clg@arm.com/

Thanks for checking, that's definitely what should be done, I was
a bit hasty...
Given it's a very simple code change (I rewrote the commit message
accordingly) I sent the proper fix as a reply to the patch directly.
Happy to send a full v2 if that would be better !

Kind regards,
Ada




More information about the linux-arm-kernel mailing list