aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-15 16:33:25 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-04 12:16:47 -0500
commit293666b7a17cb7a389fc274980439212386a19c4 (patch)
tree075cc7661d2113cf04da7130b3383979d8024206 /arch/sparc64/kernel
parent64f2dde3f743c8a1ad8c0a1aa74166c1034afd92 (diff)
sparc64: Stop using memory barriers for atomics and locks.
The kernel always executes in the TSO memory model now, so none of this stuff is necessary any more. With helpful feedback from Nick Piggin. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r--arch/sparc64/kernel/smp.c11
-rw-r--r--arch/sparc64/kernel/trampoline.S4
-rw-r--r--arch/sparc64/kernel/traps.c1
-rw-r--r--arch/sparc64/kernel/tsb.S6
4 files changed, 8 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index f500b0618bb0..c6d06362728c 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -163,7 +163,7 @@ static inline long get_delta (long *rt, long *master)
163 for (i = 0; i < NUM_ITERS; i++) { 163 for (i = 0; i < NUM_ITERS; i++) {
164 t0 = tick_ops->get_tick(); 164 t0 = tick_ops->get_tick();
165 go[MASTER] = 1; 165 go[MASTER] = 1;
166 membar_storeload(); 166 membar_safe("#StoreLoad");
167 while (!(tm = go[SLAVE])) 167 while (!(tm = go[SLAVE]))
168 rmb(); 168 rmb();
169 go[SLAVE] = 0; 169 go[SLAVE] = 0;
@@ -257,7 +257,7 @@ static void smp_synchronize_one_tick(int cpu)
257 257
258 /* now let the client proceed into his loop */ 258 /* now let the client proceed into his loop */
259 go[MASTER] = 0; 259 go[MASTER] = 0;
260 membar_storeload(); 260 membar_safe("#StoreLoad");
261 261
262 spin_lock_irqsave(&itc_sync_lock, flags); 262 spin_lock_irqsave(&itc_sync_lock, flags);
263 { 263 {
@@ -267,7 +267,7 @@ static void smp_synchronize_one_tick(int cpu)
267 go[MASTER] = 0; 267 go[MASTER] = 0;
268 wmb(); 268 wmb();
269 go[SLAVE] = tick_ops->get_tick(); 269 go[SLAVE] = tick_ops->get_tick();
270 membar_storeload(); 270 membar_safe("#StoreLoad");
271 } 271 }
272 } 272 }
273 spin_unlock_irqrestore(&itc_sync_lock, flags); 273 spin_unlock_irqrestore(&itc_sync_lock, flags);
@@ -1122,7 +1122,6 @@ void smp_capture(void)
1122 smp_processor_id()); 1122 smp_processor_id());
1123#endif 1123#endif
1124 penguins_are_doing_time = 1; 1124 penguins_are_doing_time = 1;
1125 membar_storestore_loadstore();
1126 atomic_inc(&smp_capture_registry); 1125 atomic_inc(&smp_capture_registry);
1127 smp_cross_call(&xcall_capture, 0, 0, 0); 1126 smp_cross_call(&xcall_capture, 0, 0, 0);
1128 while (atomic_read(&smp_capture_registry) != ncpus) 1127 while (atomic_read(&smp_capture_registry) != ncpus)
@@ -1142,7 +1141,7 @@ void smp_release(void)
1142 smp_processor_id()); 1141 smp_processor_id());
1143#endif 1142#endif
1144 penguins_are_doing_time = 0; 1143 penguins_are_doing_time = 0;
1145 membar_storeload_storestore(); 1144 membar_safe("#StoreLoad");
1146 atomic_dec(&smp_capture_registry); 1145 atomic_dec(&smp_capture_registry);
1147 } 1146 }
1148} 1147}
@@ -1161,7 +1160,7 @@ void smp_penguin_jailcell(int irq, struct pt_regs *regs)
1161 __asm__ __volatile__("flushw"); 1160 __asm__ __volatile__("flushw");
1162 prom_world(1); 1161 prom_world(1);
1163 atomic_inc(&smp_capture_registry); 1162 atomic_inc(&smp_capture_registry);
1164 membar_storeload_storestore(); 1163 membar_safe("#StoreLoad");
1165 while (penguins_are_doing_time) 1164 while (penguins_are_doing_time)
1166 rmb(); 1165 rmb();
1167 atomic_dec(&smp_capture_registry); 1166 atomic_dec(&smp_capture_registry);
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
index 83abd5ae88a4..da1b781b5e65 100644
--- a/arch/sparc64/kernel/trampoline.S
+++ b/arch/sparc64/kernel/trampoline.S
@@ -109,7 +109,6 @@ startup_continue:
109 */ 109 */
110 sethi %hi(prom_entry_lock), %g2 110 sethi %hi(prom_entry_lock), %g2
1111: ldstub [%g2 + %lo(prom_entry_lock)], %g1 1111: ldstub [%g2 + %lo(prom_entry_lock)], %g1
112 membar #StoreLoad | #StoreStore
113 brnz,pn %g1, 1b 112 brnz,pn %g1, 1b
114 nop 113 nop
115 114
@@ -214,7 +213,6 @@ startup_continue:
214 213
215 sethi %hi(prom_entry_lock), %g2 214 sethi %hi(prom_entry_lock), %g2
216 stb %g0, [%g2 + %lo(prom_entry_lock)] 215 stb %g0, [%g2 + %lo(prom_entry_lock)]
217 membar #StoreStore | #StoreLoad
218 216
219 ba,pt %xcc, after_lock_tlb 217 ba,pt %xcc, after_lock_tlb
220 nop 218 nop
@@ -330,7 +328,6 @@ after_lock_tlb:
330 328
331 sethi %hi(prom_entry_lock), %g2 329 sethi %hi(prom_entry_lock), %g2
3321: ldstub [%g2 + %lo(prom_entry_lock)], %g1 3301: ldstub [%g2 + %lo(prom_entry_lock)], %g1
333 membar #StoreLoad | #StoreStore
334 brnz,pn %g1, 1b 331 brnz,pn %g1, 1b
335 nop 332 nop
336 333
@@ -394,7 +391,6 @@ after_lock_tlb:
394 391
3953: sethi %hi(prom_entry_lock), %g2 3923: sethi %hi(prom_entry_lock), %g2
396 stb %g0, [%g2 + %lo(prom_entry_lock)] 393 stb %g0, [%g2 + %lo(prom_entry_lock)]
397 membar #StoreStore | #StoreLoad
398 394
399 ldx [%l0], %g6 395 ldx [%l0], %g6
400 ldx [%g6 + TI_TASK], %g4 396 ldx [%g6 + TI_TASK], %g4
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 81ccd22e78d4..04994fc8700d 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -1371,7 +1371,6 @@ static int cheetah_fix_ce(unsigned long physaddr)
1371 __asm__ __volatile__("ldxa [%0] %3, %%g0\n\t" 1371 __asm__ __volatile__("ldxa [%0] %3, %%g0\n\t"
1372 "ldxa [%1] %3, %%g0\n\t" 1372 "ldxa [%1] %3, %%g0\n\t"
1373 "casxa [%2] %3, %%g0, %%g0\n\t" 1373 "casxa [%2] %3, %%g0, %%g0\n\t"
1374 "membar #StoreLoad | #StoreStore\n\t"
1375 "ldxa [%0] %3, %%g0\n\t" 1374 "ldxa [%0] %3, %%g0\n\t"
1376 "ldxa [%1] %3, %%g0\n\t" 1375 "ldxa [%1] %3, %%g0\n\t"
1377 "membar #Sync" 1376 "membar #Sync"
diff --git a/arch/sparc64/kernel/tsb.S b/arch/sparc64/kernel/tsb.S
index c499214b501d..8c91d9b29a2f 100644
--- a/arch/sparc64/kernel/tsb.S
+++ b/arch/sparc64/kernel/tsb.S
@@ -317,7 +317,7 @@ tsb_flush:
317 srlx %g1, 32, %o3 317 srlx %g1, 32, %o3
318 andcc %o3, %g2, %g0 318 andcc %o3, %g2, %g0
319 bne,pn %icc, 1b 319 bne,pn %icc, 1b
320 membar #LoadLoad 320 nop
321 cmp %g1, %o1 321 cmp %g1, %o1
322 mov 1, %o3 322 mov 1, %o3
323 bne,pt %xcc, 2f 323 bne,pt %xcc, 2f
@@ -327,7 +327,7 @@ tsb_flush:
327 bne,pn %xcc, 1b 327 bne,pn %xcc, 1b
328 nop 328 nop
3292: retl 3292: retl
330 TSB_MEMBAR 330 nop
331 .size tsb_flush, .-tsb_flush 331 .size tsb_flush, .-tsb_flush
332 332
333 /* Reload MMU related context switch state at 333 /* Reload MMU related context switch state at
@@ -478,7 +478,7 @@ copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size
478 nop 478 nop
479 479
480 retl 480 retl
481 TSB_MEMBAR 481 nop
482 .size copy_tsb, .-copy_tsb 482 .size copy_tsb, .-copy_tsb
483 483
484 /* Set the invalid bit in all TSB entries. */ 484 /* Set the invalid bit in all TSB entries. */