From b684420d28c78e06496c761fd1275c86463d75ee Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 21 May 2024 01:10:23 +0800 Subject: [PATCH] pass the masked address to alloc_page was accidentally passing the whole address before, which was causing the LSB's that are assumed to be empty to muck up some page table computations. Also make sure old PTE entries are properly masked when recycling flags. --- kernel/src/arch/riscv/mem.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/src/arch/riscv/mem.rs b/kernel/src/arch/riscv/mem.rs index 6f472b666..75247ce42 100644 --- a/kernel/src/arch/riscv/mem.rs +++ b/kernel/src/arch/riscv/mem.rs @@ -934,8 +934,7 @@ pub fn ensure_page_exists_inner(address: usize) -> Result> 22) & ((1 << 12) - 1); @@ -1129,7 +1128,8 @@ pub fn evict_page_inner(target_pid: PID, vaddr: usize) -> Result {:08x} (flags: {:?}), count {}", + "-- evict[{}]: {:08x} -> {:08x} (flags: {:?}), count {}", + target_pid.get(), vaddr, target_paddr, MMUFlags::from_bits(target_pte & 0x3ff).unwrap(), @@ -1162,8 +1162,8 @@ pub fn evict_page_inner(target_pid: PID, vaddr: usize) -> Result