From patchwork Fri May 23 08:15:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 351757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 564B11400A9 for ; Fri, 23 May 2014 18:15:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbaEWIPs (ORCPT ); Fri, 23 May 2014 04:15:48 -0400 Received: from ozlabs.org ([103.22.144.67]:58876 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbaEWIPq (ORCPT ); Fri, 23 May 2014 04:15:46 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 993EC1400A9; Fri, 23 May 2014 18:15:44 +1000 (EST) Received: by localhost.localdomain (Postfix, from userid 1000) id 6C3E4D42E6C; Fri, 23 May 2014 18:15:44 +1000 (EST) From: Michael Neuling To: Benjamin Herrenschmidt , Alexander Graf Cc: Paul Mackerras , linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Michael Ellerman , Michael Neuling Subject: [PATCH v2 4/6] powerpc: Check cpu_thread_in_subcore() in __cpu_up() Date: Fri, 23 May 2014 18:15:28 +1000 Message-Id: <1400832930-17050-5-git-send-email-mikey@neuling.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400832930-17050-1-git-send-email-mikey@neuling.org> References: <1400832930-17050-1-git-send-email-mikey@neuling.org> Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Michael Ellerman To support split core we need to change the check in __cpu_up() that determines if a cpu is allowed to come online. Currently we refuse to online cpus which are not the primary thread within their core. On POWER8 with split core support this check needs to instead refuse to online cpus which are not the primary thread within their *sub* core. On POWER7 and other systems that do not support split core, threads_per_subcore == threads_per_core and so the check is equivalent. Signed-off-by: Michael Ellerman Signed-off-by: Michael Neuling --- arch/powerpc/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 6edae3d..b5222c4 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -489,7 +489,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) * Don't allow secondary threads to come online if inhibited */ if (threads_per_core > 1 && secondaries_inhibited() && - cpu % threads_per_core != 0) + cpu_thread_in_subcore(cpu)) return -EBUSY; if (smp_ops == NULL ||