-
Notifications
You must be signed in to change notification settings - Fork 11
MPU
Recap of MPU v3 specs
MPU v3 in QEMU
Auxiliary registers
Logging
MPU version 3 is fully supported in ARC QEMU. Below, you find a summary of MPU v3:
-
Number of regions: 0, 1, 2, 4, 8, 16
-
There is always 1 default region that does not contribute to the number of regions. If the address being handled does not fit into any of the regions, then this default region is used. This means that you can have 0 regions and still have MPU enabled. In this case, only the default region will be considered.
-
Region size: 32 bytes, 64 bytes, ..., 64 KB, 256 KB, ..., 2 GB, 4 GB
-
Each region's effective address is as such that its start address is a multiple of its size. e.g. If you define the size of a region to be 32 bytes and its address 50, it is not going to cover address 50 till 82. Instead, the region will be spanned over address 32 till 64.
-
Possible permissions: kernel read/write/execute; user read/write/execute
-
User access implies kernel access. e.g. if user is allowed to read a memory region, then the kernel can too, irrespective of if kernel read permission is set or not.
-
Regions with lower index have higher priority. For instance, in case of overlap between the regions addresses, the permission of a lower region is considered (region0 >> region 1 >> ... >> region15).
In the table below, you find the parameters that ARC-QEMU provides for configuring MPU:
| Parameter | Default | Value | Description |
|---|---|---|---|
| -global cpu.mpu-numreg | 0 | 0, 1, 2, 4, 8, 16 | number of regions available |
| -global cpu.has-mpu | true | false, true | MPU subsystem availability |
| reg name | gdb name | comment |
|---|---|---|
mpu_build |
$mpu_build |
version filed is hardcoded to 3 |
mpuen |
$mpuen |
|
mpuic |
$mpuecr |
this is addressed as MPU_ECR in reference manual |
mpurdb0 |
$mpurdb0 |
at least number of regions must be configured to 1 |
mpurdp0 |
$mpurdp0 |
" |
mpurdb1 |
$mpurdb1 |
at least number of regions must be configured to 2 |
mpurdp1 |
$mpurdp1 |
" |
mpurdb2 |
$mpurdb2 |
at least number of regions must be configured to 4 |
mpurdp2 |
$mpurdp2 |
" |
mpurdb3 |
$mpurdb3 |
" |
mpurdp3 |
$mpurdp3 |
" |
mpurdb4 |
$mpurdb4 |
at least number of regions must be configured to 8 |
mpurdp4 |
$mpurdp4 |
" |
mpurdb5 |
$mpurdb5 |
" |
mpurdp5 |
$mpurdp5 |
" |
mpurdb6 |
$mpurdb6 |
" |
mpurdp6 |
$mpurdp6 |
" |
mpurdb7 |
$mpurdb7 |
" |
mpurdp7 |
$mpurdp7 |
" |
mpurdb8 |
$mpurdb8 |
number of regions must be configured to 16 |
mpurdp8 |
$mpurdp8 |
" |
mpurdb9 |
$mpurdb9 |
" |
mpurdp9 |
$mpurdp9 |
" |
mpurdb10 |
$mpurdb10 |
" |
mpurdp10 |
$mpurdp10 |
" |
mpurdb11 |
$mpurdb11 |
" |
mpurdp11 |
$mpurdp11 |
" |
mpurdb12 |
$mpurdb12 |
" |
mpurdp12 |
$mpurdp12 |
" |
mpurdb13 |
$mpurdb13 |
" |
mpurdp13 |
$mpurdp13 |
" |
mpurdb14 |
$mpurdb14 |
" |
mpurdp14 |
$mpurdp14 |
" |
mpurdb15 |
$mpurdb15 |
" |
mpurdp15 |
$mpurdp15 |
" |
You may get information about MPU by passing -d mmu to qemu-system-arc. For better details, please consult the troubleshooting page.