Re: [PATCH v2 00/21] Runtime TDX Module update support
From: Sagi Shahar
Date: Wed Nov 19 2025 - 17:45:03 EST
On Thu, Oct 30, 2025 at 9:53 PM Chao Gao <chao.gao@xxxxxxxxx> wrote:
>
> >A reference patch we tested for "Avoid updates during update-sensitive
> >times" and one caveat was that
> >/sys/devices/virtual/tdx/tdx_tsm/version was not available post update
> >failure until a subsequent successful update:
>
> I also tested this. It works well to prevent updates during TD build, so,
>
> Tested-by: Chao Gao <chao.gao@xxxxxxxxx>
>
> And I can integrate this change into my next version if you don't object.
>
> Regarding the caveat, could you check if the diff [*] I posted earlier this
> week can fix it?
>
> [1]: https://lore.kernel.org/linux-coco/aQAwRrvYMcaMsu02@xxxxxxxxx/
[Now in plaintext]
I tried testing it with the 1.5.24 TDX module and it sometimes fails,
but the failure does not appear consistent.
I added a local change to add the
TDX_SYS_SHUTDOWN_AVOID_COMPAT_SENSITIVE flag when calling
TDH_SYS_SHUTDOWN and TDH_SYS_SHUTDOWN fails as expected if a VM is
under build:
[ 1224.571177] virt/tdx: SEAMCALL (52) failed: 0x8000051200010000
But then sometimes trying to finalize the VM fail with the following error:
[ 1230.915145] kvm_intel: SEAMCALL TDH_MR_FINALIZE failed: 0x8000ff00ffff0000
[ 1230.948264] kvm_intel: tdh_mng_vpflushdone() failed. HKID 3 is leaked.
At this point the module seems to be in a broken state and trying to
create more TDs will fail:
[ 1543.745606] kvm_intel: SEAMCALL TDH_MNG_CREATE failed: 0x8000ff00ffff0000
Trying to update the module will fail shutdown with -ENODEV