]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use correct memory barrier in exitThread function on loong64
authorGuoqi Chen <chenguoqi@loongson.cn>
Tue, 26 Nov 2024 09:10:32 +0000 (17:10 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Thu, 27 Feb 2025 01:35:25 +0000 (17:35 -0800)
In the runtime.exitThread function, a storeRelease barrier
is required instead of a full barrier.

Change-Id: I2815ddb03e4984c891d71811ccf650a82325e10d
Reviewed-on: https://go-review.googlesource.com/c/go/+/631915
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/sys_linux_loong64.s

index 57cee99da7a6582dddf8b93bac6b5f2bdf9fb5de..914da6c043a590d501a36cc680f2418e1b0d2817 100644 (file)
@@ -57,10 +57,8 @@ TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0-4
 TEXT runtime·exitThread(SB),NOSPLIT|NOFRAME,$0-8
        MOVV    wait+0(FP), R19
        // We're done using the stack.
-       MOVW    $0, R11
-       DBAR
-       MOVW    R11, (R19)
-       DBAR
+       DBAR    $0x12   // StoreRelease barrier
+       MOVW    R0, (R19)
        MOVW    $0, R4  // exit code
        MOVV    $SYS_exit, R11
        SYSCALL