guest_memory_util.h
The guest memory util interface provides various utilities and helpers for using the libsel4vm guest memory interface. The methods in the interface cover common usage patterns when managing memory for a VM instance.
Functions:
create_allocated_reservation_frame(vm, addr, rights, alloc_fault_callback, alloc_fault_cookie)
create_device_reservation_frame(vm, addr, rights, fault_callback, fault_cookie)
map_ut_alloc_reservation_with_base_paddr(vm, paddr, reservation)
The interface guest_memory_util.h
defines the following functions.
create_allocated_reservation_frame(vm, addr, rights, alloc_fault_callback, alloc_fault_cookie)
Create and map a reservation for a vka allocated frame. The allocated frame is mapped in both the vm and vmm vspace
Parameters:
vm {vm_t *}
: A handle to the VMaddr {uintptr_t}
: Address of emulated framerights {seL4_CapRights_t}
: Rights for mapping the allocated frame into the vm's vspacealloc_fault_callback {memory_fault_callback_fn}
: Fault callback for allocated framealloc_fault_cookie {void *}
: Cookie for fault callbackReturns:
Back to interface description.
create_device_reservation_frame(vm, addr, rights, fault_callback, fault_cookie)
Create and map a reservation for a device frame. The device frame is mapped in both the vm and vmm vspace
Parameters:
vm {vm_t *}
: A handle to the VMaddr {uintptr_t}
: Address of emulated framerights {seL4_CapRights_t}
: Rights for mapping the device frame into the vm's vspacefault_callback {memory_fault_callback_fn}
: Fault callback for the framefault_cookie {void *}
: Cookie for fault callbackReturns:
Back to interface description.
map_ut_alloc_reservation_with_base_paddr(vm, paddr, reservation)
Map a guest reservation backed with untyped frames allocated from a base paddr
Parameters:
vm {vm_t *}
: A handle to the VMpaddr {uintptr_t}
: Base paddr to allocate fromreservation {vm_memory_reservation_t *}
: Pointer to reservation object being mappedReturns:
Back to interface description.
map_ut_alloc_reservation(vm, reservation)
Map a guest reservation backed with untyped frames
Parameters:
vm {vm_t *}
: A handle to the VMreservation {vm_memory_reservation_t *}
: Pointer to reservation object being mappedReturns:
Back to interface description.
map_frame_alloc_reservation(vm, reservation)
Map a guest reservation backed with free vka frames
Parameters:
vm {vm_t *}
: A handle to the VMreservation {vm_memory_reservation_t *}
: Pointer to reservation object being mappedReturns:
Back to interface description.
map_maybe_device_reservation(vm, reservation)
Map a guest reservation backed with device frames
Parameters:
vm {vm_t *}
: A handle to the VMreservation {vm_memory_reservation_t *}
: Pointer to reservation object being mappedReturns:
Back to interface description.
Back to top.