diff options
author | alc <alc@FreeBSD.org> | 2008-03-23 23:04:09 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2008-03-23 23:04:09 +0000 |
commit | f9d975530469826ddc8f8999004dbb50f664fabc (patch) | |
tree | 16516855e15c86cfbba47621819fb03a77245ded | |
parent | b238ee1007dd8492836884aa1bbcd54e8bcbd813 (diff) | |
download | FreeBSD-src-f9d975530469826ddc8f8999004dbb50f664fabc.zip FreeBSD-src-f9d975530469826ddc8f8999004dbb50f664fabc.tar.gz |
Correct an error in pmap_mincore() when applied to a 2MB page mapping:
Use PG_PS_FRAME, not PG_FRAME, to obtain the physical address of the
2MB physical page from the PDE.
-rw-r--r-- | sys/amd64/amd64/pmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index a7c73a5..025a141 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4370,10 +4370,10 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr) pdep = pmap_pde(pmap, addr); if (pdep != NULL && (*pdep & PG_V)) { if (*pdep & PG_PS) { - KASSERT((*pdep & PG_FRAME & PDRMASK) == 0, - ("pmap_mincore: bad pde")); pte = *pdep; - pa = (*pdep & PG_FRAME) | (addr & PDRMASK); + /* Compute the physical address of the 4KB page. */ + pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) & + PG_FRAME; } else { pte = *pmap_pde_to_pte(pdep, addr); pa = pte & PG_FRAME; |