Re: [PATCH 0/3] Move memory acceptance x86 arch code into EFI stub

From: Edgecombe, Rick P

Date: Wed Sep 16 2026 - 14:20:34 EST


Kiryl,

On Mon, 2026-09-14 at 20:37 +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.

The TDG accept call can return:

TDX_OPERAND_INVALID - That would be a bug in Linux TDX code, we don't need to
pass it to the caller. Probably don't need to handle it.
TDX_PAGE_ALREADY_ACCEPTED - Potential security sensitive error that is the
guests fault.
TDX_PAGE_SIZE_MISMATCH - Already handled. Sort of. Not sure if it is robust to
S-EPT page size changes?
TDX_SUCCESS - Already handled
TDX_OPERAND_BUSY - Can happen from transient host side S-EPT locking. Or it
could be the guest's fault if they are accepting the same page from different
vCPUs at the same time, so the guest case is similar to
TDX_PAGE_ALREADY_ACCEPTED.

I guess the caller could care about TDX_PAGE_ALREADY_ACCEPTED errors. But SNP
doesn't do anything for this case. It seems like part of the problem is that we
are passing errors back that the caller can't feasibly handle.