linux-stable/arch/powerpc/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
..
book3s.c KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method 2019-04-30 19:40:39 +10:00
book3s.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 98 2019-05-24 17:37:54 +02:00
book3s_32_mmu.c KVM: PPC: Book3S PR: Add emulation for slbfee. instruction 2019-02-19 14:25:52 +11:00
book3s_32_mmu_host.c
book3s_32_sr.S
book3s_64_mmu.c KVM: PPC: Book3S PR: Add emulation for slbfee. instruction 2019-02-19 14:25:52 +11:00
book3s_64_mmu_host.c * ARM: HYP mode stub supports kexec/kdump on 32-bit; improved PMU 2017-05-08 12:37:56 -07:00
book3s_64_mmu_hv.c mm/gup: change GUP fast to use flags rather than a write 'bool' 2019-05-14 09:47:46 -07:00
book3s_64_mmu_radix.c KVM: PPC: Book3S HV: Add KVM stat largepages_[2M/1G] 2019-02-19 16:00:15 +11:00
book3s_64_slb.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
book3s_64_vio.c KVM: PPC: Book3S: Allocate guest TCEs on demand too 2019-04-30 14:43:13 +10:00
book3s_64_vio_hv.c KVM: PPC: Book3S: Allocate guest TCEs on demand too 2019-04-30 14:43:13 +10:00
book3s_emulate.c KVM: PPC: Book3S PR: Add emulation for slbfee. instruction 2019-02-19 14:25:52 +11:00
book3s_exports.c
book3s_hv.c powerpc updates for 5.2 2019-05-10 05:29:27 -07:00
book3s_hv_builtin.c KVM: PPC: Book3S HV: Flush TLB on secondary radix threads 2019-04-30 19:32:12 +10:00
book3s_hv_hmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 114 2019-05-24 17:39:01 +02:00
book3s_hv_interrupts.S KVM: PPC: Book3S HV: Extract PMU save/restore operations as C-callable functions 2018-10-09 16:04:27 +11:00
book3s_hv_nested.c KVM: PPC: Book3S HV: Introduce kvmhv_update_nest_rmap_rc_list() 2018-12-21 14:39:35 +11:00
book3s_hv_ras.c KVM: PPC: Book3S HV: Simplify machine check handling 2019-02-21 23:16:44 +11:00
book3s_hv_rm_mmu.c KVM: PPC: Book3S HV: Implement real mode H_PAGE_INIT handler 2019-04-30 14:43:12 +10:00
book3s_hv_rm_xics.c powerpc/mm/hash64: Map all the kernel regions in the same 0xc range 2019-04-21 23:12:39 +10:00
book3s_hv_rm_xive.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
book3s_hv_rmhandlers.S * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
book3s_hv_tm.c KVM: PPC: Use ccr field in pt_regs struct embedded in vcpu struct 2018-10-09 16:04:27 +11:00
book3s_hv_tm_builtin.c KVM: PPC: Use ccr field in pt_regs struct embedded in vcpu struct 2018-10-09 16:04:27 +11:00
book3s_interrupts.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
book3s_mmu_hpte.c
book3s_paired_singles.c
book3s_pr.c KVM: PPC: Pass change type down to memslot commit function 2018-12-17 10:57:27 +11:00
book3s_pr_papr.c KVM: PPC: Book3S PR: Enable in-kernel TCE handlers for PR KVM 2017-10-14 16:38:19 +11:00
book3s_rmhandlers.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
book3s_rtas.c KVM: PPC: Book3S: Allow XICS emulation to work in nested hosts using XIVE 2019-02-19 16:00:15 +11:00
book3s_segment.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
book3s_xics.c KVM: PPC: Book3S HV: Change to use DEFINE_SHOW_ATTRIBUTE macro 2018-12-14 15:39:47 +11:00
book3s_xics.h KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller 2017-04-27 21:37:29 +10:00
book3s_xive.c KVM: PPC: Book3S HV: XIVE: Clear escalation interrupt pointers on device close 2019-04-30 19:41:01 +10:00
book3s_xive.h KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method 2019-04-30 19:40:39 +10:00
book3s_xive_native.c KVM: PPC: Book3S HV: XIVE: Fix spelling mistake "acessing" -> "accessing" 2019-05-14 12:06:03 +10:00
book3s_xive_template.c KVM: PPC: Book3S HV: Fix XICS-on-XIVE H_IPI when priority = 0 2019-04-30 19:29:23 +10:00
booke.c KVM: PPC: Pass change type down to memslot commit function 2018-12-17 10:57:27 +11:00
booke.h
booke_emulate.c KVM: PPC: Move nip/ctr/lr/xer registers to pt_regs in kvm_vcpu_arch 2018-05-18 15:38:23 +10:00
booke_interrupts.S
bookehv_interrupts.S powerpc/fsl: Flush branch predictor when entering KVM 2018-12-20 22:59:03 +11:00
e500.c powerpc: remove unnecessary inclusion of asm/tlbflush.h 2018-07-30 22:48:20 +10:00
e500.h powerpc/mm: move platform specific mmu-xxx.h in platform directories 2018-12-04 19:45:01 +11:00
e500_emulate.c powerpc/fsl: Emulate SPRN_BUCSR register 2018-12-20 22:59:03 +11:00
e500_mmu.c mm/gup: change GUP fast to use flags rather than a write 'bool' 2019-05-14 09:47:46 -07:00
e500_mmu_host.c KVM: Make kvm_set_spte_hva() return int 2018-12-21 11:28:41 +01:00
e500_mmu_host.h
e500mc.c powerpc: remove unnecessary inclusion of asm/tlbflush.h 2018-07-30 22:48:20 +10:00
emulate.c KVM: PPC: Use exported tb_to_ns() function in decrementer emulation 2018-10-26 21:58:58 +11:00
emulate_loadstore.c KVM: PPC: Use ccr field in pt_regs struct embedded in vcpu struct 2018-10-09 16:04:27 +11:00
fpu.S
irq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig Make anon_inodes unconditional 2019-04-19 14:03:11 +02:00
Makefile KVM: PPC: Book3S HV: Add a new KVM device for the XIVE native exploitation mode 2019-04-30 19:35:16 +10:00
mpic.c
powerpc.c KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-05-28 15:52:19 +02:00
timing.c KVM: PPC: Use seq_puts() in kvmppc_exit_timing_show() 2018-01-11 20:36:06 +11:00
timing.h
tm.S KVM: PPC: Book3S: Rework TM save/restore code and make it C-callable 2018-10-09 16:04:27 +11:00
trace.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00
trace_book3s.h KVM: PPC: Book3S: Simplify external interrupt handling 2018-10-09 16:04:27 +11:00
trace_booke.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00
trace_hv.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00
trace_pr.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00