Skip to content
Commit f4a45af3 authored by Wilco Dijkstra's avatar Wilco Dijkstra
Browse files

AArch64: Check kernel version for SVE ifuncs



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.

Tested-by: default avatarFlorian Weimer <fweimer@redhat.com>
Reviewed-by: default avatarSzabolcs Nagy <szabolcs.nagy@arm.com>
(cherry picked from commit 2e94e2f5)
parent 7f3c1433
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment