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

From: Andy Chiu

Date: Fri Oct 16 2026 - 17:09:23 EST


On Tue, Oct 06, 2026 at 09:53:00AM +0200, Radim Krcmár 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 Krcmár <radim.krcmar@xxxxxxxxxxxxxxxx>

Reviewed-by: Andy Chiu <tchiu@xxxxxxxxxxxxxxx>