Re: [RFC PATCH v2 2/2] x86/virt/seamldr: Support multiple sigstruct pages
From: Chao Gao
Date: Thu Nov 12 2026 - 00:03:17 EST
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@xxxxxxxxx/
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
>>
>>