mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guodong Xu <guodong.xu@oss.qualcomm.com>
To: Icenowy Zheng <uwu@icenowy.me>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Randy Dunlap <rdunlap@infradead.org>,
	Radim Krcmar <rkrcmar@qti.qualcomm.com>,
	linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Conor Dooley <conor@kernel.org>,
	linux-kselftest@vger.kernel.org,
	Andy Chiu <tchiu@tenstorrent.com>,
	Florian Weimer <fweimer@redhat.com>,
	Peter Bergner <bergner@oss.tenstorrent.com>,
	Zihong Yao <zihong.plct@isrc.iscas.ac.cn>,
	Mark Harris <mark.hsj@gmail.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Andrew Jones <andrew.jones@linux.dev>
Subject: Re: [PATCH v9 1/4] riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection
Date: Thu, 26 Nov 2026 00:16:43 -0500	[thread overview]
Message-ID: <4ea9d48592dbf0e1120f7db7305aae37.guodong.xu@oss.qualcomm.com> (raw)
In-Reply-To: <ce886c3a5bf5af34df5c1ac3fefbd86a8f0567ff.camel@icenowy.me>

Hi Icenowy,

On Mon, 09 Nov 2026 23:56:47 +0800, Icenowy Zheng wrote:
> 在 2026-11-09一的 07:47 -0500,Guodong Xu写道:

[...]

> > +enum {
> > +	RISCV_ISA_BASE_IMA,
>
> I may have missed something, but would it be worth to add a GC tier?
>
> I think many Linux distros have GC defined as their baseline.

Thanks for raising this.

A single bit for 'RV64GC' seems to have no user to me, so I would
prefer not to add it. Allow me to explain.

G is a combination of extensions defined in the early days of the
RISC-V ISA spec: the unprivileged manual defines it as an abbreviation
for IMAFDZicsr_Zifencei, "our standard general-purpose ISA" [1].

I checked, and you are right that it is the baseline in practice: GCC
defaults riscv64 to -march=rv64gc, and Debian, Fedora and Ubuntu
(before 25.10) build with that default. But my understanding is, G is a
build-time baseline only. Nothing checks for G at run time; on a core
without F, D or C, an rv64gc distro userland just takes SIGILL on the
first such instruction.

Anyway, what this series intends to export to user space is the profile
level (RVA20U64, RVA22U64, RVA23U64). For example, a glibc-hwcaps design
can fall back to rva20u64 when its run-time check finds no rva23u64.

PS: In those terms the counterpart of rv64gc is RVA20U64 [2]
(excluding Zifencei, which the profiles mandate only in the S variants
[3] and which, as noted in hwprobe.rst [4], is not intended for direct
use by user space).

RVA20U64 and RVA22U64 came up in the LPC26 discussion as well [5]. I
would like to add them in a follow-up, probably not in this series, if
the reviewers here agree.

[1] https://github.com/riscv/riscv-isa-manual/blob/main/modules/unpriv/pages/naming.adoc
[2] https://docularxu.github.io/rva23/rva-mandatory-extensions.html
[3] https://github.com/riscv/riscv-profiles/blob/main/src/profiles.adoc,
    RVA20U64 section, the note on Zifencei
[4] Documentation/arch/riscv/hwprobe.rst, RISCV_HWPROBE_KEY_BASE_BEHAVIOR
[5] https://lpc.events/event/20/contributions/2626/

Guodong

  reply	other threads:[~2026-11-26  5:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 12:47 [PATCH v9 0/4] riscv: hwprobe: Expose RVA23U64 base behavior Guodong Xu
2026-11-09 12:47 ` [PATCH v9 1/4] riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection Guodong Xu
2026-11-09 15:56   ` Icenowy Zheng
2026-11-26  5:16     ` Guodong Xu [this message]
2026-11-26  8:15       ` Icenowy Zheng
2026-11-09 12:47 ` [PATCH v9 2/4] riscv: cpu: Output isa bases lines in cpuinfo Guodong Xu
2026-11-09 12:47 ` [PATCH v9 3/4] riscv: hwprobe: Introduce rva23u64 base behavior Guodong Xu
2026-11-17 13:09   ` Radim Krcmar
2026-11-09 12:47 ` [PATCH v9 4/4] riscv: hwprobe: Document that keys describe the user-mode environment Guodong Xu

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=4ea9d48592dbf0e1120f7db7305aae37.guodong.xu@oss.qualcomm.com \
    --to=guodong.xu@oss.qualcomm.com \
    --cc=alex@ghiti.fr \
    --cc=andrew.jones@linux.dev \
    --cc=aou@eecs.berkeley.edu \
    --cc=aurelien@aurel32.net \
    --cc=bergner@oss.tenstorrent.com \
    --cc=conor@kernel.org \
    --cc=corbet@lwn.net \
    --cc=fweimer@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.hsj@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pjw@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rkrcmar@qti.qualcomm.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tchiu@tenstorrent.com \
    --cc=uwu@icenowy.me \
    --cc=zihong.plct@isrc.iscas.ac.cn \
    /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

all inboxes | Powered by JetHome®