mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 02:43:24 +00:00
Optimize the page table implementation using the frame metadata
This PR also refactored the page table cursor, distinguishing `Cursor` from `CursorMut`, and split a lot of functions to reduce dynamic condition checking. There are also other sanitizations performed, including refactoring PTE's `is_huge` API to `is_last`, hardening tracked mapping checks, and making `VmFrame` any size.
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
69d464fc6b
commit
141fbeaf0c
@ -138,7 +138,7 @@ impl RootTable {
|
||||
if bus_entry.is_present() {
|
||||
warn!("IOMMU: Overwritting the existing device page table");
|
||||
}
|
||||
let address = page_table.root_paddr();
|
||||
let address = unsafe { page_table.root_paddr() };
|
||||
context_table.page_tables.insert(address, page_table);
|
||||
let entry = ContextEntry(address as u128 | 1 | 0x1_0000_0000_0000_0000);
|
||||
context_table
|
||||
@ -262,7 +262,7 @@ impl ContextTable {
|
||||
|
||||
if !bus_entry.is_present() {
|
||||
let table = PageTable::<DeviceMode, PageTableEntry, PagingConsts>::empty();
|
||||
let address = table.root_paddr();
|
||||
let address = unsafe { table.root_paddr() };
|
||||
self.page_tables.insert(address, table);
|
||||
let entry = ContextEntry(address as u128 | 3 | 0x1_0000_0000_0000_0000);
|
||||
self.entries_frame
|
||||
|
Reference in New Issue
Block a user