Subject: pmap stability patch
To: None <port-sparc64@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: port-sparc64
Date: 11/23/2002 13:54:07
--wac7ysb48OaltWcw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Folks...
On my CP1500 (diskless, with only 64M of RAM), the follow patch
is required in order for my system to make it through a GCC 3.3
"make bootstrap".
I know that, in theory, a dcache flush shouldn't be necessary in
pmap_clear_modify(), since the UltraSPARC cache is write-though.
However, emperically, it's necessary. Anyone have any bright
ideas? :-)
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
--wac7ysb48OaltWcw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=sparc64-pmap-patch
Index: pmap.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/sparc64/pmap.c,v
retrieving revision 1.130
diff -c -r1.130 pmap.c
*** pmap.c 2002/11/11 10:15:46 1.130
--- pmap.c 2002/11/23 21:50:00
***************
*** 2578,2583 ****
--- 2578,2584 ----
pmap_clear_modify(pg)
struct vm_page *pg;
{
+ paddr_t pa = VM_PAGE_TO_PHYS(pg);
pv_entry_t pv;
int i, changed = 0;
#ifdef DEBUG
***************
*** 2604,2610 ****
Debugger();
}
#endif
! if (pv->pv_pmap != NULL)
for (; pv; pv = pv->pv_next) {
int64_t data;
struct pmap *pmap = pv->pv_pmap;
--- 2605,2611 ----
Debugger();
}
#endif
! if (pv->pv_pmap != NULL) {
for (; pv; pv = pv->pv_next) {
int64_t data;
struct pmap *pmap = pv->pv_pmap;
***************
*** 2639,2644 ****
--- 2640,2647 ----
pv->pv_va &= ~(PV_MOD);
simple_unlock(&pmap->pm_lock);
}
+ }
+ dcache_flush_page(pa);
pv_check();
#ifdef DEBUG
if (pmap_is_modified(pg)) {
--wac7ysb48OaltWcw--