Re: [PATCH 3/6] riscv: hwprobe: Report Zicfilp and Zicfiss only when available

From: Guodong Xu

Date: Sun Nov 08 2026 - 05:05:38 EST


Hi Radim,

On 2026-10-06 09:53, Radim Krčmář wrote:
User-mode use of Zicfilp and Zicfiss requires senvcfg.LPE and
senvcfg.SSE, respectively, which we set only when is_user_lpad_enabled()
and is_user_shstk_enabled() (CONFIG_RISCV_USER_CFI, the extension on all
harts, and not disabled by riscv_nousercfi). hwprobe reports the
extensions from the per-hart ISA bitmaps alone, so it can advertise
extensions that are always disabled in user-mode.

Report correct environment to user-mode.

The changes to arch/riscv/include/asm/usercfi.h avoid
IS_ENABLED(CONFIG_RISCV_USER_CFI) guards in the conditions.

Fixes: 30c3099036a9 ("riscv/hwprobe: add zicfilp / zicfiss enumeration in hwprobe")
Signed-off-by: Radim Krčmář <radim.krcmar@xxxxxxxxxxxxxxxx>

Reviewed-by: Guodong Xu <guodong.xu@xxxxxxxxxxxxxxxx>

For the record, while looking at the riscv_nousercfi part of this I
found that the option is parsed too late for the ISA validators. I sent
a fix separately [1]. Run-time checking as done here is still correct and
that fix doesn't change anything in this patch.

[1] https://lore.kernel.org/lkml/20261108-nousercfi-early-param-v1-1-ea22d3a60683@xxxxxxxxxxxxxxxx/

BR,
Guodong Xu