Re: [PATCH v3 0/8] KVM: Register cpuhp/syscore callbacks when enabling virt
From: Huang, Kai
Date: Sun Jun 09 2024 - 21:00:04 EST
On Fri, 2024-06-07 at 17:06 -0700, Sean Christopherson wrote:
> Register KVM's cpuhp and syscore callbacks when enabling virtualization in
> hardware, as the sole purpose of said callbacks is to disable and re-enable
> virtualization as needed.
>
> The primary motivation for this series is to simplify dealing with enabling
> virtualization for Intel's TDX, which needs to enable virtualization
> when kvm-intel.ko is loaded, i.e. long before the first VM is created. TDX
> doesn't _need_ to keep virtualization enabled, but doing so is much simpler
> for KVM (see patch 3).
>
> That said, this is a nice cleanup on its own, assuming I haven't broken
> something. By registering the callbacks on-demand, the callbacks themselves
> don't need to check kvm_usage_count, because their very existence implies a
> non-zero count.
>
>
For this series,
Acked-by: Kai Huang <kai.huang@xxxxxxxxx>