From f26c7b7e7fae60ce8cf7fbb77b6056fe534c81c0 Mon Sep 17 00:00:00 2001 From: pk Date: Mon, 3 Mar 2003 22:43:58 +0000 Subject: [PATCH] Note a kernel pmap locking problem in pmap_kenter_pa4m(). --- sys/arch/sparc/sparc/pmap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c index d072b472ea92..07004544e702 100644 --- a/sys/arch/sparc/sparc/pmap.c +++ b/sys/arch/sparc/sparc/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.248 2003/03/02 21:37:21 pk Exp $ */ +/* $NetBSD: pmap.c,v 1.249 2003/03/03 22:43:58 pk Exp $ */ /* * Copyright (c) 1996 @@ -6356,13 +6356,21 @@ pmap_kenter_pa4m(va, pa, prot) sp = &rp->rg_segmap[vs]; s = splvm(); +#ifdef notyet + /* XXX - we can be called with the kernel map already locked + * pmap_enter4m()->pv_link()->pool_get() + * figure out another way to protect `sg_npte' update. + */ simple_lock(&pm->pm_lock); +#endif tpte = sp->sg_pte[VA_SUN4M_VPG(va)]; KASSERT((tpte & SRMMU_TETYPE) != SRMMU_TEPTE); sp->sg_npte++; setpgt4m(&sp->sg_pte[VA_SUN4M_VPG(va)], pteproto); +#ifdef notyet simple_unlock(&pm->pm_lock); +#endif splx(s); }