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 64-bit LoongArch support #356
Conversation
I haven't had a chance to look through the patches yet; I'll likely get to them next week. The DCO check is failing because the commits don't have a |
Building upon what @drakenclimber already said, we have a CONTRIBUTING.md doc which describes the DCO and other important requirements for submitting patches to this project. |
The results of
The results of
Failed tests:
|
After updating the kernel, the tests passed:
The full logs are as follows: |
@yetist, just to be clear - are these results from running the tests on loongarch? |
Also, it doesn't appear that support for the LoongArch architecture has been accepted into Linus' tree yet, is this correct? While we are always happy to add new processor architectures to libseccomp, the architecture must first be present in the mainline Linux Kernel. |
Yes. |
Thank you for your reply, let's wait for the kernel. |
Thanks, @yetist. I briefly looked through these changes last week, and they looked good to me. Ping us once the LoongArch changes are in the kernel, and we can work on getting this into libseccomp. |
Rebased on top of current main branch; tests passed locally, but @yetist please confirm they're still up to date as of 2.5.4. |
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Just a note to myself, as of v5.18-rc4 LoongArch does not appear to be present in the upstream Linux Kernel. |
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 See: gentoo#25189 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 See: gentoo#25189 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 See: gentoo#25189 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
The LoongArch patch is generated by diffing the original release tarball with the dist tarball, made with the LoongArch support PR [1] applied. Tests have passed on amd64 and loong. [1]: seccomp/libseccomp#356 See: gentoo#25189 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Done. |
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.
Thanks for your hard work and patience, @yetist. Looks good to me.
Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
FYI - @yetist, there's still a small test failure in test 6:
|
Maybe |
The test result on the LoongArch machine:
|
Please review this PR again, thanks. |
The latest changes look good to me. Thanks for you patience, @yetist.
|
When will this patch be merged? |
My apologies, I have been very busy lately. I hope to get to this within the next week or two; I will update the comments when it it merged or if I have any additional comments/questions. Thank you for your patience. |
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 this looks pretty good, just two very minor questions - I think once we answer/resolve those this should be ready to merge.
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn> Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn> Signed-off-by: WANG Xuerui <git@xen0n.name>
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.
Hi @yetist, thanks for making those changes! I sat down this afternoon expecting to merge this PR and while running the tests on x86_64 I saw a couple of failures :( It looks like CI wasn't running on this PR so you wouldn't have noticed them if you've only been testing on LoongArch, but I believe that is fixed now so future changes should be tested via the CI.
If you can fixup these two failures (see my comments for how to fix them) I think we'll be all set. Thanks for your patience and persistence with this PR!
tests/06-sim-actions.tests
Outdated
@@ -12,7 +12,7 @@ test type: bpf-sim | |||
06-sim-actions all write 1 0x856B008 N N N N ERRNO(1) | |||
06-sim-actions all close 4 N N N N N TRAP | |||
06-sim-actions all openat 0 0x856B008 4 N N N TRACE(1234) | |||
06-sim-actions all fstat N N N N N N KILL_PROCESS | |||
06-sim-actions all fstatfs 4 0x856B008 N N N N KILL_PROCESS | |||
06-sim-actions all rt_sigreturn N N N N N N LOG | |||
06-sim-actions x86 0-2 N N N N N N KILL | |||
06-sim-actions x86 7-107 N N N N N N KILL |
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.
Previously the test used fstat
which has a syscall number of 108 on x86, hence the tests only go up to 107 on x86; with the test now using fstatfs
, which is 100 on x86` this test line needs to be updated.
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.
There is a similar issue below with x86_64 with fstat
being 108 and fstatfs
being 100.
[xen0n: LoongArch (and a few upcoming architectures / ABIs) does not have fstat, so the fstat in 06-sim-actions is also being changed to fstatfs for uniformity across the board.] Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn> Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
@yetist is busy today so I'm helping to fix the tests after talking to him. Tests now pass on both x86_64 and loongarch64:
Thank you all for all the work and reviews! |
Nice, thanks. |
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.
This looks good to me, thanks again everyone!
I've merged this into the main branch at 7179ff3, thanks for all the work and patience that went into this! |
LoongArch is a new instruction set of Loongson 3A5000 CPU, you can read the documents or visit the development community to get more infomation.
Now I porting the libseccomp to support loongarch64, please review, thanks.
The test results of
make check
: make-check-main.log