Re: [PATCH v9 19/23] x86/virt/tdx: Refresh TDX module version after update
From: Edgecombe, Rick P
Date: Mon May 18 2026 - 23:17:17 EST
On Wed, 2026-05-13 at 08:10 -0700, Chao Gao wrote:
> The kernel exposes the TDX module version through sysfs so userspace can
> check update compatibility. That information needs to remain accurate
> across runtime updates.
>
> A runtime update may change the module's update_version, so refresh the
> cached version right after a successful update.
>
> Drop __ro_after_init from tdx_sysinfo because it is now updated at runtime.
>
> Do not refresh the rest of tdx_sysinfo, even if some values change across
> updates. TDX module updates are backward compatible, so existing
> tdx_sysinfo consumers, e.g. KVM, can continue to operate without seeing the
> new values.
>
> Refreshing the full structure would be risky. A tdx_sysinfo consumer may
> initialize its TDX support based on the features originally reported in
> tdx_sysinfo. If a runtime update adds new features and the full structure
> is refreshed, that consumer could observe and use the newly reported
> features without having performed the setup required to use them safely.
>
> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
> ---
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
The only thing I saw missing from Dave's last comments was:
---
> Note that major and minor versions are not refreshed because runtime updates
> are supported only between releases with identical major and minor versions.
I'd rather have this in code than a changelog comment.
If they can't change then warn if they do.
---
But I think we discussed offline to not do this, is it right?