Simplify the selection of the pvo_head and pvo allocation zone in
moea_enter_locked() and moea64_enter(). Eliminate an unused variable from moea64_enter().
This commit is contained in:
parent
42ee878213
commit
081b8e203b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269388
@ -1152,7 +1152,13 @@ moea_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
u_int pte_lo, pvo_flags;
|
||||
int error;
|
||||
|
||||
if (!moea_initialized) {
|
||||
if (pmap_bootstrapped)
|
||||
rw_assert(&pvh_global_lock, RA_WLOCKED);
|
||||
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
|
||||
if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
|
||||
VM_OBJECT_ASSERT_LOCKED(m->object);
|
||||
|
||||
if ((m->oflags & VPO_UNMANAGED) != 0 || !moea_initialized) {
|
||||
pvo_head = &moea_pvo_kunmanaged;
|
||||
zone = moea_upvo_zone;
|
||||
pvo_flags = 0;
|
||||
@ -1161,18 +1167,6 @@ moea_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
zone = moea_mpvo_zone;
|
||||
pvo_flags = PVO_MANAGED;
|
||||
}
|
||||
if (pmap_bootstrapped)
|
||||
rw_assert(&pvh_global_lock, RA_WLOCKED);
|
||||
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
|
||||
if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
|
||||
VM_OBJECT_ASSERT_LOCKED(m->object);
|
||||
|
||||
/* XXX change the pvo head for unmanaged pages */
|
||||
if ((m->oflags & VPO_UNMANAGED) != 0) {
|
||||
pvo_flags &= ~PVO_MANAGED;
|
||||
pvo_head = &moea_pvo_kunmanaged;
|
||||
zone = moea_upvo_zone;
|
||||
}
|
||||
|
||||
pte_lo = moea_calc_wimg(VM_PAGE_TO_PHYS(m), pmap_page_get_memattr(m));
|
||||
|
||||
|
@ -1289,33 +1289,23 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
|
||||
{
|
||||
struct pvo_head *pvo_head;
|
||||
uma_zone_t zone;
|
||||
vm_page_t pg;
|
||||
uint64_t pte_lo;
|
||||
u_int pvo_flags;
|
||||
int error;
|
||||
|
||||
if (!moea64_initialized) {
|
||||
if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
|
||||
VM_OBJECT_ASSERT_LOCKED(m->object);
|
||||
|
||||
if ((m->oflags & VPO_UNMANAGED) != 0 || !moea64_initialized) {
|
||||
pvo_head = NULL;
|
||||
pg = NULL;
|
||||
zone = moea64_upvo_zone;
|
||||
pvo_flags = 0;
|
||||
} else {
|
||||
pvo_head = vm_page_to_pvoh(m);
|
||||
pg = m;
|
||||
zone = moea64_mpvo_zone;
|
||||
pvo_flags = PVO_MANAGED;
|
||||
}
|
||||
|
||||
if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
|
||||
VM_OBJECT_ASSERT_LOCKED(m->object);
|
||||
|
||||
/* XXX change the pvo head for fake pages */
|
||||
if ((m->oflags & VPO_UNMANAGED) != 0) {
|
||||
pvo_flags &= ~PVO_MANAGED;
|
||||
pvo_head = NULL;
|
||||
zone = moea64_upvo_zone;
|
||||
}
|
||||
|
||||
pte_lo = moea64_calc_wimg(VM_PAGE_TO_PHYS(m), pmap_page_get_memattr(m));
|
||||
|
||||
if (prot & VM_PROT_WRITE) {
|
||||
|
Loading…
Reference in New Issue
Block a user