Skip to content

Commit 7f84572

Browse files
committed
Rename MM_INPUT_AREA and remove SBPFv4 memory region areas from errors
1 parent 4217e21 commit 7f84572

11 files changed

Lines changed: 117 additions & 154 deletions

File tree

benches/vm_execution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn bench_jit_vs_interpreter(
8484
executable.verify::<RequisiteVerifier>().unwrap();
8585
executable.jit_compile().unwrap();
8686
let mut context_object = TestContextObject::default();
87-
let mem_region = MemoryRegion::new_writable(mem, ebpf::MM_INPUT_START);
87+
let mem_region = MemoryRegion::new_writable(mem, ebpf::MM_TX_AREA);
8888
create_vm!(
8989
vm,
9090
&executable,

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn main() {
162162
},
163163
),
164164
MemoryRegion::new_writable(heap.as_slice_mut(), ebpf::MM_HEAP_START),
165-
MemoryRegion::new_writable(&mut mem, ebpf::MM_INPUT_START),
165+
MemoryRegion::new_writable(&mut mem, ebpf::MM_TX_AREA),
166166
];
167167

168168
let memory_mapping = MemoryMapping::new(regions, config, sbpf_version).unwrap();

fuzz/fuzz_targets/dumb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fuzz_target!(|data: DumbFuzzData| {
4444
function_registry,
4545
)
4646
.unwrap();
47-
let mem_region = MemoryRegion::new_writable(&mut mem, ebpf::MM_INPUT_START);
47+
let mem_region = MemoryRegion::new_writable(&mut mem, ebpf::MM_TX_AREA);
4848
let mut context_object = TestContextObject::new(29);
4949
create_vm!(
5050
interp_vm,

fuzz/fuzz_targets/smart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fuzz_target!(|data: FuzzData| {
5656
function_registry,
5757
)
5858
.unwrap();
59-
let mem_region = MemoryRegion::new_writable(&mut mem, ebpf::MM_INPUT_START);
59+
let mem_region = MemoryRegion::new_writable(&mut mem, ebpf::MM_TX_AREA);
6060
let mut context_object = TestContextObject::new(1 << 16);
6161
create_vm!(
6262
interp_vm,

fuzz/fuzz_targets/smart_jit_diff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fuzz_target!(|data: FuzzData| {
6666
.unwrap();
6767
let mut interp_mem = data.mem.clone();
6868
let mut interp_context_object = TestContextObject::new(1 << 16);
69-
let interp_mem_region = MemoryRegion::new_writable(&mut interp_mem, ebpf::MM_INPUT_START);
69+
let interp_mem_region = MemoryRegion::new_writable(&mut interp_mem, ebpf::MM_TX_AREA);
7070
create_vm!(
7171
interp_vm,
7272
&executable,
@@ -83,7 +83,7 @@ fuzz_target!(|data: FuzzData| {
8383
if executable.jit_compile().is_ok() {
8484
let mut jit_mem = data.mem;
8585
let mut jit_context_object = TestContextObject::new(1 << 16);
86-
let jit_mem_region = MemoryRegion::new_writable(&mut jit_mem, ebpf::MM_INPUT_START);
86+
let jit_mem_region = MemoryRegion::new_writable(&mut jit_mem, ebpf::MM_TX_AREA);
8787
create_vm!(
8888
jit_vm,
8989
&executable,

fuzz/fuzz_targets/smarter_jit_diff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fuzz_target!(|data: FuzzData| {
5656
.unwrap();
5757
let mut interp_mem = data.mem.clone();
5858
let mut interp_context_object = TestContextObject::new(1 << 16);
59-
let interp_mem_region = MemoryRegion::new_writable(&mut interp_mem, ebpf::MM_INPUT_START);
59+
let interp_mem_region = MemoryRegion::new_writable(&mut interp_mem, ebpf::MM_TX_AREA);
6060
create_vm!(
6161
interp_vm,
6262
&executable,
@@ -73,7 +73,7 @@ fuzz_target!(|data: FuzzData| {
7373
if executable.jit_compile().is_ok() {
7474
let mut jit_mem = data.mem;
7575
let mut jit_context_object = TestContextObject::new(1 << 16);
76-
let jit_mem_region = MemoryRegion::new_writable(&mut jit_mem, ebpf::MM_INPUT_START);
76+
let jit_mem_region = MemoryRegion::new_writable(&mut jit_mem, ebpf::MM_TX_AREA);
7777
create_vm!(
7878
jit_vm,
7979
&executable,

src/ebpf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ pub const MM_STACK_START: u64 = MM_REGION_SIZE * 2;
5050
/// Virtual address of the heap region
5151
pub const MM_HEAP_START: u64 = MM_REGION_SIZE * 3;
5252
/// Virtual address of the input region
53-
pub const MM_INPUT_START: u64 = MM_REGION_SIZE * 4;
53+
pub const MM_TX_AREA: u64 = MM_REGION_SIZE * 4;
5454
/// Virtual address of the scratch pad area
5555
pub const MM_SCRATCHPAD_AREA: u64 = MM_REGION_SIZE * 5;
5656
/// Virtual address of the instruction area
5757
pub const MM_TX_INSTRUCTION_AREA: u64 = MM_REGION_SIZE * 6;
5858
/// Virtual address of the instruction input payload
59-
pub const MM_TX_INSTRUCTION_INPUT: u64 = MM_REGION_SIZE * 7;
59+
pub const MM_TX_INSTRUCTION_DATA: u64 = MM_REGION_SIZE * 7;
6060
/// Virtual address of the accounts payload area
6161
pub const MM_ACCOUNTS_AREA: u64 = MM_REGION_SIZE * 8;
6262

0 commit comments

Comments
 (0)