Chapter
6.
Memory Management
The PPC405GP memory management unit (MMU) performs address translation and protection
functions. With appropriate system software, the MMU supports:
โข Translation of effective addresses to real addresses
โข Independent enabling of instruction and data address translation and protection
โข Page-level access control using the translation mechanism
โข Software control of page replacement strategy
โข Additional virtual-mode control of protection using zones
โข Real-mode write protection
6.1
MMU
Overview
The instruction and integer units generate 32-bit effective addresses (EAs) for instruction fetches and
data accesses,
respectively. Instruction EAs are generated for sequential instruction fetches, and for
instruction fetches causing changes
in
program flow (branches and interrupts). Data EAs are
generated for
load/store and cache control instructions. The MMU translates EAs into real addresses;
the instruction cache unit
(ICU) and data cache unit (DCU) use real addresses
to
access memory.
The PPC405GP MMU supports demand-paged
virtual memory and other memory management
schemes that depend on precise
control of effective to real address mapping and flexible memory
protection.
Translation misses and protection faults cause precise interrupts. Sufficient information is
available to correct the fault and restart the faulting instruction.
The MMU divides storage into pages. A page represents the
granularity of EA translation and
protection
controls. Eight page sizes
(1
KB,
4KB, 16KB, 64KB, 256KB, 1 MB, 4MB, 16MB) are
simultaneously supported. A valid entry for a page containing the EA to be translated must be in the
translation lookaside buffer (TLB) for address translation to be performed. EAs for which no valid TLB
entry exists cause TLB-miss interrupts.
6.2 Address Translation
Fields
in
the Machine State Register (MSR) control the use of the MMU for address translation. The
instruction
relocate (IR) field of the MSR controls translation for instruction accesses. The data
relocate (DR) field of the MSR controls the translation mechanism for data accesses. These fields,
specified independently, can be changed at any
ti~e
by a program
in
supervisor state. Note that all
interrupts clear MSR[IR, DR] and place the processor
in
the supervisor state. Subsequent discussion
about
translation and protection assumes that MSR[IR, DR] are set, enabling address translation.
The processor references memory when it fetches an instruction, and when it executes load/store,
branch, and cache control instructions. Processor accesses to memory use EAs to references a
memory
location. When translation is enabled, the EA is translated into a real address, as illustrated
in
Figure
6-1
on page 6-2. The ICU
or
DCU uses the real address for the access. (When translation isยท
not
enabled, the EA is already a real address.)
Preliminary
Memory Management
6-1