From owner-freebsd-current Mon Jan 15 0:11:36 2001 Delivered-To: freebsd-current@freebsd.org Received: from mobile.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id C480237B6A5; Mon, 15 Jan 2001 00:11:10 -0800 (PST) Received: from netplex.com.au (localhost [127.0.0.1]) by mobile.wemm.org (8.11.1/8.11.1) with ESMTP id f0F88CQ01192; Mon, 15 Jan 2001 00:08:13 -0800 (PST) (envelope-from peter@netplex.com.au) Message-Id: <200101150808.f0F88CQ01192@mobile.wemm.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Sheldon Hearn Cc: Dag-Erling Smorgrav , Andrea Campi , Poul-Henning Kamp , developer@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/conf GENERIC In-Reply-To: <34097.979544060@axl.fw.uunet.co.za> Date: Mon, 15 Jan 2001 00:08:12 -0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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