public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Evan Green <evan@rivosinc.com>
Cc: Palmer Dabbelt <palmer@rivosinc.com>,
	Anup Patel <apatel@ventanamicro.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Heiko Stuebner <heiko@sntech.de>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Conor Dooley <conor.dooley@microchip.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	linux-riscv@lists.infradead.org,
	Andrew Jones <ajones@ventanamicro.com>
Subject: Re: [PATCH v5] RISC-V: Show accurate per-hart isa in /proc/cpuinfo
Date: Sat, 26 Aug 2023 10:56:29 +0100	[thread overview]
Message-ID: <20230826-copper-suffocate-5f4f0e67f9a7@spud> (raw)
In-Reply-To: <20230826-anguished-tutu-81d63b3081a7@spud>

[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]

On Sat, Aug 26, 2023 at 12:26:25AM +0100, Conor Dooley wrote:
> On Fri, Aug 25, 2023 at 04:11:38PM -0700, Evan Green wrote:
> > In /proc/cpuinfo, most of the information we show for each processor is
> > specific to that hart: marchid, mvendorid, mimpid, processor, hart,
> > compatible, and the mmu size. But the ISA string gets filtered through a
> > lowest common denominator mask, so that if one CPU is missing an ISA
> > extension, no CPUs will show it.
> > 
> > Now that we track the ISA extensions for each hart, let's report ISA
> > extension info accurately per-hart in /proc/cpuinfo. We cannot change
> > the "isa:" line, as usermode may be relying on that line to show only
> > the common set of extensions supported across all harts. Add a new "hart
> > isa" line instead, which reports the true set of extensions for that
> > hart.
> > 
> > Signed-off-by: Evan Green <evan@rivosinc.com>
> > Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
> 
> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> 
> Can you drop this if you repost?
> 
> > +"isa" vs "hart isa" lines in /proc/cpuinfo
> > +------------------------------------------
> > +
> > +The "isa" line in /proc/cpuinfo describes the lowest common denominator of
> > +RISC-V ISA extensions recognized by the kernel and implemented on all harts. The
> > +"hart isa" line, in contrast, describes the set of extensions recognized by the
> > +kernel on the particular hart being described, even if those extensions may not
> > +be present on all harts in the system.
> 
> > In both cases, the presence of a feature
> > +in these lines guarantees only that the hardware has the described capability.
> > +Additional kernel support or policy control changes may be required before a
> > +feature is fully usable by userspace programs.
> 
> I do not think that "in both cases" matches the expectations of
> userspace for the existing line. It's too late at night for me to think
> properly, but I think our existing implementation does work like you
> have documented for FD/V. I think I previously mentioned that it could
> misreport things for vector during the review of the vector series but
> forgot about it until now.

I went and checked, and yes it does currently do that for vector. I
don't think that that is what userspace would expect, that Google
cpu_features project for example would draw incorrect conclusions.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-08-26  9:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 23:11 [PATCH v5] RISC-V: Show accurate per-hart isa in /proc/cpuinfo Evan Green
2023-08-25 23:26 ` Conor Dooley
2023-08-26  9:56   ` Conor Dooley [this message]
2023-08-28 16:24     ` Evan Green
2023-08-28 16:53       ` Conor Dooley
2023-08-28 17:18         ` Evan Green
2023-08-28 17:58           ` Conor Dooley
2023-08-26  8:07 ` Andrew Jones

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=20230826-copper-suffocate-5f4f0e67f9a7@spud \
    --to=conor@kernel.org \
    --cc=ajones@ventanamicro.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=apatel@ventanamicro.com \
    --cc=bagasdotme@gmail.com \
    --cc=conor.dooley@microchip.com \
    --cc=corbet@lwn.net \
    --cc=evan@rivosinc.com \
    --cc=heiko@sntech.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@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