Re: [PATCH v4 20/24] x86/virt/tdx: Enable TDX Module runtime updates
From: Chao Gao
Date: Tue Feb 24 2026 - 01:03:51 EST
On Mon, Feb 23, 2026 at 01:09:10PM +0800, Huang, Kai wrote:
>On Thu, 2026-02-12 at 06:35 -0800, Chao Gao wrote:
>> All pieces of TDX Module runtime updates are in place. Enable it if it
>> is supported.
>>
>> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
>> Reviewed-by: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>
>> Reviewed-by: Tony Lindgren <tony.lindgren@xxxxxxxxxxxxxxx>
>> ---
>> v4:
>> - s/BIT/BIT_ULL [Tony]
>> ---
>> arch/x86/include/asm/tdx.h | 5 ++++-
>> arch/x86/virt/vmx/tdx/tdx.h | 3 ---
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
>> index ffadbf64d0c1..ad62a7be0443 100644
>> --- a/arch/x86/include/asm/tdx.h
>> +++ b/arch/x86/include/asm/tdx.h
>> @@ -32,6 +32,9 @@
>> #define TDX_SUCCESS 0ULL
>> #define TDX_RND_NO_ENTROPY 0x8000020300000000ULL
>>
>> +/* Bit definitions of TDX_FEATURES0 metadata field */
>> +#define TDX_FEATURES0_TD_PRESERVING BIT_ULL(1)
>> +#define TDX_FEATURES0_NO_RBP_MOD BIT_ULL(18)
>> #ifndef __ASSEMBLER__
>>
>> #include <uapi/asm/mce.h>
>> @@ -105,7 +108,7 @@ const struct tdx_sys_info *tdx_get_sysinfo(void);
>>
>> static inline bool tdx_supports_runtime_update(const struct tdx_sys_info *sysinfo)
>> {
>> - return false; /* To be enabled when kernel is ready */
>> + return sysinfo->features.tdx_features0 & TDX_FEATURES0_TD_PRESERVING;
>> }
>>
>> int tdx_guest_keyid_alloc(void);
>> diff --git a/arch/x86/virt/vmx/tdx/tdx.h b/arch/x86/virt/vmx/tdx/tdx.h
>> index d1807a476d3b..749f4d74cb2c 100644
>> --- a/arch/x86/virt/vmx/tdx/tdx.h
>> +++ b/arch/x86/virt/vmx/tdx/tdx.h
>> @@ -88,9 +88,6 @@ struct tdmr_info {
>> DECLARE_FLEX_ARRAY(struct tdmr_reserved_area, reserved_areas);
>> } __packed __aligned(TDMR_INFO_ALIGNMENT);
>>
>> -/* Bit definitions of TDX_FEATURES0 metadata field */
>> -#define TDX_FEATURES0_NO_RBP_MOD BIT(18)
>> -
>>
>
>Nit:
>
>Strictly speaking, moving this "NO_RBP_MOD" isn't required to "enable TDX
>module runtime updates". So I think it's better to call out in changelog
>that this is trying to centralize the bit definitions.
Sure. Will do.