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

From: Ada Couprie Diaz

Date: Wed Nov 18 2026 - 10:43:47 EST


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@xxxxxxx/

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