iommu_setup_default_domain[核心1] //为每个group分配并设置default_domain. 详见后文 //通过sysfs下面的type修改iommu_group的domian也是调此函数,形参是domian type //NOTE: iommu_group会有domain和default_domain成员,分配完default_domain后会将此domain //再赋值给domain成员,当unbind驱动时会替换domain的赋值,...
struct dmar_domain: dmar_domain里面存储的是iova->hpa的转换页表,一个dmar_domain可以为多个或者一个设备服务。 struct iommu_domain: 一个iommu_domain里面可以有多个iommu_group,然后每个iommu_group通过iommu_domain最终找到dmar_domain进行转换。 后记 在下一篇文章里面会详细讲一下在虚拟化和非虚拟化场景下系统如...
iommu_domain定位了asid。group 里面的设备既然公用一套iova的页表,那么只能透传给一个虚机,不能分开透传。 一个iommu_group里面既可能只有一个device,也可能有多个device。 arm smmu-v3中的 iommugroup 类型为2类 //caq:arm中针对iommu,有两类group,如果是pci的设备,用一个默认group,否则用系统的默认group,注意...
void (*iotlb_sync)(struct iommu_domain *domain);//caq:tlb同步phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);//caq:核心热点函数int (*add_device)(struct device *dev);//caq:add 是指add到iommu_group中void (*remove_device)(struct device *dev);//caq:remove...
系统构建全局si_domain,负责地址转换页表,为每个节点内存建立IOVA与HPA间的映射。接着,设备与iommu_domain相关联,通过设备bus号定位root_table并创建context_entry,同时更新si_domain的pgd。最后,pci_bus通过iommu_ops进行设置,初始化回调和iommu_group,调用pci_device_group分配设备到特定的iommu_group...
DOMAIN_CONFIGURATION structure énumération DOMAIN_CONFIGURATION_ARCH DOMAIN_CONFIGURATION_ARM64 structure DOMAIN_CONFIGURATION_X64 structure DRIVER_ADD_DEVICE fonction de rappel DRIVER_CANCEL fonction de rappel DRIVER_CONTROL fonction de rappel DRIVER_DISPATCH fonction de rappel DRIVER_INITIALIZE fonction de...
Container:对于虚机,Container 这里可以简单理解为一个VM Domain的物理内存空间。对于用户态驱动,Container可以是多个Group的集合。 上图中PCIe-PCI桥下的两个设备,在发送DMA请求时,PCIe-PCI桥会为下面两个设备生成Source Identifier,其中Bus域为红色总线号bus,device和func域为0。这样的话,PCIe-PCI桥下的两个设备会...
* @device_group: find iommu group for a particular device * @domain_get_attr: Query domain attributes * @domain_set_attr: Change domain attributes * @support_dirty_log: Check whether domain supports dirty log tracking * @switch_dirty_log: Perform actions to start|stop dirty log tracking ...
为了分别管理,这两种概念,iommu 框架提供了两种结构体,一个是 struct iommu_domain 这个结构抽象出了一个domain的结构,用来代表底层的arm_smmu_domain,其实最核心的是管理这个domian所拥有的io page table。另外一个是sruct iommu_group这个结构是用来管理设备的,多个设备可以在一个iommu group中,以此来共享一个iopag...
(1)group: pass through给同一个虚拟机的io device集合。Group 是IO MMU能够进行DMA隔离的最小硬件单元(隔离:即使用不同的页表)。 (2)container: 对于虚拟机,container这里可以简单理解为一个VM Domain(虚拟机)的物理内存空间,对于用户态驱动,container可以是多个group的集合。从这里看出——虚拟机其实是一个特殊...