Skip to content

Commit

Permalink
[fix] bug in boot pagetable mapping in riscv64_qemu_virt
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Nov 18, 2024
1 parent 6f1808d commit f592719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/axhal/src/platform/riscv64_qemu_virt/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ static mut BOOT_PT_SV39: [u64; 512] = [0; 512];

unsafe fn init_boot_page_table() {
// 0x0000_0000..0x4000_0000, VRWX_GAD, 1G block
BOOT_PT_SV39[0] = (0x80000 << 10) | 0xef;
BOOT_PT_SV39[0] = (0x0 << 10) | 0xef;
// 0x8000_0000..0xc000_0000, VRWX_GAD, 1G block
BOOT_PT_SV39[2] = (0x80000 << 10) | 0xef;
// 0xffff_ffc0_0000_0000..0xffff_ffc0_4000_0000, VRWX_GAD, 1G block
BOOT_PT_SV39[0x100] = (0x80000 << 10) | 0xef;
BOOT_PT_SV39[0x100] = (0x0 << 10) | 0xef;
// 0xffff_ffc0_8000_0000..0xffff_ffc0_c000_0000, VRWX_GAD, 1G block
BOOT_PT_SV39[0x102] = (0x80000 << 10) | 0xef;
}
Expand Down

0 comments on commit f592719

Please sign in to comment.