From 8fe2ad6494840553c20565edc42435e99718eb41 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Fri, 16 Feb 2024 10:58:56 -0500 Subject: [release-branch.go1.22] runtime/internal/atomic: correct GOARM=7 guard at a DMB instruction CL 525637 changed to the guard of DMB instruction from the compiled-in runtime.goarm value to GOARM_7 macro and CPU feature detection. It missed a place where runtime.goarm is loaded to a register and reused later. This CL corrects the condition. Updates #65601. Fixes #65760. Change-Id: I2ddefd03a1eb1048dbec0254c6e234c65b054279 Reviewed-on: https://go-review.googlesource.com/c/go/+/564855 Run-TryBot: Cherry Mui TryBot-Result: Gopher Robot Reviewed-by: Keith Randall Reviewed-by: Keith Randall (cherry picked from commit a0226c5680f3ce6b0d8a8341f8c69611f3008393) Reviewed-on: https://go-review.googlesource.com/c/go/+/567555 LUCI-TryBot-Result: Go LUCI TryBot-Bypass: Carlos Amedee --- src/runtime/internal/atomic/atomic_arm.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/internal/atomic/atomic_arm.s b/src/runtime/internal/atomic/atomic_arm.s index 662b5987f2..1cf7d8f6ef 100644 --- a/src/runtime/internal/atomic/atomic_arm.s +++ b/src/runtime/internal/atomic/atomic_arm.s @@ -41,8 +41,10 @@ casl: BNE casl MOVW $1, R0 - CMP $7, R8 - BLT 2(PC) +#ifndef GOARM_7 + CMP $0, R11 + BEQ 2(PC) +#endif DMB MB_ISH MOVB R0, ret+12(FP) -- cgit v1.2.3-54-g00ecf