Re: riscv: hwprobe: Report Supm only when available
From: Andy Chiu
Date: Fri Oct 16 2026 - 17:45:06 EST
On Fri, Oct 16, 2026 at 04:26:03PM -0500, Andy Chiu wrote:
> On Tue, Oct 06, 2026 at 09:53:01AM +0200, Radim Krcmár wrote:
> > The RISC-V ISA defines Supm as
> >
> > "An extension that indicates that there is pointer-masking support
> > available in user mode, with some facility provided in the application
> > execution environment to control pointer masking."
> >
> > Our facility always returns -EINVAL unless Supm support is configured,
> > the pointer masking ISA extension is globally present, and the user-mode
> > is running in 64-bit mode.
> >
> > Hiding Supm in compat tasks would add complexity that doesn't seem
> > justified as 32-bit code has no reason to look at Supm anyway.
> > Reporting based on the a global sysctl toggle isn't done.
> >
> > Do not report Supm when some harts lack the extension, because it's not
> > available on any hart in that case.
> >
> > (Reporting Supm when only PMLEN=0 is supported isn't great, but doesn't
> > violate the text of the extension and we ought to have Supm7 and Supm16
> > extensions if we care about precision.)
> >
> > Fixes: 3c2e0aff7b4f ("riscv: hwprobe: Export the Supm ISA extension")
> > Signed-off-by: Radim Krcmár <radim.krcmar@xxxxxxxxxxxxxxxx>
>
> Reviewed-by: Andy Chiu <tchiu@xxxxxxxxxxxxxxx>
>
> > ---
> > The compat hiding and global sysctl toggle better fit in Andy's series.
> >
>
> Sorry, I am not aware of any ongoing series that does the compat hiding,
> but I will keep an eye on it.
Now I know the series you mentioned. That series was dropped because the
mechanism was not in flavor of reviewers and we are going to deprecate
the prctl[1]. But I can see there is still a need for understanding if an
extension exists at runtime. We will take time to revisit that
[1]: https://lore.kernel.org/all/20261007085126.222688-1-samuel.holland@xxxxxxxxxx/
Thanks,
Andy