mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.98k stars 2.58k forks source link

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

Closed chongfeng-hu closed 1 year ago

chongfeng-hu commented 2 years 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: