MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_enter_quick_locked

Function pmap_enter_quick_locked

freebsd/arm/arm/pmap-v6.c:4529–4659  ·  view source on GitHub ↗

* This code makes some *MAJOR* assumptions: * 1. Current pmap & pmap exists. * 2. Not wired. * 3. Read access. * 4. No L2 page table pages. * but is *MUCH* faster than pmap_enter... */

Source from the content-addressed store, hash-verified

4527 * but is *MUCH* faster than pmap_enter...
4528 */
4529static vm_page_t
4530pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m,
4531 vm_prot_t prot, vm_page_t mpt2pg)
4532{
4533 pt2_entry_t *pte2p, pte2;
4534 vm_paddr_t pa;
4535 struct spglist free;
4536 uint32_t l2prot;
4537
4538 KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva ||
4539 (m->oflags & VPO_UNMANAGED) != 0,
4540 ("%s: managed mapping within the clean submap", __func__));
4541 rw_assert(&pvh_global_lock, RA_WLOCKED);
4542 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
4543
4544 /*
4545 * In the case that a L2 page table page is not
4546 * resident, we are creating it here.
4547 */
4548 if (va < VM_MAXUSER_ADDRESS) {
4549 u_int pte1_idx;
4550 pt1_entry_t pte1, *pte1p;
4551 vm_paddr_t pt2_pa;
4552
4553 /*
4554 * Get L1 page table things.
4555 */
4556 pte1_idx = pte1_index(va);
4557 pte1p = pmap_pte1(pmap, va);
4558 pte1 = pte1_load(pte1p);
4559
4560 if (mpt2pg && (mpt2pg->pindex == (pte1_idx & ~PT2PG_MASK))) {
4561 /*
4562 * Each of NPT2_IN_PG L2 page tables on the page can
4563 * come here. Make sure that associated L1 page table
4564 * link is established.
4565 *
4566 * QQQ: It comes that we don't establish all links to
4567 * L2 page tables for newly allocated L2 page
4568 * tables page.
4569 */
4570 KASSERT(!pte1_is_section(pte1),
4571 ("%s: pte1 %#x is section", __func__, pte1));
4572 if (!pte1_is_link(pte1)) {
4573 pt2_pa = page_pt2pa(VM_PAGE_TO_PHYS(mpt2pg),
4574 pte1_idx);
4575 pte1_store(pte1p, PTE1_LINK(pt2_pa));
4576 }
4577 pt2_wirecount_inc(mpt2pg, pte1_idx);
4578 } else {
4579 /*
4580 * If the L2 page table page is mapped, we just
4581 * increment the hold count, and activate it.
4582 */
4583 if (pte1_is_section(pte1)) {
4584 return (NULL);
4585 } else if (pte1_is_link(pte1)) {
4586 mpt2pg = PHYS_TO_VM_PAGE(pte1_link_pa(pte1));

Callers 2

pmap_enter_quickFunction · 0.70
pmap_enter_objectFunction · 0.70

Calls 15

pte1_indexFunction · 0.85
pmap_pte1Function · 0.85
pte1_loadFunction · 0.85
pte1_is_sectionFunction · 0.85
pte1_is_linkFunction · 0.85
page_pt2paFunction · 0.85
pte1_storeFunction · 0.85
pt2_wirecount_incFunction · 0.85
PHYS_TO_VM_PAGEFunction · 0.85
pte1_link_paFunction · 0.85
_pmap_allocpte2Function · 0.85
pt2map_entryFunction · 0.85

Tested by

no test coverage detected