From 64de6aa22ce8aed7af86db8e9f4e6cf138286d09 Mon Sep 17 00:00:00 2001 From: alc Date: Thu, 31 Jul 2014 16:17:30 +0000 Subject: [PATCH] Correct a defect in r268591. In the implementation of the new function pmap_unwire(), the call to MOEA64_PVO_TO_PTE() must be performed before any changes are made to the PVO. Otherwise, MOEA64_PVO_TO_PTE() will panic. Reported by: andreast --- sys/powerpc/aim/mmu_oea64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 950948434953..fae2d0e66879 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1090,6 +1090,7 @@ moea64_unwire(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); pvo != NULL && PVO_VADDR(pvo) < eva; pvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo)) { + pt = MOEA64_PVO_TO_PTE(mmu, pvo); if ((pvo->pvo_vaddr & PVO_WIRED) == 0) panic("moea64_unwire: pvo %p is missing PVO_WIRED", pvo); @@ -1098,7 +1099,7 @@ moea64_unwire(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) panic("moea64_unwire: pte %p is missing LPTE_WIRED", &pvo->pvo_pte.lpte); pvo->pvo_pte.lpte.pte_hi &= ~LPTE_WIRED; - if ((pt = MOEA64_PVO_TO_PTE(mmu, pvo)) != -1) { + if (pt != -1) { /* * The PTE's wired attribute is not a hardware * feature, so there is no need to invalidate any TLB