From owner-freebsd-current Wed Jul 10 1:35:17 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8230A37B400; Wed, 10 Jul 2002 01:35:13 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06EF543E42; Wed, 10 Jul 2002 01:35:13 -0700 (PDT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id A0C4D2A7D6; Wed, 10 Jul 2002 01:35:12 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id 568D14C211; Wed, 10 Jul 2002 01:35:12 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id AAF853808; Wed, 10 Jul 2002 01:35:12 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: John Baldwin Cc: current@freebsd.org Subject: Re: Remember my ill-fated i386 smp pmap optimizations? In-Reply-To: <20020708205248.6D4EC3808@overcee.wemm.org> Date: Wed, 10 Jul 2002 01:35:12 -0700 From: Peter Wemm Message-Id: <20020710083512.AAF853808@overcee.wemm.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Wemm wrote: > John Baldwin wrote: > > > > On 08-Jul-2002 Peter Wemm wrote: > > > A few months ago, I had a bit of a disaster with some pmap optimizations. > > > After committing, all hell broke loose. It was backed out completely. > > > > > > I finally found the problem (diff cleaned up to highlight the problem): > > > > > > pmap_mapdev() > > > ... > > > for (tmpva = va; size > 0; ) { > > > pte = vtopte(tmpva); > > > *pte = pa | PG_RW | PG_V | pgeflag; > > > size -= PAGE_SIZE; > > > tmpva += PAGE_SIZE; > > > - pa += PAGE_SIZE; > > > } > > > invltlb(); > > > > > > Excuse me while I go outside and shoot myself. > > > > Hahahaha! > > > > Glad to see you have fixed them. :) > > Unfortunately, there are still more problems. :-( > I've still got to find this one though: > > TPTE at 0xbfca01f0 IS ZERO @ VA 2807c000 > panic: bad peter > > db> trace > panic(c043087f,bfca01f0,2807c000,1,c040e9d7) at panic+0x84 > pmap_remove_pages(c15d6ed0,0,bfc00000,115,c028aee0) at pmap_remove_pages+0x9c > exit1(c15d5180,8b,c6,c24a0d04,0) at exit1+0x4f0 > sigexit(c15d5180,b,c040fbb1,6e9,0) at sigexit+0x1b9 > postsig(b,0,c0413100,e4,400) at postsig+0x11b > ast(d3aa5d48) at ast+0x328 > doreti_ast() at doreti_ast+0x1a ARGH! I think I found this one too. :-/ I think the fix [relative to the patch] is: pmap_pte_quick() ... /* are we current address space or kernel? */ if (pmap == kernel_pmap || frame == (PTDpde & PG_FRAME)) return PTmap + index; newpf = pde & PG_FRAME; if (((*PMAP1) & PG_FRAME) != newpf) { *PMAP1 = newpf | PG_RW | PG_V; - pmap_invalidate_page(pmap, (vm_offset_t) PADDR1); + pmap_invalidate_page(kernel_pmap, (vm_offset_t) PADDR1); } return PADDR1 + (index & (NPTEPG - 1)); *blush*. (read pmap_invalidate_page() in the diff to see why) Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message