-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcpuid.4.html
167 lines (119 loc) · 6.46 KB
/
cpuid.4.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>cpuid(4) — Linux manual pages</title>
<link rel="stylesheet" href="../stylesheet/manpages.css" type="text/css" />
<link rel="home" href="../index.html" title="cpuid(4) — Linux manual pages" />
<script type="text/javascript" src="../stylesheet/manpages.js" xml:space="preserve">
</script>
<link rel="icon" href="../stylesheet/icon.gif" type="image/gif" />
</head>
<body onload="javascript:init()">
<div class="refentry" title="cpuid(4) — Linux manual pages">
<a id="cpuid.4" name="cpuid.4" shape="rect"> </a>
<div class="titlepage"> </div>
<div class="refnamediv">
<h2>Name</h2>
<p>cpuid — x86 CPUID access device</p>
</div>
<div class="refsect1" title="DESCRIPTION">
<a id="cpuid-4_sect1" name="cpuid-4_sect1" shape="rect"> </a>
<h2>DESCRIPTION</h2>
<p>CPUID provides an interface for querying information about
the x86 CPU.</p>
<p>This device is accessed by <span class="emphasis"><em>lseek (2)</em></span> or <span class="emphasis"><em>pread (2)</em></span> to the appropriate CPUID
level and reading in chunks of 16 bytes. A larger read size
means multiple reads of consecutive levels.</p>
<p>The lower 32 bits of the file position is used as the
incoming <em class="replaceable"><code>%eax</code></em>, and
the upper 32 bits of the file position as the incoming
<em class="replaceable"><code>%ecx</code></em>, the latter
intended for "counting" <code class="function">eax</code>
levels like <em class="replaceable"><code>eax=4</code></em>.</p>
<p>This driver uses <code class="filename">/dev/cpu/CPUNUM/cpuid</code>, where <code class="constant">CPUNUM</code> is the minor number, and on an SMP
box will direct the access to CPU <code class="constant">CPUNUM</code> as listed in <code class="filename">/proc/cpuinfo</code>.</p>
<p>This file is protected so that it can only be read by the
user <code class="function">root</code>, or members of the
group <code class="function">root</code>.</p>
</div>
<div class="refsect1" title="NOTES">
<a id="cpuid-4_sect2" name="cpuid-4_sect2" shape="rect"> </a>
<h2>NOTES</h2>
<p>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.</p>
<p>Most of the information in <code class="function">cpuid</code> is reported by the kernel in cooked
form either in <code class="filename">/proc/cpuinfo</code> or
through subdirectories in <code class="filename">/sys/devices/system/cpu</code>. Direct CPUID
access through this device should only be used in exceptional
cases.</p>
<p>The <code class="function">cpuid</code> driver is not
auto-loaded. On modular kernels you might need to use the
following command to load it explicitly before use:</p>
<p>$ <span class="emphasis"><em>modprobe
cpuid</em></span></p>
<p>There is no support for CPUID functions that require
additional input registers.</p>
<p>Very old x86 CPUs don't support CPUID.</p>
</div>
<div class="refsect1" title="SEE ALSO">
<a id="cpuid-4_sect3" name="cpuid-4_sect3" shape="rect"> </a>
<h2>SEE ALSO</h2>
<p>Intel Corporation, Intel 64 and IA-32 Architectures
Software Developer's Manual Volume 2A: Instruction Set
Reference, A-M, 3-180 CPUID reference.</p>
<p>Intel Corporation, Intel Processor Identification and the
CPUID Instruction, Application note 485.</p>
</div>
<div class="colophon" title="COLOPHON">
<a id="cpuid-4_sect4" name="cpuid-4_sect4" shape="rect"> </a>
<h2>COLOPHON</h2>
<p>This page is part of release 3.24 of the Linux <em class="replaceable"><code>man-pages</code></em> project. A
description of the project, and information about reporting
bugs, can be found at
http://www.kernel.org/doc/man-pages/.</p>
<div class="license">
<table style="border-collapse: collapse;">
<colgroup span="1">
<col span="1" />
</colgroup>
<tbody>
<tr>
<td style="" rowspan="1" colspan="1">
<div class="literallayout">
<br />
Copyright (c) 2009 Intel Corporation, Author Andi Kleen<br />
Description based on comments in arch/x86/kernel/cpuid.c<br />
<br />
Permission is granted to make and distribute verbatim copies of this<br />
manual provided the copyright notice and this permission notice are<br />
preserved on all copies.<br />
<br />
Permission is granted to copy and distribute modified versions of this<br />
manual under the conditions for verbatim copying, provided that the<br />
entire resulting derived work is distributed under the terms of a<br />
permission notice identical to this one.<br />
<br />
Since the Linux kernel and libraries are constantly changing, this<br />
manual page may be incorrect or out-of-date. The author(s) assume no<br />
responsibility for errors or omissions, or for damages resulting from<br />
the use of the information contained herein. The author(s) may not<br />
have taken the same level of care in the production of this manual,<br />
which is licensed free of charge, as they might when working<br />
professionally.<br />
<br />
Formatted or processed versions of this manual, if unaccompanied by<br />
the source, must acknowledge the copyright and authors of this work.<br />
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>