This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][SPARC] missing membar in niagara2_memcpy
- From: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- To: libc-alpha at sourceware dot org
- Cc: davem at davemloft dot net
- Date: Thu, 15 May 2014 18:14:44 +0200
- Subject: [PATCH][SPARC] missing membar in niagara2_memcpy
- Authentication-results: sourceware.org; auth=none
Hi.
The following patch prevents stores made before calling memcpy to
overlap with the block stores in niagara2_memcpy.
Tested on an Athena machine (sparc64x) running sparc64-*-linux-gnu.
No new warnings triggered by the patch.
No regressions detected.
PS: virtually the same code lives in the kernel in
linux/arch/sparc/lib/NG2memcpy.S. Probably that file shall be
updated too...
2014-05-15 Jose E. Marchesi <jose.marchesi@oracle.com>
* sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Add missing
membar to avoid block loads/stores to overlap previous stores.
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
index b43a9e3..a1a9642 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
@@ -211,6 +211,7 @@ ENTRY(__memcpy_niagara2)
*/
VISEntryHalf
+ membar #Sync
alignaddr %o1, %g0, %g0
add %o1, (64 - 1), %o4