]> Cypherpunks repositories - gostls13.git/commit
runtime: don't restore from g0.sched in systemstack on arm64
authorMichael Pratt <mpratt@google.com>
Wed, 30 Apr 2025 19:14:50 +0000 (15:14 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 2 May 2025 20:30:24 +0000 (13:30 -0700)
commit739fb752e3d546034b96d8cc9f2fded613040c98
treeab4fdb4be7455b2cad6c9e2f1d41ab148d6f7c5f
parent9c1d19a183e89be6cf18168addccc0d24551bb71
runtime: don't restore from g0.sched in systemstack on arm64

On arm64, systemstack restores the frame pointer from g0.sched to R29
prior to calling the callback. That doesn't really make any sense. The
frame pointer value in g0.sched is some arbitrary BP from a prior
context save, but that is not the caller of systemstack.

amd64 does not do this. In fact, it leaves BP completely unmodified so
frame pointer unwinders like gdb can walk through the systemstack frame
and continue traceback on the caller's stack. Unlike mcall, systemstack
always returns to the original goroutine, so that is safe.

We should do the same on arm64.

For #63630.

Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64-longtest
Change-Id: I6a6a636c35d321dd5d7dc1c4d09e29b55b1ab621
Reviewed-on: https://go-review.googlesource.com/c/go/+/669236
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Nick Ripley <nick.ripley@datadoghq.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/asm_arm64.s