Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 58408b7

Browse files
committed
Track whether a region is account data or resize area
1 parent 7d58371 commit 58408b7

File tree

7 files changed

+153
-68
lines changed

7 files changed

+153
-68
lines changed

benches/memory_mapping.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ macro_rules! bench_randomized_access_with_0001_entry {
109109
#[bench]
110110
fn $name(bencher: &mut Bencher) {
111111
let content = vec![0; 1024 * 2];
112-
let memory_regions = vec![MemoryRegion::new_readonly(&content[..], 0x100000000)];
112+
let memory_regions = vec![MemoryRegion::new_readonly(&content[..], 0x100000000, false)];
113113
let config = Config::default();
114114
let memory_mapping = $mem::new(memory_regions, &config, SBPFVersion::V2).unwrap();
115115
let mut prng = new_prng!();
@@ -297,8 +297,8 @@ fn do_bench_mapping_operation(bencher: &mut Bencher, op: MemoryOperation, vm_add
297297
let config = Config::default();
298298
let memory_mapping = UnalignedMemoryMapping::new(
299299
vec![
300-
MemoryRegion::new_writable(&mut mem1, 0x100000000),
301-
MemoryRegion::new_writable(&mut mem2, 0x100000000 + 8),
300+
MemoryRegion::new_writable(&mut mem1, 0x100000000, false),
301+
MemoryRegion::new_writable(&mut mem2, 0x100000000 + 8, false),
302302
],
303303
&config,
304304
SBPFVersion::V2,

benches/vm_execution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn bench_jit_vs_interpreter(
9494
executable.verify::<RequisiteVerifier>().unwrap();
9595
executable.jit_compile().unwrap();
9696
let mut context_object = TestContextObject::default();
97-
let mem_region = MemoryRegion::new_writable(mem, ebpf::MM_INPUT_START);
97+
let mem_region = MemoryRegion::new_writable(mem, ebpf::MM_INPUT_START, false);
9898
create_vm!(
9999
vm,
100100
&executable,

src/elf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ pub(crate) fn get_ro_region(ro_section: &Section, elf: &[u8]) -> MemoryRegion {
13711371
// If offset > 0, the region will start at MM_RODATA_START + the offset of
13721372
// the first read only byte. [MM_RODATA_START, MM_RODATA_START + offset)
13731373
// will be unmappable, see MemoryRegion::vm_to_host.
1374-
MemoryRegion::new_readonly(ro_data, offset as u64)
1374+
MemoryRegion::new_readonly(ro_data, offset as u64, false)
13751375
}
13761376

13771377
#[cfg(test)]

0 commit comments

Comments
 (0)