riscv: Map devices with large pages on 32 & 64-bit

For 64-bit, this adds a 2nd-level page table for mapping devices using
2MiB frames instead of 1GiB frames.

The boot mapping and hardware header generator have also been fixed to
correctly report the number of large frames needed for devices rather
than only reporting the first. The frame size is also specified
correctly (rather than assuming mapping with 4KiB frames).

This likely fixes an issue whereby only the first 4KiB frame of a device
was reserved but the remaining region of that kernel device could be
mapped at user level.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
This commit is contained in:
Curtis Millar
2020-11-19 17:16:41 +11:00
committed by Curtis Millar
parent 8e57add854
commit ab3d8c44cb
8 changed files with 38 additions and 5 deletions

View File

@@ -245,6 +245,7 @@ devices:
regions:
- index: 0
kernel: PLIC_PPTR
kernel_size: 0x04000000
# elfloader rules
- compatible: