From owner-cvs-all@FreeBSD.ORG Sat Oct 4 22:21:30 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1861616A4B3; Sat, 4 Oct 2003 22:21:30 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4911E44003; Sat, 4 Oct 2003 22:21:28 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id PAA18203; Sun, 5 Oct 2003 15:21:12 +1000 Date: Sun, 5 Oct 2003 15:19:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Peter Wemm In-Reply-To: <20031004065103.EBE312A7EA@canning.wemm.org> Message-ID: <20031005145547.X3175@gamplex.bde.org> References: <20031004065103.EBE312A7EA@canning.wemm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/i386 locore.s X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Oct 2003 05:21:30 -0000 On Fri, 3 Oct 2003, Peter Wemm wrote: > Peter Wemm wrote: > > > This is bad though because it gives kernel mode code the opportunity > > to accidently write to the first few megs of the general page pool > > which is remapped at KERNBASE. It needs to be fixed properly. > > I'm not sure, now that I think about it more, I think Bruce may have tried > to tell me about this once or twice before. Possibly when I was tinkering > with pmap_mapdev last time. I only remember complaining about the read-onlyness of the text section being broken by 4MB pages. This still seems to be broken. It now seems to be broken even in the !PSE case -- we now map r/w from btext to KERNend where we used to map r/o from btext to etext and r/w from etext to KERNend. My kernel was affected by the write-only page 0 in a different way. I had quick-fixed the setting clean-reboot signature (0x1234 at 0x472 physical) by setting it in cpu_reset_real(): %%% diff -c2 src/sys/i386/i386/vm_machdep.c~ src/sys/i386/i386/vm_machdep.c *** src/sys/i386/i386/vm_machdep.c~ Sat Aug 30 19:35:06 2003 --- src/sys/i386/i386/vm_machdep.c Sat Aug 30 20:36:33 2003 *************** *** 531,534 **** --- 509,522 ---- { + #ifndef PC98 + /* + * Tell the BIOS to warm boot. XXX magic. + * XXX this depends on brokenness of readonlyness of the text + * section caused by 4MB pages. + */ + if (cpu_feature & CPUID_PSE && rcr4() & CR4_PSE && panicstr == NULL) + *(short *)(KERNBASE + 0x472) = 0x1234; + #endif + #ifdef PC98 /* %%% The point of this signature has been defeated since 386BSD-0.0 by setting it in locore.s. The above failed for obvious reasons when 4MB pages stopped affecting page 0. Bruce