]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: mark morestack_noctxt SPWRITE for linux/loong64
authorGuoqi Chen <chenguoqi@loongson.cn>
Fri, 4 Nov 2022 05:27:23 +0000 (13:27 +0800)
committerM Zhuo <mzh@golangcn.org>
Wed, 15 Mar 2023 07:17:43 +0000 (07:17 +0000)
ref. CL 425396

Updates #54332.

Change-Id: I1a235b0cca4dbf79cf61cf5f40b594fc2d940857
Reviewed-on: https://go-review.googlesource.com/c/go/+/446895
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: WANG Xuerui <git@xen0n.name>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: xiaodong liu <teaofmoli@gmail.com>
src/runtime/asm_loong64.s

index 2513d2bb54bd63c31bce4ae1606e929039f0e18a..60641d0aee8a31cd5b0156a346649e2e6ddb3b81 100644 (file)
@@ -266,6 +266,13 @@ TEXT runtime·morestack(SB),NOSPLIT|NOFRAME,$0-0
        UNDEF
 
 TEXT runtime·morestack_noctxt(SB),NOSPLIT|NOFRAME,$0-0
+       // Force SPWRITE. This function doesn't actually write SP,
+       // but it is called with a special calling convention where
+       // the caller doesn't save LR on stack but passes it as a
+       // register (R5), and the unwinder currently doesn't understand.
+       // Make it SPWRITE to stop unwinding. (See issue 54332)
+       MOVV    R3, R3
+
        MOVV    R0, REGCTXT
        JMP     runtime·morestack(SB)