Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jan 2008 08:44:50 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Joe Marcus Clarke <marcus@freebsd.org>
Cc:        current <current@freebsd.org>
Subject:   Re: RFC: Adding a hw.features[2] sysctl
Message-ID:  <20080113064450.GW57756@deviant.kiev.zoral.com.ua>
In-Reply-To: <1200197787.67286.13.camel@shumai.marcuscom.com>
References:  <1200197787.67286.13.camel@shumai.marcuscom.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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<SSE3,RSVD2,MON,DS_CPL,CNXT-ID>
> hw.features:
> 0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,=
PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>=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/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080113064450.GW57756>