diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-10-01 19:13:02 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-10-01 19:13:02 +0000 |
commit | a7514fd7c95c679cf59a49547851275f73160bbb (patch) | |
tree | 76c011c087d459aa5fceb6ab9f658ffce7568e97 | |
parent | 1248d35941b1eaa9182edc602790fa85c2626338 (diff) |
Be more agressive in flusing the cache. In addition to flushing the
instruction cache, also purge TLB entries. The PA-RISC 2.0
architecture says that cache lines may be moved in when a translation
exists even if no access is done. This might have been hurting us
badly since we create illegal aliases in pmap_zero_page() and
pmap_copy_page().
Probably not perfect yet, and perhaps a bit of a sledgehammer, but it
makes PA-RISC 2.0 machines stable again.
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 6adb6a52ed0..03a83de24d6 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.133 2008/09/14 10:09:42 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.134 2008/10/01 19:13:01 kettenis Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -565,6 +565,7 @@ pmap_bootstrap(vstart) va = HPPA_IOBEGIN; /* now map the pde for the physmem */ bzero((void *)addr, PAGE_SIZE); + fdcache(HPPA_SID_KERNEL, addr, PAGE_SIZE); DPRINTF(PDB_INIT|PDB_VP, ("pde premap 0x%x 0x%x\n", va, addr)); pmap_pde_set(kpm, va, addr); kpm->pm_stats.resident_count++; /* count PTP as resident */ @@ -1148,11 +1149,14 @@ pmap_flush_page(struct vm_page *pg, int purge) /* purge cache for all possible mappings for the pa */ simple_lock(&pg->mdpage.pvh_lock); - for(pve = pg->mdpage.pvh_list; pve; pve = pve->pv_next) + for(pve = pg->mdpage.pvh_list; pve; pve = pve->pv_next) { if (purge) pdcache(pve->pv_pmap->pm_space, pve->pv_va, PAGE_SIZE); else fdcache(pve->pv_pmap->pm_space, pve->pv_va, PAGE_SIZE); + pdtlb(pve->pv_pmap->pm_space, pve->pv_va); + pitlb(pve->pv_pmap->pm_space, pve->pv_va); + } simple_unlock(&pg->mdpage.pvh_lock); } @@ -1166,6 +1170,9 @@ pmap_zero_page(struct vm_page *pg) pmap_flush_page(pg, 1); bzero((void *)pa, PAGE_SIZE); fdcache(HPPA_SID_KERNEL, pa, PAGE_SIZE); + pdtlb(HPPA_SID_KERNEL, pa); + ficache(HPPA_SID_KERNEL, pa, PAGE_SIZE); + pitlb(HPPA_SID_KERNEL, pa); } void @@ -1180,6 +1187,12 @@ pmap_copy_page(struct vm_page *srcpg, struct vm_page *dstpg) bcopy((void *)spa, (void *)dpa, PAGE_SIZE); pdcache(HPPA_SID_KERNEL, spa, PAGE_SIZE); fdcache(HPPA_SID_KERNEL, dpa, PAGE_SIZE); + pdtlb(HPPA_SID_KERNEL, spa); + pdtlb(HPPA_SID_KERNEL, dpa); + ficache(HPPA_SID_KERNEL, spa, PAGE_SIZE); + ficache(HPPA_SID_KERNEL, dpa, PAGE_SIZE); + pitlb(HPPA_SID_KERNEL, spa); + pitlb(HPPA_SID_KERNEL, dpa); } void |