[PATCH] AArch64: Check kernel version for SVE ifuncs

Florian Weimer fweimer@redhat.com
Mon Mar 18 11:46:44 GMT 2024


* Florian Weimer:

> * Wilco Dijkstra:
>
>> Hi Florian,
>>
>>> I generally prefer we fix the component that has the bug.  With that
>>> approach, you'd have to to use your distribution contacts to request a
>>> backport.
>>
>> The issue is present since SVE was added in 4.18 so it affects many
>> kernels.  It is unlikely to be easy to backport since it relies on
>> various other changes to how syscalls and register state is dealt
>> with.
>>
>> Originally it was thought to be OK - and it would be if you only ever
>> use SVE in vectorized loops. However using a few SVE instructions
>> everywhere in applications breaks that model. Plus all the security
>> features have increased the overhead of kernel traps in recent
>> years...
>
> Yes, that might be the case.
>
> Can we hold off merging is for a bit?  I want to cross-checks a few
> things internally before we go with the version check as proposed if
> that's possible.

I would suggest to check for version >= 6.2 || version == 5.14.0.  At
this point, people running 5.14 are very likely on the el9 kernel or a
derivative, and we have backported the upstream fix into it:

  arm64/sve: Leave SVE enabled on syscall if we don't context switch 
  <https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/commit/564deeeb8038b29b91aafe2871c06aaa299145b1>

There are no plans to backport this into the el8 kernel that I know off,
and the window for such changes is more or less closed at this point, so
a similar check for 4.18.0 is not needed.

I understand that this makes the check even uglier, but that's the
nature of version checks. 8-(

Thanks,
Florian



More information about the Libc-alpha mailing list