diff options
author | alc <alc@FreeBSD.org> | 2009-07-19 21:40:19 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2009-07-19 21:40:19 +0000 |
commit | 6e8105e16a0ad073971ede82d5e20ff84a2a1035 (patch) | |
tree | f20b252ddfa02062532e3bed9049acdffc9e40c2 /sys/amd64 | |
parent | 9defbad772d8a70e282b11397513b9380177143a (diff) | |
download | FreeBSD-src-6e8105e16a0ad073971ede82d5e20ff84a2a1035.zip FreeBSD-src-6e8105e16a0ad073971ede82d5e20ff84a2a1035.tar.gz |
Change the handling of fictitious pages by pmap_page_set_memattr() on
amd64 and i386. Essentially, fictitious pages provide a mechanism for
creating aliases for either normal or device-backed pages. Therefore,
pmap_page_set_memattr() on a fictitious page needn't update the direct
map or flush the cache. Such actions are the responsibility of the
"primary" instance of the page or the device driver that "owns" the
physical address. For example, these actions are already performed by
pmap_mapdev().
The device pager needn't restore the memory attributes on a fictitious
page before releasing it. It's now pointless.
Add pmap_page_set_memattr() to the Xen pmap.
Approved by: re (kib)
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 99f55cb..265d77d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4381,9 +4381,12 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) m->md.pat_mode = ma; /* - * Update the direct mapping and flush the cache. + * If "m" is a normal page, update its direct mapping. This update + * can be relied upon to perform any cache operations that are + * required for data coherence. */ - if (pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE, + if ((m->flags & PG_FICTITIOUS) == 0 && + pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE, m->md.pat_mode)) panic("memory attribute change on the direct map failed"); } |