Re: [PATCH v9 1/4] riscv: cpufeature: Introduce ISA bases bitmap and rva23u64 detection

From: Guodong Xu

Date: Thu Nov 26 2026 - 00:16:59 EST


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