Skip to content

Move memory acceptance x86 arch code into EFI stub

Ard Biesheuvel linux-efi lkml 2 versions – Applied

Status from this message: The following commit has been merged into the x86/boot branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesApplied
  2. v13 patches 16 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3x86/tdx: Share tdx_panic() with the EFI stubarch/x86/boot/compressed/tdx-shared.c arch/x86/coco/tdx/tdx-shared.c arch/x86/coco/tdx/tdx.c +1 more+34 -351 reply
2/3x86/boot: Move unaccepted memory handling out of the decompressorarch/x86/boot/compressed/mem.c arch/x86/boot/compressed/sev.h arch/x86/include/asm/sev.h +1 more+41 -441 reply
3/3x86/boot: Drop unused implementation of panic()arch/x86/boot/compressed/error.c arch/x86/boot/compressed/error.h+0 -200 replies

Reviews trailers per patch

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

PatchKiryl Shutsemau (Meta)
1/3R-b
2/3R-b
3/3A-b

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

Read the v2 thread

Cover letter [PATCH v2 0/3] Move memory acceptance x86 arch code into EFI stub

This is a follow-up to [0].

Move arch_accept_memory(), which is only called by the EFI stub and never by the decompressor on a non-EFI boot, into the EFI stub, and avoid relying directly on decompressor APIs such as error().

Instead, call tdx_panic() on a failure to accept memory in a TDX guest.

This makes the decompressor's implementation of panic() obsolete, and allows it to be removed. This is a prerequisite for dropping the implementation of snprintf() from the EFI stub entirely, which is what the series containing [0] implements.

Changes since v1 [1]:
- Add missing stub for early_is_sevsnp_guest() when SEV support is compiled out but TDX support is built in.
- Use native_cpuid() in EFI stub code so it does not get paravirtualized
- Set __NO_FORTIFY when including tdx-shared.c so the decompressor/stub version does not get instrumented. Needed for the memcpy() in tdx_panic().

[0] http://lore.kernel.org/r/[email protected]
[1] https://lore.kernel.org/all/[email protected]/

Cc Kiryl Shutsemau (Meta) <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Edgecombe, Rick P <[email protected]>

Ard Biesheuvel (3):
x86/tdx: Share tdx_panic() with the EFI stub
x86/boot: Move unaccepted memory handling out of the decompressor x86/boot: Drop unused implementation of panic()

 arch/x86/boot/compressed/error.c        | 19 ---------
 arch/x86/boot/compressed/error.h        |  1 -
 arch/x86/boot/compressed/mem.c          | 42 --------------------
 arch/x86/boot/compressed/sev.h          |  2 -
 arch/x86/boot/compressed/tdx-shared.c   |  2 +
 arch/x86/coco/tdx/tdx-shared.c          | 31 +++++++++++++++
 arch/x86/coco/tdx/tdx.c                 | 35 ----------------
 arch/x86/include/asm/sev.h              |  2 +
 arch/x86/include/asm/shared/tdx.h       |  1 +
 drivers/firmware/efi/libstub/x86-stub.c | 39 ++++++++++++++++++
 10 files changed, 75 insertions(+), 99 deletions(-)
Signature · 1 line
2.53.0