]> git.dujemihanovic.xyz Git - linux.git/commit
KVM: x86: leave kvm.ko out of the build if no vendor module is requested
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Oct 2024 14:15:01 +0000 (10:15 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 6 Oct 2024 07:53:41 +0000 (03:53 -0400)
commitea4290d77bda2bd1f173a86f07aa79b568e0a6f8
tree9890f2cb368f9c9535c7ccbfdcb5e10e628307c4
parentfcd1ec9cb59c4375803c2c3c18ba7f473fe91cdc
KVM: x86: leave kvm.ko out of the build if no vendor module is requested

kvm.ko is nothing but library code shared by kvm-intel.ko and kvm-amd.ko.
It provides no functionality on its own and it is unnecessary unless one
of the vendor-specific module is compiled.  In particular, /dev/kvm is
not created until one of kvm-intel.ko or kvm-amd.ko is loaded.

Use CONFIG_KVM to decide if it is built-in or a module, but use the
vendor-specific modules for the actual decision on whether to build it.

This also fixes a build failure when CONFIG_KVM_INTEL and CONFIG_KVM_AMD
are both disabled.  The cpu_emergency_register_virt_callback() function
is called from kvm.ko, but it is only defined if at least one of
CONFIG_KVM_INTEL and CONFIG_KVM_AMD is provided.

Fixes: 590b09b1d88e ("KVM: x86: Register "emergency disable" callbacks when virt is enabled")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/Kconfig
arch/x86/kvm/Makefile