]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - arch/powerpc/kvm/powerpc.c
KVM: PPC: Book3S HV: Allow userspace to set the desired SMT mode
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 6 Feb 2017 02:24:41 +0000 (13:24 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 19 Jun 2017 04:34:20 +0000 (14:34 +1000)
commit3c313524605a6afd8207448a8e9967f5e8cba734
tree618ce202f550dccba853ec66b75c973a976cf833
parent769377f77ca2087baeaf97ce0b7026abeba3b581
KVM: PPC: Book3S HV: Allow userspace to set the desired SMT mode

This allows userspace to set the desired virtual SMT (simultaneous
multithreading) mode for a VM, that is, the number of VCPUs that
get assigned to each virtual core.  Previously, the virtual SMT mode
was fixed to the number of threads per subcore, and if userspace
wanted to have fewer vcpus per vcore, then it would achieve that by
using a sparse CPU numbering.  This had the disadvantage that the
vcpu numbers can get quite large, particularly for SMT1 guests on
a POWER8 with 8 threads per core.  With this patch, userspace can
set its desired virtual SMT mode and then use contiguous vcpu
numbering.

On POWER8, where the threading mode is "strict", the virtual SMT mode
must be less than or equal to the number of threads per subcore.  On
POWER9, which implements a "loose" threading mode, the virtual SMT
mode can be any power of 2 between 1 and 8, even though there is
effectively one thread per subcore, since the threads are independent
and can all be in different partitions.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Documentation/virtual/kvm/api.txt
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/powerpc.c