Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_fault.c
Show First 20 Lines • Show All 1,518 Lines • ▼ Show 20 Lines | for (mp = ma, va = addr; va < end; mp++, va += PAGE_SIZE) { | ||||
} | } | ||||
} | } | ||||
if (pmap_failed) { | if (pmap_failed) { | ||||
/* | /* | ||||
* One or more pages could not be held by the pmap. Either no | * One or more pages could not be held by the pmap. Either no | ||||
* page was mapped at the specified virtual address or that | * page was mapped at the specified virtual address or that | ||||
* mapping had insufficient permissions. Attempt to fault in | * mapping had insufficient permissions. Attempt to fault in | ||||
* and hold these pages. | * and hold these pages. | ||||
* | |||||
* If vm_fault_disable_pagefaults() was called, | |||||
* i.e., TDP_NOFAULTING is set, we must not sleep nor | |||||
* acquire MD VM locks, which means we must not call | |||||
* vm_fault_hold(). Some (out of tree) callers mark | |||||
* too wide a code area with vm_fault_disable_pagefaults() | |||||
* already, use the VM_PROT_QUICK_NOFAULT flag to request | |||||
* the proper behaviour explicitly. | |||||
*/ | */ | ||||
if ((prot & VM_PROT_QUICK_NOFAULT) != 0 && | |||||
(curthread->td_pflags & TDP_NOFAULTING) != 0) | |||||
goto error; | |||||
for (mp = ma, va = addr; va < end; mp++, va += PAGE_SIZE) | for (mp = ma, va = addr; va < end; mp++, va += PAGE_SIZE) | ||||
if (*mp == NULL && vm_fault_hold(map, va, prot, | if (*mp == NULL && vm_fault_hold(map, va, prot, | ||||
VM_FAULT_NORMAL, mp) != KERN_SUCCESS) | VM_FAULT_NORMAL, mp) != KERN_SUCCESS) | ||||
goto error; | goto error; | ||||
} | } | ||||
return (count); | return (count); | ||||
error: | error: | ||||
for (mp = ma; mp < ma + count; mp++) | for (mp = ma; mp < ma + count; mp++) | ||||
▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines |