]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man4/cpuid.4
Many pages: Use a consistent style for lists
[thirdparty/man-pages.git] / 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 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH CPUID 4 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 cpuid \- x86 CPUID access device
9 .SH DESCRIPTION
10 CPUID provides an interface for querying information about the x86 CPU.
11 .PP
12 This device is accessed by
13 .BR lseek (2)
14 or
15 .BR pread (2)
16 to the appropriate CPUID level and reading in chunks of 16 bytes.
17 A larger read size means multiple reads of consecutive levels.
18 .PP
19 The lower 32 bits of the file position is used as the incoming
20 .IR %eax ,
21 and the upper 32 bits of the file position as the incoming
22 .IR %ecx ,
23 the latter is intended for "counting"
24 .I eax
25 levels like
26 .IR eax=4 .
27 .PP
28 This driver uses
29 .IR /dev/cpu/CPUNUM/cpuid ,
30 where
31 .I CPUNUM
32 is the minor number,
33 and on an SMP box will direct the access to CPU
34 .I CPUNUM
35 as listed in
36 .IR /proc/cpuinfo .
37 .PP
38 This file is protected so that it can be read only by the user
39 .IR root ,
40 or members of the group
41 .IR root .
42 .SH NOTES
43 The CPUID instruction can be directly executed by a program
44 using inline assembler.
45 However this device allows convenient
46 access to all CPUs without changing process affinity.
47 .PP
48 Most of the information in
49 .I cpuid
50 is reported by the kernel in cooked form either in
51 .I /proc/cpuinfo
52 or through subdirectories in
53 .IR /sys/devices/system/cpu .
54 Direct CPUID access through this device should only
55 be used in exceptional cases.
56 .PP
57 The
58 .I cpuid
59 driver is not auto-loaded.
60 On modular kernels you might need to use the following command
61 to load it explicitly before use:
62 .PP
63 .in +4n
64 .EX
65 $ modprobe cpuid
66 .EE
67 .in
68 .PP
69 There is no support for CPUID functions that require additional
70 input registers.
71 .PP
72 Very old x86 CPUs don't support CPUID.
73 .SH SEE ALSO
74 .BR cpuid (1)
75 .PP
76 Intel Corporation, Intel 64 and IA-32 Architectures
77 Software Developer's Manual Volume 2A:
78 Instruction Set Reference, A-M, 3-180 CPUID reference.
79 .PP
80 Intel Corporation, Intel Processor Identification and
81 the CPUID Instruction, Application note 485.