Skip to content

Commit 1d95f2d

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86: Have all vendor neutral sub-configs depend on KVM_X86, not just KVM
Make all vendor neutral KVM x86 configs depend on KVM_X86, not just KVM, i.e. gate them on at least one vendor module being enabled and thus on kvm.ko actually being built. Depending on just KVM allows the user to select the configs even though they won't actually take effect, and more importantly, makes it all too easy to create unmet dependencies. E.g. KVM_GENERIC_PRIVATE_MEM can't be selected by KVM_SW_PROTECTED_VM, because the KVM_GENERIC_MMU_NOTIFIER dependency is select by KVM_X86. Hiding all sub-configs when neither KVM_AMD nor KVM_INTEL is selected also helps communicate to the user that nothing "interesting" is going on, e.g. --- Virtualization <M> Kernel-based Virtual Machine (KVM) support < > KVM for Intel (and compatible) processors support < > KVM for AMD processors support Fixes: ea4290d ("KVM: x86: leave kvm.ko out of the build if no vendor module is requested") Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Fuad Tabba <tabba@google.com> Message-ID: <20250729225455.670324-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 19a9a1a commit 1d95f2d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

arch/x86/kvm/Kconfig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ config KVM_WERROR
7474
# FRAME_WARN, i.e. KVM_WERROR=y with KASAN=y requires special tuning.
7575
# Building KVM with -Werror and KASAN is still doable via enabling
7676
# the kernel-wide WERROR=y.
77-
depends on KVM && ((EXPERT && !KASAN) || WERROR)
77+
depends on KVM_X86 && ((EXPERT && !KASAN) || WERROR)
7878
help
7979
Add -Werror to the build flags for KVM.
8080

@@ -83,7 +83,7 @@ config KVM_WERROR
8383
config KVM_SW_PROTECTED_VM
8484
bool "Enable support for KVM software-protected VMs"
8585
depends on EXPERT
86-
depends on KVM && X86_64
86+
depends on KVM_X86 && X86_64
8787
help
8888
Enable support for KVM software-protected VMs. Currently, software-
8989
protected VMs are purely a development and testing vehicle for
@@ -169,7 +169,7 @@ config KVM_AMD_SEV
169169
config KVM_IOAPIC
170170
bool "I/O APIC, PIC, and PIT emulation"
171171
default y
172-
depends on KVM
172+
depends on KVM_X86
173173
help
174174
Provides support for KVM to emulate an I/O APIC, PIC, and PIT, i.e.
175175
for full in-kernel APIC emulation.
@@ -179,7 +179,7 @@ config KVM_IOAPIC
179179
config KVM_SMM
180180
bool "System Management Mode emulation"
181181
default y
182-
depends on KVM
182+
depends on KVM_X86
183183
help
184184
Provides support for KVM to emulate System Management Mode (SMM)
185185
in virtual machines. This can be used by the virtual machine
@@ -189,7 +189,7 @@ config KVM_SMM
189189

190190
config KVM_HYPERV
191191
bool "Support for Microsoft Hyper-V emulation"
192-
depends on KVM
192+
depends on KVM_X86
193193
default y
194194
help
195195
Provides KVM support for emulating Microsoft Hyper-V. This allows KVM
@@ -203,7 +203,7 @@ config KVM_HYPERV
203203

204204
config KVM_XEN
205205
bool "Support for Xen hypercall interface"
206-
depends on KVM
206+
depends on KVM_X86
207207
help
208208
Provides KVM support for the hosting Xen HVM guests and
209209
passing Xen hypercalls to userspace.
@@ -213,7 +213,7 @@ config KVM_XEN
213213
config KVM_PROVE_MMU
214214
bool "Prove KVM MMU correctness"
215215
depends on DEBUG_KERNEL
216-
depends on KVM
216+
depends on KVM_X86
217217
depends on EXPERT
218218
help
219219
Enables runtime assertions in KVM's MMU that are too costly to enable
@@ -228,7 +228,7 @@ config KVM_EXTERNAL_WRITE_TRACKING
228228

229229
config KVM_MAX_NR_VCPUS
230230
int "Maximum number of vCPUs per KVM guest"
231-
depends on KVM
231+
depends on KVM_X86
232232
range 1024 4096
233233
default 4096 if MAXSMP
234234
default 1024

0 commit comments

Comments
 (0)