summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/sdei.c
diff options
context:
space:
mode:
authorD Scott Phillips <scott@os.amperecomputing.com>2023-06-26 17:29:39 -0700
committerWill Deacon <will@kernel.org>2023-08-04 17:35:33 +0100
commit5cd474e57368f0957c343bb21e309cf82826b1ef (patch)
tree28834fe5587b0a98790159e3824fcc6ae4eb43c0 /arch/arm64/kernel/sdei.c
parentb9d6012497400aa65ef0f2cc537ce7720615dea7 (diff)
downloadlinux-stable-5cd474e57368f0957c343bb21e309cf82826b1ef.tar.gz
linux-stable-5cd474e57368f0957c343bb21e309cf82826b1ef.tar.bz2
linux-stable-5cd474e57368f0957c343bb21e309cf82826b1ef.zip
arm64: sdei: abort running SDEI handlers during crash
Interrupts are blocked in SDEI context, per the SDEI spec: "The client interrupts cannot preempt the event handler." If we crashed in the SDEI handler-running context (as with ACPI's AGDI) then we need to clean up the SDEI state before proceeding to the crash kernel so that the crash kernel can have working interrupts. Track the active SDEI handler per-cpu so that we can COMPLETE_AND_RESUME the handler, discarding the interrupted context. Fixes: f5df26961853 ("arm64: kernel: Add arch-specific SDEI entry code and CPU masking") Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com> Cc: stable@vger.kernel.org Reviewed-by: James Morse <james.morse@arm.com> Tested-by: Mihai Carabas <mihai.carabas@oracle.com> Link: https://lore.kernel.org/r/20230627002939.2758-1-scott@os.amperecomputing.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/sdei.c')
-rw-r--r--arch/arm64/kernel/sdei.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kernel/sdei.c b/arch/arm64/kernel/sdei.c
index 830be01af32d..255d12f881c2 100644
--- a/arch/arm64/kernel/sdei.c
+++ b/arch/arm64/kernel/sdei.c
@@ -47,6 +47,9 @@ DEFINE_PER_CPU(unsigned long *, sdei_shadow_call_stack_normal_ptr);
DEFINE_PER_CPU(unsigned long *, sdei_shadow_call_stack_critical_ptr);
#endif
+DEFINE_PER_CPU(struct sdei_registered_event *, sdei_active_normal_event);
+DEFINE_PER_CPU(struct sdei_registered_event *, sdei_active_critical_event);
+
static void _free_sdei_stack(unsigned long * __percpu *ptr, int cpu)
{
unsigned long *p;