Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp23990img; Tue, 19 Mar 2019 16:58:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/CPobk2milIJ7gGSy6u6k53PkmQqV7UM0YcTi0Dc4ABPTlrXj8nJRetcYkcSShkhcH6kz X-Received: by 2002:a17:902:8506:: with SMTP id bj6mr4725197plb.60.1553039930803; Tue, 19 Mar 2019 16:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553039930; cv=none; d=google.com; s=arc-20160816; b=sAy+J6VkuqsJzVIUz9/l+I5UZjEsZ8kHh1/o0FSNNN3jLakVh9NdACQ/1Svnh4y/GX Fq+Z0QEP47NqT/2JB27bH1VmlW0dZSHAQUkEiubUFmsRYGvyQfYKdKClIZpeMMkEMTdj 3awV6c92TnNpcgLp8QvrOCAKqWJN+vEQmi/F379QiQbLMP+a9ScZQAvv3DTh1rhkiLLm zra7AE8uJDmSD0Vlid5B20LilFi4eBbA6WQGnErdvUUOkozpwi+ezhKNJpXdnjf6Lk6O ZVLi3B3HQAdq1HK7KTZZ6tPvMwN629hoNT1kyG0/vGqTIlbvndMJpLi+Oiw7XQ4j+i5b 9/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :wdcipoutbound:content-language:accept-language:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=WTBjFExEcFw3x6yRH1zxBbh36Xf3VUlYXe4tJ658uto=; b=u4wH/PMaBnBdAa2aVsJhRzbKE9QUSKPQe5aCKmq+P3/wKywqy+I36QFKGC6g1fpvDu 1RWK/JcLiLTPX6rlSJIyN/OKz2Om59QMv/8DsGHb8SiXiwSuZGoSYTgjB2rnBGSip8pi iwR3wCPlX0cZU+wIXiuErojcBzbpuKPf0bZ3ftsSP0FNhl08IgHFo10pNSTVo3NH9eIj obBB87kNMw3jQAmko1b/0e8NRKwUhANxJ1jBOeAQ0hymV9zyqwVfkQjs0kzGu/FG9Aqs z/douFn51LZZ0+O7zN//ups8+xFKDUJvOCMBHd2SDXVO7Ja18lWiSS3eH4IUWWt6PFO1 3Y6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=bu0f2xgG; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b="U3T4G/4k"; 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 bc6si372892plb.227.2019.03.19.16.58.35; Tue, 19 Mar 2019 16:58:50 -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=bu0f2xgG; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b="U3T4G/4k"; 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 S1727655AbfCSX5J (ORCPT + 99 others); Tue, 19 Mar 2019 19:57:09 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:59745 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfCSX4f (ORCPT ); Tue, 19 Mar 2019 19:56:35 -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=1553039795; x=1584575795; h=from:to:cc:subject:date:message-id:references: content-transfer-encoding:mime-version; bh=t/HTHPvkjJ1accV8t6iMADgZGwTgz6CH005jmTXlcQ8=; b=bu0f2xgG2i0+aCSJw3p09DSztHqdPCnQPJpo90+8UGRg2dN2ebQaTB6H Yn8H/exfyBuFBJ4ZQD79Cs3RDvhC2EKL41tjspnTXtfHnRDGpMG0cifAm j0g23Kbfh1fQwWoPShKb8Q3qlfmus5FJj+/QYTU/1AX60NXwJB79GuDMp s1k4XmVkSskgZKr5aulvF+kMhJZvI9EEjC1/K8JqaEHNNw7eMoDwqsRmy ABF2zLgUsWKbQ2pkeYuOlqNLAee/brBS/oIBmLPe8Q+ZfJTKgbDPIcBkZ GCv8FIlnt5v9vhlnFYVyRzLUCEhpkammpXOXrjHEgumYqNkXj4Kf25zHX w==; X-IronPort-AV: E=Sophos;i="5.60,246,1549900800"; d="scan'208";a="105528985" Received: from mail-by2nam03lp2053.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([104.47.42.53]) by ob1.hgst.iphmx.com with ESMTP; 20 Mar 2019 07:56:34 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WTBjFExEcFw3x6yRH1zxBbh36Xf3VUlYXe4tJ658uto=; b=U3T4G/4kKo2pFaWJ8LRg41MIuaywxBzNDEDjh0wnoh/f+T39atmatFq1kDyp6emOcta6C5A3/q2OIoG0pCkIi/ae4qeb7PJcZt0eappD0JHBvYE3o2llz8xMuv/Mo29zKCmv26nEOrqA1S+8Sm2jdnUKaCSc5Qju2to+Kya/lME= Received: from BYAPR04MB5816.namprd04.prod.outlook.com (20.179.58.207) by BYAPR04MB4294.namprd04.prod.outlook.com (20.176.251.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Tue, 19 Mar 2019 23:56:32 +0000 Received: from BYAPR04MB5816.namprd04.prod.outlook.com ([fe80::7c30:6437:71e2:e32e]) by BYAPR04MB5816.namprd04.prod.outlook.com ([fe80::7c30:6437:71e2:e32e%3]) with mapi id 15.20.1709.015; Tue, 19 Mar 2019 23:56:32 +0000 From: Damien Le Moal To: Atish Patra , "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 Subject: Re: [v1 PATCH 4/4] RISC-V: Support nr_cpus command line option. Thread-Topic: [v1 PATCH 4/4] RISC-V: Support nr_cpus command line option. Thread-Index: AQHU3qIAiA88vIkHh0W9ePhVGAezdw== Date: Tue, 19 Mar 2019 23:56:32 +0000 Message-ID: References: <20190319222028.4293-1-atish.patra@wdc.com> <20190319222028.4293-4-atish.patra@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@wdc.com; x-originating-ip: [199.255.47.11] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cbf02de8-2a08-430b-1298-08d6acc68349 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:BYAPR04MB4294; x-ms-traffictypediagnostic: BYAPR04MB4294: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(366004)(376002)(396003)(346002)(39860400002)(189003)(199004)(6116002)(97736004)(74316002)(7736002)(305945005)(105586002)(2906002)(106356001)(99286004)(110136005)(86362001)(8676002)(54906003)(186003)(68736007)(7696005)(3846002)(2501003)(26005)(76176011)(52536014)(53546011)(102836004)(6506007)(14454004)(81156014)(81166006)(478600001)(316002)(66066001)(229853002)(72206003)(9686003)(53936002)(8936002)(486006)(71190400001)(71200400001)(33656002)(6436002)(55016002)(256004)(5660300002)(4326008)(25786009)(14444005)(446003)(6246003)(476003);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR04MB4294;H:BYAPR04MB5816.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 5/x+dTKIXlW26M5t18ppBPL6SM4+F6SvINA+ETv9aZz5O+bzLwJc4iw3tOiT/JiUT/Okuez63EaUjCPVs3cS23Q6xXwqDAV0rqWkNRleosu8IaUfWdJTBhppx6+KtsJ3Fp3feJbjC16zW+FWr9hXC2QPyuut501Lv6r++251xBpmXP1JSeiGN1q9D9myO+GmRLLqUXq1dwanaN5W3rNrt0BQ7SY1hQMtl4sRuxzeFb6LcMeUEe0iR1gIS4+8+4NoTlTWhQIPaUpAg+t/qubWj+RztTtfuXO7P9tYOcvHwAB6XscR5GsL2dl6tUPRmreMZZ9ELSJ0N3WlFyGtAFPrtGlQ3Uscj7JEBAesGtNS4GZK9e7QARyB3aRhi/1K+bEHRXYcuYw/VCD1hQxYWTfEJZ/EDHK1+rbj3HvCciu/eYA= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbf02de8-2a08-430b-1298-08d6acc68349 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2019 23:56:32.4289 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB4294 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/03/20 7:20, Atish Patra wrote:=0A= > If nr_cpus command line option is set, maximum possible cpu should be=0A= > set to that value.=0A= > =0A= > Signed-off-by: Atish Patra =0A= > ---=0A= > arch/riscv/kernel/smpboot.c | 10 +++++++++-=0A= > 1 file changed, 9 insertions(+), 1 deletion(-)=0A= > =0A= > diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c=0A= > index 609475c5..a8fe590c 100644=0A= > --- a/arch/riscv/kernel/smpboot.c=0A= > +++ b/arch/riscv/kernel/smpboot.c=0A= > @@ -86,11 +86,19 @@ void __init setup_smp(void)=0A= > }=0A= > =0A= > cpuid_to_hartid_map(cpuid) =3D hart;=0A= > - set_cpu_possible(cpuid, true);=0A= =0A= This looks weird: the code being changed does not match what patch 3/4 did.= =0A= =0A= > cpuid++;=0A= > }=0A= > =0A= > BUG_ON(!found_boot_cpu);=0A= > +=0A= > + if (cpuid > nr_cpu_ids)=0A= > + pr_warn("Total number of cpus [%d] are greater than configured via nr_= cpus [%d]\n",=0A= =0A= "The total number of cpus [%d] is greater than nr_cpus option value [%d]\n"= =0A= =0A= > + cpuid, nr_cpu_ids);=0A= > +=0A= > + for (cpuid =3D 1; cpuid < nr_cpu_ids; cpuid++) {=0A= > + if (cpuid_to_hartid_map(cpuid) !=3D INVALID_HARTID)=0A= > + set_cpu_possible(cpuid, true);=0A= > + }=0A= > }=0A= > =0A= > int __cpu_up(unsigned int cpu, struct task_struct *tidle)=0A= > =0A= =0A= =0A= -- =0A= Damien Le Moal=0A= Western Digital Research=0A=