[PATCH 0/6] riscv: hwprobe: do not report disabled extensions
Radim Krčmář
radim.krcmar at oss.qualcomm.com
Tue Oct 6 00:52:57 PDT 2026
I understand hwprobe to be an interface to query the features of
user-mode execution environment.
Some RISC-V extensions need to be enabled in user-mode through the use
of higher-mode controls (like sstatus, senvcfg, or sstateen), and when
we for some reason never enable the extensions (disabled in config, by
boot parameter, heterogenous platform alignment, etc.), hwprobe should
not report that the extensions are present.
This series brings the user-mode extension reporting into a state that
is more consistent with the user-mode observable extension set.
There are minor overlaps with Andy Chui's series to report the dynamic
state of higher-mode controls through hwprobe [1].
Andy's series adds another layer that can query features whose
availability depends on runtime variables, while this series is covering
constraints that the user-mode cannot influence.
This series doesn't touch Zicntr and Zihpm since those will require more
discussion. Zicntr could be reported through Andy's mechanism based on
the sysctl status and Zihpm might be somehow reinterpreted for perf
availability or just ignored.
Applies to riscv/for-next just as well as to v7.3-rc6.
---
1: https://lore.kernel.org/linux-riscv/20260725001614.2578617-1-tchiu@tenstorrent.com/
Radim Krčmář (6):
riscv: hwprobe: Report FP extensions only when available
riscv: hwprobe: Report Zicbom and Zicboz only when available
riscv: hwprobe: Report Zicfilp and Zicfiss only when available
riscv: hwprobe: Report Supm only when available
riscv: hwprobe: Report XTheadVector only when available
riscv: hwprobe: Report SiFive vector extensions only when available
arch/riscv/include/asm/usercfi.h | 9 ++-
arch/riscv/kernel/sys_hwprobe.c | 55 ++++++++++++-------
.../kernel/vendor_extensions/sifive_hwprobe.c | 14 +++--
.../kernel/vendor_extensions/thead_hwprobe.c | 5 +-
4 files changed, 55 insertions(+), 28 deletions(-)
--
2.55.0
More information about the linux-riscv
mailing list