Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp58628imj; Fri, 8 Feb 2019 14:58:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IbNUa/YzxcnVqj0u3HnqqqKe6JrKyAxuwhWTx5zouqnIpry+JxooWlLJO6dA2BI5AzEEmnO X-Received: by 2002:a62:345:: with SMTP id 66mr24527660pfd.189.1549666680044; Fri, 08 Feb 2019 14:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549666680; cv=none; d=google.com; s=arc-20160816; b=EmFOx4VJAPr9Hm+AN4OHSdtrx7WtB9couJJOGkiaCHdFmVLDYMSt0eVnC/tP3SSRg8 5wl4T0vf/+j10QtWyPnFOqLW9CAe+fDFrBmqvFGv5eKVskGcdg1DcY2WY3s/evku/6Z/ OJ/IXbDlRDNcevRxX4/eZBmj7RtvwWu/Zszm8N/1kscAwU4HSecOd7Rtw8ohyywTxeew Sriy0n6gOdAJy866xNxpCLEcYjFnyF4OQZHSCz6NzTP2K5HtXpMG72VfdVizkPp03XnA UKB4VSLSfMbsGuBdDxZxz/+Fw0/FlCpWh8/PLd5xe/c2/ue9WhOtfSViWiUwkIbOiH7U VhwQ== 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:dkim-signature; bh=+deS82vpwUPPr0715YcttkkSZAlzEH+Xz351rUTMa68=; b=h56c04MjlbTXuCHjs98+vg+l25iAFC4lGX6L/gjw0EPOsRuTu0rWUkl7TWYAKbYZ1u xkcGczt+I4WjYffR19/2a396NnOVzBoFHQ5CKkwguHMwYYlAYAVb4odviRva/mLQSeYL SlAvv0IUuy7dvsH/uSGyq6H/mVTRwGNGMfT3PC/R/7Flt+PykF6EbQFF3KgIn0tt2GGF n+6/sjxw7ZK8gH5RxjIe/RFR4ZAP85zDwNsBzevWpLoR1tR2OpobpVHSfipz0j21SxVz +2PezKkEt+K3gnpUZVg6PHRNgtvub5eZ6EuFX7mCQKm77NiOVLSAIfvdRTKmDiowkaep V8pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=OURAzpmo; 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 bb7si3329013plb.387.2019.02.08.14.57.44; Fri, 08 Feb 2019 14:58:00 -0800 (PST) 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=OURAzpmo; 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 S1727041AbfBHW5S (ORCPT + 99 others); Fri, 8 Feb 2019 17:57:18 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:46759 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfBHW5P (ORCPT ); Fri, 8 Feb 2019 17:57:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1549666635; x=1581202635; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=AaXLsLkp5lCyJS9vlcxg9SAChjUSNy6OwDD0PjlSrYA=; b=OURAzpmoNlAVyHRkCC2X8eeo4VNZ+Macs5LJfIvugxrjIrpteITPNGao niWJF0/EKPRvP8ecXmUS9BanGIkIPzy6Rofipq+Doi+y4rdvisgv56toz +2FKtTmO6PhTVebqIkIiMgylx2T2S5bBIVVasM7VmFdn1ct8VnLBxWI8K EvaFTz0Q6HP6zCtoeNvjSPye4MouSedIiyiN4s1WOXSB2X2ZQlEaK3I3x hlepcHwm4aPzh+/b3BFb1O8tyqyGwf7R7axiKhlesLEKQS2hf5yPeExhb Ppg3ARE7DNOSTEWVEO/sxxCbQaN9KBzcm+L1mFcy7/Pg1SPMdzz6Gq0xQ A==; X-IronPort-AV: E=Sophos;i="5.58,348,1544457600"; d="scan'208";a="100816451" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2019 06:56:59 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Feb 2019 14:37:41 -0800 Received: from usa003289.ad.shared (HELO [10.86.59.147]) ([10.86.59.147]) by uls-op-cesaip01.wdc.com with ESMTP; 08 Feb 2019 14:56:59 -0800 Subject: Re: [v3 PATCH 2/8] RISC-V: Move cpuid to hartid mapping to SMP. To: Christoph Hellwig Cc: "linux-riscv@lists.infradead.org" , =?UTF-8?Q?Patrick_St=c3=a4hlin?= , Albert Ou , Damien Le Moal , Jason Cooper , Alan Kao , Dmitriy Cherkasov , Anup Patel , Daniel Lezcano , "linux-kernel@vger.kernel.org" , Zong Li , Palmer Dabbelt , Paul Walmsley , Andreas Schwab , Marc Zyngier , Thomas Gleixner References: <1549590681-24125-1-git-send-email-atish.patra@wdc.com> <1549590681-24125-3-git-send-email-atish.patra@wdc.com> <20190208090316.GB16932@infradead.org> From: Atish Patra Message-ID: <1090db6a-f4c1-a522-7c2d-d7367846df35@wdc.com> Date: Fri, 8 Feb 2019 14:56:57 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190208090316.GB16932@infradead.org> 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 2/8/19 1:03 AM, Christoph Hellwig wrote: > On Thu, Feb 07, 2019 at 05:51:15PM -0800, Atish Patra wrote: >> Currently, logical CPU id to physical hartid mapping is >> defined for both smp and non-smp configurations. This >> is not required as we need this only for smp configuration. >> The mapping function can define directly boot_cpu_hartid >> for non-smp use case. > > Please use up your available 72 chars for the changelog. (probably also > in other patches). > Sorry. I will fix all patches to use 72 chars. >> >> The reverse mapping function i.e. hartid to cpuid can be called >> for any valid but not booted harts. So it should return default >> cpu 0 only if it is a boot hartid. >> >> Signed-off-by: Atish Patra >> Reviewed-by: Anup Patel >> --- >> arch/riscv/include/asm/smp.h | 14 +++++++++++--- >> arch/riscv/kernel/setup.c | 9 --------- >> arch/riscv/kernel/smp.c | 9 +++++++++ >> 3 files changed, 20 insertions(+), 12 deletions(-) >> >> diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h >> index 41aa73b4..21fd2d75 100644 >> --- a/arch/riscv/include/asm/smp.h >> +++ b/arch/riscv/include/asm/smp.h >> @@ -22,12 +22,13 @@ >> /* >> * Mapping between linux logical cpu index and hartid. >> */ >> -extern unsigned long __cpuid_to_hartid_map[NR_CPUS]; >> -#define cpuid_to_hartid_map(cpu) __cpuid_to_hartid_map[cpu] >> >> +extern unsigned long boot_cpu_hartid; >> struct seq_file; > > We usually try to keep forward declatations at the top of the file. > > Can you add the new external declaration below the forward one? > Sure. Regards, Atish > Otherwise looks good: > > Reviewed-by: Christoph Hellwig >