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 support for static syscalls #296

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

alessandrod
Copy link

This adds support for static, relocation-less syscalls using the same mechanism as upstream BPF:

  • CALL_IMMs with src=0 are considered syscalls, where the .imm field is the
    murmur32 hash of the syscall name
  • CALL_IMMs with src=1 are considered bpf-to-bpf calls

See also solana-labs/solana#24188

@alessandrod
Copy link
Author

Note that currently this change does not disable old relocation based syscalls. Should we disable them when config.static_syscalls=true or do it separately?

src/vm.rs Show resolved Hide resolved
src/vm.rs Outdated Show resolved Hide resolved
@Lichtso
Copy link

Lichtso commented Apr 21, 2022

This PR only separates BPF functions and syscalls, but changes nothing about the address space and immediate values, right?

@alessandrod
Copy link
Author

This PR only separates BPF functions and syscalls, but changes nothing about the address space and immediate values, right?

Correct, this is meant to be 100% backward compatible

This adds support for static, relocation-less syscalls using the same mechanism
as upstream BPF:

- CALL_IMMs with src=0 are considered syscalls, where the .imm field is the
  murmur32 hash of the syscall name
- CALL_IMMs with src=1 are considered bpf-to-bpf calls
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