* Tries to create a read- and/or execute-only 2MB page mapping. Returns true * if successful. Returns false if (1) a page table page cannot be allocated * without sleeping, (2) a mapping already exists at the specified virtual * address, or (3) a PV entry cannot be allocated without reclaiming another * PV entry. */
| 7005 | * PV entry. |
| 7006 | */ |
| 7007 | static bool |
| 7008 | pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, |
| 7009 | struct rwlock **lockp) |
| 7010 | { |
| 7011 | pd_entry_t newpde; |
| 7012 | pt_entry_t PG_V; |
| 7013 | |
| 7014 | PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
| 7015 | PG_V = pmap_valid_bit(pmap); |
| 7016 | newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 1) | |
| 7017 | PG_PS | PG_V; |
| 7018 | if ((m->oflags & VPO_UNMANAGED) == 0) |
| 7019 | newpde |= PG_MANAGED; |
| 7020 | if ((prot & VM_PROT_EXECUTE) == 0) |
| 7021 | newpde |= pg_nx; |
| 7022 | if (va < VM_MAXUSER_ADDRESS) |
| 7023 | newpde |= PG_U; |
| 7024 | return (pmap_enter_pde(pmap, va, newpde, PMAP_ENTER_NOSLEEP | |
| 7025 | PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, NULL, lockp) == |
| 7026 | KERN_SUCCESS); |
| 7027 | } |
| 7028 | |
| 7029 | /* |
| 7030 | * Returns true if every page table entry in the specified page table page is |
no test coverage detected