NetBSD-Bugs archive

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

PR/59386 CVS commit: src



The following reply was made to PR port-powerpc/59386; it has been noted by GNATS.

From: "Jared D. McNeill" <jmcneill%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/59386 CVS commit: src
Date: Sun, 4 Jan 2026 11:48:02 +0000

 Module Name:	src
 Committed By:	jmcneill
 Date:		Sun Jan  4 11:48:02 UTC 2026
 
 Modified Files:
 	src/sys/arch/powerpc/powerpc: trap_subr.S
 	src/tests/lib/libc/membar: t_spinlock.c
 
 Log Message:
 powerpc: Clear reservations on return from trap.
 
 For MP systems, clear reservations (with stwcx. instruction) when
 returning from a trap to protect the following sequence:
 
   user       kernel
   ----       ------
   lwarx                       # take reservation on address A
              trap             # exception entry
              lwarx            # take reservation on address B
              rfi              # exception return
   stwcx.                      # store with wrong reservation
 
 This can happen both for UP and SMP systems, but I think it's only a
 problem for SMP. Since we already clear the reservation on context
 switch, there is no risk of another thread storing at the same time.
 
 Fixes PR port-powerpc/59386 (t_spinlock test is failing).
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.87 -r1.88 src/sys/arch/powerpc/powerpc/trap_subr.S
 cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/membar/t_spinlock.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index