From: Guoqi Chen Date: Fri, 4 Nov 2022 05:27:23 +0000 (+0800) Subject: runtime: mark morestack_noctxt SPWRITE for linux/loong64 X-Git-Tag: go1.21rc1~1279 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b5c8ae9816e705f2202242de9d570a33dabd3a0a;p=gostls13.git runtime: mark morestack_noctxt SPWRITE for linux/loong64 ref. CL 425396 Updates #54332. Change-Id: I1a235b0cca4dbf79cf61cf5f40b594fc2d940857 Reviewed-on: https://go-review.googlesource.com/c/go/+/446895 Reviewed-by: Cherry Mui Reviewed-by: WANG Xuerui Run-TryBot: Wayne Zuo TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Reviewed-by: xiaodong liu --- diff --git a/src/runtime/asm_loong64.s b/src/runtime/asm_loong64.s index 2513d2bb54..60641d0aee 100644 --- a/src/runtime/asm_loong64.s +++ b/src/runtime/asm_loong64.s @@ -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)