Re: [PATCH 12/30] KVM: VMX: Initialize TDX during KVM module load

From: Paolo Bonzini
Date: Mon Feb 24 2025 - 13:57:22 EST


On 2/21/25 00:27, Huang, Kai wrote:
Hi Paolo,

This patch still doesn't address a bug Chao pointed out, that the
__do_tdx_cleanup() can be called from __do_tdx_bringup() with cpus_read_lock()
being hold, so we need to use cpuhp_remove_state_nocalls_cpuslocked() in
__do_tdx_cleanup().

I posted a diff to address here:

https://lore.kernel.org/lkml/46ea74bcd8eebe241a143e9280c65ca33cb8dcce.camel@xxxxxxxxx/T/#m1e86328e69b27e6cc9978f90df923144d699c350

It would be great if you could squash to the kvm-coco-queue. There will be some
minor rebase conflict to the rest patches, though, so if you want me to send out
fixup patch(es) for you to squash please do let me know.

Btw, the diff also moves the 'enable_virt_at_load' check to
kvm_can_support_tdx(), which isn't related to this issue. Below is the diff
(also attached) w/o this code change but only to address the above bug if you
prefer.

Thank, I applied this one. In fact I think we can remove kvm_can_support_tdx() altogether and inline it in tdx_bringup(),
since there are other checks like MOVDIR64B.

The conflicts are not problematic so I'm happy to solve them for you.

Paolo