Skip to content

Commit caadf87

Browse files
committed
KVM: introduce CONFIG_KVM_COMMON
CONFIG_HAVE_KVM is currently used by some architectures to either enabled the KVM config proper, or to enable host-side code that is not part of the KVM module. However, CONFIG_KVM's "select" statement in virt/kvm/Kconfig corresponds to a third meaning, namely to enable common Kconfigs required by all architectures that support KVM. These three meanings can be replaced respectively by an architecture-specific Kconfig, by IS_ENABLED(CONFIG_KVM), or by a new Kconfig symbol that is in turn selected by the architecture-specific "config KVM". Start by introducing such a new Kconfig symbol, CONFIG_KVM_COMMON. Unlike CONFIG_HAVE_KVM, it is selected by CONFIG_KVM, not by architecture code, and it brings in all dependencies of common KVM code. In particular, INTERVAL_TREE was missing in loongarch and riscv, so that is another thing that is fixed. Fixes: 8132d88 ("KVM: remove CONFIG_HAVE_KVM_EVENTFD", 2023-12-08) Reported-by: Randy Dunlap <rdunlap@infradead.org> Closes: https://lore.kernel.org/all/44907c6b-c5bd-4e4a-a921-e4d3825539d8@infradead.org/ Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 9cc5262 commit caadf87

8 files changed

Lines changed: 12 additions & 12 deletions

File tree

arch/arm64/kvm/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if VIRTUALIZATION
2121
menuconfig KVM
2222
bool "Kernel-based Virtual Machine (KVM) support"
2323
depends on HAVE_KVM
24+
select KVM_COMMON
2425
select KVM_GENERIC_HARDWARE_ENABLING
2526
select KVM_GENERIC_MMU_NOTIFIER
26-
select PREEMPT_NOTIFIERS
2727
select HAVE_KVM_CPU_RELAX_INTERCEPT
2828
select KVM_MMIO
2929
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
@@ -39,7 +39,6 @@ menuconfig KVM
3939
select HAVE_KVM_VCPU_RUN_PID_CHANGE
4040
select SCHED_INFO
4141
select GUEST_PERF_EVENTS if PERF_EVENTS
42-
select INTERVAL_TREE
4342
select XARRAY_MULTI
4443
help
4544
Support hosting virtualized guest machines.

arch/loongarch/kvm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ config KVM
2323
depends on HAVE_KVM
2424
select HAVE_KVM_DIRTY_RING_ACQ_REL
2525
select HAVE_KVM_VCPU_ASYNC_IOCTL
26+
select KVM_COMMON
2627
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
2728
select KVM_GENERIC_HARDWARE_ENABLING
2829
select KVM_GENERIC_MMU_NOTIFIER
2930
select KVM_MMIO
3031
select KVM_XFER_TO_GUEST_WORK
31-
select PREEMPT_NOTIFIERS
3232
help
3333
Support hosting virtualized guest machines using
3434
hardware virtualization extensions. You will need

arch/mips/kvm/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ config KVM
2020
depends on HAVE_KVM
2121
depends on MIPS_FP_SUPPORT
2222
select EXPORT_UASM
23-
select PREEMPT_NOTIFIERS
23+
select KVM_COMMON
2424
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
2525
select HAVE_KVM_VCPU_ASYNC_IOCTL
2626
select KVM_MMIO
2727
select KVM_GENERIC_MMU_NOTIFIER
28-
select INTERVAL_TREE
2928
select KVM_GENERIC_HARDWARE_ENABLING
3029
help
3130
Support for hosting Guest kernels.

arch/powerpc/kvm/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ if VIRTUALIZATION
1919

2020
config KVM
2121
bool
22-
select PREEMPT_NOTIFIERS
22+
select KVM_COMMON
2323
select HAVE_KVM_VCPU_ASYNC_IOCTL
2424
select KVM_VFIO
2525
select IRQ_BYPASS_MANAGER
2626
select HAVE_KVM_IRQ_BYPASS
27-
select INTERVAL_TREE
2827

2928
config KVM_BOOK3S_HANDLER
3029
bool

arch/riscv/kvm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ config KVM
2424
select HAVE_KVM_IRQ_ROUTING
2525
select HAVE_KVM_MSI
2626
select HAVE_KVM_VCPU_ASYNC_IOCTL
27+
select KVM_COMMON
2728
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
2829
select KVM_GENERIC_HARDWARE_ENABLING
2930
select KVM_MMIO
3031
select KVM_XFER_TO_GUEST_WORK
3132
select KVM_GENERIC_MMU_NOTIFIER
32-
select PREEMPT_NOTIFIERS
3333
select SCHED_INFO
3434
help
3535
Support hosting virtualized guest machines.

arch/s390/kvm/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ config KVM
2020
def_tristate y
2121
prompt "Kernel-based Virtual Machine (KVM) support"
2222
depends on HAVE_KVM
23-
select PREEMPT_NOTIFIERS
2423
select HAVE_KVM_CPU_RELAX_INTERCEPT
2524
select HAVE_KVM_VCPU_ASYNC_IOCTL
2625
select KVM_ASYNC_PF
2726
select KVM_ASYNC_PF_SYNC
27+
select KVM_COMMON
2828
select HAVE_KVM_IRQCHIP
2929
select HAVE_KVM_IRQ_ROUTING
3030
select HAVE_KVM_INVALID_WAKEUPS
3131
select HAVE_KVM_NO_POLL
3232
select KVM_VFIO
33-
select INTERVAL_TREE
3433
select MMU_NOTIFIER
3534
help
3635
Support hosting paravirtualized guest machines using the SIE

arch/x86/kvm/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ config KVM
2323
depends on HAVE_KVM
2424
depends on HIGH_RES_TIMERS
2525
depends on X86_LOCAL_APIC
26-
select PREEMPT_NOTIFIERS
26+
select KVM_COMMON
2727
select KVM_GENERIC_MMU_NOTIFIER
2828
select HAVE_KVM_IRQCHIP
2929
select HAVE_KVM_PFNCACHE
@@ -44,7 +44,6 @@ config KVM
4444
select KVM_XFER_TO_GUEST_WORK
4545
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
4646
select KVM_VFIO
47-
select INTERVAL_TREE
4847
select HAVE_KVM_PM_NOTIFIER if PM
4948
select KVM_GENERIC_HARDWARE_ENABLING
5049
help

virt/kvm/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33

44
config HAVE_KVM
55
bool
6+
7+
config KVM_COMMON
8+
bool
69
select EVENTFD
10+
select INTERVAL_TREE
11+
select PREEMPT_NOTIFIERS
712

813
config HAVE_KVM_PFNCACHE
914
bool

0 commit comments

Comments
 (0)