Memory Type Range Registers
Encyclopedia
Memory type range registers (MTRRs) are a set of processor supplementary capabilities control register
Control register
A control register is a processor register which changes or controls the general behavior of a CPU or other digital device. Common tasks performed by control registers include interrupt control, switching the addressing mode, paging control, and coprocessor control.-CR0:The CR0 register is 32 bits...

s that provide system software
System software
System software is computer software designed to operate the computer hardware and to provide a platform for running application software.The most basic types of system software are:...

 with control of how accesses to memory
Computer storage
Computer data storage, often called storage or memory, refers to computer components and recording media that retain digital data. Data storage is one of the core functions and fundamental components of computers....

 ranges by the CPU are cached
CPU cache
A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations...

. It uses a set of programmable model-specific register
Model-specific register
Model-specific registers are control registers provided by processor implementations to provide system software with features that are provided on specific processor implementations, but not others....

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-combining
    Write combining is a computer bus technique for allowing data to be combined and temporarily stored in a buffer -- the write combine buffer -- to be released together later in burst mode instead of writing as single bits or small chunks.Write combining cannot be used for general memory access ...

  • write-protect
  • write-back


Additional bits which are provided on some computer architecture
Computer architecture
In computer science and engineering, computer architecture is the practical art of selecting and interconnecting hardware components to create computers that meet functional, performance and cost goals and the formal modelling of those systems....

s such as AMD64 allow the shadowing of ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...

 contents in system memory (Shadow ROM) and the configuration of memory-mapped I/O
Memory-mapped I/O
Memory-mapped I/O and port I/O are two complementary methods of performing input/output between the CPU and peripheral devices in a computer...

.

In write-back mode, writes are written to the CPU's cache
CPU cache
A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations...

 and the cache is marked dirty, so that its contents are written to memory later.

Write-combining allows bus
Computer bus
In computer architecture, a bus is a subsystem that transfers data between components inside a computer, or between computers.Early computer buses were literally parallel electrical wires with multiple connections, but the term is now used for any physical arrangement that provides the same...

 write transfers to be combined into a larger transfer before bursting
Burst mode (computing)
Burst mode is a generic computing term referring to any situation in which a device is transmitting data repeatedly without waiting for input from another device or waiting for an internal process to terminate before continuing the transfer of data.In the case of DMA, the DMA controller and the...

 them over the bus
to allow more efficient writes to system resources like graphics card memory.
This often increases the speed of image write operations by several times, at the cost of losing the simple sequential read/write semantics of normal memory.

MTRRs in x86-PC processors

In early x86 architecture
X86 architecture
The term x86 refers to a family of instruction set architectures based on the Intel 8086 CPU. The 8086 was launched in 1978 as a fully 16-bit extension of Intel's 8-bit based 8080 microprocessor and also introduced segmentation to overcome the 16-bit addressing barrier of such designs...

 systems, especially where the cache
Cache
In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...

 was provided by separate chips outside of the CPU package, this function was controlled by the chipset
Chipset
A chipset, PC chipset, or chip set refers to a group of integrated circuits, or chips, that are designed to work together. They are usually marketed as a single product.- Computers :...

 itself and configured through BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 settings.

When the CPU cache was moved inside the CPU, the CPUs implemented fixed-range MTRRs ranges which cover the first mebibyte
MIB
MIB may refer to any of several concepts:* Master of International Business, a postgraduate business degree* Melayu Islam Beraja, the adopted national philosophy of Brunei* Motion induced blindness, a visual illusion in peripheral vision...

 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 in real mode
Real mode
Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible CPUs. Real mode is characterized by a 20 bit segmented memory address space and unlimited direct software access to all memory, I/O addresses and peripheral hardware...

. Above 1 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
Peripheral Component Interconnect
Conventional PCI is a computer bus for attaching hardware devices in a computer...

 devices.

Starting with the Intel P6
P6 (microarchitecture)
The P6 microarchitecture is the sixth generation Intel x86 microarchitecture, implemented by the Pentium Pro microprocessor that was introduced in November 1995. It is sometimes referred to as i686. It was succeeded by the NetBurst microarchitecture in 2000, but eventually revived in the Pentium M...

 family of processors (Pentium Pro
Pentium Pro
The Pentium Pro is a sixth-generation x86 microprocessor developed and manufactured by Intel introduced in November 1, 1995 . It introduced the P6 microarchitecture and was originally intended to replace the original Pentium in a full range of applications...

, Pentium II
Pentium II
The Pentium II brand refers to Intel's sixth-generation microarchitecture and x86-compatible microprocessors introduced on May 7, 1997. Containing 7.5 million transistors, the Pentium II featured an improved version of the first P6-generation core of the Pentium Pro, which contained 5.5 million...

 and later), MTRRs may be used to control the processor access to memory ranges.

The Cyrix
Cyrix
Cyrix Corporation was a microprocessor developer that was founded in 1988 in Richardson, Texas as a specialist supplier of high-performance math coprocessors for 286 and 386 microprocessors. The company was founded by former Texas Instruments staff members and had a long but troubled relationship...

 6x86, 6x86MX and MII processors have Address Range Registers
Address Range Registers
Address-range registers are control registers of the Cyrix 6x86, 6x86MX and MII processors that are used as a control mechanism which provides system software with control of how accesses to memory ranges by the CPU are cached, similar to what memory type range registers provide on other...

 (ARRs) which provide a similar functionality to MTRRs.

The AMD K6-2 (stepping 8 and above) and K6-III processors have two MTRRs. The AMD Athlon
Athlon
Athlon is the brand name applied to a series of x86-compatible microprocessors designed and manufactured by Advanced Micro Devices . The original Athlon was the first seventh-generation x86 processor and, in a first, retained the initial performance lead it had over Intel's competing processors...

 family provide 8 Intel-style MTRRs.

The Centaur
Centaur Technology
Centaur Technology is an x86 CPU design company, now a wholly owned subsidiary of VIA Technologies, a member of the Formosa Plastics Group, Taiwan's largest industrial conglomerate.-History:...

 C6 WinChip
WinChip
The WinChip series was a low-power Socket 7-based x86 processor designed by Centaur Technology and marketed by its parent company IDT.-Design:The design of the WinChip was quite different from other processors of the time...

 has 8 MCRs
ARM architecture
ARM is a 32-bit reduced instruction set computer instruction set architecture developed by ARM Holdings. It was named the Advanced RISC Machine, and before that, the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in numbers produced...

, allowing write-combining.

The VIA
VIA Technologies
VIA Technologies is a Taiwanese manufacturer of integrated circuits, mainly motherboard chipsets, CPUs, and memory, and is part of the Formosa Plastics Group. It is the world's largest independent manufacturer of motherboard chipsets...

 Cyrix III
Cyrix III
Cyrix III is an x86-compatible Socket 370 CPU. VIA Technologies launched the processor in February 2000. VIA had recently purchased both Centaur Technology and Cyrix. Cyrix III was to be based upon a core from one of the two companies.- Joshua :...

 and VIA C3
VIA C3
The VIA C3 is a family of x86 central processing units for personal computers designed by Centaur Technology and sold by VIA Technologies. The different CPU cores are built following the design methodology of Centaur Technology.-Samuel 2 and Ezra cores:...

 CPUs offer 8 Intel-style MTRRs.

The memory interface of AMD K8 CPUs supports "Extended fixed-range MTRR Type-Field Encodings" which allows one to specify whether accesses to certain address ranges are executed by accessing RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

 through the Direct Connect Architecture
Direct Connect Architecture
The Direct Connect Architecture is the I/O architecture of the Athlon 64 X2, Opteron, and Phenom microprocessors from AMD. It consists of the combination of three elements:...

 or by executing memory-mapped I/O
Memory-mapped I/O
Memory-mapped I/O and port I/O are two complementary methods of performing input/output between the CPU and peripheral devices in a computer...

. This allows, for example, shadow RAM to be implemented by copying ROM contents into RAM.

Successor

Newer (primarily 64-bit
64-bit
64-bit is a word size that defines certain classes of computer architecture, buses, memory and CPUs, and by extension the software that runs on them. 64-bit CPUs have existed in supercomputers since the 1970s and in RISC-based workstations and servers since the early 1990s...

) x86 CPUs support a more advanced technique called Page Attribute Table
Page Attribute Table
The page attribute table is a processor supplementary capability extension to the page table format of certain x86 and x86-64 microprocessors...

s that allow for per-table setting of these modes, instead of having a limited number of low-granularity registers to deal with modern memory sizes that can be as high as 8 GiB even on a laptop, and several times that amount on a desktop system.

Details on how MTRRs work are described in the processor manuals from CPU vendors.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK