summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Murzin <vladimir.murzin@arm.com>2026-07-27 17:34:14 +0100
committerWill Deacon <will@kernel.org>2026-08-06 13:07:45 +0000
commitd3ebdc1772c0714faca14eec789ff082f6e00535 (patch)
tree5321d682e93e4c2b30712bd998d735815283ac44
parent630ca6c58fcfeaddd96dd46e7b11826013977955 (diff)
downloadlinux-d3ebdc1772c0714faca14eec789ff082f6e00535.tar.gz
linux-d3ebdc1772c0714faca14eec789ff082f6e00535.zip
arm64: suspend: Initialize PMR on resume
When we resume from cpu_suspend() context tracking, specially, ct_idle_exit() performs IRQ save/restore sequence. It doesn't cause any functional issues since we have masked all exceptions prior suspend and have not restored them. However, in case of pseudo-NMI PMR can be set by firmware to arbitrary value, thus IRQ save/restore routines manipulates this arbitrary value. Again, it doesn't cause any issues since PMR variant of IRQ save helper carries a __pmr_irqs_disabled_flags() guard. Going forward __pmr_irqs_disabled_flags() guard will be gone and we will call __pmr_local_irq_disable() unconditionally - that would cause warning in case CONFIG_ARM64_DEBUG_PRIORITY_MASKING is set. Initialize PMR to a value known to Linux on resume until the normal exception restore path restores the saved DAIF and PMR state. Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--arch/arm64/mm/proc.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 22866b49be37..06c8bc9a85d6 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -169,6 +169,13 @@ alternative_if ARM64_HAS_RAS_EXTN
msr_s SYS_DISR_EL1, xzr
alternative_else_nop_endif
+#ifdef CONFIG_ARM64_PSEUDO_NMI
+alternative_if ARM64_HAS_GIC_PRIO_MASKING
+ mov x1, #GIC_PRIO_IRQON
+ msr_s SYS_ICC_PMR_EL1, x1
+alternative_else_nop_endif
+#endif
+
ptrauth_keys_install_kernel_nosync x14, x1, x2, x3
isb
ret