mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Move memory acceptance x86 arch code into EFI stub
@ 2026-09-25  7:51 Ard Biesheuvel
  2026-09-25  7:51 ` [PATCH v2 1/3] x86/tdx: Share tdx_panic() with the " Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2026-09-25  7:51 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-kernel, x86, Ard Biesheuvel, Kiryl Shutsemau (Meta),
	Borislav Petkov, Edgecombe, Rick P

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/20260909115530.1924665-13-ardb+git@google.com
[1] https://lore.kernel.org/all/20260914183745.37538-5-ardb@kernel.org/

Cc: Kiryl Shutsemau (Meta) <kas@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Edgecombe, Rick P <rick.p.edgecombe@intel.com>

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(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-09-25  7:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25  7:51 [PATCH v2 0/3] Move memory acceptance x86 arch code into EFI stub Ard Biesheuvel
2026-09-25  7:51 ` [PATCH v2 1/3] x86/tdx: Share tdx_panic() with the " Ard Biesheuvel
2026-09-25  7:51 ` [PATCH v2 2/3] x86/boot: Move unaccepted memory handling out of the decompressor Ard Biesheuvel
2026-09-25  7:51 ` [PATCH v2 3/3] x86/boot: Drop unused implementation of panic() Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®