Skip to content
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 loong64 support for seccomp #1187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zhaixiaojuan
Copy link

The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style.

Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html

@@ -726,6 +726,7 @@ The following parameters can be specified to set up seccomp:
* `SCMP_ARCH_PARISC`
* `SCMP_ARCH_PARISC64`
* `SCMP_ARCH_RISCV64`
* `SCMP_ARCH_LOONGARCH64`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L708: A valid list of constants as of libseccomp v2.5.0 is shown below.

This has to be updated to v2.6.0 (and we have to wait for v2.6.0 to be released)

@AkihiroSuda AkihiroSuda added this to the v1.2.0 milestone Mar 14, 2023
@@ -692,6 +692,7 @@ const (
ArchPARISC Arch = "SCMP_ARCH_PARISC"
ArchPARISC64 Arch = "SCMP_ARCH_PARISC64"
ArchRISCV64 Arch = "SCMP_ARCH_RISCV64"
ArchLOONG64 Arch = "SCMP_ARCH_LOONGARCH64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ArchLOONG64 Arch = "SCMP_ARCH_LOONGARCH64"
ArchLOONGARCH64 Arch = "SCMP_ARCH_LOONGARCH64"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi AkihiroSuda,
ArchLOONG64 is used here, because the GOARCH name corresponding to the LoongArch64 architecture in golang is loong64.
The support for loong64 will also be integrated into libseccomp-go, and the corresponding PR is: seccomp/libseccomp-golang#106
I understand that it should be a better solution to keep the name of Arch consistent in these two projects.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name here must correspond to the seccomp arch name, not the GOARCH name.
See ArchX86_64 vs amd64, ArchAARCH64 vs arm64.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name here must correspond to the seccomp arch name, not the GOARCH name. See ArchX86_64 vs amd64, ArchAARCH64 vs arm64.

Thanks

Signed-off-by: zhaixiaojuan <zhaixiaojuan@loongson.cn>
@AkihiroSuda
Copy link
Member

@AkihiroSuda any update? 😘

#1187 (comment)

@zhaixiaojuan
Copy link
Author

libseccomp v2.6.0 does not appear to be released yet

@AkihiroSuda
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants