Re: [PATCH v4 13/24] x86/virt/seamldr: Shut down the current TDX module

From: Chao Gao

Date: Fri Mar 06 2026 - 03:19:01 EST


>> Ideally, the kernel needs to retrieve the handoff versions supported by
>> the current module and the new module and select a version supported by
>> both. But, since the Linux kernel only supports module upgrades, simply
>
>Nit:
>
>Again, ".. the Linux kernel only supports module upgrades ..." sounds like
>describing the behaviour of the current kernel, but for now runtime update
>is not supported yet.

ack.

>
>I would change to " .. this implementation chooses to only support module
>upgrades".

looks good to me. Will do.

>> --- a/arch/x86/virt/vmx/tdx/tdx.h
>> +++ b/arch/x86/virt/vmx/tdx/tdx.h
>> @@ -46,6 +46,7 @@
>> #define TDH_PHYMEM_PAGE_WBINVD 41
>> #define TDH_VP_WR 43
>> #define TDH_SYS_CONFIG 45
>> +#define TDH_SYS_SHUTDOWN 52
>>
>> /*
>> * SEAMCALL leaf:
>> @@ -118,4 +119,6 @@ struct tdmr_info_list {
>> int max_tdmrs; /* How many 'tdmr_info's are allocated */
>> };
>>
>> +int tdx_module_shutdown(void);
>
>This (and future patches) makes couple of tdx_xx() functions visible out of
>tdx.c. The alternative is to move the main "module update" function out of
>seamldr.c to tdx.c, but that would require making couple of seamldr_xx()s
>(and data structures probably) visible to tdx.c too.

Yes. I'll keep this organization unless someone strongly prefers moving the
main "module update" function and related data structures to tdx.c.

If neither approach is acceptable, a third option would be to remove seamldr.c
entirely and merge it into tdx.c. This would mean adding ~360 LoC to an
existing file that already has ~1900 LoC.