* Tries to create a read- and/or execute-only 2 or 4 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. */
| 3902 | * reclaiming another PV entry. |
| 3903 | */ |
| 3904 | static bool |
| 3905 | pmap_enter_4mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) |
| 3906 | { |
| 3907 | pd_entry_t newpde; |
| 3908 | |
| 3909 | PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
| 3910 | newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 1) | |
| 3911 | PG_PS | PG_V; |
| 3912 | if ((m->oflags & VPO_UNMANAGED) == 0) |
| 3913 | newpde |= PG_MANAGED; |
| 3914 | #ifdef PMAP_PAE_COMP |
| 3915 | if ((prot & VM_PROT_EXECUTE) == 0 && !i386_read_exec) |
| 3916 | newpde |= pg_nx; |
| 3917 | #endif |
| 3918 | if (pmap != kernel_pmap) |
| 3919 | newpde |= PG_U; |
| 3920 | return (pmap_enter_pde(pmap, va, newpde, PMAP_ENTER_NOSLEEP | |
| 3921 | PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, NULL) == |
| 3922 | KERN_SUCCESS); |
| 3923 | } |
| 3924 | |
| 3925 | /* |
| 3926 | * Returns true if every page table entry in the page table page that maps |
no test coverage detected