From owner-freebsd-hackers Sun Feb 28 13:52:45 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 14490152D8 for ; Sun, 28 Feb 1999 13:52:43 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.1/8.9.1) id PAA05441; Sun, 28 Feb 1999 15:52:21 -0600 (CST) Date: Sun, 28 Feb 1999 15:52:21 -0600 From: Dan Nelson To: Matthew Dillon Cc: Dennis , hackers@FreeBSD.ORG Subject: Re: CPU-type question Message-ID: <19990228155221.A5190@dan.emsphone.com> References: <199902281711.MAA00353@etinc.com> <199902282045.MAA39096@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <199902282045.MAA39096@apollo.backplane.com>; from "Matthew Dillon" on Sun Feb 28 12:45:26 GMT 1999 X-OS: FreeBSD 3.1-STABLE Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Feb 28), Matthew Dillon said: > :What does the "cpu" directive in the kernel config actually do? In > :the context of a binary driver, is there a potential problem if the > :binary was compiled on one type of cpu and that cpu type was not > :specified in the target machine's config? (that is that the driver > :was compiled on a i586 and the target machine only specified i686). > : > :I suppose this has some relevance to loadable drivers as well. > > cpu "I586_CPU" > cpu "I686_CPU" > > This means that the above kernel will *NOT* run on a 386 or 486, > but it will run more efficiently ( though not by much ) on a P or > PII because it doesn't bother to check for 486 specific stuff. > Or, at least, the kernel will be slightly smaller by not > including the 386 or 486 specific stuff. There was a thread in -questions back on October arguing over how much faster your kernel was if you removed the unnecessary CPU types from your config file. Go to http://www.freebsd.org/search/search-mid.html and search for messageid <19981031141836.B2302@emsphone.com> for my response. The summary is that most of the CPU-specific code is in initcpu(), which enables CPU caches, optimized memcpys, and F00F workarounds depending on the detected CPU. So, Dennis, the CPU-types specified in the kernel shouldn't have any bearing on loadable modules, as long as you make sure your module works on all CPU types (i.e. don't put any #ifdef Ix86_CPU blocks in your lkm). -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message