Re: HEADS UP: APM users on -current!

From: Peter Wemm <peter_at_wemm.org>
Date: Fri, 03 Oct 2003 23:37:15 -0700
"Kevin Oberman" wrote:
> > Date: Wed, 01 Oct 2003 22:01:07 -0700
> > From: Peter Wemm <peter_at_wemm.org>
> > Sender: owner-freebsd-current_at_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

_at__at_ -787,7 +788,12 _at__at_
 
 /* 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_at_wemm.org; peter_at_FreeBSD.org; peter_at_yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
Received on Fri Oct 03 2003 - 21:37:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:24 UTC