Skip to content

Commit 2c41df0

Browse files
ziqiaozhouCopilot
andcommitted
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. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Ziqiao Zhou <ziqiaozhou@microsoft.com>
1 parent 8b15f7d commit 2c41df0

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
@@ -36,8 +36,9 @@ impl GenericPageTableFlags for PTEntryFlags {
3636
const HUGE: Self = Self::HUGE;
3737

3838
/// present, writable, user-accessible, and accessed.
39+
/// ACCESSED & DIRTY => prevent future hardware mutations.
3940
fn parent_flags() -> Self {
40-
Self::PRESENT | Self::WRITABLE | Self::USER | Self::ACCESSED
41+
Self::PRESENT | Self::WRITABLE | Self::USER | Self::ACCESSED | Self::DIRTY
4142
}
4243

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

0 commit comments

Comments
 (0)