Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/2.12.1: 6610_all_glibc-r10k-workarounds.patch README.history
Date: Tue, 05 Jul 2011 06:00:20
Message-Id: 20110705060004.7C6AA2004B@flycatcher.gentoo.org
1 vapier 11/07/05 06:00:04
2
3 Modified: README.history
4 Added: 6610_all_glibc-r10k-workarounds.patch
5 Log:
6 re-add the mips r10k errata workaround #373361 by Matt Turner
7
8 Revision Changes Path
9 1.16 src/patchsets/glibc/2.12.1/README.history
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.12.1/README.history?rev=1.16&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.12.1/README.history?rev=1.16&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.12.1/README.history?r1=1.15&r2=1.16
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.12.1/README.history,v
18 retrieving revision 1.15
19 retrieving revision 1.16
20 diff -u -r1.15 -r1.16
21 --- README.history 10 Mar 2011 07:42:16 -0000 1.15
22 +++ README.history 5 Jul 2011 06:00:04 -0000 1.16
23 @@ -1,6 +1,7 @@
24 9 [pending]
25 U 1505_hppa_glibc-2.11-hppa-nptl.patch
26 + 6532_all_sparc64-tls-cross-test.patch
27 + + 6610_all_glibc-r10k-workarounds.patch
28
29 8 09.12.2010
30 + 6606_all_mips-glibc-delete-getpagesize.c.patch
31
32
33
34 1.1 src/patchsets/glibc/2.12.1/6610_all_glibc-r10k-workarounds.patch
35
36 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.12.1/6610_all_glibc-r10k-workarounds.patch?rev=1.1&view=markup
37 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.12.1/6610_all_glibc-r10k-workarounds.patch?rev=1.1&content-type=text/plain
38
39 Index: 6610_all_glibc-r10k-workarounds.patch
40 ===================================================================
41 http://bugs.gentoo.org/373361
42
43 From c804165aae6e4055a7a8c42cf66ea0b1a29ef3ed Mon Sep 17 00:00:00 2001
44 From: Matt Turner <mattst88@×××××.com>
45 Date: Tue, 28 Jun 2011 11:30:53 -0400
46 Subject: [PATCH] mips: work-around R10k ll/sc errata
47
48 The R10000 needs an LL/SC Workaround. If not applied all R10k before
49 rev 3.0 misbehave on atomic ops and rev 2.6 and lower (e.g. SGI IP28)
50 die after very few seconds with a deadlock due to even more erratas.
51 ---
52 ChangeLog.mips | 4 ++++
53 sysdeps/mips/bits/atomic.h | 38 ++++++++++++++++++++++++++++++++------
54 2 files changed, 36 insertions(+), 6 deletions(-)
55
56 diff --git a/sysdeps/mips/bits/atomic.h b/sysdeps/mips/bits/atomic.h
57 index 11b3467..2bd723d 100644
58 --- a/ports/sysdeps/mips/bits/atomic.h
59 +++ b/ports/sysdeps/mips/bits/atomic.h
60 @@ -49,6 +49,32 @@ typedef uintmax_t uatomic_max_t;
61 # define MIPS_SYNC sync
62 #endif
63
64 +/* Certain revisions of the R10000 Processor need an LL/SC Workaround
65 + enabled. Revisions before 3.0 misbehave on atomic operations, and
66 + Revs 2.6 and lower deadlock after several seconds due to other errata.
67 +
68 + To quote the R10K Errata:
69 + Workaround: The basic idea is to inhibit the four instructions
70 + from simultaneously becoming active in R10000. Padding all
71 + ll/sc sequences with nops or changing the looping branch in the
72 + routines to a branch likely (which is always predicted taken
73 + by R10000) will work. The nops should go after the loop, and the
74 + number of them should be 28. This number could be decremented for
75 + each additional instruction in the ll/sc loop such as the lock
76 + modifier(s) between the ll and sc, the looping branch and its
77 + delay slot. For typical short routines with one ll/sc loop, any
78 + instructions after the loop could also count as a decrement. The
79 + nop workaround pollutes the cache more but would be a few cycles
80 + faster if all the code is in the cache and the looping branch
81 + is predicted not taken. */
82 +
83 +
84 +#ifdef _MIPS_ARCH_R10000
85 +#define R10K_BEQZ_INSN "beqzl"
86 +#else
87 +#define R10K_BEQZ_INSN "beqz"
88 +#endif
89 +
90 #define MIPS_SYNC_STR_2(X) #X
91 #define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X)
92 #define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC)
93 @@ -74,7 +100,7 @@ typedef uintmax_t uatomic_max_t;
94 "bne %0,%3,2f\n\t" \
95 "move %1,%4\n\t" \
96 "sc %1,%2\n\t" \
97 - "beqz %1,1b\n" \
98 + R10K_BEQZ_INSN" %1,1b\n" \
99 acq "\n\t" \
100 ".set pop\n" \
101 "2:\n\t" \
102 @@ -98,7 +124,7 @@ typedef uintmax_t uatomic_max_t;
103 "bne %0,%3,2f\n\t" \
104 "move %1,%4\n\t" \
105 "scd %1,%2\n\t" \
106 - "beqz %1,1b\n" \
107 + R10K_BEQZ_INSN" %1,1b\n" \
108 acq "\n\t" \
109 ".set pop\n" \
110 "2:\n\t" \
111 @@ -192,7 +218,7 @@ typedef uintmax_t uatomic_max_t;
112 "ll %0,%4\n\t" \
113 "move %1,%3\n\t" \
114 "sc %1,%2\n\t" \
115 - "beqz %1,1b\n" \
116 + R10K_BEQZ_INSN" %1,1b\n" \
117 acq "\n\t" \
118 ".set pop\n" \
119 "2:\n\t" \
120 @@ -216,7 +242,7 @@ typedef uintmax_t uatomic_max_t;
121 "lld %0,%4\n\t" \
122 "move %1,%3\n\t" \
123 "scd %1,%2\n\t" \
124 - "beqz %1,1b\n" \
125 + R10K_BEQZ_INSN" %1,1b\n" \
126 acq "\n\t" \
127 ".set pop\n" \
128 "2:\n\t" \
129 @@ -251,7 +277,7 @@ typedef uintmax_t uatomic_max_t;
130 "ll %0,%4\n\t" \
131 "addu %1,%0,%3\n\t" \
132 "sc %1,%2\n\t" \
133 - "beqz %1,1b\n" \
134 + R10K_BEQZ_INSN" %1,1b\n" \
135 acq "\n\t" \
136 ".set pop\n" \
137 "2:\n\t" \
138 @@ -275,7 +301,7 @@ typedef uintmax_t uatomic_max_t;
139 "lld %0,%4\n\t" \
140 "daddu %1,%0,%3\n\t" \
141 "scd %1,%2\n\t" \
142 - "beqz %1,1b\n" \
143 + R10K_BEQZ_INSN" %1,1b\n" \
144 acq "\n\t" \
145 ".set pop\n" \
146 "2:\n\t" \
147 --
148 1.7.3.4