Re: [PATCH v4 2/2] x86/virt/seamldr: Support multiple sigstruct pages

From: Edgecombe, Rick P

Date: Fri Dec 04 2026 - 19:38:52 EST


On Fri, 2026-12-04 at 02:59 -0800, Chao Gao wrote:
> TDX module sigstructs are limited to 4KB. Each update image carries a
> sigstruct, which is handed to P-SEAMLDR in 'struct seamldr_params'
> along with the module binary. The structure has room for the physical
> address of only one sigstruct page.
>
> TDX modules are moving to a post-quantum signature algorithm. Its
> signatures are far larger than the ones in use today, so the sigstruct
> no longer fits in 4KB.
>
> The P-SEAMLDR ABI was extended to take up to four sigstruct pages. The
> physical addresses of the three added pages follow the existing one, in
> space that was reserved. Setting the 'version' field of the structure
> to 1 tells P-SEAMLDR that the added addresses are in use.
>
> Grow sigstruct_pages_pa_list[] to four entries to match. In anticipation
> of this change, the list is already filled in a loop, so filling the
> new entries needs no new code.
>
> Use version 1 only when the sigstruct spans more than one page. Old
> P-SEAMLDRs reject version 1, so this keeps today's modules working on
> them.
>
> P-SEAMLDR enumerates its support for version 1 with a feature bit. Do
> not query it. Userspace selects the update image and is responsible
> for ensuring the module is compatible with P-SEAMLDR.
>
> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>

It looks good. The only question it leaves open is, if the bits for the extra
sigstruct pages were previously reserved, then why do we need to select a
version. Seems weird that the seamldr can't just check the for non-zero fields.
I guess then you can't pass pfn 0. Or perhaps the seamldr wasn't previously
rejecting garbage in the reserved fields. Do you know the reason?

It seems notable that the kernel side can smoothly increase the size without
breaking its uABI but the TDX module needs extra hints. I actually think it
might be worth commenting that the TDX ABI is deficient in this way, for the
purpose of dispelling any confusion that something is off in the reviewers
understanding. Otherwise,

Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>