device file mappings: communicate map flags and fault missing translations

This commit is contained in:
Balazs Gerofi
2016-06-24 12:42:47 -07:00
parent dd37443fc7
commit 648bacc90f
7 changed files with 84 additions and 24 deletions

View File

@ -2261,6 +2261,7 @@ int read_process_vm(struct process_vm *vm, void *kdst, const void *usrc, size_t
if ((ustart < vm->region.user_start)
|| (vm->region.user_end <= ustart)
|| ((vm->region.user_end - ustart) < siz)) {
kprintf("%s: error: out of user range\n", __FUNCTION__);
return -EFAULT;
}
@ -2268,6 +2269,7 @@ int read_process_vm(struct process_vm *vm, void *kdst, const void *usrc, size_t
for (addr = ustart & PAGE_MASK; addr < uend; addr += PAGE_SIZE) {
error = page_fault_process_vm(vm, (void *)addr, reason);
if (error) {
kprintf("%s: error: PF for %p failed\n", __FUNCTION__, addr);
return error;
}
}
@ -2283,6 +2285,7 @@ int read_process_vm(struct process_vm *vm, void *kdst, const void *usrc, size_t
error = ihk_mc_pt_virt_to_phys(vm->address_space->page_table, from, &pa);
if (error) {
kprintf("%s: error: resolving physical address or %p\n", __FUNCTION__, from);
return error;
}