Skip to content

Commit 8132d88

Browse files
committed
KVM: remove CONFIG_HAVE_KVM_EVENTFD
virt/kvm/eventfd.c is compiled unconditionally, meaning that the ioeventfds member of struct kvm is accessed unconditionally. CONFIG_HAVE_KVM_EVENTFD therefore must be defined for KVM common code to compile successfully, remove it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 1c3c87d commit 8132d88

9 files changed

Lines changed: 2 additions & 40 deletions

File tree

arch/arm64/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ menuconfig KVM
2929
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
3030
select KVM_XFER_TO_GUEST_WORK
3131
select KVM_VFIO
32-
select HAVE_KVM_EVENTFD
3332
select HAVE_KVM_IRQFD
3433
select HAVE_KVM_DIRTY_RING_ACQ_REL
3534
select NEED_KVM_DIRTY_RING_WITH_BITMAP

arch/loongarch/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config KVM
2222
depends on AS_HAS_LVZ_EXTENSION
2323
depends on HAVE_KVM
2424
select HAVE_KVM_DIRTY_RING_ACQ_REL
25-
select HAVE_KVM_EVENTFD
2625
select HAVE_KVM_VCPU_ASYNC_IOCTL
2726
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
2827
select KVM_GENERIC_HARDWARE_ENABLING

arch/mips/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config KVM
2222
select EXPORT_UASM
2323
select PREEMPT_NOTIFIERS
2424
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
25-
select HAVE_KVM_EVENTFD
2625
select HAVE_KVM_VCPU_ASYNC_IOCTL
2726
select KVM_MMIO
2827
select KVM_GENERIC_MMU_NOTIFIER

arch/powerpc/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if VIRTUALIZATION
2020
config KVM
2121
bool
2222
select PREEMPT_NOTIFIERS
23-
select HAVE_KVM_EVENTFD
2423
select HAVE_KVM_VCPU_ASYNC_IOCTL
2524
select KVM_VFIO
2625
select IRQ_BYPASS_MANAGER

arch/riscv/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if VIRTUALIZATION
2020
config KVM
2121
tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)"
2222
depends on RISCV_SBI && MMU
23-
select HAVE_KVM_EVENTFD
2423
select HAVE_KVM_IRQCHIP
2524
select HAVE_KVM_IRQFD
2625
select HAVE_KVM_IRQ_ROUTING

arch/s390/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ config KVM
2323
select PREEMPT_NOTIFIERS
2424
select HAVE_KVM_CPU_RELAX_INTERCEPT
2525
select HAVE_KVM_VCPU_ASYNC_IOCTL
26-
select HAVE_KVM_EVENTFD
2726
select KVM_ASYNC_PF
2827
select KVM_ASYNC_PF_SYNC
2928
select HAVE_KVM_IRQCHIP

arch/x86/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ config KVM
3333
select IRQ_BYPASS_MANAGER
3434
select HAVE_KVM_IRQ_BYPASS
3535
select HAVE_KVM_IRQ_ROUTING
36-
select HAVE_KVM_EVENTFD
3736
select KVM_ASYNC_PF
3837
select USER_RETURN_NOTIFIER
3938
select KVM_MMIO

include/linux/kvm_host.h

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ struct kvm {
782782
struct list_head vm_list;
783783
struct mutex lock;
784784
struct kvm_io_bus __rcu *buses[KVM_NR_BUSES];
785-
#ifdef CONFIG_HAVE_KVM_EVENTFD
786785
struct {
787786
spinlock_t lock;
788787
struct list_head items;
@@ -791,7 +790,6 @@ struct kvm {
791790
struct mutex resampler_lock;
792791
} irqfds;
793792
struct list_head ioeventfds;
794-
#endif
795793
struct kvm_vm_stat stat;
796794
struct kvm_arch arch;
797795
refcount_t users_count;
@@ -2056,8 +2054,6 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
20562054

20572055
int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
20582056

2059-
#ifdef CONFIG_HAVE_KVM_EVENTFD
2060-
20612057
void kvm_eventfd_init(struct kvm *kvm);
20622058
int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
20632059

@@ -2082,31 +2078,7 @@ static inline bool kvm_notify_irqfd_resampler(struct kvm *kvm,
20822078
{
20832079
return false;
20842080
}
2085-
#endif
2086-
2087-
#else
2088-
2089-
static inline void kvm_eventfd_init(struct kvm *kvm) {}
2090-
2091-
static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
2092-
{
2093-
return -EINVAL;
2094-
}
2095-
2096-
static inline void kvm_irqfd_release(struct kvm *kvm) {}
2097-
2098-
#ifdef CONFIG_HAVE_KVM_IRQCHIP
2099-
static inline void kvm_irq_routing_update(struct kvm *kvm)
2100-
{
2101-
}
2102-
#endif
2103-
2104-
static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
2105-
{
2106-
return -ENOSYS;
2107-
}
2108-
2109-
#endif /* CONFIG_HAVE_KVM_EVENTFD */
2081+
#endif /* CONFIG_HAVE_KVM_IRQFD */
21102082

21112083
void kvm_arch_irq_routing_update(struct kvm *kvm);
21122084

virt/kvm/Kconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
config HAVE_KVM
55
bool
6+
select EVENTFD
67

78
config HAVE_KVM_PFNCACHE
89
bool
@@ -39,10 +40,6 @@ config NEED_KVM_DIRTY_RING_WITH_BITMAP
3940
bool
4041
depends on HAVE_KVM_DIRTY_RING
4142

42-
config HAVE_KVM_EVENTFD
43-
bool
44-
select EVENTFD
45-
4643
config KVM_MMIO
4744
bool
4845

0 commit comments

Comments
 (0)