Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp84694img; Tue, 19 Mar 2019 18:31:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFtyivDDgtP9lRBS7Gte1WNeRX/YZA5CAqW/PfcdSJ+ktI29ZH+hZ8aTcBBpBpfsbZzyvi X-Received: by 2002:a63:464c:: with SMTP id v12mr12745082pgk.431.1553045496359; Tue, 19 Mar 2019 18:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553045496; cv=none; d=google.com; s=arc-20160816; b=AuGldAOAF/4DCj24+TAJJdHXcJOVS+gDkkoJAV4PqfS49uIwDRwip1M0NfxAznwn7g TZpFDA5R9JXzMHzWcVV4ddO/6KMYzM7KN8uFseX8XpulgaXUEHtkAxmNGB7/FJbbGTnl 79Dai0CFfXqZgc/nnsTfiFY1biRhVaHfDMRPO33SQP5A7OrVCqZd8fxl+yyFN3gM/Gx7 ELQDpt4t74mLoYqJTYbtUJN5SKRt9YNOpRwwJlvyrVKSEgYZ5D94Z/8J/UOC2RPJ8Gnl +6MPm4wusJxXOxEepqZgmdF+v2o0u4qIWtICm3jor27DOqjWbWm9m9OI3hZq5HSqyj+F 3pfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr :dkim-signature; bh=pyP6ryL3qE4+lj8INr3CtSzUElv5ke1A0FnE3ZiOUvA=; b=eDoC1ESUlAr3QXlQynPv5QzRHAwiZH7hNfa1LFI4XorSqr+7w6Flf2+6Mxmy5Tucr+ eJT/68xm055zeFua7VeENJP42x95gKAPgg4Fh5ZgByBJzW43NMwbgvwT9TCHXum8w9jT lrgm00l/PaeHi4ZUGNru/FJo06yn3FzlsdY2ah2N8XLzld4viUR04gF7GibOplm5IHJU p3+PpvzkYSqBUBZ+ZYTI+RaT6TTRY5IRXBqw7R9jXUitOq5lthztdDjnw7OHgC561oMO DqbBHdnWJfUeNPLt84Zxpt9Hg9I59iz91umk1U/s+hXGt8EFiW4I3S33cm+xNFtkx//P KGxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Dz13dbwy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a40si571833pla.234.2019.03.19.18.31.20; Tue, 19 Mar 2019 18:31:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Dz13dbwy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727167AbfCTB3Y (ORCPT + 99 others); Tue, 19 Mar 2019 21:29:24 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:25874 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfCTB3Y (ORCPT ); Tue, 19 Mar 2019 21:29:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1553045364; x=1584581364; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=E38eZeQ9viQA5lcPyg6T8ZDnldIgV4Gx/PClWhyMd1Y=; b=Dz13dbwyBOzM+BqGbKwiwJO9Gte2lntOxcaJtXSKJbAAACFe239wAE17 9htXUFydaoU0VKD4hxYePcjv0OhTlC18rjIhj8dv7GEHOEui2Adp5Xdw4 zUuaYzqBuS+DDs4lHAgpOnE0ZvS7ND08cS9sPTNOO3gA/CImErj4i4B6Y MWZ+O66JOL4HqiJ7KhhcVaR8oqkSQfH/548Oqc/ZhZ0qrQTDXZI6q8nxI 7yfpB3NnSwE38hxtaNHOu5J01wXKujGgkRKlcAu4Qwnc58R1BX0vDF2TF WEyDapUayK0AhuorpxYWatOdk/QHb2LNphewFYGBzxjpAYFE5iTfKQwsS A==; X-IronPort-AV: E=Sophos;i="5.60,246,1549900800"; d="scan'208";a="105533605" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Mar 2019 09:29:24 +0800 IronPort-SDR: UyC1AfKo5AeepZUZkML4jvpdboQ/a5Kdar40DYnOjZocuv0E9BanWWWrUYd0ltp9BH+nfBr6Lw LO0nCDuuED3XtPIm/W8FAgXLVY6tSZiHI8mnNfjp2D/QEZYI29RBYC9fkRuILMQbhww6EUii1T oXMvh06rJFFTKxL6d0Tq9pcSIcP9OYVHpwg+PEYykkRieYTHqYz6Hoytcs8i9mw/kCQaZZjClR +KGz7GEY19Lp1H81spiWfcsx0lQNA8R0/PKvaspF9JvyRj5RqnNrSys3CNfVO7+BFD/jbB+tkw ADqHxtrX7S3YMFJrCGrNmjUk Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Mar 2019 18:07:01 -0700 IronPort-SDR: ehNFdQnfwd/m+YDcdOgF4/akeWcqQ3xEoATR/qDhm0CgvHERM2qSgNbKPtT1SgneCBv3gXpAlK 0dg9EyZye1LX9w283yHtxHJQ4jePb/p2fcX/U5aJGmgAmUDpuiTeyjXv0suiDQYO8IeTYYr56M KTJv6mKsqJUIMlBOMPaDg+KKcVlep0E97KU2vS99NXtgN4O2G9j8BHEHK1GBNAEgXaYRNiSxk6 yZZIuOVDGZP8s0bcranNx5mZYr3AaSvD8vRuDZRUtlOycyQirn5qKYruxh8wlVUYOqH+Un7vhx tYk= Received: from c02v91rdhtd5.sdcorp.global.sandisk.com (HELO [10.111.70.138]) ([10.111.70.138]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Mar 2019 18:29:24 -0700 Subject: Re: [v1 PATCH 4/4] RISC-V: Support nr_cpus command line option. To: Damien Le Moal , "linux-riscv@lists.infradead.org" Cc: Albert Ou , Andreas Schwab , Anup Patel , Dmitriy Cherkasov , Johan Hovold , "linux-kernel@vger.kernel.org" , Palmer Dabbelt , Paul Walmsley , Anup Patel References: <20190319222028.4293-1-atish.patra@wdc.com> <20190319222028.4293-4-atish.patra@wdc.com> From: Atish Patra Message-ID: <17dc2df7-a730-1461-2577-1a05ec27d32d@wdc.com> Date: Tue, 19 Mar 2019 18:29:23 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/19/19 4:58 PM, Damien Le Moal wrote: > On 2019/03/20 8:56, Damien Le Moal wrote: >> On 2019/03/20 7:20, Atish Patra wrote: >>> If nr_cpus command line option is set, maximum possible cpu should be >>> set to that value. >>> >>> Signed-off-by: Atish Patra >>> --- >>> arch/riscv/kernel/smpboot.c | 10 +++++++++- >>> 1 file changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c >>> index 609475c5..a8fe590c 100644 >>> --- a/arch/riscv/kernel/smpboot.c >>> +++ b/arch/riscv/kernel/smpboot.c >>> @@ -86,11 +86,19 @@ void __init setup_smp(void) >>> } >>> >>> cpuid_to_hartid_map(cpuid) = hart; >>> - set_cpu_possible(cpuid, true); >> >> This looks weird: the code being changed does not match what patch 3/4 did. > > Arg... Ignore this one. My bad. Morning here, I need more coffee :) > :). >> >>> cpuid++; >>> } >>> >>> BUG_ON(!found_boot_cpu); >>> + >>> + if (cpuid > nr_cpu_ids) >>> + pr_warn("Total number of cpus [%d] are greater than configured via nr_cpus [%d]\n", >> >> "The total number of cpus [%d] is greater than nr_cpus option value [%d]\n" >> ok. I will fix it in v2. Regards, Atish >>> + cpuid, nr_cpu_ids); >>> + >>> + for (cpuid = 1; cpuid < nr_cpu_ids; cpuid++) { >>> + if (cpuid_to_hartid_map(cpuid) != INVALID_HARTID) >>> + set_cpu_possible(cpuid, true); >>> + } >>> } >>> >>> int __cpu_up(unsigned int cpu, struct task_struct *tidle) >>> >> >> > >