mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.58k stars 2.38k forks source link

Use NAPOT PMP to cover the entire physical address space #154

Open chongfeng-hu opened 1 year ago

chongfeng-hu commented 1 year ago

The current PMP setting uses TOR regions, which does not cover the end of the memory (spec: If PMP entry 0’s A field is set to TOR, zero is used for the lower bound, and so it matches any address y < pmpaddr0).

Proposed new NAPOT PMP covers every byte of physical memory in the 56-bit physical address space.

Quote from Andrew: you need to use a NAPOT PMP if you want to grant permissions to the entire address space.

Relevant discussions: