summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2012-10-10 17:15:34 +0000
committeralc <alc@FreeBSD.org>2012-10-10 17:15:34 +0000
commit99dca09c832a8b3e5b75d7cb0e7b52c9443df3a8 (patch)
tree4e86190fc3cee480309db55b2acdded9ffcf7034 /sys/i386
parentb806dc0e3e4a373918eceeedf54c56deabc03e0e (diff)
downloadFreeBSD-src-99dca09c832a8b3e5b75d7cb0e7b52c9443df3a8.zip
FreeBSD-src-99dca09c832a8b3e5b75d7cb0e7b52c9443df3a8.tar.gz
MFi386 r241356
Add several asserts. MFC after: 3 days
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/xen/pmap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c
index 2eea8c6..7f197e5 100644
--- a/sys/i386/xen/pmap.c
+++ b/sys/i386/xen/pmap.c
@@ -2014,6 +2014,9 @@ pmap_pv_reclaim(pmap_t locked_pmap)
pmap_pte_release(pte);
if ((tpte & PG_W) != 0)
continue;
+ KASSERT(tpte != 0,
+ ("pmap_pv_reclaim: pmap %p va %x zero pte",
+ pmap, va));
if ((tpte & PG_G) != 0)
pmap_invalidate_page(pmap, va);
m = PHYS_TO_VM_PAGE(tpte & PG_FRAME);
@@ -2286,6 +2289,8 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va, vm_page_t *free)
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
oldpte = *ptq;
PT_SET_VA_MA(ptq, 0, TRUE);
+ KASSERT(oldpte != 0,
+ ("pmap_remove_pte: pmap %p va %x zero pte", pmap, va));
if (oldpte & PG_W)
pmap->pm_stats.wired_count -= 1;
/*
@@ -2470,6 +2475,8 @@ pmap_remove_all(vm_page_t m)
pte = pmap_pte_quick(pmap, pv->pv_va);
tpte = *pte;
PT_SET_VA_MA(pte, 0, TRUE);
+ KASSERT(tpte != 0, ("pmap_remove_all: pmap %p va %x zero pte",
+ pmap, pv->pv_va));
if (tpte & PG_W)
pmap->pm_stats.wired_count--;
if (tpte & PG_A)
@@ -3533,6 +3540,8 @@ pmap_remove_pages(pmap_t pmap)
PMAP_LOCK(pmap);
sched_pin();
TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) {
+ KASSERT(pc->pc_pmap == pmap, ("Wrong pmap %p %p", pmap,
+ pc->pc_pmap));
allfree = 1;
for (field = 0; field < _NPCM; field++) {
inuse = ~pc->pc_map[field] & pc_freemask[field];
OpenPOWER on IntegriCloud