1
0
Fork 0
alistair23-linux/arch/mips/kvm
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
..
00README.txt KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
Kconfig Make anon_inodes unconditional 2019-04-19 14:03:11 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
commpage.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
commpage.h MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" 2014-06-30 16:52:03 +02:00
dyntrans.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
emulate.c MIPS: KVM: Use prandom_u32_max() to generate tlbwr index 2019-03-25 14:02:12 -07:00
entry.c KVM: MIPS/Entry: Update entry code to support VZ 2017-03-28 14:53:51 +01:00
fpu.S MIPS: KVM: Fix fpu.S misassembly with r6 2016-07-05 16:09:11 +02:00
hypcall.c KVM: MIPS: Implement HYPCALL emulation 2017-03-28 14:53:33 +01:00
interrupt.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
interrupt.h KVM: MIPS: Implement VZ support 2017-03-28 14:53:54 +01:00
mips.c KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-05-28 15:52:19 +02:00
mmu.c KVM: Make kvm_set_spte_hva() return int 2018-12-21 11:28:41 +01:00
msa.S MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
stats.c MIPS: KVM: Clean up kvm_exit trace event 2016-06-14 11:16:23 +02:00
tlb.c KVM: MIPS: Fix maybe-uninitialized build failure 2017-06-20 17:02:48 +02:00
trace.h KVM: MIPS/VZ: Trace guest mode changes 2017-03-28 14:54:00 +01:00
trap_emul.c MIPS: mm: Add set_cpu_context() for ASID assignments 2019-02-04 10:56:33 -08:00
vz.c MIPS: mm: Unify ASID version checks 2019-02-04 10:56:30 -08:00