OSDN Git Service

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