-
Notifications
You must be signed in to change notification settings - Fork 175
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
Unify BPF verifiers #177
Unify BPF verifiers #177
Conversation
5e3efaf
to
5b97b3f
Compare
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.
Lets talk about these changes first, some changes in the RBPF repo might be useful and should make it to the mono repo. Or even better, let the mono repo just use this verifier with only the absolutely necessary changes applied.
@@ -258,7 +253,7 @@ pub fn check(prog: &[u8]) -> Result<(), UserError> { | |||
ebpf::ADD64_REG => {}, | |||
ebpf::SUB64_IMM => {}, | |||
ebpf::SUB64_REG => {}, | |||
ebpf::MUL64_IMM => {}, | |||
ebpf::MUL64_IMM => { check_imm_nonzero(&insn, insn_ptr)?; }, |
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.
Semantic difference
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.
Yes, stale in rbpf
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.
Actually, this was removed here but not in the mono repo I think.
And I would carry the removal forward as MUL32_IMM
also has no such limit.
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.
Great, I'll take a look if we can remove it from the monorepo
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.
We should remove from the monorepo in s separate PR, probably with featurization, tracking here: solana-labs/solana#17520
5b97b3f
to
014ce37
Compare
014ce37
to
38927bd
Compare
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.
What about the changes related to clippy::upper_case_acronyms
?
And this added space here:
Line 62 in 38927bd
if !check_closure(&vm, result) || !solana_rbpf::vm::Tracer::compare(&_tracer_interpreter, tracer_jit) { |
Otherwise I think it is ready to go.
tests/ubpf_execution.rs
Outdated
@@ -61,7 +59,7 @@ macro_rules! test_interpreter_and_jit { | |||
$(test_interpreter_and_jit!(bind, vm, $location => $syscall_function; $syscall_context_object);)* | |||
let result = vm.execute_program_jit(&mut TestInstructionMeter { remaining: $expected_instruction_count }); | |||
let tracer_jit = vm.get_tracer(); | |||
if !check_closure(&vm, result) || !solana_rbpf::vm::Tracer::compare(&_tracer_interpreter, tracer_jit) { | |||
if !check_closure(&vm, result) || !solana_rbpf::vm::Tracer::compare(&_tracer_interpreter, tracer_jit) { |
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.
Debugging hiccup?
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.
cargo fmt sucks in macros
I like the upper case for things like instruction names "LDDW" rather than "Lddw" and think this is a good place to make that exception. But, I could go either way if you feel stronger about it |
I liked them as well, but in other places we also go with the clippy flow. |
38927bd
to
79f5375
Compare
Apparently clippy no longer cares... |
There are currently two bpf verifiers, one in the rbpf crate and one in the bpf_loader crate in the Solana repo. Only the one in the bpf_loader crate is used by the cluster but having two is confusing.
This PR pulls the verifier from the bpf_loader crate and makes the necessary changes in prep for the bpf_loader crate to switch over to the updated one in the rbpf create.