From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 10 04:00:29 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB33D16A4BF for ; Fri, 10 Oct 2003 04:00:29 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 7C53A43FDD for ; Fri, 10 Oct 2003 04:00:28 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 11827 invoked from network); 10 Oct 2003 11:00:27 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 10 Oct 2003 11:00:27 -0000 X-pair-Authenticated: 209.68.2.70 Date: Fri, 10 Oct 2003 06:00:26 -0500 (CDT) From: Mike Silbersack To: Joseph Koshy In-Reply-To: <20031010103640.6F5A216A4BF@hub.freebsd.org> Message-ID: <20031010055857.M1695@odysseus.silby.com> References: <20031010103640.6F5A216A4BF@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Determining CPU features / cache organization from userland X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2003 11:00:29 -0000 On Fri, 10 Oct 2003, Joseph Koshy wrote: > Hi -hackers, > > I'm looking for ways that a userland program can determine the CPU > features available on an SMP machine -- processor model, stepping > numbers, supported features, cache organization etc. > > For example, on some x86 processors the CPUID instruction could be > used to determine some of these parameters, but using this instruction > in an SMP context is a little tricky since we do not know which CPU > gets to execute the instruction. At least in the Intel world, multiprocessor systems are _always_ supposed to have matching processor steppings, so the reliability of the information should be very good indeed. Mike "Silby" Silbersack