/external/crosvm/vm_memory/src/ |
D | guest_address.rs | 13 pub struct GuestAddress(pub u64); struct 15 impl GuestAddress { implementation 26 pub fn offset_from(self, base: GuestAddress) -> u64 { in offset_from() 37 pub fn checked_add(self, other: u64) -> Option<GuestAddress> { in checked_add() argument 38 self.0.checked_add(other).map(GuestAddress) in checked_add() 43 pub fn unchecked_add(self, offset: u64) -> GuestAddress { in unchecked_add() argument 44 GuestAddress(self.0 + offset) in unchecked_add() 48 pub fn checked_sub(self, other: u64) -> Option<GuestAddress> { in checked_sub() argument 49 self.0.checked_sub(other).map(GuestAddress) in checked_sub() 53 pub fn mask(self, mask: u64) -> GuestAddress { in mask() argument [all …]
|
D | guest_memory.rs | 14 use crate::guest_address::GuestAddress; 30 InvalidGuestAddress(GuestAddress), 32 MemoryAccess(GuestAddress, MmapError), 98 guest_base: GuestAddress, 104 fn start(&self) -> GuestAddress { in start() argument 108 fn end(&self) -> GuestAddress { in end() argument 113 fn contains(&self, addr: GuestAddress) -> bool { in contains() 136 fn create_shm(ranges: &[(GuestAddress, u64)]) -> Result<SharedMemory> { in create_shm() argument 162 pub fn new(ranges: &[(GuestAddress, u64)]) -> Result<GuestMemory> { in new() argument 217 pub fn end_addr(&self) -> GuestAddress { in end_addr() argument [all …]
|
/external/crosvm/devices/src/usb/xhci/ |
D | event_ring.rs | 9 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 17 BadEnqueuePointer(GuestAddress), 19 BadSegTableAddress(GuestAddress), 50 segment_table_base_address: GuestAddress, 53 enqueue_pointer: GuestAddress, 54 dequeue_pointer: GuestAddress, 64 segment_table_base_address: GuestAddress(0), in new() 66 enqueue_pointer: GuestAddress(0), in new() 67 dequeue_pointer: GuestAddress(0), in new() 135 pub fn set_seg_table_base_addr(&mut self, addr: GuestAddress) -> Result<()> { in set_seg_table_base_addr() [all …]
|
D | ring_buffer.rs | 10 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 15 BadDequeuePointer(GuestAddress), 42 dequeue_pointer: GuestAddress, 61 dequeue_pointer: GuestAddress(0), in new() 75 self.dequeue_pointer = GuestAddress(link_trb.get_ring_segment_pointer()); in dequeue_transfer_descriptor() 113 pub fn set_dequeue_pointer(&mut self, addr: GuestAddress) { in set_dequeue_pointer() argument 157 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in ring_test_dequeue() 169 gm.write_obj_at_addr(trb.clone(), GuestAddress(0x100)) in ring_test_dequeue() 173 gm.write_obj_at_addr(trb, GuestAddress(0x100 + trb_size)) in ring_test_dequeue() 179 gm.write_obj_at_addr(ltrb, GuestAddress(0x100 + 2 * trb_size)) in ring_test_dequeue() [all …]
|
D | ring_buffer_controller.rs | 13 use vm_memory::{GuestAddress, GuestMemory}; 126 pub fn set_dequeue_pointer(&self, ptr: GuestAddress) { in set_dequeue_pointer() argument 266 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in setup_mem() 277 gm.write_obj_at_addr(trb.clone(), GuestAddress(0x100)) in setup_mem() 281 gm.write_obj_at_addr(trb, GuestAddress(0x100 + trb_size)) in setup_mem() 287 gm.write_obj_at_addr(ltrb, GuestAddress(0x100 + 2 * trb_size)) in setup_mem() 291 gm.write_obj_at_addr(trb, GuestAddress(0x200)).unwrap(); in setup_mem() 296 gm.write_obj_at_addr(trb, GuestAddress(0x200 + 1 * trb_size)) in setup_mem() 300 gm.write_obj_at_addr(ltrb, GuestAddress(0x200 + 2 * trb_size)) in setup_mem() 305 gm.write_obj_at_addr(trb, GuestAddress(0x300)).unwrap(); in setup_mem() [all …]
|
D | scatter_gather_buffer.rs | 10 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 77 fn get_trb_data(&self, atrb: &AddressedTrb) -> Result<(GuestAddress, usize)> { in get_trb_data() argument 89 Ok((GuestAddress(addr), len)) in get_trb_data() 154 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in scatter_gather_buffer_test() 188 gm.read_exact_at_addr(&mut d, GuestAddress(0x100)).unwrap(); in scatter_gather_buffer_test() 190 gm.read_exact_at_addr(&mut d, GuestAddress(0x200)).unwrap(); in scatter_gather_buffer_test() 192 gm.read_exact_at_addr(&mut d, GuestAddress(0x300)).unwrap(); in scatter_gather_buffer_test() 202 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in immediate_data_test() 215 gm.write_obj_at_addr(trb, GuestAddress(0xc00)).unwrap(); in immediate_data_test()
|
D | device_slot.rs | 25 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 38 BadInputContextAddr(GuestAddress), 39 BadDeviceContextAddr(GuestAddress), 414 let input_context_ptr = GuestAddress(trb.get_input_context_pointer()); in set_address() 506 .read_obj_from_addr(GuestAddress(trb.get_input_context_pointer())) in configure_endpoint() 516 GuestAddress(trb.get_input_context_pointer()), in configure_endpoint() 542 .read_obj_from_addr(GuestAddress(trb.get_input_context_pointer())) in evaluate_context() 549 .read_obj_from_addr(GuestAddress( in evaluate_context() 567 .read_obj_from_addr(GuestAddress( in evaluate_context() 657 trc.set_dequeue_pointer(GuestAddress(ptr)); in set_tr_dequeue_ptr() [all …]
|
/external/crosvm/devices/src/virtio/ |
D | descriptor_utils.rs | 22 use vm_memory::{GuestAddress, GuestMemory}; 95 mem.get_slice_at_addr(GuestAddress(region.offset), region.len) 142 mem.get_slice_at_addr(GuestAddress(region.offset), region.len) 753 descriptor_array_addr: GuestAddress, in create_descriptor_chain() argument 754 mut buffers_start_addr: GuestAddress, in create_descriptor_chain() argument 805 let memory_start_addr = GuestAddress(0x0); in reader_test_simple_chain() 810 GuestAddress(0x0), in reader_test_simple_chain() 811 GuestAddress(0x100), in reader_test_simple_chain() 846 let memory_start_addr = GuestAddress(0x0); in writer_test_simple_chain() 851 GuestAddress(0x0), in writer_test_simple_chain() [all …]
|
D | queue.rs | 12 use vm_memory::{GuestAddress, GuestMemory}; 60 desc_table: GuestAddress, 68 pub addr: GuestAddress, 84 desc_table: GuestAddress, in checked_new() argument 95 let addr = GuestAddress(mem.read_obj_from_addr::<u64>(desc_head).unwrap() as u64); in checked_new() 216 pub desc_table: GuestAddress, 219 pub avail_ring: GuestAddress, 222 pub used_ring: GuestAddress, 245 desc_table: GuestAddress(0), in new() 246 avail_ring: GuestAddress(0), in new() [all …]
|
D | balloon.rs | 19 use vm_memory::{GuestAddress, GuestMemory}; 119 F: FnMut(GuestAddress, u64), in handle_address_chain() 146 desc_handler(GuestAddress(range_start), range_size); in handle_address_chain() 153 desc_handler(GuestAddress(range_start), range_size); in handle_address_chain() 166 F: FnMut(GuestAddress, u64), in handle_queue() argument 549 let memory_start_addr = GuestAddress(0x0); in desc_parsing_inflate() 552 .write_obj_at_addr(0x10u32, GuestAddress(0x100)) in desc_parsing_inflate() 555 .write_obj_at_addr(0xaa55aa55u32, GuestAddress(0x104)) in desc_parsing_inflate() 560 GuestAddress(0x0), in desc_parsing_inflate() 561 GuestAddress(0x100), in desc_parsing_inflate() [all …]
|
/external/crosvm/devices/src/virtio/gpu/ |
D | udmabuf.rs | 24 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 91 fn memory_offset(mem: &GuestMemory, guest_addr: GuestAddress, len: u64) -> UdmabufResult<u64> { in memory_offset() argument 133 iovecs: &[(GuestAddress, usize)], in create_udmabuf() argument 177 use vm_memory::GuestAddress; 185 let start_addr1 = GuestAddress(0x100); in test_memory_offsets() 186 let start_addr2 = GuestAddress(0x1100); in test_memory_offsets() 187 let start_addr3 = GuestAddress(0x2100); in test_memory_offsets() 196 assert_eq!(memory_offset(&mem, GuestAddress(0x300), 1).unwrap(), 0x200); in test_memory_offsets() 198 memory_offset(&mem, GuestAddress(0x1200), 1).unwrap(), in test_memory_offsets() 202 memory_offset(&mem, GuestAddress(0x1100), 0x1000).unwrap(), in test_memory_offsets() [all …]
|
/external/crosvm/x86_64/src/ |
D | lib.rs | 71 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 231 fn bios_start(bios_size: u64) -> GuestAddress { in bios_start() argument 232 GuestAddress(FIRST_ADDR_PAST_32BITS - bios_size) in bios_start() 238 kernel_addr: GuestAddress, in configure_system() argument 239 cmdline_addr: GuestAddress, in configure_system() argument 241 setup_data: Option<GuestAddress>, in configure_system() argument 242 initrd: Option<(GuestAddress, usize)>, in configure_system() argument 250 let first_addr_past_32bits = GuestAddress(FIRST_ADDR_PAST_32BITS); in configure_system() 251 let end_32bit_gap_start = GuestAddress(END_ADDR_BEFORE_32BITS); in configure_system() 294 let zero_page_addr = GuestAddress(ZERO_PAGE_OFFSET); in configure_system() [all …]
|
D | smbios.rs | 15 use vm_memory::{GuestAddress, GuestMemory}; 197 mut curptr: GuestAddress, in write_and_incr() argument 198 ) -> Result<GuestAddress> { in write_and_incr() argument 207 fn write_string(mem: &GuestMemory, val: &str, mut curptr: GuestAddress) -> Result<GuestAddress> { in write_string() argument 241 let physptr = GuestAddress(SMBIOS_START) in setup_smbios_from_file() 253 mem.write_obj_at_addr(smbios_ep, GuestAddress(SMBIOS_START)) in setup_smbios_from_file() 264 let physptr = GuestAddress(SMBIOS_START) in setup_smbios_from_file() 278 mem.write_obj_at_addr(smbios_ep, GuestAddress(SMBIOS_START)) in setup_smbios_from_file() 292 let physptr = GuestAddress(SMBIOS_START) in setup_smbios() 356 mem.write_obj_at_addr(smbios_ep, GuestAddress(SMBIOS_START)) in setup_smbios() [all …]
|
D | mptable.rs | 14 use vm_memory::{GuestAddress, GuestMemory}; 123 let mut base_mp = GuestAddress(MPTABLE_START); in setup_mptable() 401 GuestAddress(MPTABLE_START), in bounds_check() 412 let mem = GuestMemory::new(&[(GuestAddress(MPTABLE_START), 0x1000)]).unwrap(); in bounds_check_fails() 421 GuestAddress(MPTABLE_START), in mpf_intel_checksum() 428 let mpf_intel = mem.read_obj_from_addr(GuestAddress(MPTABLE_START)).unwrap(); in mpf_intel_checksum() 437 GuestAddress(MPTABLE_START), in mpc_table_checksum() 444 let mpf_intel: mpf_intel = mem.read_obj_from_addr(GuestAddress(MPTABLE_START)).unwrap(); in mpc_table_checksum() 445 let mpc_offset = GuestAddress(mpf_intel.physptr as u64); in mpc_table_checksum() 462 GuestAddress(MPTABLE_START), in cpu_entry_count() [all …]
|
/external/crosvm/vhost/src/ |
D | lib.rs | 21 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 184 desc_addr: GuestAddress, in is_valid() argument 185 avail_addr: GuestAddress, in is_valid() argument 186 used_addr: GuestAddress, in is_valid() argument 230 desc_addr: GuestAddress, in set_vring_addr() argument 231 used_addr: GuestAddress, in set_vring_addr() argument 232 avail_addr: GuestAddress, in set_vring_addr() argument 233 log_addr: Option<GuestAddress>, in set_vring_addr() argument 345 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryError}; 348 let start_addr1 = GuestAddress(0x0); in create_guest_memory() [all …]
|
/external/crosvm/fuzz/ |
D | fs_server_fuzzer.rs | 12 use vm_memory::{GuestAddress, GuestMemory}; 15 const BUFFER_ADDR: GuestAddress = GuestAddress(0x100); 18 static GUEST_MEM: GuestMemory = GuestMemory::new(&[(GuestAddress(0), MEM_SIZE)]).unwrap(); 29 GuestAddress(0),
|
D | virtqueue_fuzzer.rs | 13 use vm_memory::{GuestAddress, GuestMemory}; 19 static GUEST_MEM: GuestMemory = GuestMemory::new(&[(GuestAddress(0), MEM_SIZE)]).unwrap(); 63 q.desc_table = GuestAddress(rng.gen_range(0, MEM_SIZE - max_table_size)); 64 q.avail_ring = GuestAddress(rng.gen_range(0, MEM_SIZE - size_of::<virtq_avail>() as u64)); 65 q.used_ring = GuestAddress(rng.gen_range(0, MEM_SIZE - size_of::<virtq_used>() as u64)); 74 .get_slice_at_addr(GuestAddress(0), MEM_SIZE as usize)
|
D | zimage_fuzzer.rs | 9 use vm_memory::{GuestAddress, GuestMemory}; 26 let mem = GuestMemory::new(&[(GuestAddress(0), MEM_SIZE)]).unwrap(); 27 let _ = kernel_loader::load_kernel(&mem, GuestAddress(0), &mut kimage);
|
D | block_fuzzer.rs | 17 use vm_memory::{GuestAddress, GuestMemory}; 26 let mem = GuestMemory::new(&[(GuestAddress(0), MEM_SIZE)]).unwrap(); 56 GuestAddress(command_addr as u64), 67 .write_all_at_addr(&bytes[32..], GuestAddress(desc_table as u64))
|
/external/crosvm/kernel_loader/src/ |
D | lib.rs | 11 use vm_memory::{GuestAddress, GuestMemory}; 75 kernel_start: GuestAddress, in load_kernel() argument 155 guest_addr: GuestAddress, in load_cmdline() argument 183 use vm_memory::{GuestAddress, GuestMemory}; 188 GuestMemory::new(&vec![(GuestAddress(0x0), MEM_SIZE)]).unwrap() in create_guest_mem() 194 let cmdline_address = GuestAddress(MEM_SIZE - 5); in cmdline_overflow() 208 let mut cmdline_address = GuestAddress(45); in cmdline_write_end() 252 let kernel_addr = GuestAddress(0x0); in load_elf() 260 let kernel_addr = GuestAddress(0x0); in bad_magic() 273 let kernel_addr = GuestAddress(0x0); in bad_endian() [all …]
|
/external/crosvm/vm_control/src/ |
D | gdb.rs | 7 use vm_memory::GuestAddress; 12 ReadMem(GuestAddress, usize), 15 WriteMem(GuestAddress, Vec<u8>), 17 SetHwBreakPoint(Vec<GuestAddress>),
|
/external/rust/crates/vmm_vhost/src/vhost_kern/ |
D | vsock.rs | 82 use vm_memory::{GuestAddress, GuestMemory, GuestMemoryMmap}; 91 let m = GuestMemoryMmap::from_ranges(&[(GuestAddress(0), 0x10_0000)]).unwrap(); in test_vsock_new_device() 95 assert!(vsock.mem().find_region(GuestAddress(0x100)).is_some()); in test_vsock_new_device() 96 assert!(vsock.mem().find_region(GuestAddress(0x10_0000)).is_none()); in test_vsock_new_device() 102 let m = GuestMemoryMmap::from_ranges(&[(GuestAddress(0), 0x10_0000)]).unwrap(); in test_vsock_is_valid() 127 let m = GuestMemoryMmap::from_ranges(&[(GuestAddress(0), 0x10_0000)]).unwrap(); in test_vsock_ioctls() 151 userspace_addr: m.get_host_address(GuestAddress(0x0)).unwrap() as u64, in test_vsock_ioctls()
|
/external/crosvm/hypervisor/src/kvm/ |
D | mod.rs | 41 use vm_memory::{GuestAddress, GuestMemory}; 452 guest_addr: GuestAddress, in add_memory_region() argument 1169 use vm_memory::GuestAddress; 1196 let gm = GuestMemory::new(&[(GuestAddress(0), 0x1000)]).unwrap(); in create_vm() 1203 let gm = GuestMemory::new(&[(GuestAddress(0), 0x1000)]).unwrap(); in clone_vm() 1211 let gm = GuestMemory::new(&[(GuestAddress(0), 0x1000)]).unwrap(); in send_vm() 1223 let gm = GuestMemory::new(&[(GuestAddress(0), 0x1000)]).unwrap(); in check_vm_capability() 1233 let gm = GuestMemory::new(&[(GuestAddress(0), 0x10000)]).unwrap(); in create_vcpu() 1241 let gm = GuestMemory::new(&[(GuestAddress(0), 0x1000)]).unwrap(); in get_memory() 1243 let obj_addr = GuestAddress(0xf0); in get_memory() [all …]
|
/external/crosvm/kvm/src/ |
D | lib.rs | 40 use vm_memory::{GuestAddress, GuestMemory}; 334 guest_addr: GuestAddress, in add_memory_region() argument 438 pub fn set_identity_map_addr(&self, addr: GuestAddress) -> Result<()> { in set_identity_map_addr() 1716 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in create_vm() 1731 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in check_vm_extension() 1766 (GuestAddress(0), 0x1000), in add_memory() 1767 (GuestAddress(0x5000), 0x5000), in add_memory() 1773 vm.add_memory_region(GuestAddress(0x1000), Box::new(mem), false, false) in add_memory() 1776 vm.add_memory_region(GuestAddress(0x10000), Box::new(mem), false, false) in add_memory() 1783 let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap(); in add_memory_ro() [all …]
|
/external/crosvm/kvm/tests/ |
D | read_only_memory.rs | 10 use vm_memory::{GuestAddress, GuestMemory}; 22 let load_addr = GuestAddress(0x1000); in test_run() 50 GuestAddress(0), in test_run() 73 GuestAddress(vcpu_sregs.es.base), in test_run()
|