mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 12:56:48 +00:00
Add some TODOs in IOMMU initialization
This commit is contained in:
parent
d2ff5fc1a9
commit
dd9fc81a81
@ -74,6 +74,11 @@ pub fn init() {
|
|||||||
// Create a Root Table instance.
|
// Create a Root Table instance.
|
||||||
let mut root_table = RootTable::new();
|
let mut root_table = RootTable::new();
|
||||||
// For all PCI devices, use the same page table.
|
// For all PCI devices, use the same page table.
|
||||||
|
//
|
||||||
|
// TODO: The BIOS reserves some memory regions as DMA targets and lists them in the Reserved
|
||||||
|
// Memory Region Reporting (RMRR) structures. These regions must be mapped for the hardware or
|
||||||
|
// firmware to function properly. For more details, see Intel(R) Virtualization Technology for
|
||||||
|
// Directed I/O (Revision 5.0), 3.16 Handling Requests to Reserved System Memory.
|
||||||
let page_table = PageTable::<DeviceMode, PageTableEntry, PagingConsts>::empty();
|
let page_table = PageTable::<DeviceMode, PageTableEntry, PagingConsts>::empty();
|
||||||
for table in PciDeviceLocation::all() {
|
for table in PciDeviceLocation::all() {
|
||||||
root_table.specify_device_page_table(table, unsafe { page_table.shallow_copy() })
|
root_table.specify_device_page_table(table, unsafe { page_table.shallow_copy() })
|
||||||
|
@ -258,6 +258,15 @@ impl IommuRegisters {
|
|||||||
|
|
||||||
let base_address = dmar
|
let base_address = dmar
|
||||||
.remapping_iter()
|
.remapping_iter()
|
||||||
|
// TODO: Add support for multiple DMA remapping hardware unit definitions (DRHDs). Note
|
||||||
|
// that we use `rev()` here to select the last one, since DRHDs that control specific
|
||||||
|
// devices tend to be reported first.
|
||||||
|
//
|
||||||
|
// For example, Intel(R) Virtualization Technology for Directed I/O (Revision 5.0), 8.4
|
||||||
|
// DMA Remapping Hardware Unit Definition Structure says "If a DRHD structure with
|
||||||
|
// INCLUDE_PCI_ALL flag Set is reported for a Segment, it must be enumerated by BIOS
|
||||||
|
// after all other DRHD structures for the same Segment".
|
||||||
|
.rev()
|
||||||
.find_map(|remapping| match remapping {
|
.find_map(|remapping| match remapping {
|
||||||
Remapping::Drhd(drhd) => Some(drhd.register_base_addr()),
|
Remapping::Drhd(drhd) => Some(drhd.register_base_addr()),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user