From: Anup Patel <anup@brainfault.org>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>,
Atish Patra <atish.patra@wdc.com>,
Christoph Hellwig <hch@infradead.org>,
linux-riscv@lists.infradead.org,
"linux-kernel@vger.kernel.org List"
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo
Date: Sat, 29 Sep 2018 11:42:47 +0530 [thread overview]
Message-ID: <CAAhSdy2gC15j9zW+_rjBQzofGyhBjcNVWSYCbBtrAmQtDogBqA@mail.gmail.com> (raw)
In-Reply-To: <mhng-f8bcf381-8d26-4082-876a-781fe87ee721@palmer-si-x1c4>
On Sat, Sep 29, 2018 at 7:16 AM Palmer Dabbelt <palmer@sifive.com> 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 <anup@brainfault.org>
> > ---
> > 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
next prev parent reply other threads:[~2018-09-29 6:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 14:38 [PATCH] RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo Anup Patel
2018-09-12 16:47 ` Atish Patra
2018-09-13 3:39 ` Anup Patel
2018-09-17 14:10 ` Christoph Hellwig
2018-09-23 13:04 ` Anup Patel
2018-09-29 1:46 ` Palmer Dabbelt
2018-09-29 6:12 ` Anup Patel [this message]
2018-10-01 16:42 ` Palmer Dabbelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAhSdy2gC15j9zW+_rjBQzofGyhBjcNVWSYCbBtrAmQtDogBqA@mail.gmail.com \
--to=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@wdc.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).