linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] efi: Follow-up fixes for EFI runtime stack
@ 2023-01-06 17:47 Ard Biesheuvel
  2023-01-06 17:47 ` [PATCH v3 1/2] arm64: efi: Avoid workqueue to check whether EFI runtime is live Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ard Biesheuvel @ 2023-01-06 17:47 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-arm-kernel, will, catalin.marinas, Ard Biesheuvel,
	Mark Rutland, Lee Jones

Commit ff7a167961d1b ("arm64: efi: Execute runtime services from a
dedicated stack") introduced a dedicated stack for EFI runtime services,
in an attempt to make the execution of EFI runtime services more robust,
given that they execute at the same privilege level as the kernel.

However, this stack needs to be declared to the stacktrace machinery,
which is careful not to walk the stack when it leads into memory regions
that are not known to be allocated for stack use.

Also, given that the ACPI code may invoke the low-level EFI runtime call
wrapper without using the dedicated kernel thread and workqueue, we
should take this into account when trying to gracefully handle
synchronous exceptions.

Changes since v2:
- clear efi_rt_stack_top[-1] from asm code, and use READ_ONCE() to read
  its value when not holding the spinlock, to ensure that all accesses
  are safe under concurrency;
- add Mark's ack to patch #2

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Lee Jones <lee@kernel.org>

Ard Biesheuvel (2):
  arm64: efi: Avoid workqueue to check whether EFI runtime is live
  arm64: efi: Account for the EFI runtime stack in stack unwinder

 arch/arm64/include/asm/efi.h        |  9 +++++++++
 arch/arm64/include/asm/stacktrace.h | 15 +++++++++++++++
 arch/arm64/kernel/efi-rt-wrapper.S  |  6 ++++++
 arch/arm64/kernel/efi.c             |  3 ++-
 arch/arm64/kernel/stacktrace.c      | 12 ++++++++++++
 5 files changed, 44 insertions(+), 1 deletion(-)

-- 
2.39.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-01-11 22:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06 17:47 [PATCH v3 0/2] efi: Follow-up fixes for EFI runtime stack Ard Biesheuvel
2023-01-06 17:47 ` [PATCH v3 1/2] arm64: efi: Avoid workqueue to check whether EFI runtime is live Ard Biesheuvel
2023-01-09 13:26   ` Mark Rutland
2023-01-06 17:47 ` [PATCH v3 2/2] arm64: efi: Account for the EFI runtime stack in stack unwinder Ard Biesheuvel
2023-01-10 20:48   ` Nathan Chancellor
2023-01-11  8:45     ` Ard Biesheuvel
2023-01-11 21:18       ` Nathan Chancellor
2023-01-11 22:53         ` Ard Biesheuvel
2023-01-09 10:38 ` [PATCH v3 0/2] efi: Follow-up fixes for EFI runtime stack Lee Jones
2023-01-09 13:46   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).