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 <pingf...@linux.vnet.ibm.com>
---
 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

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to