Fix pte_clear to TLB flush the va, not the tlb adress (which is only valid
for clearing the ref bit). pvo_to_pte (if !diagnostic) will return NULL immediately if PTE_VALID is not set.
This commit is contained in:
parent
79ca4cf1a1
commit
ab93af26ea
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.c,v 1.34 2001/11/06 06:25:28 matt Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.35 2001/11/11 23:07:02 matt Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
|
@ -506,13 +506,13 @@ pmap_pte_synch(volatile pte_t *pt, pte_t *pvo_pt)
|
|||
}
|
||||
|
||||
static __inline void
|
||||
pmap_pte_clear(volatile pte_t *pt, int ptebit)
|
||||
pmap_pte_clear(volatile pte_t *pt, vaddr_t va, int ptebit)
|
||||
{
|
||||
/*
|
||||
* As shown in Section 7.6.3.2.2
|
||||
* As shown in Section 7.6.3.2.3
|
||||
*/
|
||||
pt->pte_lo &= ~ptebit;
|
||||
TLBIE(pt);
|
||||
TLBIE(va);
|
||||
EIEIO();
|
||||
TLBSYNC();
|
||||
SYNC();
|
||||
|
@ -1042,6 +1042,11 @@ pmap_pvo_to_pte(const struct pvo_entry *pvo, int pteidx)
|
|||
{
|
||||
volatile pte_t *pt;
|
||||
|
||||
#ifndef DIAGNOSTIC
|
||||
if ((pvo->pvo_pte.hi & PTE_VALID) == 0)
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If we haven't been supplied the ptegidx, calculate it.
|
||||
*/
|
||||
|
@ -2049,7 +2054,8 @@ pmap_clear_bit(struct vm_page *pg, int ptebit)
|
|||
pt = pmap_pvo_to_pte(pvo, -1);
|
||||
if (pt != NULL) {
|
||||
pmap_pte_synch(pt, &pvo->pvo_pte);
|
||||
pmap_pte_clear(pt, ptebit);
|
||||
if (pvo->pvo_pte.pte_lo & ptebit)
|
||||
pmap_pte_clear(pt, PVO_VADDR(pvo), ptebit);
|
||||
}
|
||||
rv |= pvo->pvo_pte.pte_lo;
|
||||
pvo->pvo_pte.pte_lo &= ~ptebit;
|
||||
|
|
Loading…
Reference in New Issue