]> Cypherpunks repositories - gostls13.git/commit
runtime: add async preemption support on MIPS and MIPS64
authorCherry Zhang <cherryyz@google.com>
Sun, 27 Oct 2019 02:54:28 +0000 (22:54 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 7 Nov 2019 20:59:14 +0000 (20:59 +0000)
commita930fede7386fd3583553b523fd6f7fa5fef1244
tree73081ff2104bd49d8b6cfed4e54f57d08c533d92
parenta120cc8b365be33d3f82bbf8b79584e0e3439b9b
runtime: add async preemption support on MIPS and MIPS64

This CL adds support of call injection and async preemption on
MIPS and MIPS64.

Like ARM64, we need to clobber one register (REGTMP) for
returning from the injected call. Previous CLs have marked code
sequences that use REGTMP async-nonpreemtible.

It seems on MIPS/MIPS64, a CALL instruction is not "atomic" (!).
If a signal is delivered right at the CALL instruction, we may
see an updated LR with a not-yet-updated PC. In some cases this
may lead to failed stack unwinding. Don't preempt in this case.

Change-Id: I99437b2d05869ded5c0c8cb55265dbfc933aedab
Reviewed-on: https://go-review.googlesource.com/c/go/+/203720
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/MIPS64Ops.go
src/cmd/compile/internal/ssa/gen/MIPSOps.go
src/runtime/mkpreempt.go
src/runtime/preempt.go
src/runtime/preempt_mips64x.s
src/runtime/preempt_mipsx.s
src/runtime/signal_mips64x.go
src/runtime/signal_mipsx.go
src/runtime/signal_unix.go