* Add a list of wired pages to the kva * this routine is only used for temporary * kernel mappings that do not need to have * page modification or references recorded. * Note that old mappings are simply written * over. The page *must* be wired. * Note: SMP coherent. Uses a ranged shootdown IPI. */
| 3848 | * Note: SMP coherent. Uses a ranged shootdown IPI. |
| 3849 | */ |
| 3850 | void |
| 3851 | pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) |
| 3852 | { |
| 3853 | pt_entry_t *endpte, oldpte, pa, *pte; |
| 3854 | vm_page_t m; |
| 3855 | int cache_bits; |
| 3856 | |
| 3857 | oldpte = 0; |
| 3858 | pte = vtopte(sva); |
| 3859 | endpte = pte + count; |
| 3860 | while (pte < endpte) { |
| 3861 | m = *ma++; |
| 3862 | cache_bits = pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0); |
| 3863 | pa = VM_PAGE_TO_PHYS(m) | cache_bits; |
| 3864 | if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) { |
| 3865 | oldpte |= *pte; |
| 3866 | pte_store(pte, pa | pg_g | pg_nx | X86_PG_RW | X86_PG_V); |
| 3867 | } |
| 3868 | pte++; |
| 3869 | } |
| 3870 | if (__predict_false((oldpte & X86_PG_V) != 0)) |
| 3871 | pmap_invalidate_range(kernel_pmap, sva, sva + count * |
| 3872 | PAGE_SIZE); |
| 3873 | } |
| 3874 | |
| 3875 | /* |
| 3876 | * This routine tears out page mappings from the |
no test coverage detected