[PATCH v1 14/18] arm64/acpi: Mask NMIs while notifying SEA
Mark Brown
broonie at kernel.org
Fri Nov 4 16:54:49 PDT 2022
Since we report SEA as though it were a NMI mask any actual NMIs that
might be delivered during the region marked as a NMI, avoiding any
potential confusion that might result from trying to nest them. Handling
of SError happens with actual NMIs unmasked so we can unconditionally
mask and unmask them.
Signed-off-by: Mark Brown <broonie at kernel.org>
---
arch/arm64/kernel/acpi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index a5a256e3f9fe..7bcb8de84096 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -31,6 +31,7 @@
#include <asm/cputype.h>
#include <asm/cpu_ops.h>
#include <asm/daifflags.h>
+#include <asm/nmi.h>
#include <asm/smp_plat.h>
int acpi_noirq = 1; /* skip ACPI IRQ initialization */
@@ -378,13 +379,16 @@ int apei_claim_sea(struct pt_regs *regs)
return_to_irqs_enabled = interrupts_enabled(regs);
/*
- * SEA can interrupt SError, mask it and describe this as an NMI so
- * that APEI defers the handling.
+ * SEA can interrupt SError, mask it and describe this as a NMI so
+ * that APEI defers the handling. Since we are describing this as
+ * a NMI also ensure that any actual NMIs are masked while doing so.
*/
+ nmi_mask();
local_daif_restore(DAIF_ERRCTX);
nmi_enter();
err = ghes_notify_sea();
nmi_exit();
+ nmi_unmask();
/*
* APEI NMI-like notifications are deferred to irq_work. Unless
--
2.30.2
More information about the linux-arm-kernel
mailing list