From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159AbcGUKgx (ORCPT ); Thu, 21 Jul 2016 06:36:53 -0400 Received: from foss.arm.com ([217.140.101.70]:47242 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbcGUKgt (ORCPT ); Thu, 21 Jul 2016 06:36:49 -0400 Date: Thu, 21 Jul 2016 11:36:44 +0100 From: Mark Rutland To: Suzuki K Poulose Cc: catalin.marinas@arm.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, James Morse Subject: Re: [PATCH] [4.7] arm64: Honor nosmp kernel command line option Message-ID: <20160721103643.GD20559@leverpostej> References: <1469096127-1136-1-git-send-email-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469096127-1136-1-git-send-email-suzuki.poulose@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2016 at 11:15:27AM +0100, Suzuki K Poulose wrote: > Passing "nosmp" should boot the kernel with a single processor, without > provision to enable secondary CPUs even if they are present. "nosmp" is > implemented by setting maxcpus=0. At the moment we still mark the secondary > CPUs present even with nosmp, which allows the userspace to bring them > up. This patch corrects the smp_prepare_cpus() to honor the maxcpus == 0. > > Commit 44dbcc93ab67145 ("arm64: Fix behavior of maxcpus=N") fixed the > behavior for maxcpus >= 1, but broke maxcpus = 0. > > Fixes: commit 44dbcc93ab67145 ("arm64: Fix behavior of maxcpus=N") > Cc: Will Deacon > Cc: Catalin Marinas > Cc: Mark Rutland > Cc: James Morse > Signed-off-by: Suzuki K Poulose > --- > arch/arm64/kernel/smp.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index d242e81..ec08b7a 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -694,6 +694,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) > smp_store_cpu_info(smp_processor_id()); > > /* > + * If UP is mandated by "nosmp"(implies maxcpus=0), don't bother about Nit: missing space between the quote abnd opening bracket. It would also be nicer to have s/implies/which implies/ Otherwise: Acked-by: Mark Rutland Mark. > + * secondary CPUs. > + */ > + if (max_cpus == 0) > + return; > + > + /* > * Initialise the present map (which describes the set of CPUs > * actually populated at the present time) and release the > * secondaries from the bootloader. > -- > 2.7.4 >