Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 00:08:12 -0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Sheldon Hearn <sheldonh@uunet.co.za>
Cc:        Dag-Erling Smorgrav <des@ofug.org>, Andrea Campi <andrea@webcom.it>, Poul-Henning Kamp <phk@critter.freebsd.dk>, developer@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/i386/conf GENERIC 
Message-ID:  <200101150808.f0F88CQ01192@mobile.wemm.org>
In-Reply-To: <34097.979544060@axl.fw.uunet.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
Sheldon Hearn wrote:
> 
> 
> On 15 Jan 2001 01:38:00 +0100, Dag-Erling Smorgrav wrote:
> 
> > I'm tempted to suggest that the freebsd-small and / or PicoBSD gang
> > would be the right people to ask to maintain i386 support in FreeBSD.
> 
> Guys, was Matt Dillon's suggestion infeasible?  Can't we keep CPU_I386
> support and just make it mutually excllusive with SMP?

Right now it is.  But as long as we support a super-kernel that runs on
386's through p3's we've got problems due to the lack of the cmpxchg
instruction.  ie: the moment you add I386_CPU, we switch to the inefficient
instruction sequence:

        "       pushfl ;                "
        "       cli ;                   "
        "       cmpl    %1,%3 ;         "
        "       jne     1f ;            "
        "       movl    %2,%3 ;         "
        "1:                             "
        "       sete    %%al;           "
        "       movzbl  %%al,%0 ;       "
        "       popfl ;                 "

.. which disables interrupts...  Your 1GHz cpu uses the slower 386-friendly
version instead of the optimal 486-and-above sequence:

        "       cmpxchgl %2,%3 ;        "
        "       setz    %%al ;          "
        "       movzbl  %%al,%0 ;       "

The 486-and-above sequence is made MPsafe by adding the lock prefix when
compiling under SMP mode.

At the very least, we should warn people that they are shooting themselves
in the foot if they add I386_CPU to their kernel (eg: copied from RELENG_4)
and IMHO we should make the compile fail if you attempt to mix types.

The patch below does this:
http://people.freebsd.org/~peter/i386_cleanup.diff

1: it removes the 486-and-above code from the 386-only cases.
2: it removes the runtime conditionals that everybody currently executes
   if I386_CPU is present
3: prevents people shooting themselves in the foot at 'make depend' stage
   if they accidently activate I386_CPU.

To be clear:  THIS DOES NOT REMOVE i386 SUPPORT!  It will actually slightly
improve i386 runtime speed by removing the useless conditional tests.

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101150808.f0F88CQ01192>