Source-Changes archive

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

CVS commit: [netbsd-11] src



Module Name:    src
Committed By:   martin
Date:           Mon Jan  5 14:29:51 UTC 2026

Modified Files:
        src/sys/arch/powerpc/powerpc [netbsd-11]: trap_subr.S
        src/tests/lib/libc/membar [netbsd-11]: t_spinlock.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #140):

        sys/arch/powerpc/powerpc/trap_subr.S: revision 1.88
        tests/lib/libc/membar/t_spinlock.c: revision 1.6

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.87.2.1 src/sys/arch/powerpc/powerpc/trap_subr.S
cvs rdiff -u -r1.5 -r1.5.2.1 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