Revert "Add 64-bit slm optimized strlcpy and srlcat."

This reverts commit 2e7145c048.

When src is at the end page, the sse2 strlcpy SSE2 optimized version
can issue a movdqu instruction that can cross the page boundary.  If
the next page is not allocated to that process, it leads to
segmentation fault.  This is a rare but has be caught multiple times
during robustness testing.

We isolated a way to reproduce that issue outside of an Android device
and we have been able to resolve this particular case.  However, we
ran some additional compliance and robustness tests and found several
other similar page crossing issues with this implementation.

In conclusion, this optimization needs to be re-written from scratch
because its design is at cause.  In the meantime, it is better to
remove it.

Bug: http://b/78355649
Change-Id:  If90450de430ba9b7cd9282a422783beabd701f3d
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>

(cherry picked from commit 611ad621c6)
This commit is contained in:
Jeremy Compostella 2018-04-10 16:16:14 -07:00 committed by Elliott Hughes
parent 4c9504aa6c
commit 592bf711fd
3 changed files with 0 additions and 1103 deletions

View file

@ -628,8 +628,6 @@ cc_library_static {
"upstream-openbsd/lib/libc/string/stpncpy.c", "upstream-openbsd/lib/libc/string/stpncpy.c",
"upstream-openbsd/lib/libc/string/strcat.c", "upstream-openbsd/lib/libc/string/strcat.c",
"upstream-openbsd/lib/libc/string/strcpy.c", "upstream-openbsd/lib/libc/string/strcpy.c",
"upstream-openbsd/lib/libc/string/strlcat.c",
"upstream-openbsd/lib/libc/string/strlcpy.c",
"upstream-openbsd/lib/libc/string/strncat.c", "upstream-openbsd/lib/libc/string/strncat.c",
"upstream-openbsd/lib/libc/string/strncmp.c", "upstream-openbsd/lib/libc/string/strncmp.c",
"upstream-openbsd/lib/libc/string/strncpy.c", "upstream-openbsd/lib/libc/string/strncpy.c",
@ -1182,8 +1180,6 @@ cc_library_static {
"arch-x86_64/string/sse2-stpncpy-slm.S", "arch-x86_64/string/sse2-stpncpy-slm.S",
"arch-x86_64/string/sse2-strcat-slm.S", "arch-x86_64/string/sse2-strcat-slm.S",
"arch-x86_64/string/sse2-strcpy-slm.S", "arch-x86_64/string/sse2-strcpy-slm.S",
"arch-x86_64/string/sse2-strlcat-slm.S",
"arch-x86_64/string/sse2-strlcpy-slm.S",
"arch-x86_64/string/sse2-strlen-slm.S", "arch-x86_64/string/sse2-strlen-slm.S",
"arch-x86_64/string/sse2-strncat-slm.S", "arch-x86_64/string/sse2-strncat-slm.S",
"arch-x86_64/string/sse2-strncpy-slm.S", "arch-x86_64/string/sse2-strncpy-slm.S",

View file

@ -1,37 +0,0 @@
/*
Copyright (c) 2014, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define USE_AS_STRLCAT
#ifndef STRLCPY
# define STRLCPY strlcat
#endif
#include "sse2-strlcpy-slm.S"

File diff suppressed because it is too large Load diff