This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 22 May 2018 05:25:50 -0700
- Subject: Re: [PATCH] Don't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196)
- References: <mvm1se4romh.fsf@suse.de> <CAMe9rOq_Ba4Hah=Mj9QB1-SkUL1j_TzHjaPVnekiEU4HsacQBg@mail.gmail.com> <mvmpo1nrijw.fsf@suse.de>
On Tue, May 22, 2018 at 5:17 AM, Andreas Schwab <schwab@suse.de> wrote:
> On Mai 22 2018, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>
>> The modified test does't fail on Skylake server with unchanged
>> memmove-avx512-no-vzeroupper.S. Can you modify the test
>> so that it fails with the original memmove-avx512-no-vzeroupper.S
>> on Skylake server?
>
> How to do that? I have tested it on a Xeon Phi (whateve that means)
> where it failed without the fix.
__mempcpy_avx512_no_vzeroupper is also tested on Skylake server:
[hjl@gnu-skx-1 build-x86_64-linux]$ ./string/test-mempcpy
simple_mempcpy __mempcpy_avx512_no_vzeroupper
__mempcpy_avx512_unaligned __mempcpy_avx512_unaligned_erms
__mempcpy_avx_unaligned__mempcpy_avx_unaligned_erms
__mempcpy_ssse3_back __mempcpy_ssse3 __mempcpy_sse2_unaligned
__mempcpy_sse2_unaligned_erms __mempcpy_erms
[hjl@gnu-skx-1 build-x86_64-linux]$
It should also fail without the fix.
>> memmove-vec-unaligned-erms.S supports no vzeroupper:
>>
>> #ifndef VZEROUPPER
>> # if VEC_SIZE > 16
>> # define VZEROUPPER vzeroupper
>> # else
>> # define VZEROUPPER
>> # endif
>> #endif
>>
>> Should it be used instead?
>
> I don't understand what that has to do with the bug in question.
__mempcpy_avx512_no_vzeroupper can be implemented with
memmove-vec-unaligned-erms.S. It doesn't have the issue in
memmove-avx512-no-vzeroupper.S.
--
H.J.