aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_unix.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-10-26 22:54:28 -0400
committerCherry Zhang <cherryyz@google.com>2019-11-07 20:59:14 +0000
commita930fede7386fd3583553b523fd6f7fa5fef1244 (patch)
tree73081ff2104bd49d8b6cfed4e54f57d08c533d92 /src/runtime/signal_unix.go
parenta120cc8b365be33d3f82bbf8b79584e0e3439b9b (diff)
downloadgo-a930fede7386fd3583553b523fd6f7fa5fef1244.tar.gz
go-a930fede7386fd3583553b523fd6f7fa5fef1244.zip
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>
Diffstat (limited to 'src/runtime/signal_unix.go')
-rw-r--r--src/runtime/signal_unix.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go
index fab8574d1c..35e641286b 100644
--- a/src/runtime/signal_unix.go
+++ b/src/runtime/signal_unix.go
@@ -326,7 +326,7 @@ func sigpipe() {
func doSigPreempt(gp *g, ctxt *sigctxt) {
// Check if this G wants to be preempted and is safe to
// preempt.
- if wantAsyncPreempt(gp) && isAsyncSafePoint(gp, ctxt.sigpc(), ctxt.sigsp()) {
+ if wantAsyncPreempt(gp) && isAsyncSafePoint(gp, ctxt.sigpc(), ctxt.sigsp(), ctxt.siglr()) {
// Inject a call to asyncPreempt.
ctxt.pushCall(funcPC(asyncPreempt))
}