mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
a120cc8b36
commit
a930fede73
9 changed files with 370 additions and 12 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue