Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kvm: move KVM_CAP_NR_MEMSLOTS to common code

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>

+4 -15
+2 -3
Documentation/virtual/kvm/api.txt
··· 1117 1117 This ioctl allows the user to create, modify or delete a guest physical 1118 1118 memory slot. Bits 0-15 of "slot" specify the slot id and this value 1119 1119 should be less than the maximum number of user memory slots supported per 1120 - VM. The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS, 1121 - if this capability is supported by the architecture. Slots may not 1122 - overlap in guest physical address space. 1120 + VM. The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS. 1121 + Slots may not overlap in guest physical address space. 1123 1122 1124 1123 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot" 1125 1124 specifies the address space which is being modified. They must be
-3
arch/powerpc/kvm/powerpc.c
··· 644 644 else 645 645 r = num_online_cpus(); 646 646 break; 647 - case KVM_CAP_NR_MEMSLOTS: 648 - r = KVM_USER_MEM_SLOTS; 649 - break; 650 647 case KVM_CAP_MAX_VCPUS: 651 648 r = KVM_MAX_VCPUS; 652 649 break;
-3
arch/s390/kvm/kvm-s390.c
··· 513 513 else if (sclp.has_esca && sclp.has_64bscao) 514 514 r = KVM_S390_ESCA_CPU_SLOTS; 515 515 break; 516 - case KVM_CAP_NR_MEMSLOTS: 517 - r = KVM_USER_MEM_SLOTS; 518 - break; 519 516 case KVM_CAP_S390_COW: 520 517 r = MACHINE_HAS_ESOP; 521 518 break;
-3
arch/x86/kvm/x86.c
··· 3093 3093 case KVM_CAP_MAX_VCPUS: 3094 3094 r = KVM_MAX_VCPUS; 3095 3095 break; 3096 - case KVM_CAP_NR_MEMSLOTS: 3097 - r = KVM_USER_MEM_SLOTS; 3098 - break; 3099 3096 case KVM_CAP_PV_MMU: /* obsolete */ 3100 3097 r = 0; 3101 3098 break;
-3
virt/kvm/arm/arm.c
··· 224 224 case KVM_CAP_MAX_VCPUS: 225 225 r = KVM_MAX_VCPUS; 226 226 break; 227 - case KVM_CAP_NR_MEMSLOTS: 228 - r = KVM_USER_MEM_SLOTS; 229 - break; 230 227 case KVM_CAP_MSI_DEVID: 231 228 if (!kvm) 232 229 r = -EINVAL;
+2
virt/kvm/kvm_main.c
··· 3063 3063 #endif 3064 3064 case KVM_CAP_MAX_VCPU_ID: 3065 3065 return KVM_MAX_VCPU_ID; 3066 + case KVM_CAP_NR_MEMSLOTS: 3067 + return KVM_USER_MEM_SLOTS; 3066 3068 default: 3067 3069 break; 3068 3070 }