Model-specific register
A model-specific register (MSR) is any of various
History
With the introduction of the
With the introduction of the Pentium processor, Intel provided a pair of instructions (RDMSR and WRMSR) to access current and future "model-specific registers", as well as the CPUID instruction to determine which features are present on a particular model. Many of these registers have proven useful enough to be retained. Intel has classified these as architectural model-specific registers and has committed to their inclusion in future product lines.[5]
On modern x86-based systems, the BIOS or UEFI firmware will initialize CPUID registers and model-specific registers on each system startup.
Using MSRs
Reading and writing to these registers is handled by the rdmsr
and wrmsr
instructions, respectively. As these are privileged instructions, they can be executed only by the operating system. Use of the Linux msr kernel module creates a pseudo file "/dev/cpu/x/msr" (with a unique x for each processor or processor core). A user with permissions to read and/or write to this file can use the file I/O API to access these registers. The msr-tools[6] package provides a reference implementation.
Documentation regarding which MSRs a certain processor implementation supports is usually found in the processor documentation of the CPU vendor. Examples for rather well-known MSRs are the memory type range registers (MTRRs) and the address-range registers (ARRs).
See also
References
- ^ "10.6.2 Test Registers". 80386 PROGRAMMER'S REFERENCE MANUAL (PDF). Intel. 1986.
- ^ "10.6.2 Test Registers". i486 PROCESSOR PROGRAMMER'S REFERENCE MANUAL (PDF). Intel. 1990.
- ^ "23.2.12 Test Registers". Pentium Processor User's Manual Volume 3: Architecture and Programming Manual (PDF). Intel. 1993.
- ^ Alan Cruse. "Model-Specific Registers" (PPT). Lecture notes, Advanced Microcomputer Programming class, University of San Francisco, 2006.
- ^ "2.1 ARCHITECTURAL MSRS". Intel 64 and IA-32 Architectures Software Developer's Manual Volume 4: Model-Specific Registers. Intel. May 2020.
- ^ msr-tools at 01.org
External links
- The Intel Model-Specific Registers (MSRs) are described in-depth in the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 4; the link to the Intel reference manuals (PDFs) download page (which includes Vol 4):