Skip to content

Commit 2c888a9

Browse files
committed
tool: generate page tables for EL1 support
This is as per the documentation given above the function, just for some reason only lvl0_lower ever had anything placed in it. This makes the code dual-use for hypervisor/not. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
1 parent 3db249f commit 2c888a9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tool/microkit/src/loader.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,11 +870,14 @@ impl<'a> Loader<'a> {
870870
boot_lvl2_lower[start..end].copy_from_slice(&pt_entry.to_le_bytes());
871871
}
872872

873-
let boot_lvl0_upper: [u8; PAGE_TABLE_SIZE] = [0; PAGE_TABLE_SIZE];
873+
let mut boot_lvl0_upper: [u8; PAGE_TABLE_SIZE] = [0; PAGE_TABLE_SIZE];
874874
{
875875
let pt_entry = aarch64::table_descriptor(boot_lvl1_upper_addr);
876876
let idx = aarch64::lvl0_index(first_vaddr);
877+
// For EL2.
877878
boot_lvl0_lower[8 * idx..8 * (idx + 1)].copy_from_slice(&pt_entry.to_le_bytes());
879+
// For EL1.
880+
boot_lvl0_upper[8 * idx..8 * (idx + 1)].copy_from_slice(&pt_entry.to_le_bytes());
878881
}
879882

880883
let mut boot_lvl1_upper: [u8; PAGE_TABLE_SIZE] = [0; PAGE_TABLE_SIZE];

0 commit comments

Comments
 (0)