Commit 995ade86 authored by Cherry Zhang's avatar Cherry Zhang

runtime: enable async preemption on darwin/arm64

The problem should be fixed by the previous CL. Reenable async
preemption on darwin/arm64.

Updates #35439.

Change-Id: I93e8c4702b4d8fe6abaa6fc9c27def5c8aed1b59
Reviewed-on: https://go-review.googlesource.com/c/go/+/206419Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 13fb147e
...@@ -342,6 +342,12 @@ func genARM64() { ...@@ -342,6 +342,12 @@ func genARM64() {
p("MOVD R29, -8(RSP)") // save frame pointer (only used on Linux) p("MOVD R29, -8(RSP)") // save frame pointer (only used on Linux)
p("SUB $8, RSP, R29") // set up new frame pointer p("SUB $8, RSP, R29") // set up new frame pointer
p("#endif") p("#endif")
// On darwin, save the LR again after decrementing SP. We run the
// signal handler on the G stack (as it doesn't support SA_ONSTACK),
// so any writes below SP may be clobbered.
p("#ifdef GOOS_darwin")
p("MOVD R30, (RSP)")
p("#endif")
l.save() l.save()
p("CALL ·asyncPreempt2(SB)") p("CALL ·asyncPreempt2(SB)")
......
...@@ -10,6 +10,9 @@ TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0 ...@@ -10,6 +10,9 @@ TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
MOVD R29, -8(RSP) MOVD R29, -8(RSP)
SUB $8, RSP, R29 SUB $8, RSP, R29
#endif #endif
#ifdef GOOS_darwin
MOVD R30, (RSP)
#endif
MOVD R0, 8(RSP) MOVD R0, 8(RSP)
MOVD R1, 16(RSP) MOVD R1, 16(RSP)
MOVD R2, 24(RSP) MOVD R2, 24(RSP)
......
...@@ -79,9 +79,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) { ...@@ -79,9 +79,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
c.set_pc(uint64(funcPC(sigpanic))) c.set_pc(uint64(funcPC(sigpanic)))
} }
// TODO(issue 35439): enabling async preemption causes failures on darwin/arm64. const pushCallSupported = true
// Disable for now.
const pushCallSupported = GOOS != "darwin"
func (c *sigctxt) pushCall(targetPC uintptr) { func (c *sigctxt) pushCall(targetPC uintptr) {
// Push the LR to stack, as we'll clobber it in order to // Push the LR to stack, as we'll clobber it in order to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment