Skip to content

Commit 3ed66e8

Browse files
committed
riscv64: fix
1 parent d5f27ea commit 3ed66e8

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/arch/riscv64/mm/paging.rs

Lines changed: 1 addition & 5 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,7 +382,7 @@ 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
391387
self.entries[index].unset()
392388
} else {

0 commit comments

Comments
 (0)