-
Notifications
You must be signed in to change notification settings - Fork 12
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
Upstreaming plans #5
Comments
I've got feedback: this is awesome news and I really appreciate the work you're doing on this. Thanks Drew! |
@michaelforney got anything you want included? |
My patches from when I looked at this are available here: Based on what you've already integrated into the Regarding soft-float, I think you'll need:
Alternatively, maybe you can sidestep these issues for now and simply fail at configure if diff --git a/configure b/configure
index 4d3d8b44..0adec994 100755
--- a/configure
+++ b/configure
@@ -644,7 +644,7 @@ fi
if test "$ARCH" = "riscv" || test "$ARCH" = "riscv64" ; then
trycppif "RISCVEB || _RISCVEB || __RISCVEB || __RISCVEB__" "$t" && SUBARCH=${SUBARCH}eb
-trycppif __riscv_soft_float "$t" && SUBARCH=${SUBARCH}-sf
+trycppif __riscv_float_abi_soft "$t" && fail "$0: error: soft-float not supported on riscv"
fi
if test "$ARCH" = "sh" ; then |
Thanks for clarifying!
Up to you if you want to have this included in the first upstream patch. We can explain the unknowns in the patch comments and do a code review on the list if you'd like, or we can skip it and integrate soft float separately. |
Also, I'm not sure if the merged fix for the
Either way is fine with me. Whatever you think is easier. |
Looking at glibc's setjmp (https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/setjmp.S;h=38a93b78e88ec13535934394e1302a7ddbc12e8d;hb=HEAD#l46), I see they also use So maybe just integrate those three soft-float patches, and then if any issues come up on the list, you can resubmit with the change to fail at configure. |
Will investigate.
Sounds good 😄 |
I think it's best to hold off on rv32 until we have glibc upstream and the kernel ABI sorted out. |
I don't intend to include rv32. |
I think ima / imac support would be very useful. Could we please merge michaelforney's patches in so that we can test them ? |
It would be good to have a "staging-experimental" branch with the @michaelforney patches. |
That seems more complicated than it ought to be. |
Blocker: fixing #1 properly Also, update: I should have time to put a bow on this next week. |
Regarding If riscv ABI has anything like that, you may need to do the same. Otherwise (if float regs are only call-saved on hardfloat ABI), then checking |
Here's what the psABI says:
I think this means that they do not need to be saved on the soft-float ABI. |
Yes. The "width 0" interpretation needed to get there is a little bit confusing and unclear whether it's intentional, but with the text following "therefore", I think it's very clear. Thanks for finding that. |
The "FLEN=0" concept is used in a handful of places, so I think that's why it was mentioned so quickly there. GCC generates code with the expected behavior
|
Sorry for the delay, I've been busier than I thought. I've made the following changes to staging branch:
I've created a new develop branch based on this, to give people a space to work on riscv32. My plan is:
I think we have two outstanding issues that block upstreaming:
My plan is to shepard fixes for these issues into the staging and develop branches, then spend some time testing the staging branch and awaiting feedback from those interested. Then we can rebase this into one patch to present upstream, hopefully in time for musl 1.1.23. |
How is this one going? The Haiku folks would love to switch to musl from their hacked together glibc. Since i've been working on the riscv64 port, this is an important repo :-) |
Those two oustanding issues remain outstanding. |
Oh? I thought #7 was done per the comments in it? |
Whoops, you're right. So it's just #6 afaik |
Ah, so waiting on the Barrier fixes @sorear mentioned?
|
Patch sent upstream |
I'm still unclear on what the "barrier issue" is, but as noted in my reply to the patch on-list, I think atomic_arch.h is currently broken (not providing working atomics). There are a few other small issues/questions I have there, but mostly this looks good, and I now have a toolchain for testing. |
Thanks for the feedback, Rich! I'll have time to update the patch per your feedback next week. |
Ping. I would really like to have some interaction in terms of replies to review rather than just a week of radio silence then a new patch that might or might not address the important concerns. I think we're really close here, but I've had that impression several times before then things just went silent. Let's get this upstream this time. |
Sorry Rich, I thought I had mentioned that I was about to travel and would be picking this back up once I returned. My plan is to address your feedback in a new patch on Monday. |
No problem. Somehow I misinterpreted "next week" (at the time of the above comment) as the week that just passed. |
Any update on upstreaming status? |
It's upstream! |
This issue could probably be closed since it seems to be scoped to 64-bit, but riscv32 upstreaming still remains open and I think would be appropriate to do now. Basically all the the prerequisites are done due to time64 work. Adding SYS_waitid backend where SYS_wait4 is not supported is probably the only missing ingredient. Of course the kernel folks haven't made it clear whether we can expect syscall ABI to be stable, but it looks like the only way it's going to get declared stable is to have a libc using it, and glibc is moving slowly on this. |
Hi All, Is there any plan for the upstreaming of riscv32? |
Someone needs to take the lead on it. Why not you? |
I'd like it to happen in this release cycle if at all possible. Kernel seems stabilized now. I don't think there's much left to do. Some refactoring needed to match upstream musl now and corresponding fixes made in rv64 upstream. Probably a few places we need to #ifdef out use of syscalls rv32 doesn't have in fallback code paths. |
I'm willing to spend time on this but I'm not sure how to test it, partly on musl's end but mostly due to unclarity about what interfaces the kernel intends to make stable. |
Talk on the glibc side is that 5.4 will be their minimum kernel version so I think everything that was in 5.4 is "stable". |
I'm willing to spend some time. if kernel 5.4 is stable, so what we need to do is upstream musl now and corresponding fixes made in rv64 upstream? or there will still be need to #ifdef out some rv32 syscalls. |
I'm not sure but I'm happy to review a proposal. |
For glibc we're saying 5.4 because it's a long-term stable release, but IIRC the last actual ABI change we had landed in 5.0 -- specifically d4c08b9776b3 ("riscv: Use latest system call ABI"). I doubt anyone is going to look closely, though. I'm not sure when the rv32 musl port was last updated, but it's possible that nothing actually ended up changing. |
If my memory serves you can't implement POSIX semantics on the riscv32 linux 5.3 because waitpid(0) was removed from the kernel before waitid(P_PGID, 0) support was added. |
I have a musl patch that's close to working, I will send it out for review at some point soon. |
Great. One thing I plan to do when reviewing it is diff all files against corresponding riscv64 files and make sure the differences look like what I'd expect, so that might be a useful check for you to do too. |
That may not be terribly informative since I did this by copying all the riscv64 files and changing everything that was observably bitsize dependent. |
OK, thanks for telling me. That actually serves as a good point of confidence in what you've done, since I was worried there might be rv32 bitrot or things we fixed in discussion of rv64 that weren't carried over to rv32. It might make sense to actually do the opposite with your new patch - diffing it against the old rv32 proposal to see what changed by virtue of redoing it off rv64 as the base. |
https://www.openwall.com/lists/musl/2020/09/03/2 all interested parties please follow there |
Are you still using musl with rv32? |
I've just crossed off my last TODO by adding a VDSO implementation for #4. I intend to leave it open for feedback for a week or two from any interested parties, then I'm going to prepare a patch for musl upstream. My plan is to only include
riscv64
in this patch.I've ported a substantial subset of Alpine Linux to riscv64 based on this work, and I'm fairly confident in the quality of the patch.
If anyone has any objections or feedback before then, please let me know!
The text was updated successfully, but these errors were encountered: