From f521b3ea4ce83725075ed049af14b006bed8033c Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 10 Dec 2021 23:29:21 +0100 Subject: example:long_mode: Map guest software page readonly. --- examples/long_mode.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/long_mode.rs') diff --git a/examples/long_mode.rs b/examples/long_mode.rs index 0696ae4..01b3f53 100644 --- a/examples/long_mode.rs +++ b/examples/long_mode.rs @@ -95,7 +95,8 @@ fn setup_long_mode_4level_paging(mem: &mut UserMem) -> PhysAddr { w(PhysAddr(0x2000), PAGE_ENTRY_PRESENT | PAGE_RENTRY_RW | 0x3000); // PTE[0] maps Virt [0x0000:0x0fff] -> Phys [0x4000:0x4fff]. - w(PhysAddr(0x3000), PAGE_ENTRY_PRESENT | PAGE_RENTRY_RW | 0x4000); + // Just because we can, map this page readonly, as we loaded our guest sw here. + w(PhysAddr(0x3000), PAGE_ENTRY_PRESENT | 0x4000); // PTE[1] maps Virt [0x1000:0x1fff] -> Phys [0x5000:0x5fff]. w(PhysAddr(0x3008), PAGE_ENTRY_PRESENT | PAGE_RENTRY_RW | 0x5000); // PTE[2] maps Virt [0x2000:0x2fff] -> Phys [0x6000:0x6fff]. -- cgit v1.2.3