-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: add async preemption support on riscv64 #38146
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
Conversation
This PR (HEAD: 08ba718) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/226206 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: 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/226206. |
Message from Joel Sing: Patch Set 1: (6 comments) Thanks for working on this - a quick first pass. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
This PR (HEAD: 788ef99) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/226206 to see it. Tip: You can toggle comments from me using the |
Message from Quey-Liang Kao: Patch Set 1: (6 comments)
Thanks! BTW I have two newbie questions:
Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Cherry Zhang: Patch Set 2: Run-TryBot+1 (3 comments) Thanks for doing this. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Gobot Gobot: Patch Set 2: TryBots beginning. Status page: https://farmer.golang.org/try?commit=8e0c462d Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Cherry Zhang: Patch Set 2:
This is mostly documented at https://godoc.org/golang.org/x/review/git-codereview#hdr-Multiple_Commit_Work_Branches Basically, git codereview change If you need to rebase or adjust commits, you may find "git codereview sync" and "git codereview rebase-work" useful. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Cherry Zhang: Patch Set 2:
I'm not familiar with GitHub and Pull Request enough to answer this. In the end, if nothing works, you can just discard this and send a new CL or PR. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Cherry Zhang: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Gobot Gobot: Patch Set 2: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Quey-Liang Kao: Patch Set 2: (4 comments)
Thanks for applying trybot. I myself run the test on Fedora/riscv on qemu, with As a side note, on the same environment, I found that
Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
This PR (HEAD: 03a06c4) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/226206 to see it. Tip: You can toggle comments from me using the |
Message from Joel Sing: Patch Set 3: (4 comments)
The current diff fails for me during build - I don't have the panic handy, but can provide it later if need be.
The linux/riscv64 port is stable and ./all.bash passes (aside from one recently broken cmd/compile test) - I've done riscv64 work under qemu in the past, but I'm currently running fedora on a SiFive HiFive Unleashed board. You'll want to check that the version of qemu is fairly current, as there was an atomics issue that was present (and is now fixed upstream). I've also heard of other issues that people have seen with more recent guest kernels. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Joel Sing: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
For async preemption, we will be using REGTMP as a temporary register in injected call on riscv64, which will clobber it. So mark all codes that use REGTMP. Change-Id: I4e32377427cb0f7360b3a91ed9e8b0224599a872
The preprocess function calculates Spadj for each Prog purely based on the stacksize of the function, which ignores frameless calls. However, if some frameless assembly function moves sp, the offset will not be recorded correctly in pcln table, and thus it fails when executing anything involving backtrace. This is essential for async preempt support, because the injected call asyncPreempt performs context save/restore on the stack. It cannot survive a runtime.GC() without correct sp information. Change-Id: If5e3d9d57810b4fcdb538bda26848e088654ff80
This CL adds support of call injection and async preemption on riscv64. We also clobbered REG_TMP for the injected call. Unsafe points related to REG_TMP access have been marked in previous commits. Fixes #36711. Change-Id: I69d7f2ac5fde2279f62046725adbac69f98dd9ab
Message from Quey-Liang Kao: Patch Set 3: (4 comments)
Thanks for the hint. I can now bootstrap native go toolchain on qemu upstream. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
This PR (HEAD: f6110d4) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/226206 to see it. Tip: You can toggle comments from me using the |
Message from Cherry Zhang: Patch Set 4: Run-TryBot+1 Code-Review+1 (1 comment) LGTM. If Joel could confirm that it passes all.bash, I think it is good to go. Thanks! Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Gobot Gobot: Patch Set 4: TryBots beginning. Status page: https://farmer.golang.org/try?commit=03e36b95 Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Gobot Gobot: Patch Set 4: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
Message from Joel Sing: Patch Set 4: Code-Review+2
Confirmed all.bash passes successfully. Please don’t reply on this GitHub thread. Visit golang.org/cl/226206. |
This CL adds support of call injection and async preemption on riscv64. We also clobbered REG_TMP for the injected call. Unsafe points related to REG_TMP access have been marked in previous commits. Fixes #36711. Change-Id: I1a1df5b7fc23eaafc34a6a6448fcc3c91054496e GitHub-Last-Rev: f6110d4 GitHub-Pull-Request: #38146 Reviewed-on: https://go-review.googlesource.com/c/go/+/226206 Reviewed-by: Cherry Zhang <[email protected]> Reviewed-by: Joel Sing <[email protected]> Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
This PR is being closed because golang.org/cl/226206 has been merged. |
This CL adds support of call injection and async preemption on
riscv64. We also clobbered REG_TMP for the injected call. Unsafe
points related to REG_TMP access have been marked in previous commits.
Fixes #36711.