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

Function pmap_remove_kernel_pde

freebsd/amd64/amd64/pmap.c:5807–5842  ·  view source on GitHub ↗

* pmap_remove_kernel_pde: Remove a kernel superpage mapping. */

Source from the content-addressed store, hash-verified

5805 * pmap_remove_kernel_pde: Remove a kernel superpage mapping.
5806 */
5807static void
5808pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va)
5809{
5810 pd_entry_t newpde;
5811 vm_paddr_t mptepa;
5812 vm_page_t mpte;
5813
5814 KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap));
5815 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
5816 mpte = pmap_remove_pt_page(pmap, va);
5817 if (mpte == NULL)
5818 panic("pmap_remove_kernel_pde: Missing pt page.");
5819
5820 mptepa = VM_PAGE_TO_PHYS(mpte);
5821 newpde = mptepa | X86_PG_M | X86_PG_A | X86_PG_RW | X86_PG_V;
5822
5823 /*
5824 * If this page table page was unmapped by a promotion, then it
5825 * contains valid mappings. Zero it to invalidate those mappings.
5826 */
5827 if (mpte->valid != 0)
5828 pagezero((void *)PHYS_TO_DMAP(mptepa));
5829
5830 /*
5831 * Demote the mapping.
5832 */
5833 if (workaround_erratum383)
5834 pmap_update_pde(pmap, va, pde, newpde);
5835 else
5836 pde_store(pde, newpde);
5837
5838 /*
5839 * Invalidate a stale recursive mapping of the page table page.
5840 */
5841 pmap_invalidate_page(pmap, (vm_offset_t)vtopte(va));
5842}
5843
5844/*
5845 * pmap_remove_pde: do the things to unmap a superpage in a process

Callers 1

pmap_remove_pdeFunction · 0.70

Calls 6

vtopteFunction · 0.85
pmap_remove_pt_pageFunction · 0.70
pmap_update_pdeFunction · 0.70
pmap_invalidate_pageFunction · 0.70
panicFunction · 0.50
pagezeroFunction · 0.50

Tested by

no test coverage detected