Skip to content

Commit 2274e53

Browse files
committed
riscv64: fix
1 parent d5f27ea commit 2274e53

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/arch/riscv64/mm/paging.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ impl PageTableEntry {
152152
physical_address.is_aligned_to(BasePageSize::SIZE),
153153
"Physical address is not on a 4 KiB page boundary (physical_address = {physical_address:#X})"
154154
);
155-
assert!(
156-
!physical_address.is_null(),
157-
"Cannot set a page table entry with null address"
158-
);
159155

160156
let mut flags_to_set = flags;
161157
flags_to_set.insert(PageTableEntryFlags::VALID);
@@ -386,9 +382,9 @@ impl<L: PageTableLevel> PageTableMethods for PageTable<L> {
386382
let index = page.table_index::<L>();
387383
let flush = self.entries[index].is_present();
388384

389-
if physical_address.is_null() {
385+
if physical_address.is_null() && flags == PageTableEntryFlags::BLANK {
390386
// Clear PTE
391-
self.entries[index].unset()
387+
self.entries[index].unset();
392388
} else {
393389
self.entries[index].set(
394390
physical_address,

0 commit comments

Comments
 (0)