linux/Documentation/arch
JinRui 248dbaf777 riscv: report Zfhmin/Zvfhmin when Zfh/Zvfh are present
The RISC-V ISA manual specifies that Zfh implies Zfhmin, a normative
rule clarified in
https://github.com/riscv/riscv-isa-manual/pull/3070. Zvfh likewise
implies Zvfhmin, as stated by the vector extension specification.

The kernel currently reports ZFH and ZFHMIN (and ZVFH and ZVFHMIN) as
independent hwprobe bits derived only from what the device tree
declares. Platforms that declare just "zfh" (Zfh being a superset that
already contains all Zfhmin instructions) therefore report
RISCV_HWPROBE_EXT_ZFHMIN=0, which breaks userspace RVA23 conformance
checks (e.g. snapd installing core26 on riscv64).

Use the existing superset mechanism to set the implied subset bits:
  - zfh implies zfhmin
  - zvfh implies zvfhmin

Add a hwprobe selftest asserting the implication holds and update the
hwprobe documentation accordingly.

This is complementary to the rva23u64 base behavior discussion: the
RVA23 conformance query proposed there is derived from the
per-extension bits fixed here, so correct EXT_0 reporting is a
prerequisite for it to work on harts whose device tree declares only
"zfh".

Tested on a RISC-V QEMU VM whose device tree only declares "zfh" and
"zvfh": with this change both /proc/cpuinfo and the hwprobe
RISCV_HWPROBE_KEY_IMA_EXT_0 bitmap report ZFHMIN and ZVFHMIN, and the
hwprobe selftest (including the new implication check) passes.

Link: https://lore.kernel.org/kvm-riscv/20260206002349.96740-1-andrew.jones@oss.qualcomm.com/
Signed-off-by: JinRui <jinrui@haiwei.tech>
Link: https://patch.msgid.link/7190E4DB338251C3+20260811081513.2849980-1-jinrui@haiwei.tech
[pjw@kernel.org: trimmed superfluous blank line in tags]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-09-01 19:19:44 -06:00
..
arc Documentation: arch: fix brackets 2026-06-12 13:16:01 -06:00
arm soc: arm code changes for 7.2 2026-06-17 11:28:10 -07:00
arm64 pci-v7.3-changes 2026-08-23 12:44:10 -07:00
loongarch Docs/LoongArch: Add advanced extended IRQ model 2026-06-03 22:28:11 +02:00
m68k ne2k: fold drivers/net/Space.c into ne.c 2026-05-01 16:46:53 -07:00
mips Documentation: use a source-read extension for the index link boilerplate 2026-01-23 11:59:34 -07:00
nios2 docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
openrisc Documentation: use a source-read extension for the index link boilerplate 2026-01-23 11:59:34 -07:00
parisc Documentation: use a source-read extension for the index link boilerplate 2026-01-23 11:59:34 -07:00
powerpc Documentation: arch: fix brackets 2026-06-12 13:16:01 -06:00
riscv riscv: report Zfhmin/Zvfhmin when Zfh/Zvfh are present 2026-09-01 19:19:44 -06:00
s390 s390/debug: Add s390dbf kernel parameter 2026-05-11 16:42:31 +02:00
sh docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
sparc Documentation: arch: fix brackets 2026-06-12 13:16:01 -06:00
x86 platform-drivers-x86 for v7.3-1 2026-08-24 10:16:35 -07:00
xtensa docs: kernel_feat.py: fix potential command injection 2024-01-11 09:21:01 -07:00
index.rst The number of commits for documentation is not huge this time around, but 2023-11-01 17:11:41 -10:00