The primary hwthread ceases the scheduler of secondary hwthread by bringing them into NAP. Then, the secondary is ready for guest. Signed-off-by: Liu Ping Fan <pingfank@xxxxxxxxxxxxxxxxxx> --- arch/powerpc/kvm/book3s_hv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 4348abd..7896c31 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -1593,15 +1593,22 @@ static int on_primary_thread(void) { int cpu = smp_processor_id(); int thr; + struct cpumask msk; /* Are we on a primary subcore? */ if (cpu_thread_in_subcore(cpu)) return 0; thr = 0; +#ifdef KVMPPC_ENABLE_SECONDARY + while (++thr < threads_per_subcore) + cpumask_set_cpu(thr, &msk); + stop_cpus_async(&msk, kvmppc_secondary_stopper, NULL); +#else while (++thr < threads_per_subcore) if (cpu_online(cpu + thr)) return 0; +#endif /* Grab all hw threads so they can't go into the kernel */ for (thr = 1; thr < threads_per_subcore; ++thr) { -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html