Skip to content

Commit 9ab9ee7

Browse files
bonzinisashalevin
authored andcommitted
kvm: move advertising of KVM_CAP_IRQFD to common code
[ Upstream commit dc9be0f ] 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> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent 1b6bd91 commit 9ab9ee7

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
@@ -152,7 +152,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
152152
case KVM_CAP_ONE_REG:
153153
case KVM_CAP_ENABLE_CAP:
154154
case KVM_CAP_S390_CSS_SUPPORT:
155-
case KVM_CAP_IRQFD:
156155
case KVM_CAP_IOEVENTFD:
157156
case KVM_CAP_DEVICE_CTRL:
158157
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
@@ -2713,7 +2713,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
27132713
case KVM_CAP_USER_NMI:
27142714
case KVM_CAP_REINJECT_CONTROL:
27152715
case KVM_CAP_IRQ_INJECT_STATUS:
2716-
case KVM_CAP_IRQFD:
27172716
case KVM_CAP_IOEVENTFD:
27182717
case KVM_CAP_IOEVENTFD_NO_LENGTH:
27192718
case KVM_CAP_PIT2:

‎virt/kvm/kvm_main.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,6 +2417,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
24172417
case KVM_CAP_SIGNAL_MSI:
24182418
#endif
24192419
#ifdef CONFIG_HAVE_KVM_IRQFD
2420+
case KVM_CAP_IRQFD:
24202421
case KVM_CAP_IRQFD_RESAMPLE:
24212422
#endif
24222423
case KVM_CAP_CHECK_EXTENSION_VM:

0 commit comments

Comments
 (0)