diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2007-06-19 09:41:40 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2007-06-19 09:41:40 +0000 |
commit | ba3f9c3432acd99143b0759fb2d8c3b9f0f715fb (patch) | |
tree | 39d124b0c5601e4f26db8dbd887a865c6a153535 /sys/arch | |
parent | adfc604b4653fa8423fe973bac1cf07a412e20b3 (diff) |
Mark PDE entries with PG_U and PG_M. We never need that information from the
mmu, it slightly speeds up tlb misses and according to an errata from AMD
it can actually work around a bug in the mmu.
toby@ ok
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/pmap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index b3f72727a33..8504bb6f5eb 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.117 2007/06/07 15:31:09 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.118 2007/06/19 09:41:39 art Exp $ */ /* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */ /* @@ -543,7 +543,8 @@ pmap_map_ptes(struct pmap *pmap) /* need to load a new alternate pt space into curpmap? */ opde = *APDP_PDE; if (!pmap_valid_entry(opde) || (opde & PG_FRAME) != pmap->pm_pdirpa) { - *APDP_PDE = (pd_entry_t) (pmap->pm_pdirpa | PG_RW | PG_V); + *APDP_PDE = (pd_entry_t) (pmap->pm_pdirpa | PG_RW | PG_V | + PG_U | PG_M); if (pmap_valid_entry(opde)) pmap_apte_flush(curpcb->pcb_pmap); } @@ -1457,7 +1458,8 @@ pmap_pinit(struct pmap *pmap) /* zero init area */ bzero(pmap->pm_pdir, PDSLOT_PTE * sizeof(pd_entry_t)); /* put in recursive PDE to map the PTEs */ - pmap->pm_pdir[PDSLOT_PTE] = pmap->pm_pdirpa | PG_V | PG_KW; + pmap->pm_pdir[PDSLOT_PTE] = pmap->pm_pdirpa | PG_V | PG_KW | PG_U | + PG_M; /* init the LDT */ pmap->pm_ldt = NULL; @@ -2817,7 +2819,7 @@ pmap_growkernel(vaddr_t maxkvaddr) pmap_zero_phys(ptaddr); kpm->pm_pdir[PDSLOT_KERN + nkpde] = - ptaddr | PG_RW | PG_V; + ptaddr | PG_RW | PG_V | PG_U | PG_M; /* count PTP as resident */ kpm->pm_stats.resident_count++; |