diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2022-08-18 11:49:39 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-08-19 17:28:00 +0000 |
| commit | 0a1da095d1cef7c8ac6065da2983565b450566a5 (patch) | |
| tree | 6a5017293e763f3e944b2e2ead655e4ecb25311f /src/runtime/internal/atomic/sys_linux_arm.s | |
| parent | dc8e2a6a8ec94f2c98ba20edd57932eba284efb1 (diff) | |
| download | go-0a1da095d1cef7c8ac6065da2983565b450566a5.tar.xz | |
runtime/internal/atomic: remove double-check in kernelcas on linux/arm
Older kernels which require the double check of the __kuser_cmpxchg
result are no longer supported as of Go 1.18 which requires at least
Linux 2.6.32.
For #45964
Change-Id: Ic3d6691bf006353ac51b9d43e742d970e3d4e961
Reviewed-on: https://go-review.googlesource.com/c/go/+/424556
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/internal/atomic/sys_linux_arm.s')
| -rw-r--r-- | src/runtime/internal/atomic/sys_linux_arm.s | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/runtime/internal/atomic/sys_linux_arm.s b/src/runtime/internal/atomic/sys_linux_arm.s index 0cc7fa73d1..9225df8439 100644 --- a/src/runtime/internal/atomic/sys_linux_arm.s +++ b/src/runtime/internal/atomic/sys_linux_arm.s @@ -15,9 +15,6 @@ // LR = return address // The function returns with CS true if the swap happened. // http://lxr.linux.no/linux+v2.6.37.2/arch/arm/kernel/entry-armv.S#L850 -// On older kernels (before 2.6.24) the function can incorrectly -// report a conflict, so we have to double-check the compare ourselves -// and retry if necessary. // // https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b49c0f24cf6744a3f4fd09289fe7cade349dead5 // @@ -37,20 +34,13 @@ TEXT kernelcas<>(SB),NOSPLIT,$0 // because we don't know how to traceback through __kuser_cmpxchg MOVW (R2), R0 MOVW old+4(FP), R0 -loop: MOVW new+8(FP), R1 BL cas<>(SB) - BCC check + BCC ret0 MOVW $1, R0 MOVB R0, ret+12(FP) RET -check: - // Kernel lies; double-check. - MOVW ptr+0(FP), R2 - MOVW old+4(FP), R0 - MOVW 0(R2), R3 - CMP R0, R3 - BEQ loop +ret0: MOVW $0, R0 MOVB R0, ret+12(FP) RET |
