mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-16 08:46:48 +00:00
Panic if overriding existing device page tables
This commit is contained in:
parent
eca88697dd
commit
bad1a7a79a
@ -5,7 +5,6 @@
|
||||
use alloc::collections::BTreeMap;
|
||||
use core::mem::size_of;
|
||||
|
||||
use log::warn;
|
||||
use ostd_pod::Pod;
|
||||
|
||||
use super::second_stage::{DeviceMode, PageTableEntry, PagingConsts};
|
||||
@ -116,9 +115,12 @@ impl RootTable {
|
||||
* size_of::<ContextEntry>(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
if bus_entry.is_present() {
|
||||
warn!("IOMMU: Overwriting the existing device page table");
|
||||
panic!("existing device page tables should not be overridden");
|
||||
}
|
||||
|
||||
// Activate page table.
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user