From 770e5daaf5b1a211ed05b706b7e8d3b479122952 Mon Sep 17 00:00:00 2001 From: Cole Kauder-McMurrich Date: Fri, 25 Oct 2024 09:48:08 -0400 Subject: [PATCH] Copy all old pages table entries --- uefi/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/uefi/src/main.rs b/uefi/src/main.rs index 93dfb6c7..3c5cb4a3 100644 --- a/uefi/src/main.rs +++ b/uefi/src/main.rs @@ -410,9 +410,10 @@ fn create_page_tables( } }; - // copy the first entry (we don't need to access more than 512 GiB; also, some UEFI - // implementations seem to create an level 4 table entry 0 in all slots) - new_table[0] = old_table[0].clone(); + // copy all entries + for (index, entry) in old_table.iter().enumerate() { + new_table[index] = entry.clone(); + } // the first level 4 table entry is now identical, so we can just load the new one unsafe {