Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+7 -4
+6 -3
arch/x86/kvm/Kconfig
··· 17 17 18 18 if VIRTUALIZATION 19 19 20 - config KVM 21 - tristate "Kernel-based Virtual Machine (KVM) support" 20 + config KVM_X86 21 + def_tristate KVM if KVM_INTEL || KVM_AMD 22 22 depends on X86_LOCAL_APIC 23 23 select KVM_COMMON 24 24 select KVM_GENERIC_MMU_NOTIFIER ··· 44 44 select HAVE_KVM_PM_NOTIFIER if PM 45 45 select KVM_GENERIC_HARDWARE_ENABLING 46 46 select KVM_GENERIC_PRE_FAULT_MEMORY 47 + select KVM_GENERIC_PRIVATE_MEM if KVM_SW_PROTECTED_VM 47 48 select KVM_WERROR if WERROR 49 + 50 + config KVM 51 + tristate "Kernel-based Virtual Machine (KVM) support" 48 52 help 49 53 Support hosting fully virtualized guest machines using hardware 50 54 virtualization extensions. You will need a fairly recent ··· 81 77 bool "Enable support for KVM software-protected VMs" 82 78 depends on EXPERT 83 79 depends on KVM && X86_64 84 - select KVM_GENERIC_PRIVATE_MEM 85 80 help 86 81 Enable support for KVM software-protected VMs. Currently, software- 87 82 protected VMs are purely a development and testing vehicle for
+1 -1
arch/x86/kvm/Makefile
··· 32 32 kvm-amd-y += svm/svm_onhyperv.o 33 33 endif 34 34 35 - obj-$(CONFIG_KVM) += kvm.o 35 + obj-$(CONFIG_KVM_X86) += kvm.o 36 36 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o 37 37 obj-$(CONFIG_KVM_AMD) += kvm-amd.o 38 38