diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-08-12 17:50:56 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-08-12 17:50:56 +0000 |
commit | a0dbecc9596491b4cd6d3d0602414d3755af1f85 (patch) | |
tree | 970cde17d01780978a05299fdef3b4b310bce732 /sys/arch/hppa | |
parent | 33e8aee5ce106a59b7b8a0579848c69296642451 (diff) |
Non-equivalent writable aliases (aka illegal aliases) are bad. Since PA-RISC
doesn't have a usuable uncachable bit, whack all other mappings of a page
if we are about to create a non-equivalent writable alias by entering a
mapping for it.
ok art@, miod@
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 1550046539e..cc41a58ff51 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.143 2009/08/09 19:10:10 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.144 2009/08/12 17:50:55 kettenis Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -363,9 +363,11 @@ pmap_check_alias(struct pv_entry *pve, vaddr_t va, pt_entry_t pte) pte |= pmap_vp_find(pve->pv_pmap, pve->pv_va); if ((va & HPPA_PGAOFF) != (pve->pv_va & HPPA_PGAOFF) && (pte & PTE_PROT(TLB_WRITE))) { +#ifdef PMAPDEBUG printf("pmap_check_alias: " "aliased writable mapping 0x%x:0x%x\n", pve->pv_pmap->pm_space, pve->pv_va); +#endif ret++; } } @@ -415,11 +417,6 @@ pmap_pv_enter(struct vm_page *pg, struct pv_entry *pve, struct pmap *pm, pve->pv_ptp = pdep; pve->pv_next = pg->mdpage.pvh_list; pg->mdpage.pvh_list = pve; - if (pmap_check_alias(pve, va, 0)) -#ifdef PMAPDEBUG - Debugger() -#endif - ; } static __inline struct pv_entry * @@ -847,6 +844,9 @@ pmap_enter(pmap, va, pa, prot, flags) } panic("pmap_enter: no pv entries available"); } + pte |= PTE_PROT(pmap_prot(pmap, prot)); + if (pmap_check_alias(pg->mdpage.pvh_list, va, pte)) + pmap_page_remove(pg); pmap_pv_enter(pg, pve, pmap, va, ptp); } else if (pve) pmap_pv_free(pve); |