From owner-freebsd-current@FreeBSD.ORG Sun Jan 13 06:44:57 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9D7116A418; Sun, 13 Jan 2008 06:44:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 7823013C4E3; Sun, 13 Jan 2008 06:44:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=deviant.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JDwaR-000AAf-9Z; Sun, 13 Jan 2008 08:44:55 +0200 Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m0D6ioiA068073; Sun, 13 Jan 2008 08:44:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m0D6ioJe068072; Sun, 13 Jan 2008 08:44:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 13 Jan 2008 08:44:50 +0200 From: Kostik Belousov To: Joe Marcus Clarke Message-ID: <20080113064450.GW57756@deviant.kiev.zoral.com.ua> References: <1200197787.67286.13.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OAN8QHC2SXyWe5k/" Content-Disposition: inline In-Reply-To: <1200197787.67286.13.camel@shumai.marcuscom.com> User-Agent: Mutt/1.4.2.3i X-Scanner-Signature: b3971b7ac160fe45482707327a257f38 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 1977 [Jan 11 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: current Subject: Re: RFC: Adding a hw.features[2] sysctl X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2008 06:44:57 -0000 --OAN8QHC2SXyWe5k/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 12, 2008 at 11:16:27PM -0500, Joe Marcus Clarke wrote: > I find it would be useful to have the list of CPU features available via > a sysctl. Currently, he only ways to get this information are to have > linprocfs mounted, or parse dmesg.boot (if it exists). Attached are Not quite true, since the raw CPU capabilities are accessible using the cpuid instruction, both to the kernel- and user-mode. > patches to add hw.features and hw.features2 sysctls for i386 and amd64 > (where a list of CPU features is applicable). The results are identical > to the Features and Features2 strings from dmesg: >=20 > hw.features2: 0x41d > hw.features: > 0xbfebfbff >=20 > Comments? The only part that I do not fully agree is to dedicate 1Kb of the kernel memory to the strings that could be reconstructed in the usermode and are relatively rare used. I would suggest either export only bitmask of the cpu features and do the formatting in the sysctl(8), or implement the user-mode utility that would pretty-print results of the cpuid execution, like cpuid from ports. The first option could be preferable, since kernel might disable some features, that is not reflected in the output of cpuid instruction. Example of this would be identcpu.c, line 860 (HTT on AMD). --OAN8QHC2SXyWe5k/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHibNiC3+MBN1Mb4gRAg+zAKDcVJhXTUmjHtvQtbxYEvPRGDpDJgCfZxQd kJ9yF4r1Z9oRZhWWuI4XDL4= =KpSK -----END PGP SIGNATURE----- --OAN8QHC2SXyWe5k/--