[PATCH] x86: Fix tst-cpu-features-cpuinfo on Ryzen 9 (BZ #27873)

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Jun 23 21:15:54 GMT 2021



On 23/06/2021 17:41, H.J. Lu wrote:
>> @@ -216,12 +233,15 @@ do_test (int argc, char **argv)
>>    fails += CHECK_PROC (sgx, SGX);
>>    fails += CHECK_PROC (sgx_lc, SGX_LC);
>>    fails += CHECK_PROC (sha_ni, SHA);
>> -  fails += CHECK_PROC (shstk, SHSTK);
>> +  fails += CHECK_PROC_OPTIN (shstk, SHSTK);
> 
> Why do you need this?  If kernel doesn't support SHSTK, it will be
> turned off:
> 
>  /* Check CET status.  */
>   unsigned int cet_status = get_cet_status ();
> 
>   if ((cet_status & GNU_PROPERTY_X86_FEATURE_1_IBT) == 0)
>     CPU_FEATURE_UNSET (cpu_features, IBT)
>   if ((cet_status & GNU_PROPERTY_X86_FEATURE_1_SHSTK) == 0)
>     CPU_FEATURE_UNSET (cpu_features, SHSTK)

The problem is this is only enabled for CET_ENABLED, the configuration I am using
does not define __CET__.  So the CPU I am using does support SHSTK, but the bit
ended up not being cleared by glibc.


More information about the Libc-alpha mailing list