Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/oea . don't call VSID_TO_HASH() on a pmap.p...



details:   https://anonhg.NetBSD.org/src/rev/3a38cc84ecc2
branches:  trunk
changeset: 559625:3a38cc84ecc2
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Sun Mar 21 10:25:59 2004 +0000

description:
. don't call VSID_TO_HASH() on a pmap.pm_vsid. It already holds the hash value.
  This should fix PR #24754, as well as many of the hangs and process
  aborts reported on port-macppc@ in the last weeks.
  This error would cause the pmap's vsid never to be freed, and would
  occasionnally free a valid vsid used by another pmap, sometimes the kernel's.
. add a related KASSERT() to avoid regression

diffstat:

 sys/arch/powerpc/oea/pmap.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r bb67bbf7be24 -r 3a38cc84ecc2 sys/arch/powerpc/oea/pmap.c
--- a/sys/arch/powerpc/oea/pmap.c       Sun Mar 21 10:24:01 2004 +0000
+++ b/sys/arch/powerpc/oea/pmap.c       Sun Mar 21 10:25:59 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.21 2004/03/17 14:14:02 aymeric Exp $        */
+/*     $NetBSD: pmap.c,v 1.22 2004/03/21 10:25:59 aymeric Exp $        */
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.21 2004/03/17 14:14:02 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.22 2004/03/21 10:25:59 aymeric Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_altivec.h"
@@ -1231,9 +1231,11 @@
        
        if (pm->pm_sr[0] == 0)
                panic("pmap_release");
-       idx = VSID_TO_HASH(pm->pm_vsid) & (NPMAPS-1);
+       idx = pm->pm_vsid & (NPMAPS-1);
        mask = 1 << (idx % VSID_NBPW);
        idx /= VSID_NBPW;
+
+       KASSERT(pmap_vsid_bitmap[idx] & mask);
        pmap_vsid_bitmap[idx] &= ~mask;
 }
 



Home | Main Index | Thread Index | Old Index