-
Notifications
You must be signed in to change notification settings - Fork 177
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
Add support for RISC-V RV64 (64-bit, riscv64) #134
Conversation
Thanks @davidlt, please let me know when the kernel patches have been accepted and I'll take a closer look. |
I plan to send kernel patches later today (already working on it), but I don't expect feedback in coming days due to RISC-V Summit. I plan to enable audit (already in linux-next), seccomp and selinux (depends on audit) in Fedora 30/RISCV once rc6 happens (in few days). |
That's great, thanks. I'll look forward to hearing the kernel patches have been merged upstream. |
Hi @davidlt, I've pinged @palmer-dabbelt to check if the patches submitted by you on this series can be merged. Any other adjustments are required? |
Yes. One patch can be dropped (alternative version was applied), another patch is missing (kernel self test). Some adjusting due to various changes might be needed, but should be minor. |
I've successfully applied the patch below and build Kernel 5.1.0 to test SECCOMP functionality: ➜ uname -a All Kernel tests and Libseccomp tests passed:
|
I don't see this kernel patch in Linus' tree yet, do you expect it to go in via the next merge window? |
I plan to post v2 in few days. I am cooking a new Fedora/RISCV disk image with seccomp patch included for more testing. |
Just ran the tests on the Unleashed board with success:
|
Also ran the Kernel self tests on the Unleashed board:
|
I still don't see the kernel support in Linus' tree, can you update us on where that stands?
|
The patch adds support for riscv64 architecture. It was tested on Fedora/RISCV using 5.2-rc7 kernel. Tested on top of libseccomp commit: 2b406e3 SECCOMP patch is included in Fedora/RISCV starting 20190703.n.0: https://dl.fedoraproject.org/pub/alt/risc-v/disk-images/fedora/rawhide/20190703.n.0/Developer/ Kernel SECCOMP selftest is failing one test: [..] # [ RUN ] global.user_notification_signal # [ FAIL ] global.user_notification_signal [..] # [==========] 73 / 74 tests passed. # [ FAILED ] libseccomp test results: ./regression -T live Regression Test Summary tests run: 9 tests skipped: 0 tests passed: 9 tests failed: 0 tests errored: 0 ./regression Regression Test Summary tests run: 5200 tests skipped: 142 tests passed: 5200 tests failed: 0 tests errored: 0 Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Rebased to resolve conflicts with merge to master. Tested on Fedora/RISCV with 5.2-rc7 kernel. libseccomp testsuite passes all the test (see the commit message), but there is one (global.user_notification_signal) kernel self-test failing, which seems to be a new addition. Even with failing kernel self-test I plan to send out v2. |
Can someone please comment on the upstream Linux Kernel plans? That is the largest gating factor at this point, and until support hits Linus tree all the test reports/rebasing mean very little. |
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediatly if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Cc: keescook@chromium.org Cc: me@carlosedp.com Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Hey @pcmoore, the patch has been submitted to the riscv-linux list: http://lists.infradead.org/pipermail/linux-riscv/2019-August/006235.html |
Thanks @carlosedp and @davidlt for patch and the update. I don't see any comments yet, but it was only posted yesterday so I guess that isn't too surprising. Please let us know once this hits Linus' tree. |
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediately if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Cc: keescook@chromium.org Cc: me@carlosedp.com Tested-by: Carlos de Paula <me@carlosedp.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/linux-riscv/CAEn-LTp=ss0Dfv6J00=rCAy+N78U2AmhqJNjfqjr2FDpPYjxEQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-riscv/CAJr-aD=UnCN9E_mdVJ2H5nt=6juRSWikZnA5HxDLQxXLbsRz-w@mail.gmail.com/ [paul.walmsley@sifive.com: cleaned up Cc: lines; fixed spelling and checkpatch issues; updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediately if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Cc: keescook@chromium.org Cc: me@carlosedp.com Tested-by: Carlos de Paula <me@carlosedp.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/linux-riscv/CAEn-LTp=ss0Dfv6J00=rCAy+N78U2AmhqJNjfqjr2FDpPYjxEQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-riscv/CAJr-aD=UnCN9E_mdVJ2H5nt=6juRSWikZnA5HxDLQxXLbsRz-w@mail.gmail.com/ [paul.walmsley@sifive.com: cleaned up Cc: lines; fixed spelling and checkpatch issues; updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediately if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Cc: keescook@chromium.org Cc: me@carlosedp.com Tested-by: Carlos de Paula <me@carlosedp.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/linux-riscv/CAEn-LTp=ss0Dfv6J00=rCAy+N78U2AmhqJNjfqjr2FDpPYjxEQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-riscv/CAJr-aD=UnCN9E_mdVJ2H5nt=6juRSWikZnA5HxDLQxXLbsRz-w@mail.gmail.com/ [paul.walmsley@sifive.com: cleaned up Cc: lines; fixed spelling and checkpatch issues; updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Looking at the code in Linus tree right now I still don't see the required kernel support, and this PR is no longer passing the Travis builds so I think it is time to close this PR. Please remember that we are happy to add RISC-V support to libseccomp, but we won't do so until the kernel has the necessary support. Please use issue #110 to track libseccomp support for RISC-V. Thanks, everyone. |
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediately if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Cc: keescook@chromium.org Cc: me@carlosedp.com Tested-by: Carlos de Paula <me@carlosedp.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/linux-riscv/CAEn-LTp=ss0Dfv6J00=rCAy+N78U2AmhqJNjfqjr2FDpPYjxEQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-riscv/CAJr-aD=UnCN9E_mdVJ2H5nt=6juRSWikZnA5HxDLQxXLbsRz-w@mail.gmail.com/ [paul.walmsley@sifive.com: cleaned up Cc: lines; fixed spelling and checkpatch issues; updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediately if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Cc: keescook@chromium.org Cc: me@carlosedp.com Tested-by: Carlos de Paula <me@carlosedp.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/linux-riscv/CAEn-LTp=ss0Dfv6J00=rCAy+N78U2AmhqJNjfqjr2FDpPYjxEQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-riscv/CAJr-aD=UnCN9E_mdVJ2H5nt=6juRSWikZnA5HxDLQxXLbsRz-w@mail.gmail.com/ [paul.walmsley@sifive.com: cleaned up Cc: lines; fixed spelling and checkpatch issues; updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com> (cherry picked from commit 5340627) Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
This patch was extensively tested on Fedora/RISCV (applied by default on top of 5.2-rc7 kernel for <2 months). The patch was also tested with 5.3-rc on QEMU and SiFive Unleashed board. libseccomp (userspace) was rebased: seccomp/libseccomp#134 Fully passes libseccomp regression testing (simulation and live). There is one failing kernel selftest: global.user_notification_signal v1 -> v2: - return immediately if secure_computing(NULL) returns -1 - fixed whitespace issues - add missing seccomp.h - remove patch #2 (solved now) - add riscv to seccomp kernel selftest Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Cc: keescook@chromium.org Cc: me@carlosedp.com Tested-by: Carlos de Paula <me@carlosedp.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/linux-riscv/CAEn-LTp=ss0Dfv6J00=rCAy+N78U2AmhqJNjfqjr2FDpPYjxEQ@mail.gmail.com/ Link: https://lore.kernel.org/linux-riscv/CAJr-aD=UnCN9E_mdVJ2H5nt=6juRSWikZnA5HxDLQxXLbsRz-w@mail.gmail.com/ [paul.walmsley@sifive.com: cleaned up Cc: lines; fixed spelling and checkpatch issues; updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com> (cherry picked from commit 5340627) Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
The patch adds support for riscv64 architecture. It also enables
the following syscalls:
This was tested on Fedora 29/RISCV [0] using 4.19 kernel.
Tested on top of libseccomp commit:
1e64feb
Results for testing:
./regression -T live
Regression Test Summary
tests run: 8
tests skipped: 0
tests passed: 8
tests failed: 0
tests errored: 0
./regression
Regression Test Summary
tests run: 5129
tests skipped: 104
tests passed: 5129
tests failed: 0
tests errored: 0
I plan to post kernel side patches later this week.
[0] https://fedoraproject.org/wiki/Architectures/RISC-V
Signed-off-by: David Abdurachmanov david.abdurachmanov@gmail.com