From owner-freebsd-current@FreeBSD.ORG Fri Oct 3 23:37:15 2003 Return-Path: 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 ECB5F16A4B3 for ; Fri, 3 Oct 2003 23:37:15 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58C3544015 for ; Fri, 3 Oct 2003 23:37:15 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id 3FAE52A8D5; Fri, 3 Oct 2003 23:37:15 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: "Kevin Oberman" In-Reply-To: <20031002162742.652935D07@ptavv.es.net> Date: Fri, 03 Oct 2003 23:37:15 -0700 From: Peter Wemm Message-Id: <20031004063715.3FAE52A8D5@canning.wemm.org> cc: current@freebsd.org Subject: Re: HEADS UP: APM users on -current! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2003 06:37:16 -0000 "Kevin Oberman" wrote: > > Date: Wed, 01 Oct 2003 22:01:07 -0700 > > From: Peter Wemm > > Sender: owner-freebsd-current@freebsd.org > > > > I've made a commit that has been reported as breaking APM for some people. > > I'll be following this up, so could folks please report here if things > > break? (and feel free to say so if you find the problem :-). It would > > also be interesting to know that things are ok for a few people too. > > > > If you're stuck (hang or reset on boot), take out apm for the time being. > > Yes, I know that isn't a solution, but please bear with me. > > No hangs or resets on my ThinkPad T30. It just crashes. :-( I found it.. please try with revision 1.177 of locore.s.. peter 2003/10/03 23:30:56 PDT FreeBSD src repository Modified files: sys/i386/i386 locore.s Log: Emulate bugs in the old PSE code so that apm works again. I do not yet understand why, but apm *depended* on the fact that the old PSE code caused the first 1MB of ram to be mapped read/write because it was in the same 4MB page as the kernel text+data+bss blob. If anybody ever tried DISABLE_PSE before, apm would not work. If your cpu did not have PSE, apm would not work there either (eg: 486). This bug has been around for a Very Long Time. The Pentium-4-fix commits did not emulate this unintended side effect of the PSE post-early-boot fixup, and thus apm blew up. I've added a hack to emulate the bug until either apm is fixed or we set fire to our bridges. 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. Revision Changes Path 1.177 +5 -0 src/sys/i386/i386/locore.s @@ -787,7 +788,12 @@ /* Map read-only from zero to the beginning of the kernel text section */ xorl %eax, %eax +#ifdef BURN_BRIDGES xorl %edx,%edx +#else +/* XXX emulate bugs in the old PSE code so that apm works */ + movl $PG_RW,%edx +#endif movl $R(btext),%ecx addl $PAGE_MASK,%ecx shrl $PAGE_SHIFT,%ecx 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