* Tries to create a read- and/or execute-only 1 MB page mapping. Returns * true if successful. Returns false if (1) a mapping already exists at the * specified virtual address or (2) a PV entry cannot be allocated without * reclaiming another PV entry. */
| 4676 | * reclaiming another PV entry. |
| 4677 | */ |
| 4678 | static bool |
| 4679 | pmap_enter_1mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) |
| 4680 | { |
| 4681 | pt1_entry_t pte1; |
| 4682 | vm_paddr_t pa; |
| 4683 | |
| 4684 | PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
| 4685 | pa = VM_PAGE_TO_PHYS(m); |
| 4686 | pte1 = PTE1(pa, PTE1_NM | PTE1_RO, ATTR_TO_L1(vm_page_pte2_attr(m))); |
| 4687 | if ((prot & VM_PROT_EXECUTE) == 0) |
| 4688 | pte1 |= PTE1_NX; |
| 4689 | if (va < VM_MAXUSER_ADDRESS) |
| 4690 | pte1 |= PTE1_U; |
| 4691 | if (pmap != kernel_pmap) |
| 4692 | pte1 |= PTE1_NG; |
| 4693 | return (pmap_enter_pte1(pmap, va, pte1, PMAP_ENTER_NOSLEEP | |
| 4694 | PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, m) == KERN_SUCCESS); |
| 4695 | } |
| 4696 | |
| 4697 | /* |
| 4698 | * Tries to create the specified 1 MB page mapping. Returns KERN_SUCCESS if |
no test coverage detected