Use return with register for async preemption resumption on arm64.
This has the same behaviour as the current use of JMP, however
is permitted when Branch Target Identification is being enforced,
while a JMP with register is considered an indirect call and
requires a `BTI J` marker at the resumption address.
Updates #66054
Change-Id: I135ac577073467bedd9efd8df15b76c97dc08767
Reviewed-on: https://go-review.googlesource.com/c/go/+/646782
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
p("MOVD -8(RSP), R29") // restore frame pointer
p("MOVD (RSP), R27") // load PC to REGTMP
p("ADD $%d, RSP", l.stack+16) // pop frame (including the space pushed by sigctxt.pushCall)
- p("JMP (R27)")
+ p("RET (R27)")
}
func genMIPS(_64bit bool) {
MOVD -8(RSP), R29
MOVD (RSP), R27
ADD $512, RSP
- JMP (R27)
+ RET (R27)