[PATCH] AArch64: Check kernel version for SVE ifuncs

Szabolcs Nagy szabolcs.nagy@arm.com
Thu Mar 14 14:26:58 GMT 2024


The 03/14/2024 10:47, Adhemerval Zanella Netto wrote:
> On 14/03/24 05:35, Szabolcs Nagy wrote:
> > The 03/13/2024 16:55, Adhemerval Zanella Netto wrote:
> >> On 13/03/24 16:25, Szabolcs Nagy wrote:
> >>> The 03/13/2024 15:12, Adhemerval Zanella Netto wrote:
> >> And I don't think __ASSUME_FAST_SVE would work well here, it means it
> >> would always detect a good kernel even when running on a older one
> > 
> > why? if it is set based on min supported kernel version then
> > running on older kernel is a bug. if it can be overriden by
> > a tunable then it is a user error if the tunable is wrong.
> > 
> >> (I am not sure how usual this is).  The minimum supported kernel 
> >> version can work to ensure that this check won't be necessary, but in
> >> this case we won't really need this test anyway.
> > 
> > you mean after min version is increased the check can be removed?
> > i expect all __ASSUME* based on min linux version works like that
> > and it's useful to have the __ASSUME exactly to be able to find
> > which code can be removed after a min version increase.
> > 
> > i don't know if distros actually adjust the min version in their
> > glibc, i guess that would be risky if it should work in containers,
> > so 6.2 min version is probably far in the future.
> 
> All major distros I am aware of does not set --enable-kernel, so SVE
> only will be selected either someone builds a glibc with
> --enable-kernel=6.2 or when we raise the minimum version to 6.2.  Not
> a deal breaker, but the SVE routines will ended up not being actively
> used for a long time.

the __ASSUME would just gate the runtime version check,
we would still do a kernel version check so sve will be
used on new kernels, the __ASSUME is there so we dont
forget to remove the check when the min version is high
enough.


More information about the Libc-alpha mailing list