diff options
author | alc <alc@FreeBSD.org> | 2005-12-02 18:02:54 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2005-12-02 18:02:54 +0000 |
commit | acfad9885011bedc56b6a5c778a089504e3d72ef (patch) | |
tree | d781eccfb91301579e154f315972188211dd22a4 /sys/alpha | |
parent | 7be677a68d5ab7530a65d22243fa0e73e9fb2dd0 (diff) | |
download | FreeBSD-src-acfad9885011bedc56b6a5c778a089504e3d72ef.zip FreeBSD-src-acfad9885011bedc56b6a5c778a089504e3d72ef.tar.gz |
Change pmap_enter_quick() to use the vm_prot_t parameter introduced in
revision 1.179 to correctly set/clear execute permission on the mapping
it creates. Thus, mmap(2)ing a memory resident file will not result in
the file being mapped with execute permission when execute permission was
not requested.
Eliminate an unneeded Instruction Memory Barrier (IMB) in
pmap_enter_quick(). Since there was no previous (instruction) mapping
for the given virtual address prior to pmap_enter_quick(), there can be
no instructions from the given virtual address in the pipeline that need
flushing.
MFC after: 1 week
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/pmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 13704ff..5fdbb34 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -1941,11 +1941,12 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, pmap->pm_stats.resident_count++; /* - * Now validate mapping with RO protection + * Validate the mapping with limited access, read and/or execute but + * not write. */ - *pte = pmap_phys_to_pte(VM_PAGE_TO_PHYS(m)) | PG_V | PG_KRE | PG_URE | managed; + *pte = pmap_phys_to_pte(VM_PAGE_TO_PHYS(m)) | PG_V | pte_prot(pmap, + prot & (VM_PROT_READ | VM_PROT_EXECUTE)) | managed; out: - alpha_pal_imb(); /* XXX overkill? */ PMAP_UNLOCK(pmap); return mpte; } |