]> Git Repo - linux.git/commit
Merge branch 'kvm-redo-enable-virt' into HEAD
authorPaolo Bonzini <[email protected]>
Thu, 12 Sep 2024 15:13:05 +0000 (11:13 -0400)
committerPaolo Bonzini <[email protected]>
Tue, 17 Sep 2024 15:38:20 +0000 (11:38 -0400)
commitc09dd2bb5748075d995ae46c2d18423032230f9b
tree69dfdceb3b3a7a4f178e7d21e89f41a3e6af18ea
parent55f50b2f86929ae042cd2eee8b2e8ffe00b5a885
parent590b09b1d88e18ae57f89930a6f7b89795d2e9f3
Merge branch 'kvm-redo-enable-virt' into HEAD

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.

That said, this is a nice cleanup on its own.  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.

Patch 1 (re)adds a dedicated lock for kvm_usage_count.  This avoids a
lock ordering issue between cpus_read_lock() and kvm_lock.  The lock
ordering issue still exist in very rare cases, and will be fixed for
good by switching vm_list to an (S)RCU-protected list.

Signed-off-by: Paolo Bonzini <[email protected]>
arch/arm64/kvm/arm.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
This page took 0.083996 seconds and 4 git commands to generate.