[PATCH] PowerPC: Influence hwcaps via cpu arch-level GLIBC_TUNABLES.

Peter Bergner bergner@linux.ibm.com
Tue Jun 20 16:20:05 GMT 2023


On 6/19/23 3:09 AM, bmahi496--- via Libc-alpha wrote:
> This patch enables the option to influence hwcaps used by the powerpc.
> The user can set a CPU arch-level tunable like power10 instead of single
> HWCAP features.
> 
> The influenced hwcap are stored in the powerpc-specific cpu_features struct.
> 
> Below are the supported cpu arch-level tunables.
> -  power10: power10 feature set
> -  power9: power9 feature set
> -  power8: power8 feature set
> -  power7: power7 feature set
> -  power6: power6 feature set
> -  power5: power5 feature set
> -  power4: power4 feature set.

I'm all for allowing modifying full cpu specific hwcap tunables with one
"cpu" option, but it's hard to tell whether this change allows modifying
single HWCAP/HWCAP2 features too.  Say I only want to disable the VSX
feature or the MMA feature and nothing else.  Does this patch support that?
We *do* want that ability!




> +            /* we don't disable altivec and vsx */

This is not a correctly formatted sentence with proper capitalization, etc.



> +  if (disable_vsx)
> +    cpu_features_curr.hwcap &= ~PPC_FEATURE_HAS_VSX;

Why the special handling for the VSX feature here?  How is it different
than say the Altivec feature or any of our other feature bits which don't
have special handling?  It's not obvious to me why we need special handling,
so it's probably not obvious to others either.  If we really do need special
handling for this, you should add a comment explaining why.



> +  /* Copy back the supported tunable features */

Missing a '.' and 2 spaces before the */


Peter





More information about the Libc-alpha mailing list