This pull request primarily introduces a new custom test for the eBPF (Extended Berkeley Packet Filter) JIT (Just-In-Time) compiler, focusing on testing if JIT'd eBPF programs correctly pass the context to helper functions via the default dispatcher.
custom_tests/srcs/ubpf_test_default_dispatcher_simple_context.cc: Implemented the new custom test. This test program invokes an external function via the registered external helper dispatcher and expects the result of the eBPF program execution to point to the same place as the &memory pointer.
Codebase Improvement:
vm/ubpf_jit_x86_64.h: Simplified the jump instruction in the emit_dispatched_external_helper_call function. The change replaces the manual offset placeholder emission with a call to emit_jump_address_reloc.
This pull request primarily introduces a new custom test for the eBPF (Extended Berkeley Packet Filter) JIT (Just-In-Time) compiler, focusing on testing if JIT'd eBPF programs correctly pass the context to helper functions via the default dispatcher.
Test Implementation:
custom_tests/data/ubpf_test_default_dispatcher_simple_context.input
: Added a new test input data.custom_tests/descrs/ubpf_test_default_dispatcher_simple_context.md
: Added a new test description. This test checks if JIT'd eBPF programs correctly pass the context to helper functions using the default dispatcher.custom_tests/srcs/ubpf_test_default_dispatcher_simple_context.cc
: Implemented the new custom test. This test program invokes an external function via the registered external helper dispatcher and expects the result of the eBPF program execution to point to the same place as the&memory
pointer.Codebase Improvement:
vm/ubpf_jit_x86_64.h
: Simplified the jump instruction in theemit_dispatched_external_helper_call
function. The change replaces the manual offset placeholder emission with a call toemit_jump_address_reloc
.