Model-specific register

A model-specific register (MSR) is any of various control registers in the x86 system architecture used for debugging, program execution tracing, performance monitoring, and toggling certain CPU features.

History

With the introduction of the 80386 processor, Intel began introducing "experimental" features that would not necessarily be present in future versions of the processor. The first of these were two "test registers" (TR6 and TR7) that enabled testing of the processor's translation lookaside buffer (TLB); a special variant of the MOV instruction allowed moving to and from the test registers.[1] Three additional test registers followed in the 80486 (TR3–TR5) that enabled testing of the processor's caches for code and data.[2] None of these five registers were implemented in the subsequent Pentium processor; the special variant of MOV generated an invalid opcode exception.[3][4]

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

  1. ^ "10.6.2 Test Registers". 80386 PROGRAMMER'S REFERENCE MANUAL (PDF). Intel. 1986.
  2. ^ "10.6.2 Test Registers". i486 PROCESSOR PROGRAMMER'S REFERENCE MANUAL (PDF). Intel. 1990.
  3. ^ "23.2.12 Test Registers". Pentium Processor User's Manual Volume 3: Architecture and Programming Manual (PDF). Intel. 1993.
  4. ^ Alan Cruse. "Model-Specific Registers" (PPT). Lecture notes, Advanced Microcomputer Programming class, University of San Francisco, 2006.
  5. ^ "2.1 ARCHITECTURAL MSRS". Intel 64 and IA-32 Architectures Software Developer's Manual Volume 4: Model-Specific Registers. Intel. May 2020.
  6. ^ msr-tools at 01.org
  • 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):

https://cdrdv2.intel.com/v1/dl/getContent/671200

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.