Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1581142imm; Fri, 28 Sep 2018 23:13:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV63b1/4/5K6QNSv27IdTnR09XkVn/Ns6BTWw4zs/sUQ82uh94v+sSESMSkxbuHF8XGcbYmnK X-Received: by 2002:a17:902:9b84:: with SMTP id y4-v6mr1804890plp.332.1538201606987; Fri, 28 Sep 2018 23:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538201606; cv=none; d=google.com; s=arc-20160816; b=gz/fxkat4O7P+X476ZRH8qGjrPrvGRzFFS2A5knqTHNaWgb4OjsI/mubasgCMsDiFW U4Nakv/GHf19GUSPwAu81wfcuRr1CVFewXyjGvWBR1ayW/v03uESAYtH2oJYweDNlwJP 7ueu418SuFp52OV67DpKOTbLyuf5MXPMKQse5jigs0d8JfrPjlWfwFsBekdzQOWg/jRo kr1ZjvV7F+hlbOozLBWACUeQg2uohLevYGKU1HT8nSTb8QVjLidEPHxUa5YqsB0cIx+g AETdVV89MWP6kw1CqR7oEFfGugkmO7nuyhMyhIL8obwOvi1P4B/soKt6Ah6dLv1/hUzI Y83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=29jDzSXlXoffgt2mMIY4dV6BM8lRkIziSF82pMVMEUI=; b=NBvqilxrHxoYXgNOMjaz7TOfQEKIL0sRj+TYfDkHNnRmjCbev3q/W2NaV9K0yBIo44 nD5ouYfnjyIFqVs8FjCwKvGhmCvO7DuMmmAhoVQFNbM5slul5zKDSpAcU71iyEi8A0PT MXvTb8j7jqN3PeV8LzNBcrEEQLHfxpvYpo/Oy2MvcmEMss37ugZXWYITEzsF4C7ZxdPW jQ/DBtgdAwu99jA7T1m7VMuk1V8VYmz80S7cSeKMJdSYY32/c1KLUGb+ETGoKrT+2ZpJ k2qxoEgknhTRj7WqTkIdPsqUjL4D9B5aItTDAEwgP9Vqa1f78MrWeuNQNt8HmpLnyYlk 39CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=X+HY5Ft5; 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 cf12-v6si7068026plb.433.2018.09.28.23.13.12; Fri, 28 Sep 2018 23:13:26 -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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=X+HY5Ft5; 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 S1727470AbeI2MkI (ORCPT + 99 others); Sat, 29 Sep 2018 08:40:08 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39720 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727248AbeI2MkI (ORCPT ); Sat, 29 Sep 2018 08:40:08 -0400 Received: by mail-wm1-f65.google.com with SMTP id q8-v6so4034496wmq.4 for ; Fri, 28 Sep 2018 23:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=29jDzSXlXoffgt2mMIY4dV6BM8lRkIziSF82pMVMEUI=; b=X+HY5Ft5iJaK0ZTUxP+aceQUKNO/Y1AdprsmKMDrmGYY3DmZ6BIKQn7tZN93/7piOC YNkh9/XQjZHBUBS98iXRFnblDKAnUQOeced4giytTsSjIu51dG7MaDSz82UoAn8XC5Tm yeAYv3NeZ7REQwEM4jHvSLnRZ/RzWvXwvCETCXvgSxjqa9kQ9Kqt1ctx3cORjw7Cwba5 Wl07ONSXkhVEJEe5o1NZnhdWXqdSoUzM0gwDGlpo+6tfWN7TfIT4mqhdsb7kz8UKyJwp RUZe4uxJHcRpUBQ+k8z8T2elU0K2MbuvfwJAt06y23KBwPsE096PtWMmRCVQV1K1OAED 5dLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=29jDzSXlXoffgt2mMIY4dV6BM8lRkIziSF82pMVMEUI=; b=EM/lU0WHRRBZk4I1VyezGoh9hagcJbhgMS7/ze89QPwjGzIh4o2S8nhffXnEjMbVmC pMCChyNHFxqZRbIlV/SDsG5Gw5fMvxaoaUTbRpfs4S6XJfH9M/UgUubVTfOFfNyNTNb3 pkZH12o7z7/W+NvtATURrGyO4OewWufcgbJdUVOUZ+lWLcuDTPYn2eWnOa4KL1IpVN6K 57d7rknx48VRitGn56vggHZITzohtq5Hzsl2i77WvKC+m/9Omj1SD0Wm+j+vE3p6oxJy zOMekHXlSnnaAT4KdSd/I4w7ML2A7eoRQxBWd/uqED4Fur80XfdbD10+SLlR1KdO8QMc +uAQ== X-Gm-Message-State: ABuFfogAYgSzQ//d0z+eO8dYj4lGm/EThnxUJNWwBC8MVGM99Q8CMExm OK9j9nxTki8uwrMRIM1Cp/5e84oY8ux6fLHzv8+cqg== X-Received: by 2002:a1c:3383:: with SMTP id z125-v6mr3183079wmz.56.1538201577553; Fri, 28 Sep 2018 23:12:57 -0700 (PDT) MIME-Version: 1.0 References: <20180912143822.21948-1-anup@brainfault.org> In-Reply-To: From: Anup Patel Date: Sat, 29 Sep 2018 11:42:47 +0530 Message-ID: Subject: Re: [PATCH] RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo To: Palmer Dabbelt Cc: Albert Ou , Atish Patra , Christoph Hellwig , linux-riscv@lists.infradead.org, "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, Anup