Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_fault.c
Show First 20 Lines • Show All 591 Lines • ▼ Show 20 Lines | for (pidx = pager_first, m = vm_page_lookup(fs->first_object, pidx); | ||||
* For example, this will happen on amd64 if the entire | * For example, this will happen on amd64 if the entire | ||||
* address range does not share the same userspace protection | * address range does not share the same userspace protection | ||||
* key. Revert to single-page mappings if this happens. | * key. Revert to single-page mappings if this happens. | ||||
*/ | */ | ||||
MPASS(rv == KERN_SUCCESS || | MPASS(rv == KERN_SUCCESS || | ||||
(psind > 0 && rv == KERN_PROTECTION_FAILURE)); | (psind > 0 && rv == KERN_PROTECTION_FAILURE)); | ||||
if (__predict_false(psind > 0 && | if (__predict_false(psind > 0 && | ||||
rv == KERN_PROTECTION_FAILURE)) { | rv == KERN_PROTECTION_FAILURE)) { | ||||
MPASS(!fs->wired); | |||||
for (i = 0; i < npages; i++) { | for (i = 0; i < npages; i++) { | ||||
rv = pmap_enter(fs->map->pmap, vaddr + ptoa(i), | rv = pmap_enter(fs->map->pmap, vaddr + ptoa(i), | ||||
&m[i], fs->prot, fs->fault_type | | &m[i], fs->prot, fs->fault_type, 0); | ||||
(fs->wired ? PMAP_ENTER_WIRED : 0), 0); | |||||
MPASS(rv == KERN_SUCCESS); | MPASS(rv == KERN_SUCCESS); | ||||
alc: I'm confused. Lines 578 and 579 seem to be setting psind to 0 if fs->wired is true. So, I… | |||||
Done Inline ActionsIndeed, this was unnecessary. I was confused by the existing use of fs->wired in the pmap_enter() parameters. markj: Indeed, this was unnecessary. I was confused by the existing use of `fs->wired` in the… | |||||
} | } | ||||
} | } | ||||
VM_OBJECT_WLOCK(fs->first_object); | VM_OBJECT_WLOCK(fs->first_object); | ||||
for (i = 0; i < npages; i++) { | for (i = 0; i < npages; i++) { | ||||
if ((fs->fault_flags & VM_FAULT_WIRE) != 0) | if ((fs->fault_flags & VM_FAULT_WIRE) != 0 && | ||||
m[i].pindex == fs->first_pindex) | |||||
vm_page_wire(&m[i]); | vm_page_wire(&m[i]); | ||||
else | else | ||||
vm_page_activate(&m[i]); | vm_page_activate(&m[i]); | ||||
if (fs->m_hold != NULL && m[i].pindex == fs->first_pindex) { | if (fs->m_hold != NULL && | ||||
m[i].pindex == fs->first_pindex) { | |||||
(*fs->m_hold) = &m[i]; | (*fs->m_hold) = &m[i]; | ||||
vm_page_wire(&m[i]); | vm_page_wire(&m[i]); | ||||
} | } | ||||
vm_page_xunbusy(&m[i]); | vm_page_xunbusy(&m[i]); | ||||
} | } | ||||
} | } | ||||
out: | out: | ||||
curthread->td_ru.ru_majflt++; | curthread->td_ru.ru_majflt++; | ||||
▲ Show 20 Lines • Show All 1,557 Lines • Show Last 20 Lines |
I'm confused. Lines 578 and 579 seem to be setting psind to 0 if fs->wired is true. So, I don't see how you can be executing this line with fs->wired being true.