kvm: move KVM_CAP_NR_MEMSLOTS to common code
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Mar 2019 16:24:03 +0000 (17:24 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Apr 2019 13:39:08 +0000 (15:39 +0200)
All architectures except MIPS were defining it in the same way,
and memory slots are handled entirely by common code so there
is no point in keeping the definition per-architecture.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virtual/kvm/api.txt
arch/powerpc/kvm/powerpc.c
arch/s390/kvm/kvm-s390.c
arch/x86/kvm/x86.c
virt/kvm/arm/arm.c
virt/kvm/kvm_main.c

index 67068c47c591a5ce8fc373313d46f434863ef54b..b62ad0d9423440a30c3d3fc386f325468567e88c 100644 (file)
@@ -1117,9 +1117,8 @@ struct kvm_userspace_memory_region {
 This ioctl allows the user to create, modify or delete a guest physical
 memory slot.  Bits 0-15 of "slot" specify the slot id and this value
 should be less than the maximum number of user memory slots supported per
-VM.  The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
-if this capability is supported by the architecture.  Slots may not
-overlap in guest physical address space.
+VM.  The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS.
+Slots may not overlap in guest physical address space.
 
 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
 specifies the address space which is being modified.  They must be
index 8885377ec3e0c611b3ec3f14b8565e2f7ffde4aa..92910b7c5bcc2beaf1778353602da529032e0de0 100644 (file)
@@ -644,9 +644,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                else
                        r = num_online_cpus();
                break;
-       case KVM_CAP_NR_MEMSLOTS:
-               r = KVM_USER_MEM_SLOTS;
-               break;
        case KVM_CAP_MAX_VCPUS:
                r = KVM_MAX_VCPUS;
                break;
index 4638303ba6a858793eded0e331b67aeea67db5d0..28f35d2b06cbae01df288da88c109a64a8c11673 100644 (file)
@@ -513,9 +513,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                else if (sclp.has_esca && sclp.has_64bscao)
                        r = KVM_S390_ESCA_CPU_SLOTS;
                break;
-       case KVM_CAP_NR_MEMSLOTS:
-               r = KVM_USER_MEM_SLOTS;
-               break;
        case KVM_CAP_S390_COW:
                r = MACHINE_HAS_ESOP;
                break;
index 38440316a806c456f21282e484a985927de35cc7..6c27d224f744aac2a54545821ff390334b9ab10a 100644 (file)
@@ -3093,9 +3093,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_MAX_VCPUS:
                r = KVM_MAX_VCPUS;
                break;
-       case KVM_CAP_NR_MEMSLOTS:
-               r = KVM_USER_MEM_SLOTS;
-               break;
        case KVM_CAP_PV_MMU:    /* obsolete */
                r = 0;
                break;
index 99c37384ba7bd3766db4fb863d6baea908210c75..be4ec5f3ba5f81144d94898e77d9d0faf4063001 100644 (file)
@@ -224,9 +224,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_MAX_VCPUS:
                r = KVM_MAX_VCPUS;
                break;
-       case KVM_CAP_NR_MEMSLOTS:
-               r = KVM_USER_MEM_SLOTS;
-               break;
        case KVM_CAP_MSI_DEVID:
                if (!kvm)
                        r = -EINVAL;
index dc8edc97ba850384680b56f88063f61bebfc96c8..684b67252cd56bc4775cbec3519ff42b0a8d98fa 100644 (file)
@@ -3063,6 +3063,8 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
 #endif
        case KVM_CAP_MAX_VCPU_ID:
                return KVM_MAX_VCPU_ID;
+       case KVM_CAP_NR_MEMSLOTS:
+               return KVM_USER_MEM_SLOTS;
        default:
                break;
        }