-
Notifications
You must be signed in to change notification settings - Fork 187
RFE: Add support for SPARC #471
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
|
The sparc patch looks reasonable at a quick glance. I'll try to dig up a sparc machine so that I can test it out :) |
|
On Aug 29, 2025, at 9:45 PM, Tom Hromatka ***@***.***> wrote:drakenclimber left a comment (seccomp/libseccomp#471)
The sparc patch looks reasonable at a quick glance. I'll try to dig up a sparc machine so that I can test it out :)Message ID: ***@***.***>
Thanks!There is gcc202 in the GCC Compile Farm which is currently offline but should be back online next week after hardware maintenance.
|
I found a Sparc box here within Oracle (not a surprise), but I need to put a newer Linux on it. I expect that to happen next week. If my box doesn't work out, I'll try out the gcc box. |
Ah, nice. Great that this is still possible ;-).
The GCC porterbox is expected to return to service tomorrow (crossing fingers). |
|
I have my sparc64 box up and running. I'm getting test failures on test 36 and 37 with this patchset. I'll try and look into it later this week. |
|
Thanks a lot! We're having delays with our SPARC T5, so I'm glad you got a machine yourself. FWIW, I think the Linux kernel on SPARC might need some additional fixes for seccomp. I'm looking into that as well. |
|
I found the bug that was causing tests 36 and 37 to fail. Definitely not what I expected :). Here's the fix for those test failures: |
|
For completeness, I'd recommend adding sparc and sparc64 to test 37: |
I agree. Test 52 is a test that loads a really simple seccomp filter in the kernel. It's failing in the |
Oh, wow. I would have never guessed that. I will fix that. Thanks so much for the thorough review! |
Do I just have to modify |
We'll need to modify |
Thank you so much! |
c418705 to
51a837a
Compare
|
Requested changes have been implemented. Please retry. |
drakenclimber
left a comment
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.
Unfortunately I wasn't able to successfully run the python tests. Either I screwed something up, or there are problems with the Python/Debian/Pip repos. I'm guessing the former :)
I'm still seeing a failure with test 52 (which loads the filter into the kernel). Seems like an issue with the sparc/seccomp kernel itself. I'll gladly help test/review kernel changes to get this working.
All in all, this looks good to me. I had a few small nitpicks, but they're easily fixed.
I think I'd prefer to wait to merge it until we get it fully working, but I'll defer to others here. Once we get it running, I'll add my Reviewed-by.
Thanks for the hard work, @glaubitz. It's always cool to see another architecture added :)
| #define __SNR_open_tree __PNR_open_tree | ||
| #endif | ||
|
|
||
| #define __SNR_open_tree_attr __PNR_open_tree_attr |
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 should this be:
#ifdef __NR_open_tree_attr
#define __SNR_open_tree_attr __NR_open_tree_attr
#else
#define __SNR_open_tree_attr __PNR_open_tree_attr
#endif
|
|
||
| #define __SNR_perf_event_open __NR_perf_event_open | ||
|
|
||
| #define __SNR_perfctr __PNR_perfctr |
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 should this be:
#ifdef __NR_perfctr
#define __SNR_perfctr __NR_perfctr
#else
#define __SNR_perfctr __PNR_perfctr
#endif
| #define __SNR_utimes __PNR_utimes | ||
| #endif | ||
|
|
||
| #define __SNR_utrap_install __PNR_utrap_install |
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 should this be:
#ifdef __NR_utrap_install
#define __SNR_utrap_install __NR_utrap_install
#else
#define __SNR_utrap_install __PNR_utrap_install
#endif
| # | ||
| function dump_sys_sparc() { | ||
| dump_from_syscall_tbl "$1/arch/sparc/kernel/syscalls/syscall.tbl" \ | ||
| nospu 32 |
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 don't believe that sparc uses nospu, correct? Thus, nospu should be removed.
| # | ||
| function dump_sys_sparc64() { | ||
| dump_from_syscall_tbl "$1/arch/sparc/kernel/syscalls/syscall.tbl" \ | ||
| nospu 64 |
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 don't believe that sparc64 uses nospu, correct? Thus, nospu should be removed.
I'm going to retest on Debian unstable sparc64 later this week.
We're currently working on fixing many issues in the Linux kernel running on SPARC. Oracle engineers actually made a lot of contributions here, but they stopped upstreaming these changes when they abandoned the project. The patches are part of the UEK 4/Update 7 kernel.
Sure, no problem.
Once SPARC support has been merged, Alpha will be the last unsupported platform and I'm sure we'll get that eventually added as well. ;-) |
Yeah ... oops! Does anyone want to submit a separate PR to fix that? |
What issue exactly do you mean? And I just realized you requested some additional changes. I will look into these in the weekend. FWIW, there is a Debian unstable machine running on a SPARC T5 LDOM in the GCC Compile Farm now available for testing (cfarm202.cfarm.net). I will ask for help to implement SECCOMP_FILTER on SPARC, I have filed an issue for it already. |
My apologies, I thought the |
This PR adds support for both 32-bit and 64-bit SPARC.
SPARC is one of the two remaining architectures, the other one being Alpha,
that is currently not supported by libseccomp. As the kernel already supports
SECCOMP on SPARC, we just have to add support to libseccomp.