- Memory Type Range Registers
Memory Type Range Registers (MTRRs) are
control register s that providesystem software with control of how accesses to memory ranges by theCPU are cached. It uses a set of programmablemodel-specific register s (MSRs) which are special registers provided by most modern CPUs.Possible access modes to memory ranges can be:
* uncached
* write-through
*write-combining
* write-protect
* write-backAdditional bits which are provided on some
computer architecture s such asAMD64 allow the shadowing of ROM contents insystem memory (Shadow ROM) and the configuration ofmemory-mapped I/O .In write-back mode, writes are written to the
CPU 's cache and the cache is marked dirty, so that its contents are written to memory later.Write-combining allows bus write transfers to be combined into a larger transfer before bursting them over the busto allow more efficient writes to system resources like
graphics card memory.This often increases the speed of image write operations by 2.5 times, at the cost of losing the simple sequential read/write semantics of normal memory.In early
x86 architecture systems, especially where thecache was provided by separate chips outside of the CPU package, this function was controlled by thechipset itself and configured throughBIOS settings.When the CPU cache was moved inside the CPU, the CPUs implemented "fixed-range MTRRs" ranges which cover the first megabyte of memory to be compatible to what PC-BIOSes provided at that time. These are used to control the cache policy needed for
VGA accesses and all other memory-accesses done while the system is inreal mode . Above the first MiB, CPUs provide a number of "variable-range MTRRs", which can be freely placed and even overlap. These variable-range MTRRs can be used to set the caching-policy of graphics memory and other memory ranges used by PCI devices.Starting with the
Intel P6 family processors (Pentium Pro ,Pentium II and later), MTRR's may be used to control the processor access to memory ranges.The
Cyrix 6x86 ,6x86MX and MII processors haveAddress Range Registers (ARRs) which provide a similar functionality to MTRRs.The
AMD K6-2 (stepping 8 and above) andK6-III processors have two MTRRs. The AMDAthlon family provide 8 Intel style MTRRs.The Centaur C6
WinChip has 8 MCRs, allowing write-combining.The VIA
Cyrix III andVIA C3 CPUs offer 8 Intel style MTRRs.The memory interface of AMD K8 CPUs supports "Extended fixed-range MTRR Type-Field Encodings" which allow to specify whether accesses to certain address ranges are executed by accessing
RAM through theDirect Connect Architecture or by executingmemory-mapped I/O . This allows e.g. to implement Shadow RAM by copying ROM contents into RAM.Details on how MTRRs work in detail are described in the processor manuals from CPU vendors.
See also
*
Write barrier External links
* [http://www.meduna.org/txt_mtrr_en.html Speeding up graphics with MTRR] includes technical explanation
* [http://www.amd.com/gb-uk/Processors/TechnicalResources/0,,30_182_739_7044,00.html AMD64 Architecture Programmer's Manual Volume 2: System Programming] (PDF )
* [http://www.intel.com/products/processor/manuals/index.htm Intel 64 and IA-32 Architectures Software Developer's Manuals] See "Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide" section 10.11 "MEMORY TYPE RANGE REGISTERS (MTRRS)"
Wikimedia Foundation. 2010.