-
Notifications
You must be signed in to change notification settings - Fork 18.8k
internal/runtime/gc/scan: fix calls for retpoline compatibility #77421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This PR (HEAD: aef3c28) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/741241. Important tips:
|
The assembler's retpoline pass for Spectre mitigations did not recognize several indirect CALL instructions, causing assembly failures with: # internal/runtime/gc/scan asm: non-retpoline-compatible: 00005 (/path_to_go/src/internal/runtime/gc/scan/scan_amd64.s:15) CALL (BX)(CX*8) asm: non-retpoline-compatible: 00015 (/path_to_go/src/internal/runtime/gc/scan/scan_amd64.s:28) CALL (BX)(CX*8) asm: assembly failed Adapt the calls in scan_amd64.s to allow the assembler to correctly apply retpolines and fix the build with Spectre mitigations enabled. Fixes golang#77420
The assembler's retpoline pass for Spectre mitigations did not recognize several indirect CALL instructions, causing assembly failures with: # internal/runtime/startlinetest asm: non-retpoline-compatible: 00005 (/path_to_go/src/internal/runtime/startlinetest/func_amd64.s:27) CALL (DX) asm: assembly failed Adapt the calls in func_amd64.s to allow the assembler to correctly apply retpolines and fix the build with Spectre mitigations enabled. Fixes golang#77420
aef3c28 to
8da87b0
Compare
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/741241. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/741241. |
|
This PR (HEAD: 8da87b0) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/741241. Important tips:
|
| LEAQ ·gcExpandersAVX512(SB), BX | ||
| CALL (BX)(CX*8) | ||
| MOVQ (BX)(CX*8), R11 | ||
| CALL R11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
93048 32459
The assembler's retpoline pass for Spectre mitigations did not recognize
several indirect CALL instructions, causing assembly failures with:
# internal/runtime/gc/scan
asm: non-retpoline-compatible: 00005 (/path_to_go/src/internal/runtime/gc/scan/scan_amd64.s:15) CALL (BX)(CX8)
asm: non-retpoline-compatible: 00015 (/path_to_go/src/internal/runtime/gc/scan/scan_amd64.s:28) CALL (BX)(CX8)
asm: assembly failed
# internal/runtime/startlinetest
asm: non-retpoline-compatible: 00005 (/path_to_go/src/internal/runtime/startlinetest/func_amd64.s:27) CALL (DX)
asm: assembly failed
Adapt the calls in func_amd64.s and scan_amd64.s to allow the assembler to
correctly apply retpolines and fix the build with Spectre mitigations
enabled.
I'm not certain about the syntax or the exact registers (e.g.
R11), butgo tool dist testpasses on target. There's probably a better approach.Commits are split in case this needs backporting, since paths are different
on <1.26.
Fixes #77420