All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Gao <chao.gao@intel.com>
To: Xu Yilun <yilun.xu@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-coco@lists.linux.dev>,
	<kvm@vger.kernel.org>, <yilun.xu@intel.com>,
	<arjan.van.de.ven@intel.com>, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, "Borislav Petkov" <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Kiryl Shutsemau <kas@kernel.org>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>
Subject: Re: [RFC PATCH v2 2/2] x86/virt/seamldr: Support multiple sigstruct pages
Date: Thu, 12 Nov 2026 12:37:09 +0800	[thread overview]
Message-ID: <avVCddqEgJsmYHJp@intel.com> (raw)
In-Reply-To: <avSxHkwvLYVKrhCv@yilunxu-OptiPlex-7050>

On Thu, Nov 12, 2026 at 02:17:02AM +0800, Xu Yilun wrote:
>> Extend 'struct seamldr_params' to match the new ABI. The sigstruct
>> address list is already populated in a loop over all sigstruct pages, so
>> raising SEAMLDR_MAX_NR_SIG_PAGES is enough to fill the new slots
>
>As you mentioned [*], could you add a note maybe in populate_pa_list(),
>that chaining is only intended for the module binary, in case anyone
>gets lost when revisiting the sigstruct part.
>
>[*] https://lore.kernel.org/kvm/aumh_q8olQPwH0pe@intel.com/

Sure. Updated the comment above populate_pa_list() to:

/*
 * Given a vmalloc() allocation, write all of the backing physical
 * addresses to pa_list[]. Caller guarantees that the array is big
 * enough.
 *
 * If pa_list[] spans multiple pages, chain them by pointing the last
 * entry of each page to the next page. Note that a pa_list[] that
 * does not cross a page boundary, such as sigstruct_pages_pa_list[],
 * is never chained.
 */


>> @@ -166,6 +166,13 @@ static void populate_seamldr_params(struct seamldr_params *params,
>>  				    const u8 *mod, u32 mod_nr_pages)
>>  {
>>  	params->version		= 0;
>> +	/*
>> +	 * Use version 1 only for multi-page sigstructs, to stay
>> +	 * compatible with old P-SEAMLDRs that lack version 1 support.
>> +	 */
>> +	if (sig_nr_pages > 1)
>> +		params->version	= 1;
>
>If in future sig grows to more than 4 pages, can we stick to version 1?

That is up to the P-SEAMLDR ABI, but I will ask the P-SEAMLDR architects
to keep version 1 in that case.

>What's the planned boundary for sigstruct_pages_pa_list? I hope we don't
>further bump version on this.

The ABI allows four pages. The largest sigstruct today is two pages, so
there is already room for two more.

>
>> +
>>  	params->scenario	= SEAMLDR_SCENARIO_UPDATE;
>>  	params->module_nr_pages	= mod_nr_pages;
>>  
>> -- 
>> 2.52.0
>> 
>> 

      reply	other threads:[~2026-11-12  4:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 13:21 [RFC PATCH v2 0/2] TDX: P-SEAMLDR: Support large TDX modules and sigstructs Chao Gao
2026-11-06 13:21 ` [RFC PATCH v2 1/2] x86/virt/seamldr: Support large TDX module binaries Chao Gao
2026-11-09 22:34   ` Edgecombe, Rick P
2026-11-10  6:34     ` Binbin Wu
2026-11-11  8:45       ` Chao Gao
2026-11-11  7:57     ` Chao Gao
2026-11-11 17:15       ` Xu Yilun
2026-11-11 17:09   ` Xu Yilun
2026-11-12  4:05     ` Chao Gao
2026-11-06 13:21 ` [RFC PATCH v2 2/2] x86/virt/seamldr: Support multiple sigstruct pages Chao Gao
2026-11-09 22:12   ` Edgecombe, Rick P
2026-11-09 22:19     ` Dave Hansen
2026-11-11  7:24     ` Chao Gao
2026-11-11 18:17   ` Xu Yilun
2026-11-12  4:37     ` Chao Gao [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=avVCddqEgJsmYHJp@intel.com \
    --to=chao.gao@intel.com \
    --cc=arjan.van.de.ven@intel.com \
    --cc=bp@alien8.de \
    --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=rick.p.edgecombe@intel.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.