Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 2009 13:36:27 -0500 (CDT)
From:      Mark Tinguely <tinguely@casselton.net>
To:        mih@semihalf.com, stas@FreeBSD.org
Cc:        freebsd-arm@FreeBSD.org, tinguely@casselton.net
Subject:   Re: pmap problem in FreeBSD current
Message-ID:  <200907061836.n66IaRSc068048@casselton.net>
In-Reply-To: <20090706134612.5cf860e4.stas@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
One quick observation:
in pmap_nuke_pv(), lower if statement cleans out the pv_list when there
is no other mapping besides the kernel mapping. If I remember correctly,
this was put in at the last minute. we had to remove the kernel mapping
because the page went back to the one of the queues and the kernel mapping
caused a panic.

When the kernel mapping is removed from the other-wise empty pv_list,
the PG_WRITABLE is turned off like is done when the pv_entry list is
normally emptied.

But at this point, we know that there still is a kernel mapping and the
pmap_enter() should have enabled the PG_WRITABLE flag because kernel mappings
should be writable. In my opinion, that flag should be enabled.

Does it make sense that we should leave the page modified bit
or will it panic on the freeing of the page?

	if (pv != NULL && (pv->pv_flags & PVF_UNMAN) &&
	    TAILQ_NEXT(pv, pv_list) == NULL) {
		pg->md.pv_kva = pv->pv_va;
			/* a recursive pmap_nuke_pv */
		TAILQ_REMOVE(&pg->md.pv_list, pv, pv_list);
		TAILQ_REMOVE(&pm->pm_pvlist, pv, pv_plist);
		if (pv->pv_flags & PVF_WIRED)
			--pm->pm_stats.wired_count;
		pg->md.pvh_attrs &= ~PVF_REF;
-		pg->md.pvh_attrs &= ~PVF_MOD;
-		vm_page_flag_clear(pg, PG_WRITEABLE);
		pmap_free_pv_entry(pv);
	}





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907061836.n66IaRSc068048>