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

MAHESH BODAPATI bmahi496@linux.ibm.com
Tue Jun 20 17:45:53 GMT 2023


On 20/06/23 9:50 pm, Peter Bergner wrote:
> 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!
>
This patch will not support single HWCAP/HWCAP2 features. This is only 
for CPU arch-level features.
We can add tunable support for single HWCAP/HWCAP2 in a separate patch.
>
>
>> +            /* we don't disable altivec and vsx */
> This is not a correctly formatted sentence with proper capitalization, etc.
>
I will update the sentence.
>
>> +  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.
>
On PowerPC32, The function selection happened through VSX feature on 
some libraries.
Say I set tunable as "power7,power6" then it should set to power6 but 
it's picking the power7 specific code
So I am disabling VSX feature on the machines which are lower than 
power7 and the code should work on the precedence as well,
For suppose "power6,power7" then it should set to power7.
>> +  /* Copy back the supported tunable features */
> Missing a '.' and 2 spaces before the */
>
I will update the sentence.
> Peter
>
>


More information about the Libc-alpha mailing list