-
Notifications
You must be signed in to change notification settings - Fork 172
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
RFE: add RISC-V 32-bit arch support #327
base: main
Are you sure you want to change the base?
Conversation
69a12c4
to
ee4aba3
Compare
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.
I think the changes look really good. Thanks, @kraj.
It looks like we forgot to update this list in arch-syscall-validate when we added RISCV64. (Github won't let me comment on lines that haven't been modified.) We should update it with both RISCV64 and RISCV32.
I don't have access to a RISCV32 box, and obviously our continuous integration isn't setup to run it either. Do the following commands pass on RISCV32:
# ./configure --enable-python
# make check
# (cd tests; ./regression -T live)
Here is summary on qemu Regression Test Summary Failed tests There is a batch of tests which errored with same message like
Does this look ok ? I am no way expert in libseccomp but if you give some hints on fixing these tests I can try |
I also ran tests on my pc and it came all passing
|
Thanks!
This failure doesn't surprise me. The syscall numbers won't align between RISC-V 32 and x86_64, so that's likely the culprit.
This failure is more interesting, but I would be fine with ignoring it for this patchset. (Adding a github issue might be a good idea, though). The first check of test 53 expects a return code of ERRNO(0) - which now that I think about it doesn't really make sense. Looks like RISC-V 32 got EFAULT instead.
This error could be the most concerning. Does RISC-V 32 multiplex its IPC and/or socket syscalls? See here and here for other architecture examples. You may need to look through the RISC-V kernel code to truly verify.
Yes, we're definitely getting closer. Could you please look into the IPC issue? I'll try to create a RISC-V 32 qemu VM. I would prefer to resolve these issues if they aren't too difficult - famous last words :) Thanks for your help! |
@kraj - I was able to run the automated libseccomp tests on a RISC-V 64-bit Fedora qemu image. They all passed :) I half-heartedly looked around for a 32-bit RISC-V Linux image (from any distro) but didn't find one. What are you running? |
One quick comment, please change the subject line on commit ee4aba3; something like "syscalls: update the syscall defs for Linux v5.13-rc5" or similar. We try very hard to stick to the "<subject_area>:<brief_description>" format. Thanks. |
done |
I am using yocto to build 32bit qemu image. I can upload one for you if you like |
@kraj - That would be awesome. Thanks! |
@drakenclimber I have uploaded needed artifacts into https://uclibc.org/~kraj/qemuriscv32/ |
I'm not sure what's going wrong with my RISC-V 32 qemu setup. (RISC-V 64 worked fine for me.) It's hanging between the hardware output and the first dmesg line from the kernel. I've tried rebuilding a couple different versions of qemu and a couple different kernels. I'll try and revisit it next week sometime. |
I build qemu also using yocto, but this should have worked with system qemu too from your distro ( fedora/debian) If needed |
Getting closer. I switched over to using your kernel. (In fact I'm using all of the files you provided verbatim.) Now it's puking on my rootfs:
|
Got it booting after a resize2fs :)
|
Thanks for all the help, @kraj. I have my RISC-V 32 qemu image up and running. I found a couple issues with the patchset, but there's still more work to do. (I need to switch gears and work on a couple issues for the v2.5.2 release of libseccomp.) The Here are a couple changes I made that helped the tests get further. YMMV. Let me know if you have any questions
|
@kraj can you please take a look at the comments - 2.5.2 is now out, and the patches that are carried in Yocto for 2.5.1 are difficult to forward-port. So we can't update. |
let me do the update for that package. |
85b092b
to
d59e03b
Compare
Thanks, @kraj. I think you're making good progress. The tests passed on libseccomp's (x86_64) CI, and I ran them on an arm VM where they also passed. I encountered several errors on RISC-V 32, though:
The failures were largely in socket, IPC, and the binary tree logic. How does RISC-V 32 handle multiplexing of sockets/IPC? Finally, combining the update to Linux v5.15.0-rc3 and the addition of RISC-V 32 into one commit may cause maintenance issues. If we bisect a problem down to that commit, is it because of the kernel change or the RISC change? |
@kraj can you please rebase and fix the conflicts again, so we can update to 2.5.3? Would be good to get this merged as well. |
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. (From OE-Core rev: 77b161f334310c66402a8bba9c459e5d5820cdd7) Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. (From OE-Core rev: 77b161f334310c66402a8bba9c459e5d5820cdd7) Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. (From OE-Core rev: 77b161f334310c66402a8bba9c459e5d5820cdd7) Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Support for rv32 was upstreamed into 5.4+ kernel Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Include RISCV32 arch as well Signed-off-by: Khem Raj <[email protected]>
ead77da
to
0637247
Compare
@drakenclimber rebased again. I will test again on riscv32 and try to dig into reasons for failures you saw. |
libseccomp support is not yet upstreamed. see seccomp/libseccomp#327 Signed-off-by: Khem Raj <[email protected]>
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. (From OE-Core rev: 0374850b8abeecd3721215713481d9a802a19f46) Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
libseccomp support is not yet upstreamed. see seccomp/libseccomp#327 Signed-off-by: Khem Raj <[email protected]>
Thanks, @kraj. I have my riscv32 VM up and running again. I'll check out the changes this week. |
I ran the automated tests on my riscv32 VM. (Out of expediency, I didn't enable python for this test run.)
Looks like there were failures in the binary tree, IPC, and socket-related tests. |
From what I can see this PR has some test failures, but no follow up with fixes; any updates @kraj? |
yeah I had to shift my focus on other things, I can revive this again perhaps next week or so. |
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. (From OE-Core rev: 0374850b8abeecd3721215713481d9a802a19f46) Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Drop all patches from MR seccomp/libseccomp#327 as it has stalled, and rebasing them is non-trivial. Please land the changes upstream first. Drop 0001-configure.ac-Bump-version-to-2.5.99.patch as upstream has addressed the issue. (From OE-Core rev: 0374850b8abeecd3721215713481d9a802a19f46) Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
Update syscall.csv to reflect rv32 arch and use latest 5.13-rc5 kernel for that