Basics of getting started with ARM-A architecture (3) MMU

14-day learning training camp instructor course: Zhou Hehe "ARMv8/ARMv9 Architecture - Quick Start"

1. MMU(Memory Management Unit)

The meaning of the memory management unit, MMU is to convert the virtual address of the software program into a real physical address.

2. Types of MMUs

  1. Secure EL1&0 translation regime, when EL2 is disabled
  2. Non-secure EL1&0 translation regime, when EL2 is disabled
  3. SECURE EL1&0 translation regime, when EL2 is enabled
  4. Non-secure EL1&0 translation regime, when EL2 is enabled
  5. Secure EL2&0 translation regime
  6. Non-secure EL2&0 translation regime
  7. Secure EL2 translation regime
  8. Non-secure EL2 translation regime
  9. Secure EL3 translation regime

3. How to enable MMU

  1. Set the page table base address TTBR
  2. Initialize MAIR_EL3
  3. Configure TCR_EL3
  4. create page table
  5. Enable MMU

4. MMU model

insert image description here

5. Page table attributes

insert image description here
PBHA, bits[62:59] : for FEAT_HPDS2
XN or UXN, bit[54] : Execute-never or Unprivileged execute-never
PXN, bit[53] : Privileged execute-never
Contiguous, bit[51] : translation table entry Yes Continuous, can exist in a TLB Entry
DBM, bit[51] : Dirty Bit Modifier
GP, bit[50] : for FEAT_BTI
nT, bit[16] : for FEAT_BBM
nG, bit[11] : translation cached in the TLB , whether to use ASID to identify
AF, bit[10] : Access flag, after AF=0, when accessing the page for the first time, the flag will be set to 1
SH, bits[9:8] : shareable attribute
AP[2: 1], bit[7:6] : Data Access Permissions bits
NS, bit[5] : Non-secure bit
Attrlndx[2:0], bits[4:2]

6. Memory Properties

insert image description here
insert image description here

R or W Meaning
0b0 No Allocate
0b1 Allocate
dd Meaning
0b00 Device-nGnRnE memory
0b01 Device-nGnRE memory
0b10 Device-nGRE memory
0b11 Device-GRE memory

insert image description here

おすすめ

転載: blog.csdn.net/In_engineer/article/details/128127620