public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* cpuid(7) manpage
@ 2009-02-22 17:06 Andi Kleen
       [not found] ` <20090222170616.GA23612-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2009-02-22 17:06 UTC (permalink / raw)
  To: linux-man-u79uwXL29TY76Z2rM5mHXA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w

Simple manpage for the cpuid devices.

-Andi


.\" Description based on comment in arch/x86/kernel/cpuid.c
.TH MSR 7 2009-02-22 "Linux" "Linux Programmer's Manual"
.SH NAME
cpuid \- x86 CPUID access device
.SH DESCRIPTIONS
CPUID allows to query information about the x86 CPU.

This device is accessed by 
.I lseek(2) 
or
.I pread(2)
to the appropriate CPUID level
and then read in chunks of 16 bytes.  A larger size means multiple
reads of consecutive levels.

The lower 32 bits of the file position is used as the incoming %eax,
and the upper 32 bits of the file position as the incoming %ecx,
the latter intended for "counting" eax levels like eax=4.

This driver uses 
.I /dev/cpu/CPUNUM/cpuid 
where
.I CPUNUM is the minor number, and on
an SMP box will direct the access to CPU CPUNUM as listed in 
.I /proc/cpuinfo.
.SH NOTES
The CPUID instruction can be directly executed by a program
using inline assembler. However this device allows convenient
access to all CPUs without changing process affinity. 

Most of the information in CPUID is reported by the kernel
in cooked form either in 
.I /proc/cpuinfo
or through sub directories in 
.I /sys/devices/system/cpu
Direct cpuid access through this device should only
be used in exceptional cases.

The 
.I cpuid
driver is not auto-loaded. On modular kernel you might need to use
.B modprobe cpuid
to load it explicitely before use.

There is no support for cpuid functions that require additional
input registers.

Very old x86 CPUs don't support CPUID.
.SH SEE ALSO
Intel Corporation, Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2A
Instruction Set Reference, A-M, 3-180 CPUID reference.

Intel Corporation, Intel Processor Identification and the CPUID Instruction, Application note
485.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-30 20:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-22 17:06 cpuid(7) manpage Andi Kleen
     [not found] ` <20090222170616.GA23612-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
2009-03-30 20:57   ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox