* Removes a 2- or 4MB page mapping from the kernel pmap. */
| 2930 | * Removes a 2- or 4MB page mapping from the kernel pmap. |
| 2931 | */ |
| 2932 | static void |
| 2933 | pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) |
| 2934 | { |
| 2935 | pd_entry_t newpde; |
| 2936 | vm_paddr_t mptepa; |
| 2937 | vm_page_t mpte; |
| 2938 | |
| 2939 | PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
| 2940 | mpte = pmap_remove_pt_page(pmap, va); |
| 2941 | if (mpte == NULL) |
| 2942 | panic("pmap_remove_kernel_pde: Missing pt page."); |
| 2943 | |
| 2944 | mptepa = VM_PAGE_TO_PHYS(mpte); |
| 2945 | newpde = mptepa | PG_M | PG_A | PG_RW | PG_V; |
| 2946 | |
| 2947 | /* |
| 2948 | * If this page table page was unmapped by a promotion, then it |
| 2949 | * contains valid mappings. Zero it to invalidate those mappings. |
| 2950 | */ |
| 2951 | if (mpte->valid != 0) |
| 2952 | pagezero((void *)&KPTmap[i386_btop(trunc_4mpage(va))]); |
| 2953 | |
| 2954 | /* |
| 2955 | * Remove the mapping. |
| 2956 | */ |
| 2957 | if (workaround_erratum383) |
| 2958 | pmap_update_pde(pmap, va, pde, newpde); |
| 2959 | else |
| 2960 | pmap_kenter_pde(va, newpde); |
| 2961 | |
| 2962 | /* |
| 2963 | * Invalidate the recursive mapping of the page table page. |
| 2964 | */ |
| 2965 | pmap_invalidate_page_int(pmap, (vm_offset_t)vtopte(va)); |
| 2966 | } |
| 2967 | |
| 2968 | /* |
| 2969 | * pmap_remove_pde: do the things to unmap a superpage in a process |
no test coverage detected