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:

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.

"All of this is for nothing if we don't go to the stars" - JMS/B5

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to