From 2f8704b6c8c3ce65cdf2b589a98de1d1d9dc8ffa Mon Sep 17 00:00:00 2001 From: Daniel Cederman Date: Thu, 13 Jul 2017 09:26:50 +0200 Subject: sparc: Add assembly workaround for LEON3FT B2BST errata This patch adds NOP instructions to prevent instruction sequences that are sensitive to the LEON3FT B2BST errata. See GRLIB-TN-0009: "LEON3FT Stale Cache Entry After Store with Data Tag Parity Error" for more information. The sequences are only modified if __FIX_LEON3FT_B2BST is defined. The patch works in conjunction with the -mfix-ut700, -mfix-gr712rc, and -mfix-ut699 GCC flags that prevents the sensitive sequences from being generated. Update #3057. --- c/src/lib/libcpu/sparc/access/access.S | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'c/src/lib/libcpu/sparc/access/access.S') diff --git a/c/src/lib/libcpu/sparc/access/access.S b/c/src/lib/libcpu/sparc/access/access.S index cb8693b776..9397cb815b 100644 --- a/c/src/lib/libcpu/sparc/access/access.S +++ b/c/src/lib/libcpu/sparc/access/access.S @@ -59,6 +59,33 @@ SYM(_ld64): retl ldd [%o0], %o0 +#if defined(__FIX_LEON3FT_B2BST) + +SYM(_st8): + stub %o1, [%o0] + retl + nop + +SYM(_st_be16): +SYM(_st16): + stuh %o1, [%o0] + retl + nop + +SYM(_st_be32): +SYM(_st32): + st %o1, [%o0] + retl + nop + +SYM(_st_be64): +SYM(_st64): + std %o1, [%o0] + retl + nop + +#else + SYM(_st8): retl stb %o1, [%o0] @@ -79,3 +106,4 @@ SYM(_st64): mov %o1, %o2 retl std %o2, [%o0] +#endif -- cgit v1.2.3