From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
Szabolcs Nagy <Szabolcs.Nagy@arm.com>
Cc: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
'GNU C Library' <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] AArch64: Check kernel version for SVE ifuncs
Date: Thu, 21 Mar 2024 12:43:36 -0300 [thread overview]
Message-ID: <65f5177c-f7a3-40e9-9ab8-a91a91087f67@linaro.org> (raw)
In-Reply-To: <87o7b7zu63.fsf@oldenburg.str.redhat.com>
On 21/03/24 08:44, Florian Weimer wrote:
> * Szabolcs Nagy:
>
>> The 03/20/2024 16:39, Florian Weimer wrote:
>>> * 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?
>>
>> i checked some (suse,ubuntu,debian) and they didn't have the
>> SVE backport (maybe we should request those backports, but
>> today the version check looks ok)
>
> I think we should make this change in one commit if at all possible,
> otherwise we risk creating too much divergence. But if you consider
> further kernel backports unlikely, the v2 patch is okay.
>
> Anyway, I verified this against 4.18 and 5.14 kernels, and got the
> expected results (__memcpy_generic and __memcpy_sve).
If you have check through the string tests, you might not get the
correct answer since it uses the ifunc-impl-list.c and this patch
does not changes the reported functions.
>
> Tested-by: Florian Weimer <fweimer@redhat.com>
>
> Thanks,
> Florian
>
next prev parent reply other threads:[~2024-03-21 15:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 14:14 [PATCH v2] AArch64: Check kernel version for SVE ifuncs Wilco Dijkstra
2024-03-20 15:05 ` Szabolcs Nagy
2024-03-20 15:39 ` Florian Weimer
2024-03-20 16:13 ` Szabolcs Nagy
2024-03-21 11:44 ` Florian Weimer
2024-03-21 15:43 ` Adhemerval Zanella Netto [this message]
2024-03-21 16:11 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65f5177c-f7a3-40e9-9ab8-a91a91087f67@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=Szabolcs.Nagy@arm.com \
--cc=Wilco.Dijkstra@arm.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).