From 7126a966b316184716f981d74bc3c4552cbb699d Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sun, 12 Dec 2004 19:27:58 +0000 Subject: [PATCH] Fix the last of the instability and the cause of the annoying "vm_fault: fault on nofault entry, addr: %lx" panic. The problem was a stale PTE in the TLB that marked the page as not present, even though we had a good PTE in the VHPT. We typically don't yet insert PTEs in the TLB. We do that lazily. The CPU will look for the PTE in the VHPT when there's no PTE in the TLB. Unfortunately this doesn't handle the case of the stale PTE in the TLB. The quick fix is to invalidate the TLB (sloppily) when the VHPT doesn't contain a valid PTE. This is also the only case that may cause a PTE in the TLB that marks a page as non-present. --- sys/ia64/ia64/pmap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index ab37b87ae16..da1bcf1eccb 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -787,8 +787,10 @@ pmap_enter_vhpt(struct ia64_lpte *pte, vm_offset_t va) vhpte->chain = ia64_tpa((vm_offset_t)pte); ia64_mf(); - if (!pmap_lpte_present(vhpte) && pmap_lpte_present(pte)) + if (!pmap_lpte_present(vhpte) && pmap_lpte_present(pte)) { + ia64_ptc_g(va, PAGE_SHIFT << 2); pmap_install_pte(vhpte, pte); + } mtx_unlock(&pmap_vhptmutex); } @@ -806,8 +808,10 @@ pmap_update_vhpt(struct ia64_lpte *pte, vm_offset_t va) mtx_lock(&pmap_vhptmutex); if ((!pmap_lpte_present(vhpte) || vhpte->tag == pte->tag) && - pmap_lpte_present(pte)) + pmap_lpte_present(pte)) { + ia64_ptc_g(va, PAGE_SHIFT << 2); pmap_install_pte(vhpte, pte); + } mtx_unlock(&pmap_vhptmutex); }