linux/virt/kvm/arm
Thomas Huth a86cb413f4 KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID
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>
2019-05-28 15:52:19 +02:00
..
hyp KVM: arm/arm64: Move cc/it checks under hyp's Makefile to avoid instrumentation 2019-05-24 14:53:20 +01:00
vgic KVM: arm/arm64: vgic-v3: Retire pending interrupts on disabling LPIs 2019-04-03 02:18:43 +01:00
aarch32.c KVM: arm/arm64: Move cc/it checks under hyp's Makefile to avoid instrumentation 2019-05-24 14:53:20 +01:00
arch_timer.c KVM: arm/arm64: Don't emulate virtual timers on userspace ioctls 2019-04-25 14:13:31 +01:00
arm.c KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-05-28 15:52:19 +02:00
mmio.c arm64: KVM: Skip MMIO insn after emulation 2018-12-18 14:10:36 +00:00
mmu.c arm64 updates for 5.2 2019-05-06 17:54:22 -07:00
perf.c KVM: arm/arm64: Move shared files to virt/kvm/arm 2017-05-04 13:57:26 +02:00
pmu.c KVM: arm64: Rewrite system register accessors to read/write functions 2018-03-19 10:53:16 +00:00
psci.c arm/arm64: KVM: Allow a VCPU to fully reset itself 2019-02-07 11:44:13 +00:00
trace.h KVM: arm/arm64: Fix TRACE_INCLUDE_PATH 2019-02-19 21:05:51 +00:00