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: > > 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> > > 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).
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:25 UTC