Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/arch/powerpc/powerpc Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/6b10b9265604
branches:  netbsd-7
changeset: 800187:6b10b9265604
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Apr 19 17:02:43 2017 +0000

description:
Pull up following revision(s) (requested by phx in ticket #1382):
        sys/arch/powerpc/powerpc/locore_subr.S: revision 1.55
in cpu_switchto() and the fast-softint context switch code,
put back the stwcx. instruction to clear the reservation.
we used to have this in the old cpu_switch() until it was
if-0'd in 2003 and removed completely in 2007.
this fixes hangs I've seen where a softint thread is
blocked waiting for a mutex that is not held.
this should also fix PR 44387.

diffstat:

 sys/arch/powerpc/powerpc/locore_subr.S |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 3327da7cdb2c -r 6b10b9265604 sys/arch/powerpc/powerpc/locore_subr.S
--- a/sys/arch/powerpc/powerpc/locore_subr.S    Wed Apr 19 16:58:28 2017 +0000
+++ b/sys/arch/powerpc/powerpc/locore_subr.S    Wed Apr 19 17:02:43 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_subr.S,v 1.54 2014/07/30 23:27:55 matt Exp $    */
+/*     $NetBSD: locore_subr.S,v 1.54.2.1 2017/04/19 17:02:43 snj Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -288,6 +288,7 @@
  */
        ldreg   %r31,CFRAME_R31(%r1)    /* restore saved registers */
        ldreg   %r30,CFRAME_R30(%r1)
+       stwcx.  %r1,0,%r1               /* clear reservation */
 #if 1
        addi    %r1,%r1,CALLFRAMELEN
 #else
@@ -328,6 +329,7 @@
        mtmsr   %r0
        isync
 #endif
+       stwcx.  %r1,0,%r1               /* clear reservation */
        addi    %r1, %r1, CALLFRAMELEN
        ldreg   %r0, CFRAME_LR(%r1)
        mtlr    %r0
@@ -478,6 +480,7 @@
        ldreg   %r29,SFRAME_R29(%r1)    /* R29 */
        ldreg   %r31,SFRAMELEN+CFRAME_R31(%r1)  /* restore saved registers */
        ldreg   %r30,SFRAMELEN+CFRAME_R30(%r1)
+       stwcx.  %r1,0,%r1               /* clear reservation */
        addi    %r1,%r1,SFRAMELEN+2*CALLFRAMELEN /* remove switch & callframes */
 #endif
        ldreg   %r0,CFRAME_LR(%r1)



Home | Main Index | Thread Index | Old Index