CPUID: Difference between revisions
No edit summary |
No edit summary |
||
| Line 18: | Line 18: | ||
The complete Intel algorithm is available in AP-485, or via anonymous FTP at ftp://ftp.intel.com/pub/IAL/tools_utils_demos/cpuid3.zip. | The complete Intel algorithm is available in AP-485, or via anonymous FTP at ftp://ftp.intel.com/pub/IAL/tools_utils_demos/cpuid3.zip. | ||
==CPUID and [[SMP|multiple processors]]== | |||
Some CPUID attributes require multiple CPUID calls to retrieve (often EAX is first set to 0 to determine the highest attribute request supported, then called again with specific requests). Behavior is undefined if CPUID information from one processor is used to form requests for another (especially in a heterogeneous system). Furthermore, CPUID must be performed on each processor used -- results for one processor have no general ramifications for others (again, especially in a heterogeneous system). Thus, either: | |||
* the process using CPUID must be bound to a single CPU by the system administrator, | |||
* the process must be able to bind itself to a CPU (usually requiring root), or | |||
* the operating system must provide a world-readable interface (ie, the process never calls CPUID directly) | |||
On [[Linux APIs|Linux]], the <tt>/dev/cpuid(4)</tt> device provides an obsolete interface to CPUID. On modern systems, it is chmod'd 0440, and its use is discouraged. Instead, since [http://lkml.indiana.edu/hypermail/linux/kernel/0801.3/2419.html at least 2.6.24] a [[sysfs]] interface has been supported; see <tt>/sys/devices/system/cpu/*/</tt>. | |||
==See Also== | ==See Also== | ||