]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: sdei: abort running SDEI handlers during crash
authorD Scott Phillips <scott@os.amperecomputing.com>
Tue, 27 Jun 2023 00:29:39 +0000 (17:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:52 +0000 (12:22 +0200)
commit6aff2732577ca07de6c1b4c691ca83e150283cc3
tree7f8ddf61d6c9fafec0104a98fb1a45581e0e074a
parentfedecaeef88899d940b69368c996e8b3b0b8650d
arm64: sdei: abort running SDEI handlers during crash

commit 5cd474e57368f0957c343bb21e309cf82826b1ef upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/sdei.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/sdei.c
arch/arm64/kernel/smp.c
drivers/firmware/arm_sdei.c
include/linux/arm_sdei.h