Date: Mon, 22 Aug 2016 12:56:40 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304600 - head/sys/arm64/arm64 Message-ID: <201608221256.u7MCuewg029987@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Mon Aug 22 12:56:40 2016 New Revision: 304600 URL: https://svnweb.freebsd.org/changeset/base/304600 Log: Use pmap_update_entry in pmap_enter when updating an entry with a new physical address. This is required when either mapping is writeable. While here remove an unneeded call to pmap_pde, we already have the pde from earlier in the function. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 12:17:40 2016 (r304599) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 12:56:40 2016 (r304600) @@ -2429,7 +2429,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, l3 = pmap_l2_to_l3(pde, va); } else { - pde = pmap_pde(pmap, va, &lvl); /* * If we get a level 2 pde it must point to a level 3 entry * otherwise we will need to create the intermediate tables @@ -2572,10 +2571,11 @@ havel3: */ if (orig_l3 != 0) { validate: - orig_l3 = pmap_load_store(l3, new_l3); + orig_l3 = pmap_load(l3); opa = orig_l3 & ~ATTR_MASK; if (opa != pa) { + pmap_update_entry(pmap, l3, new_l3, va, PAGE_SIZE); if ((orig_l3 & ATTR_SW_MANAGED) != 0) { om = PHYS_TO_VM_PAGE(opa); if (pmap_page_dirty(orig_l3)) @@ -2585,8 +2585,11 @@ validate: CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pmap_pvh_free(&om->md, pmap, va); } - } else if (pmap_page_dirty(orig_l3)) { - if ((orig_l3 & ATTR_SW_MANAGED) != 0) + } else { + pmap_load_store(l3, new_l3); + PTE_SYNC(l3); + pmap_invalidate_page(pmap, va); + if (pmap_page_dirty(orig_l3) && (orig_l3 & ATTR_SW_MANAGED) != 0) vm_page_dirty(m); } } else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608221256.u7MCuewg029987>