From ac500af15a7fc72984e0f7b27a15c18a06a8e79b Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 31 Mar 2022 00:52:00 +0000 Subject: [PATCH 17/49] powerpc: Use lwsync, not sync, for store-release. sync is only needed for store-before-load, which is needed only inside exotic Dekker-type algorithms, not for ordinary locks. --- sys/arch/powerpc/powerpc/lock_stubs.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arch/powerpc/powerpc/lock_stubs.S b/sys/arch/powerpc/powerpc/lock_stubs.S index 00dc0823a8e0..4b5baff070d0 100644 --- a/sys/arch/powerpc/powerpc/lock_stubs.S +++ b/sys/arch/powerpc/powerpc/lock_stubs.S @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR @@ -40,9 +40,11 @@ #if defined(MULTIPROCESSOR) #define ISYNC isync +#define LWYNC lwsync #define SYNC sync #else #define ISYNC /* nothing */ +#define LWSYNC /* nothing */ #define SYNC /* nothing */ #endif @@ -88,7 +90,7 @@ ENTRY(mutex_enter) * void mutex_exit(kmutex_t *); */ ENTRY(mutex_exit) - SYNC + LWSYNC li %r7,0 1: lptrarx %r10,0,%r3 @@ -172,7 +174,7 @@ ENTRY(rw_tryenter) */ ENTRY(rw_exit) ldptr %r9,RW_OWNER(%r3) - SYNC + LWSYNC andi. %r0,%r9,RW_WRITE_LOCKED bne- 1f -- 2.33.0