sel4vmmplatsupport: rm map_ut_allocman_reservation Remove this helper mapping function as it is unused and allocations should occur through the vka interface rather than the allocman implementation.
diff --git a/libsel4vmmplatsupport/include/sel4vmmplatsupport/guest_memory_util.h b/libsel4vmmplatsupport/include/sel4vmmplatsupport/guest_memory_util.h index d32ce29..d12c669 100644 --- a/libsel4vmmplatsupport/include/sel4vmmplatsupport/guest_memory_util.h +++ b/libsel4vmmplatsupport/include/sel4vmmplatsupport/guest_memory_util.h
@@ -35,13 +35,6 @@ */ void *create_device_reservation_frame(vm_t *vm, uintptr_t addr, seL4_CapRights_t rights, memory_fault_callback_fn fault_callback, void *fault_cookie); -/** - * Map a guest reservation backed with untyped allocman frames - * @param[in] vm A handle to the VM - * @param[in] reservation Pointer to reservation object being mapped - * @return -1 on failure otherwise 0 for success - */ -int map_ut_allocman_reservation(vm_t *vm, vm_memory_reservation_t *reservation); /** * Map a guest reservation backed with untyped frames allocated from a base paddr
diff --git a/libsel4vmmplatsupport/src/guest_memory_util.c b/libsel4vmmplatsupport/src/guest_memory_util.c index b58128f..f8e97e8 100644 --- a/libsel4vmmplatsupport/src/guest_memory_util.c +++ b/libsel4vmmplatsupport/src/guest_memory_util.c
@@ -119,38 +119,6 @@ return frame_result; } -static vm_frame_t ut_allocman_iterator(uintptr_t addr, void *cookie) -{ - int ret; - int error; - vka_object_t object; - vm_frame_t frame_result = { seL4_CapNull, seL4_NoRights, 0, 0 }; - vm_t *vm = (vm_t *)cookie; - if (!vm) { - return frame_result; - } - int page_size = seL4_PageBits; - uintptr_t frame_start = ROUND_DOWN(addr, BIT(page_size)); - cspacepath_t path; - error = vka_cspace_alloc_path(vm->vka, &path); - if (error) { - ZF_LOGE("Failed to allocate path"); - return frame_result; - } - seL4_Word alloc_cookie = allocman_utspace_alloc(vm->allocman, page_size, - kobject_get_type(KOBJECT_FRAME, page_size), &path, true, &ret); - if (error) { - ZF_LOGE("Failed to allocate page"); - vka_cspace_free_path(vm->vka, path); - return frame_result; - } - frame_result.cptr = path.capPtr; - frame_result.rights = seL4_AllRights; - frame_result.vaddr = frame_start; - frame_result.size_bits = page_size; - return frame_result; -} - static vm_frame_t maybe_device_alloc_iterator(uintptr_t addr, void *cookie) { int ret; @@ -363,11 +331,6 @@ return vm_map_reservation(vm, reservation, ut_alloc_iterator, (void *)cookie); } -int map_ut_allocman_reservation(vm_t *vm, vm_memory_reservation_t *reservation) -{ - return vm_map_reservation(vm, reservation, ut_allocman_iterator, (void *)vm); -} - int map_frame_alloc_reservation(vm_t *vm, vm_memory_reservation_t *reservation) { return vm_map_reservation(vm, reservation, frame_alloc_iterator, (void *)vm);