소스 검색

fix(set_root_page_table): satp::set should take pfn

greatbridf 7 달 전
부모
커밋
070dcd8779
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      arch/src/riscv64/mod.rs

+ 1 - 3
arch/src/riscv64/mod.rs

@@ -34,9 +34,7 @@ pub fn get_root_page_table_pfn() -> PFN {
 
 #[inline(always)]
 pub fn set_root_page_table_pfn(pfn: PFN) {
-    let ppn = PAddr::from(pfn).addr();
-
-    unsafe { satp::set(satp::Mode::Sv39, 0, ppn) };
+    unsafe { satp::set(satp::Mode::Sv48, 0, usize::from(pfn)) };
     sfence_vma_all();
 }