OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man4 / cpuid.4
1 .\" Copyright (c) 2009 Intel Corporation, Author Andi Kleen
2 .\" Description based on comments in arch/x86/kernel/cpuid.c
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .TH CPUID 4 2009-03-31 "Linux" "Linux Programmer's Manual"
25 .SH NAME
26 cpuid \- x86 CPUID access device
27 .SH DESCRIPTION
28 CPUID provides an interface for querying information about the x86 CPU.
29
30 This device is accessed by
31 .B lseek (2)
32 or
33 .B pread (2)
34 to the appropriate CPUID level and reading in chunks of 16 bytes.
35 A larger read size means multiple reads of consecutive levels.
36
37 The lower 32 bits of the file position is used as the incoming
38 .IR %eax ,
39 and the upper 32 bits of the file position as the incoming
40 .IR %ecx ,
41 the latter intended for "counting"
42 .I eax
43 levels like
44 .IR eax=4 .
45
46 This driver uses
47 .IR /dev/cpu/CPUNUM/cpuid ,
48 where
49 .I CPUNUM
50 is the minor number,
51 and on an SMP box will direct the access to CPU
52 .I CPUNUM
53 as listed in
54 .IR /proc/cpuinfo .
55
56 This file is protected so that it can only be read by the user
57 .IR root ,
58 or members of the group
59 .IR root .
60 .SH NOTES
61 The CPUID instruction can be directly executed by a program
62 using inline assembler.
63 However this device allows convenient
64 access to all CPUs without changing process affinity.
65
66 Most of the information in
67 .I cpuid
68 is reported by the kernel in cooked form either in
69 .I /proc/cpuinfo
70 or through subdirectories in
71 .IR /sys/devices/system/cpu .
72 Direct CPUID access through this device should only
73 be used in exceptional cases.
74
75 The
76 .I cpuid
77 driver is not auto-loaded.
78 On modular kernels you might need to use the following command
79 to load it explicitly before use:
80
81      $ \fImodprobe cpuid\fP
82
83 There is no support for CPUID functions that require additional
84 input registers.
85
86 Very old x86 CPUs don't support CPUID.
87 .SH SEE ALSO
88 Intel Corporation, Intel 64 and IA-32 Architectures
89 Software Developer's Manual Volume 2A:
90 Instruction Set Reference, A-M, 3-180 CPUID reference.
91
92 Intel Corporation, Intel Processor Identification and
93 the CPUID Instruction, Application note 485.