]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: PPC: Book3S HV: Allow for running POWER9 host in single-threaded mode
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 16 Oct 2017 05:11:57 +0000 (16:11 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Wed, 1 Nov 2017 04:36:35 +0000 (15:36 +1100)
commit516f7898ae20d9dd902a85522676055a4de9dc9b
treea9e2eecb5c4533c685bc019213b1f572afb75c66
parent18c3640cefc7f1c6986b7be48f5013a8d5e394cb
KVM: PPC: Book3S HV: Allow for running POWER9 host in single-threaded mode

This patch allows for a mode on POWER9 hosts where we control all the
threads of a core, much as we do on POWER8.  The mode is controlled by
a module parameter on the kvm_hv module, called "indep_threads_mode".
The normal mode on POWER9 is the "independent threads" mode, with
indep_threads_mode=Y, where the host is in SMT4 mode (or in fact any
desired SMT mode) and each thread independently enters and exits from
KVM guests without reference to what other threads in the core are
doing.

If indep_threads_mode is set to N at the point when a VM is started,
KVM will expect every core that the guest runs on to be in single
threaded mode (that is, threads 1, 2 and 3 offline), and will set the
flag that prevents secondary threads from coming online.  We can still
use all four threads; the code that implements dynamic micro-threading
on POWER8 will become active in over-commit situations and will allow
up to three other VCPUs to be run on the secondary threads of the core
whenever a VCPU is run.

The reason for wanting this mode is that this will allow us to run HPT
guests on a radix host on a POWER9 machine that does not support
"mixed mode", that is, having some threads in a core be in HPT mode
while other threads are in radix mode.  It will also make it possible
to implement a "strict threads" mode in future, if desired.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_rmhandlers.S