KVM: s390: Enable up to 248 VCPUs per VM
authorEugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Wed, 22 Apr 2015 16:37:40 +0000 (18:37 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 30 Nov 2015 11:47:08 +0000 (12:47 +0100)
This patch allows s390 to have more than 64 VCPUs for a guest (up to
248 for memory usage considerations), if supported by the underlaying
hardware (sclp.has_esca).

Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/include/asm/kvm_host.h
arch/s390/kvm/kvm-s390.c

index 86c33863a0ad87378f81f961360643783b44091e..12e9291da2673ff8a65c6500f5f384349accf97f 100644 (file)
@@ -27,7 +27,7 @@
 
 #define KVM_S390_BSCA_CPU_SLOTS 64
 #define KVM_S390_ESCA_CPU_SLOTS 248
-#define KVM_MAX_VCPUS KVM_S390_BSCA_CPU_SLOTS
+#define KVM_MAX_VCPUS KVM_S390_ESCA_CPU_SLOTS
 #define KVM_USER_MEM_SLOTS 32
 
 /*
index 5e884aa890cbbdf8ee546141ceaa198a88b0ff8f..16c19fb0af8db2c0489083bca7814d85c510eccd 100644 (file)
@@ -246,7 +246,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                break;
        case KVM_CAP_NR_VCPUS:
        case KVM_CAP_MAX_VCPUS:
-               r = KVM_MAX_VCPUS;
+               r = sclp.has_esca ? KVM_S390_ESCA_CPU_SLOTS
+                                 : KVM_S390_BSCA_CPU_SLOTS;
                break;
        case KVM_CAP_NR_MEMSLOTS:
                r = KVM_USER_MEM_SLOTS;