Skip to content

Commit dc9be0f

Browse files
bonzinimatosatti
authored andcommitted
kvm: move advertising of KVM_CAP_IRQFD to common code
POWER supports irqfds but forgot to advertise them. Some userspace does not check for the capability, but others check it---thus they work on x86 and s390 but not POWER. To avoid that other architectures in the future make the same mistake, let common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE. Reported-and-tested-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Cc: stable@vger.kernel.org Fixes: 297e210 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
1 parent affb817 commit dc9be0f

3 files changed

Lines changed: 1 addition & 2 deletions

File tree

‎arch/s390/kvm/kvm-s390.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
165165
case KVM_CAP_ONE_REG:
166166
case KVM_CAP_ENABLE_CAP:
167167
case KVM_CAP_S390_CSS_SUPPORT:
168-
case KVM_CAP_IRQFD:
169168
case KVM_CAP_IOEVENTFD:
170169
case KVM_CAP_DEVICE_CTRL:
171170
case KVM_CAP_ENABLE_CAP_VM:

‎arch/x86/kvm/x86.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
27442744
case KVM_CAP_USER_NMI:
27452745
case KVM_CAP_REINJECT_CONTROL:
27462746
case KVM_CAP_IRQ_INJECT_STATUS:
2747-
case KVM_CAP_IRQFD:
27482747
case KVM_CAP_IOEVENTFD:
27492748
case KVM_CAP_IOEVENTFD_NO_LENGTH:
27502749
case KVM_CAP_PIT2:

‎virt/kvm/kvm_main.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,6 +2492,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
24922492
case KVM_CAP_SIGNAL_MSI:
24932493
#endif
24942494
#ifdef CONFIG_HAVE_KVM_IRQFD
2495+
case KVM_CAP_IRQFD:
24952496
case KVM_CAP_IRQFD_RESAMPLE:
24962497
#endif
24972498
case KVM_CAP_CHECK_EXTENSION_VM:

0 commit comments

Comments
 (0)