Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Gao, Chao" <chao.gao@intel.com>
Cc: "Van De Ven, Arjan" <arjan.van.de.ven@intel.com>,
	"Xu, Yilun" <yilun.xu@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"kas@kernel.org" <kas@kernel.org>
Subject: Re: [PATCH v4 2/2] x86/virt/seamldr: Support multiple sigstruct pages
Date: Sat, 5 Dec 2026 00:38:33 +0000	[thread overview]
Message-ID: <e7b209044a039eacf5dd1b17b0569a7869627e8c.camel@intel.com> (raw)
In-Reply-To: <20261204105951.1811487-3-chao.gao@intel.com>

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@intel.com>

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@intel.com>


      reply	other threads:[~2026-12-05  0:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 10:59 [PATCH v4 0/2] TDX: P-SEAMLDR: Support large TDX modules and sigstructs Chao Gao
2026-12-04 10:59 ` [PATCH v4 1/2] x86/virt/seamldr: Support large TDX module binaries Chao Gao
2026-12-05  0:27   ` Edgecombe, Rick P
2026-12-04 10:59 ` [PATCH v4 2/2] x86/virt/seamldr: Support multiple sigstruct pages Chao Gao
2026-12-05  0:38   ` Edgecombe, Rick P [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7b209044a039eacf5dd1b17b0569a7869627e8c.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=arjan.van.de.ven@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox