diff options
author | alc <alc@FreeBSD.org> | 2016-05-04 17:54:13 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2016-05-04 17:54:13 +0000 |
commit | 52f3fcfa90cf9bf2b975562688c13718237be636 (patch) | |
tree | c5a2aa5700304e6b1294893f8f25ce5bcb481767 /sys/amd64/amd64/pmap.c | |
parent | dfa987f8a029da774c0a3f9ab580b0202bdfa018 (diff) | |
download | FreeBSD-src-52f3fcfa90cf9bf2b975562688c13718237be636.zip FreeBSD-src-52f3fcfa90cf9bf2b975562688c13718237be636.tar.gz |
Explain why pmap_copy(), pmap_enter_pde(), and pmap_enter_quick_locked()
call pmap_invalidate_page() even though they are not destroying a leaf-
level page table entry.
Eliminate some bogus white-space characters in a comment.
Reviewed by: kib
Diffstat (limited to 'sys/amd64/amd64/pmap.c')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 22a6c31..a7c879c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4407,6 +4407,12 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, lockp)) { SLIST_INIT(&free); if (pmap_unwire_ptp(pmap, va, mpde, &free)) { + /* + * Although "va" is not mapped, paging- + * structure caches could nonetheless have + * entries that refer to the freed page table + * pages. Invalidate those entries. + */ pmap_invalidate_page(pmap, va); pmap_free_zero_pages(&free); } @@ -4584,6 +4590,12 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, if (mpte != NULL) { SLIST_INIT(&free); if (pmap_unwire_ptp(pmap, va, mpte, &free)) { + /* + * Although "va" is not mapped, paging- + * structure caches could nonetheless have + * entries that refer to the freed page table + * pages. Invalidate those entries. + */ pmap_invalidate_page(pmap, va); pmap_free_zero_pages(&free); } @@ -4967,6 +4979,14 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, SLIST_INIT(&free); if (pmap_unwire_ptp(dst_pmap, addr, dstmpte, &free)) { + /* + * Although "addr" is not + * mapped, paging-structure + * caches could nonetheless + * have entries that refer to + * the freed page table pages. + * Invalidate those entries. + */ pmap_invalidate_page(dst_pmap, addr); pmap_free_zero_pages(&free); @@ -5219,7 +5239,7 @@ pmap_page_is_mapped(vm_page_t m) * Destroy all managed, non-wired mappings in the given user-space * pmap. This pmap cannot be active on any processor besides the * caller. - * + * * This function cannot be applied to the kernel pmap. Moreover, it * is not intended for general use. It is only to be used during * process termination. Consequently, it can be implemented in ways |