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

Track whether a region is account data or resize area #636

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions benches/memory_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ macro_rules! bench_randomized_access_with_0001_entry {
#[bench]
fn $name(bencher: &mut Bencher) {
let content = vec![0; 1024 * 2];
let memory_regions = vec![MemoryRegion::new_readonly(&content[..], 0x100000000)];
let memory_regions = vec![MemoryRegion::new_readonly(&content[..], 0x100000000, false)];
let config = Config::default();
let memory_mapping = $mem::new(memory_regions, &config, SBPFVersion::V2).unwrap();
let mut prng = new_prng!();
Expand Down Expand Up @@ -297,8 +297,8 @@ fn do_bench_mapping_operation(bencher: &mut Bencher, op: MemoryOperation, vm_add
let config = Config::default();
let memory_mapping = UnalignedMemoryMapping::new(
vec![
MemoryRegion::new_writable(&mut mem1, 0x100000000),
MemoryRegion::new_writable(&mut mem2, 0x100000000 + 8),
MemoryRegion::new_writable(&mut mem1, 0x100000000, false),
MemoryRegion::new_writable(&mut mem2, 0x100000000 + 8, false),
],
&config,
SBPFVersion::V2,
Expand Down
2 changes: 1 addition & 1 deletion benches/vm_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn bench_jit_vs_interpreter(
executable.verify::<RequisiteVerifier>().unwrap();
executable.jit_compile().unwrap();
let mut context_object = TestContextObject::default();
let mem_region = MemoryRegion::new_writable(mem, ebpf::MM_INPUT_START);
let mem_region = MemoryRegion::new_writable(mem, ebpf::MM_INPUT_START, false);
create_vm!(
vm,
&executable,
Expand Down
2 changes: 1 addition & 1 deletion src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ pub(crate) fn get_ro_region(ro_section: &Section, elf: &[u8]) -> MemoryRegion {
// If offset > 0, the region will start at MM_RODATA_START + the offset of
// the first read only byte. [MM_RODATA_START, MM_RODATA_START + offset)
// will be unmappable, see MemoryRegion::vm_to_host.
MemoryRegion::new_readonly(ro_data, offset as u64)
MemoryRegion::new_readonly(ro_data, offset as u64, false)
}

#[cfg(test)]
Expand Down
Loading
Loading