Skip to content

Commit

Permalink
Copy all old pages table entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Colepng committed Oct 25, 2024
1 parent ea3f61a commit 770e5da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions uefi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 770e5da

Please sign in to comment.