Skip to content

Commit 4cb9b27

Browse files
committed
paging: mark default writable parent entries dirty
Add DIRTY to the default x86_64 parent page-table entry flags to prevent hardware from updating the entry again. Signed-off-by: Ziqiao Zhou <ziqiaozhou@microsoft.com>
1 parent f4a4ef2 commit 4cb9b27

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

paging/src/x86_64.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ impl GenericPageTableFlags for PTEntryFlags {
3232
const HUGE: Self = Self::HUGE;
3333

3434
/// present, writable, user-accessible, and accessed.
35+
/// ACCESSED & DIRTY => prevent future hardware mutations.
3536
fn parent_flags() -> Self {
36-
Self::PRESENT | Self::WRITABLE | Self::USER | Self::ACCESSED
37+
Self::PRESENT | Self::WRITABLE | Self::USER | Self::ACCESSED | Self::DIRTY
3738
}
3839

3940
/// page table is not accessible by user mode, and is not executable.

0 commit comments

Comments
 (0)