linux-stable/arch
Thomas Huth 527919d0cc KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID
commit a86cb413f4 upstream.

KVM_CAP_MAX_VCPU_ID is currently always reporting KVM_MAX_VCPU_ID on all
architectures. However, on s390x, the amount of usable CPUs is determined
during runtime - it is depending on the features of the machine the code
is running on. Since we are using the vcpu_id as an index into the SCA
structures that are defined by the hardware (see e.g. the sca_add_vcpu()
function), it is not only the amount of CPUs that is limited by the hard-
ware, but also the range of IDs that we can use.
Thus KVM_CAP_MAX_VCPU_ID must be determined during runtime on s390x, too.
So the handling of KVM_CAP_MAX_VCPU_ID has to be moved from the common
code into the architecture specific code, and on s390x we have to return
the same value here as for KVM_CAP_MAX_VCPUS.
This problem has been discovered with the kvm_create_max_vcpus selftest.
With this change applied, the selftest now passes on s390x, too.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190523164309.13345-9-thuth@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-09 09:18:16 +02:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:20:53 +01:00
arc arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM 2019-04-20 09:14:59 +02:00
arm ARM: vdso: Remove dependency with the arch_timer driver internals 2019-05-31 06:47:18 -07:00
arm64 arm64: cpu_ops: fix a leaked reference by adding missing of_node_put 2019-05-31 06:47:30 -07:00
blackfin
c6x
cris
frv
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:31:25 +02:00
hexagon hexagon: modify ffs() and fls() to return int 2018-10-10 08:54:25 +02:00
ia64
m32r
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 14:35:21 +01:00
metag
microblaze
mips KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
mn10300
nios2
openrisc
parisc parisc: Rename LEVEL to PA_ASM_LEVEL to avoid name clash with DRBD code 2019-05-25 18:25:18 +02:00
powerpc KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
s390 KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
score
sh sh: fix multiple function definition build errors 2019-05-08 07:20:51 +02:00
sparc sparc64: Fix regression in non-hypervisor TLB flush xcall 2019-06-09 09:18:13 +02:00
tile
um um: Avoid marking pages with "changed protection" 2019-02-12 19:46:08 +01:00
unicore32
x86 KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
xtensa xtensa: xtfpga.dtsi: fix dtc warnings about SPI 2019-05-16 19:42:30 +02:00
.gitignore
Kconfig compiler.h: Allow arch-specific asm/compiler.h 2018-11-04 14:52:46 +01:00