summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeel Natu <neel@FreeBSD.org>2013-07-03 23:21:25 +0000
committerNeel Natu <neel@FreeBSD.org>2013-07-03 23:21:25 +0000
commitbe28275d008e76ef46d262a824cb390f31cf3d4f (patch)
tree9e6fe5349f1192ad97c561454b29a0152d2e8762
parentde16308c480d6cfc5a3d9e6034abc376787e1487 (diff)
Notes
-rw-r--r--sys/amd64/amd64/pmap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 8dcf23235f64..e1d373c1754b 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -4400,6 +4400,7 @@ pmap_remove_pages(pmap_t pmap)
int64_t bit;
uint64_t inuse, bitmask;
int allfree, field, freed, idx;
+ vm_paddr_t pa;
if (pmap != PCPU_GET(curpmap)) {
printf("warning: pmap_remove_pages called with non-current pmap\n");
@@ -4429,7 +4430,7 @@ pmap_remove_pages(pmap_t pmap)
pte = (pt_entry_t *)PHYS_TO_DMAP(tpte &
PG_FRAME);
pte = &pte[pmap_pte_index(pv->pv_va)];
- tpte = *pte & ~PG_PTE_PAT;
+ tpte = *pte;
}
if ((tpte & PG_V) == 0) {
panic("bad pte va %lx pte %lx",
@@ -4444,8 +4445,13 @@ pmap_remove_pages(pmap_t pmap)
continue;
}
- m = PHYS_TO_VM_PAGE(tpte & PG_FRAME);
- KASSERT(m->phys_addr == (tpte & PG_FRAME),
+ if (tpte & PG_PS)
+ pa = tpte & PG_PS_FRAME;
+ else
+ pa = tpte & PG_FRAME;
+
+ m = PHYS_TO_VM_PAGE(pa);
+ KASSERT(m->phys_addr == pa,
("vm_page_t %p phys_addr mismatch %016jx %016jx",
m, (uintmax_t)m->phys_addr,
(uintmax_t)tpte));