kvm: make KVM_CAP_COALESCED_MMIO architecture agnostic
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 31 Mar 2017 11:53:22 +0000 (13:53 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 7 Apr 2017 14:49:00 +0000 (16:49 +0200)
Remove code from architecture files that can be moved to virt/kvm, since there
is already common code for coalesced MMIO.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
[Removed a pointless 'break' after 'return'.]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/arm/kvm/arm.c
arch/mips/kvm/mips.c
arch/powerpc/kvm/powerpc.c
arch/x86/kvm/x86.c
virt/kvm/kvm_main.c

index 96dba7cd8be7b4b6f29d9896e2d4515c477ca963..e3c8105ada65a87c70e2bf362e3a4008d526c2dd 100644 (file)
@@ -209,9 +209,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_IMMEDIATE_EXIT:
                r = 1;
                break;
-       case KVM_CAP_COALESCED_MMIO:
-               r = KVM_COALESCED_MMIO_PAGE_OFFSET;
-               break;
        case KVM_CAP_ARM_SET_DEVICE_ADDR:
                r = 1;
                break;
index 1fc6fef463db15641dff38842d0dd8dce7dc7c34..d4b2ad18eef2023d23701b0dd5a320d2370fee5d 100644 (file)
@@ -1070,9 +1070,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_IMMEDIATE_EXIT:
                r = 1;
                break;
-       case KVM_CAP_COALESCED_MMIO:
-               r = KVM_COALESCED_MMIO_PAGE_OFFSET;
-               break;
        case KVM_CAP_NR_VCPUS:
                r = num_online_cpus();
                break;
index 95c91a9de351c4b8b67f23c299279faa283efef7..0e42aa8a279f323d7728c993251c65b788ef27ae 100644 (file)
@@ -524,11 +524,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                /* We support this only for PR */
                r = !hv_enabled;
                break;
-#ifdef CONFIG_KVM_MMIO
-       case KVM_CAP_COALESCED_MMIO:
-               r = KVM_COALESCED_MMIO_PAGE_OFFSET;
-               break;
-#endif
 #ifdef CONFIG_KVM_MPIC
        case KVM_CAP_IRQ_MPIC:
                r = 1;
index 1853cda7f6d58b14cccb3447d1d2e4b7cd765af2..bb3a1531b2490b0eaeb9be5a904095c3b4df30f3 100644 (file)
@@ -2690,9 +2690,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                 */
                r = kvm_x86_ops->cpu_has_high_real_mode_segbase();
                break;
-       case KVM_CAP_COALESCED_MMIO:
-               r = KVM_COALESCED_MMIO_PAGE_OFFSET;
-               break;
        case KVM_CAP_VAPIC:
                r = !kvm_x86_ops->cpu_has_accelerated_tpr();
                break;
index ff3bf5d26e0b1943a8a496a385676204eb3e897a..b5dcde10c53b9c5335f5521c23d8238d75e77e04 100644 (file)
@@ -2918,6 +2918,10 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
        case KVM_CAP_IOEVENTFD_ANY_LENGTH:
        case KVM_CAP_CHECK_EXTENSION_VM:
                return 1;
+#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
+       case KVM_CAP_COALESCED_MMIO:
+               return KVM_COALESCED_MMIO_PAGE_OFFSET;
+#endif
 #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
        case KVM_CAP_IRQ_ROUTING:
                return KVM_MAX_IRQ_ROUTES;