Re: [PATCH 0/3] Move memory acceptance x86 arch code into EFI stub
From: Borislav Petkov
Date: Mon Sep 14 2026 - 19:27:35 EST
+ Rick and linux-coco
On Mon, Sep 14, 2026 at 08:37:46PM +0200, Ard Biesheuvel wrote:
> 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.
>
> [0] http://lore.kernel.org/r/20260909115530.1924665-13-ardb+git@xxxxxxxxxx
>
> Cc: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
>
> 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/coco/tdx/tdx-shared.c | 35 ++++++++++++++++
> 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 | 40 +++++++++++++++++++
> 9 files changed, 78 insertions(+), 99 deletions(-)
>
>
> base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
> --
> 2.47.3
>
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette