Skip to content

Commit 770e5da

Browse files
committed
Copy all old pages table entries
1 parent ea3f61a commit 770e5da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

uefi/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,10 @@ fn create_page_tables(
410410
}
411411
};
412412

413-
// copy the first entry (we don't need to access more than 512 GiB; also, some UEFI
414-
// implementations seem to create an level 4 table entry 0 in all slots)
415-
new_table[0] = old_table[0].clone();
413+
// copy all entries
414+
for (index, entry) in old_table.iter().enumerate() {
415+
new_table[index] = entry.clone();
416+
}
416417

417418
// the first level 4 table entry is now identical, so we can just load the new one
418419
unsafe {

0 commit comments

Comments
 (0)