[PATCH v2] AArch64: Check kernel version for SVE ifuncs
Florian Weimer
fweimer@redhat.com
Wed Mar 20 15:39:29 GMT 2024
* Szabolcs Nagy:
> The 03/18/2024 14:14, Wilco Dijkstra wrote:
>>
>> v2: Add __LINUX_KERNEL_VERSION #ifdefs, improve parser, use 8:8:8 format.
>>
>> Old Linux kernels disable SVE after every system call. Calling the
>> SVE-optimized memcpy afterwards will then cause a trap to reenable SVE.
>> As a result, applications with a high use of syscalls may run slower with
>> the SVE memcpy. This is true for kernels between 4.15.0 and before 6.2.0,
>> except for 5.14.0 which was patched. Avoid this by checking the kernel
>> version and selecting the SVE ifunc on modern kernels.
>>
>> Parse the kernel version reported by uname() into a 24-bit kernel.major.minor
>> value without calling any library functions. If uname() is not supported or
>> if the version format is not recognized, assume the kernel is modern.
>>
>> Passes regress, OK for commit?
>
> OK to commit. (clearly a hack but what can we do..)
>
> Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
I have not had a chance to test this yet with the el9 kernel.
I will try to do this tomorrow.
Do we need to include other distribution LTS kernels in the version
check?
Thanks,
Florian
More information about the Libc-alpha
mailing list