Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp276157imm; Mon, 1 Oct 2018 09:44:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV61zI11xfAXwfwNoF8YHPkS4cKMXyV1830oFH6Xc8jlWu0IP6tGmRkGYtBDINl6ogM471lsh X-Received: by 2002:a63:2106:: with SMTP id h6-v6mr10856245pgh.161.1538412274516; Mon, 01 Oct 2018 09:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538412274; cv=none; d=google.com; s=arc-20160816; b=yx11mZ1DnG2ckM87GBLXY+ogbpXD1jSGl+N/B8qem+Y0wk46gWBNdjVBewxpuAFKNp zIlf0mSmESSY7iKDYhpRIf96tK4o6DS3SoMhXO1474dNycN9BFHbtrevE+eSIgEHCMzp 0oNUlPtTRzV28+uzxbIEqnZaMQ4WJZk0/Q2gI7o58nyfqgEfDVzsGYxruqi6zOJvfV3P D78o+FF/sJdbexOeLwDHeNH2nA8jqawbofkmwQimm6Vu86BY3X9HcMJ4wutnUVsh33Ez po12uR0a61JOaUjdCtNvJfdH9bJr8YC4zkuag6U8igU7It9xLZxPywR5rw0rt3ge+SEY kySw== 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:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=h3bEcrrSNY9f1REFsb0jumY0i0qy9sSG5USvLnAw73s=; b=gDAsfs780x8XgOhr0D6df3YEmoKJxwQCvREITnlEiDTjoWIB5DiakaBKGh/wPiNxvW fJQ6DhFpHW3kMMjep9zrICwjp9PZVNXLBT2xVIextihTV/IW0vbbVb6eKHUnyNInDk5k Uconxp6xs/kUt1Mr+tULHZ1Q+r6q6MR6Q5cAzOBlcA/kRyVXrPEejTh0wCU4LQQcqsTy b64akNxkyGMqSM29QnEgB+W8C5klhAV046kKiaqmd2uTMtl8QGAHmu78J6Dp9MQtDaOv HZ7D4pryIU240egnnvr1eDnSK8jiWLUxhpRRs4tcX+nbszGESHuwWkWBZajdlWCBKrRO JsLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=NOp+V4Pt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si12004638pgr.98.2018.10.01.09.44.19; Mon, 01 Oct 2018 09:44:34 -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=pass header.i=@sifive.com header.s=google header.b=NOp+V4Pt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726348AbeJAXVW (ORCPT + 99 others); Mon, 1 Oct 2018 19:21:22 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40728 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725740AbeJAXVU (ORCPT ); Mon, 1 Oct 2018 19:21:20 -0400 Received: by mail-pf1-f194.google.com with SMTP id s5-v6so9629962pfj.7 for ; Mon, 01 Oct 2018 09:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=h3bEcrrSNY9f1REFsb0jumY0i0qy9sSG5USvLnAw73s=; b=NOp+V4PtclyvgDhPQW9NPO5Bq5ixy8wY+UjexDsznNmUWNdmuU+Xup+waWfeG8s2KU 0zBXCBGXywCP1CkhqAdtzbPg5ljAJeXFgqw5+oEtpwDhqOLz1ZNE76gxQVJashBE+YrD la85iF5E+Xf8Ug7VpPIYBYddR+QO71B731X+/cXGiXxYTkkte6xQ4DWYSD891YWwzsXd NMUOpA4t9QPZLVqi1ePFmlZSRIT1iAc6eSTTphlFCCjtEtnc77O1e/sRRvOFbyUKGdNp 9OaxRKVrK6+J2Xu4J1/qV8qAH130aHA+GNF34WY4jebKnmp187Bua0XAV34SAA37TYa7 zBqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=h3bEcrrSNY9f1REFsb0jumY0i0qy9sSG5USvLnAw73s=; b=mYFLOJ5nQ6T5OOaByrztDzsMIPvckOIL1CEmL6ilXyG2P4YjdPUvmhh9NrVxTVbIs7 vsO69V+XSDnBkRo0V6TgnHzVs9FguQJ8lrZhD1L2CI1in71I/XM1WoL7gv0XMkpvvn6X a/byup9dFO5iGCmniCjpKILfSsUVg1y5qduAie6H9wArFSZncs84uVQCp/Kc+0HR0nQk MZ/tVpCflQd4oCE16p2lRfmRENTlkCVLiQiC8fRrUNJYhAr97ukN5vPIkAHXouSKj18y QKNPLaB4bcA+CWdL9koiLT1QVqQTgIArhtO/DXomfKCGJcS1njXUNCRjoVuc3Ij+pMoH 6/Jw== X-Gm-Message-State: ABuFfohQsDQYJsrAMGwDZiIcWPBFLQEV6nf3ArIUy5b64sZh0NghbvKJ tH/QJZXc6CQu+UKRRRLaIwVFQA== X-Received: by 2002:a17:902:f01:: with SMTP id 1-v6mr12752281ply.8.1538412160897; Mon, 01 Oct 2018 09:42:40 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id a2-v6sm16322337pgc.68.2018.10.01.09.42.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 09:42:39 -0700 (PDT) Date: Mon, 01 Oct 2018 09:42:39 -0700 (PDT) X-Google-Original-Date: Mon, 01 Oct 2018 09:40:12 PDT (-0700) Subject: Re: [PATCH] RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo In-Reply-To: CC: aou@eecs.berkeley.edu, atish.patra@wdc.com, Christoph Hellwig , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: anup@brainfault.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 28 Sep 2018 23:12:47 PDT (-0700), anup@brainfault.org wrote: > On Sat, Sep 29, 2018 at 7:16 AM Palmer Dabbelt wrote: >> >> On Wed, 12 Sep 2018 07:38:22 PDT (-0700), anup@brainfault.org wrote: >> > Currently, /proc/cpuinfo show logical CPU ID as Hart ID which >> > is in-correct. This patch shows CPU ID and Hart ID separately >> > in /proc/cpuinfo using cpuid_to_hardid_map(). >> > >> > With this patch, contents of /proc/cpuinfo looks as follows: >> > cpu : 0 >> > hart : 1 >> > isa : rv64imafdcsu >> > mmu : sv48 >> > >> > cpu : 1 >> > hart : 0 >> > isa : rv64imafdcsu >> > mmu : sv48 >> > >> > cpu : 2 >> > hart : 3 >> > isa : rv64imafdcsu >> > mmu : sv48 >> > >> > cpu : 3 >> > hart : 2 >> > isa : rv64imafdcsu >> > mmu : sv48 >> > >> > Signed-off-by: Anup Patel >> > --- >> > arch/riscv/kernel/cpu.c | 3 ++- >> > 1 file changed, 2 insertions(+), 1 deletion(-) >> > >> > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c >> > index f0f0ec2737b7..7c1342e242e6 100644 >> > --- a/arch/riscv/kernel/cpu.c >> > +++ b/arch/riscv/kernel/cpu.c >> > @@ -87,7 +87,8 @@ static int c_show(struct seq_file *m, void *v) >> > NULL); >> > const char *compat, *isa, *mmu; >> > >> > - seq_printf(m, "hart\t: %lu\n", cpu_id); >> > + seq_printf(m, "cpu\t: %lu\n", cpu_id); >> > + seq_printf(m, "hart\t: %lu\n", cpuid_to_hardid_map(cpu_id)); >> > if (!of_property_read_string(node, "riscv,isa", &isa) >> > && isa[0] == 'r' >> > && isa[1] == 'v') >> >> I like this, but it doesn't appear to apply. Do you mind sending something >> against Linus' master? Then I should be able to sort it out. >> > > This patch is requires cpuid_to_hardid_map() added by Atish's > patchset so I have requested Atish to make this patch part of > his v6 patchset. Thanks!