Re: [RFC PATCH v1 04/11] riscv: Add B to hwcap
From: Andrew Jones
Date: Fri Mar 06 2026 - 14:04:54 EST
On Fri, Mar 06, 2026 at 06:50:20PM +0000, Conor Dooley wrote:
> On Fri, Mar 06, 2026 at 12:27:50PM -0600, Andrew Jones wrote:
> > On Fri, Mar 06, 2026 at 10:17:19AM +0800, Guodong Xu wrote:
>
> > > + /*
> > > + * B is functionally a bundle (Zba + Zbb + Zbs,
> > > + * no additional instructions). We use SUPERSET
> > > + * instead of BUNDLE because B needs a valid ext
> > > + * id for isa2hwcap[] to set COMPAT_HWCAP_ISA_B.
>
> What's the actual rationale for it working like that?
> Why shouldn't bundles appear in cpuinfo etc, I forget entirely why we
> did it this way. Feels like it'd be easier for users, no?
>
> 2023 me might disagree, but 2026 me doesn't see the value in hiding these
> extensions. All I can think of was me being very negative, and hedging
> against bad software checking for zkn and not checking for the subsets,
> and breaking if the dt listed the entire subset but not zkn. That, or
> not wanting to implement code that looked for subset extensions and
> populated the relevant bundle if the bundle itself was missing but all
> components were there.
I also can't remember and the 2026 me doesn't want to google 2023 me's
thoughts. I think we may have opted not to publish bundles because we
didn't believe publishing them would help reduce much confusion, as the
concept of a bundle itself was a bit confusing...
Thanks,
drew