From 15a54d627ca7a0bdf45a3d1862b35a892024cacc Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 9 Nov 2021 11:35:52 -0500 Subject: [PATCH] runtime: add upper half and carry bit with zero https://golang.org/cl/246763 accidentally changed this from upper + 0 + carry to upper + old vdsoSP + carry. The old value of vdsoPC is usually zero, so this typically works. However, the reentrant case will have a non-zero value, resulting in a bogus returned time. Fixes #49481 Change-Id: I0110b84277bf911804cb0ff8097aebf1b7eb100a Reviewed-on: https://go-review.googlesource.com/c/go/+/362674 Trust: Michael Pratt Run-TryBot: Michael Pratt TryBot-Result: Go Bot Reviewed-by: Cherry Mui --- src/runtime/sys_linux_arm.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s index 65935de99f..ca443b699f 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -456,7 +456,7 @@ finish: MOVW $1000000000, R3 MULLU R0, R3, (R1, R0) ADD.S R2, R0 - ADC R4, R1 + ADC $0, R1 // Add carry bit to upper half. MOVW R0, ret_lo+0(FP) MOVW R1, ret_hi+4(FP) -- 2.50.0