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

Implement for aarch64 #13

Closed
wants to merge 1 commit into from
Closed

Implement for aarch64 #13

wants to merge 1 commit into from

Conversation

Kijewski
Copy link
Contributor

This PR is based on #7 by Aaron Dewes.

I did not test the PR, because I don't have any aarch64 machines. It compiles, though.

This PR is based on <#7>
by [Aaron Dewes](mailto:aaron.dewes@protonmail.com).
@Kijewski
Copy link
Contributor Author

Ping @AaronDewes.

@boustrophedon
Copy link
Owner

Hi, I somehow didn't see this when you posted it - my bad!

I can take a closer look this week but I'm still not sure what the best way to achieve multi-arch support is.

If we separate arm and x86 entirely, the issue is duplication of work and having to add syscalls in all places when a new one is added, and the possibility of missing ones. I don't think Aaron's solution of just copying all the code wholesale is correct, but I'm wondering if it's closer than just smushing everything all together in one place.

@boustrophedon
Copy link
Owner

I wonder if the best way to do this would be to wrap the syscalls that are different on different arches internally and just have it "expand" to the correct syscall somehow. e.g. something that would take "OurSysno::eventfd" and return both "eventfd" and "eventfd2" on amd64 but only eventfd2 on arm64.

That's essentially what's happening in this PR, but the issue is that if a user wants to implement their own RuleSet, they have to also support all architectures themselves.

I think if someone wants to use extrasafe on arm, this PR is probably the best intermediate solution, but I'm not sure that I want to accept it without being able to have it run in CI. It looks like we'd have to set up our own arm github runner because github hasn't made arm runners available yet actions/runner-images#5631

@Kijewski
Copy link
Contributor Author

It's not possible to run the code on another platform than amd64, but you can cross compile it for an ARM target: cargo build --lib --target aarch64-unknown-linux-gnu. This way you can be sure that it compiles, but not whether it actually works.

@boustrophedon
Copy link
Owner

It's not possible to run the code on another platform than amd64

Why do you say this? Presumably I could create an Azure or AWS arm instance and run the code there. What else would prevent it from running?

@Kijewski
Copy link
Contributor Author

It was kinda implied that I meant with the standard actions github gives you. I only meant to answer that it was maybe not important to run the code on another platform, and simply compiling it might be enough.

@Kijewski Kijewski closed this Jul 15, 2023
@Kijewski Kijewski deleted the pr-aarch64 branch July 15, 2023 01:55
@boustrophedon
Copy link
Owner

I think it's fine to leave this open until github supports ARM or we set up a separate arm runner for this repo. I don't think it would be that much work but I'm not sure.

Also, I didn't say it earlier but thank you for working on this in the first place!

@AaronDewes
Copy link

It was kinda implied that I meant with the standard actions github gives you. I only meant to answer that it was maybe not important to run the code on another platform, and simply compiling it might be enough.

It is possible with QEMU (but that is slow).

@boustrophedon
Copy link
Owner

I wonder if it would be possible to do faster using a firecracker VM - I took a quick look and it seems like it will at least run aarch64 guests.

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.

None yet

3 participants