From 160d7972607d5c630c7cfd1b4b54f7c27c3387b1 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Sat, 29 May 2021 04:06:56 +1000 Subject: [PATCH] runtime: correct mips64 asmcgocall signal stack behaviour Do not switch to the g0 stack if we're already running on the signal stack, otherwise all kind of fun ensues. Updates #36435 Change-Id: I57f35d75b9ee4f92b997713b4cdd38ce881705e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/334880 Trust: Joel Sing Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Cherry Mui --- src/runtime/asm_mips64x.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/asm_mips64x.s b/src/runtime/asm_mips64x.s index b2e2384c36..940a38a0d6 100644 --- a/src/runtime/asm_mips64x.s +++ b/src/runtime/asm_mips64x.s @@ -426,6 +426,8 @@ TEXT ·asmcgocall(SB),NOSPLIT,$0-20 // We get called to create new OS threads too, and those // come in on the m->g0 stack already. MOVV g_m(g), R5 + MOVV m_gsignal(R5), R6 + BEQ R6, g, g0 MOVV m_g0(R5), R6 BEQ R6, g, g0