1
0
mirror of https://github.com/golang/go synced 2024-11-23 10:30:03 -07:00

syscall: call ABI0 exitsyscall on Plan 9/AMD64

CL 376356 changes syscall.Syscall to call ABIInternal entersyscall
and exitsyscall. As mentioned in the CL description, it is
important to call entersyscall without ABI wrapper, but it is not
important to call exitsyscall this way. In fact, it is actually
problematic -- on Plan 9, syscall may clobber our fixed G register,
and we did not restore it. This CL changes it back to ABI0
exitsyscall, which will restore the G register through the wrapper.

Should fix Plan 9/AMD64 build.

Change-Id: I1f03d553f03e7b9f36d64686f20f2b2df0a0bf79
Reviewed-on: https://go-review.googlesource.com/c/go/+/393494
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Cherry Mui 2022-03-16 19:21:49 -04:00
parent 1cfe1007cd
commit 66865363f0

View File

@ -38,7 +38,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64
MOVQ $128, sysargs1-152(SP)
MOVQ $SYS_ERRSTR, BP
SYSCALL
CALL runtime·exitsyscall<ABIInternal>(SB)
CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
MOVQ sysargs-160(SP), AX
MOVQ AX, errbuf-168(SP)
CALL runtime·gostring(SB)
@ -46,7 +46,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64
JMP copyresult3
ok3:
CALL runtime·exitsyscall<ABIInternal>(SB)
CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
LEAQ ·emptystring(SB), SI
copyresult3:
@ -83,7 +83,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$168-88
MOVQ $128, sysargs1-152(SP)
MOVQ $SYS_ERRSTR, BP
SYSCALL
CALL runtime·exitsyscall<ABIInternal>(SB)
CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
MOVQ sysargs-160(SP), AX
MOVQ AX, errbuf-168(SP)
CALL runtime·gostring(SB)
@ -91,7 +91,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$168-88
JMP copyresult4
ok4:
CALL runtime·exitsyscall<ABIInternal>(SB)
CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
LEAQ ·emptystring(SB), SI
copyresult4: