Skip to content

efi: Follow-up fixes for EFI runtime stack

Ard Biesheuvel linux-arm-kernel linux-efi llvm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 7 repliesIn review
  2. v22 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- 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

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm64: efi: Avoid workqueue to check whether EFI runtime is livearch/arm64/include/asm/efi.h arch/arm64/kernel/efi-rt-wrapper.S arch/arm64/kernel/efi.c+17 -11 reply
2/2arm64: efi: Account for the EFI runtime stack in stack unwinderarch/arm64/include/asm/stacktrace.h arch/arm64/kernel/stacktrace.c+27 -04 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMark Rutland
1/2R-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] efi: Follow-up fixes for EFI runtime stack

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 <[email protected]>
Cc Lee Jones <[email protected]>

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(-)
Signature · 1 line
2.39.0