Skip to content

Commit

Permalink
Put NOPs to avoid load delay hazard on R3000.
Browse files Browse the repository at this point in the history
Fixes TLB miss panic in ras_mutex_spin_exit() on NWS-3470D.
  • Loading branch information
tsutsui committed Mar 8, 2011
1 parent fe92fa8 commit 908b1c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sys/arch/mips/mips/lock_stubs_ras.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: lock_stubs_ras.S,v 1.1 2011/02/20 07:45:47 matt Exp $ */
/* $NetBSD: lock_stubs_ras.S,v 1.2 2011/03/08 15:01:02 tsutsui Exp $ */

/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -377,6 +377,7 @@ END(ras_mutex_spin_enter)
*/
LEAF(ras_mutex_spin_exit)
PTR_L t2, L_CPU(MIPS_CURLWP)
nop
#if defined(DIAGNOSTIC)
INT_L t0, MTX_LOCK(a0)
nop
Expand All @@ -392,7 +393,6 @@ LEAF(ras_mutex_spin_exit)
*/
#ifdef PARANOIA
INT_L a2, MTX_IPL(a0)
nop
#endif
INT_L a0, CPU_INFO_MTX_OLDSPL(t2)

Expand All @@ -408,6 +408,7 @@ LEAF(ras_mutex_spin_exit)
* If the IPL doesn't change, nothing to do
*/
INT_L a1, CPU_INFO_CPL(t2)
nop

#ifdef PARANOIA
sltu v0, a1, a2 # v0 = cpl < mtx_ipl
Expand Down

0 comments on commit 908b1c6

Please sign in to comment.