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

Function pmap_remove_kernel_pte1

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

* Removes a 1MB page mapping from the kernel pmap. */

Source from the content-addressed store, hash-verified

3566 * Removes a 1MB page mapping from the kernel pmap.
3567 */
3568static void
3569pmap_remove_kernel_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va)
3570{
3571 vm_page_t m;
3572 uint32_t pte1_idx;
3573 pt2_entry_t *fpte2p;
3574 vm_paddr_t pt2_pa;
3575
3576 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
3577 m = pmap_pt2_page(pmap, va);
3578 if (m == NULL)
3579 /*
3580 * QQQ: Is this function called only on promoted pte1?
3581 * We certainly do section mappings directly
3582 * (without promotion) in kernel !!!
3583 */
3584 panic("%s: missing pt2 page", __func__);
3585
3586 pte1_idx = pte1_index(va);
3587
3588 /*
3589 * Initialize the L2 page table.
3590 */
3591 fpte2p = page_pt2(pt2map_pt2pg(va), pte1_idx);
3592 pmap_clear_pt2(fpte2p);
3593
3594 /*
3595 * Remove the mapping.
3596 */
3597 pt2_pa = page_pt2pa(VM_PAGE_TO_PHYS(m), pte1_idx);
3598 pmap_kenter_pte1(va, PTE1_LINK(pt2_pa));
3599
3600 /*
3601 * QQQ: We do not need to invalidate PT2MAP mapping
3602 * as we did not change it. I.e. the L2 page table page
3603 * was and still is mapped the same way.
3604 */
3605}
3606
3607/*
3608 * Do the things to unmap a section in a process

Callers 1

pmap_remove_pte1Function · 0.85

Calls 8

pmap_pt2_pageFunction · 0.85
pte1_indexFunction · 0.85
page_pt2Function · 0.85
pt2map_pt2pgFunction · 0.85
pmap_clear_pt2Function · 0.85
page_pt2paFunction · 0.85
pmap_kenter_pte1Function · 0.85
panicFunction · 0.50

Tested by

no test coverage detected