Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "Hansen, Dave" <dave.hansen@intel.com>, "Gao, Chao" <chao.gao@intel.com>
Cc: "Van De Ven, Arjan" <arjan.van.de.ven@intel.com>,
	"Xu, Yilun" <yilun.xu@intel.com>, "bp@alien8.de" <bp@alien8.de>,
	"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
	"kas@kernel.org" <kas@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"tglx@kernel.org" <tglx@kernel.org>
Subject: Re: [PATCH v3 1/2] x86/virt/seamldr: Support large TDX module binaries
Date: Mon, 23 Nov 2026 19:20:11 +0000	[thread overview]
Message-ID: <41dc795ec6611a1998e94d8b422172d1cb588df4.camel@intel.com> (raw)
In-Reply-To: <awQ7Mb0atIOtP1D9@intel.com>

On Mon, 2026-11-23 at 21:10 +0800, Chao Gao wrote:
> > Why don't the data structures look like this disagram?
> 
> I started with data structures that look like the diagram. Three
> simplifications got from there to the current code.
> 
> First, make the pages in the diagram contiguous. The diagram shows
> them apart, as the ABI allows, but we don't need to allocate them
> separately. It can be just a single large structure, and the existing
> allocation code is reused as is.
> 
> Second, use a fixed number of pages. The ABI allows any number of
> them, to support a module of any size. But modules are about 2MB
> today, so the structure is just 16 pages, which is enough for a module
> of about 32MB. The number can be raised if modules outgrow it.
> 
> Third, don't define the entries that point to the next page
> explicitly. They are always the last u64 of a page. So the code that
> fills in the structure can locate them as it goes.
> 
> Defining those entries explicitly would match the diagram. But then
> those entries split the list of module page addresses into multiple
> lists, one per page, and the first one is shorter than the others.
> The code that fills them in has to keep track of which list it is in
> and how long that list is. That is more code.

How does it look if you just have two versions of the struct and cast? Did you
try it? How many more lines? We don't want to fight to save a few lines of code
if we end up needing lots of explanation to justify it.

  reply	other threads:[~2026-11-23 19:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  7:49 [PATCH v3 0/2] TDX: P-SEAMLDR: Support large TDX modules and sigstructs Chao Gao
2026-11-19  7:49 ` [PATCH v3 1/2] x86/virt/seamldr: Support large TDX module binaries Chao Gao
2026-11-19 18:10   ` Dave Hansen
2026-11-20  2:58     ` Chao Gao
2026-11-20 15:19       ` Dave Hansen
2026-11-23 13:10         ` Chao Gao
2026-11-23 19:20           ` Edgecombe, Rick P [this message]
2026-11-19  7:49 ` [PATCH v3 2/2] x86/virt/seamldr: Support multiple sigstruct pages Chao Gao

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=41dc795ec6611a1998e94d8b422172d1cb588df4.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@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