If you have IOMMU on, there's a chance you really want it to do something. But is it really? Is it ensuring that PCI / PCIe devices make DMA reads and writes only where they're allowed to? For example, if these lines appear in the kernel log, iommu: Default domain type: Translat...
root=/dev/mapper/pve-root ro quiet vfio-pci.ids=8086:9a49 intel_iommu=on [ 0.040467] DMAR: IOMMU enabled [ 0.685431] pci 0000:00:02.0: DMAR: Skip IOMMU disabling for graphics [ 0.723207] iommu: Default domain type: Translated [ 0.723207] iommu: DMA domain TLB invalidation policy: lazy ...
[ 2.779978] iommu: Default domain type: Translated [ 2.779978] iommu: DMA domain TLB invalidation policy: lazy mode $ accel-config -v 4.1.3+ $ sudo accel-config load-config -c contrib/configs/app_profile.conf -e Enabling device dsa0 Error enabling device Error[0x800c0000] dsa0: wq ...
drivers/iommu/iommu.c iommu.passthrough的实现 voidiommu_set_default_passthrough(boolcmd_line){if(cmd_line)iommu_cmd_line|=IOMMU_CMD_LINE_DMA_API;iommu_def_domain_type=IOMMU_DOMAIN_IDENTITY;}voidiommu_set_default_translated(boolcmd_line){if(cmd_line)iommu_cmd_line|=IOMMU_CMD_LINE_DMA_API;io...
[ 0.491591] pci 0000:00:02.0: DMAR: Skip IOMMU disabling for graphics [ 0.520069] iommu: Default domain type: Translated [ 0.520069] iommu: DMA domain TLB invalidation policy: lazy mode [ 0.560897] DMAR: IOMMU feature fl1gp_support inconsistent ...
在IOMMU 中,每一个 domain 即代表一个 IOMMU 映射地址空间,即一个 page table。一个 group 逻辑上是需要与 domain 进行绑定的,即一个 group 中的所有设备都位于一个 domain 中。在 Linux 内核的 IOMMU 子系统中,domain 由 struct iommu_domain 结构体表示,这个结构体定义 (位于 include/linux/iommu.h 文件...
* @def_domain_type: device default domain type, return value: * - IOMMU_DOMAIN_IDENTITY: must use an identity domain * - IOMMU_DOMAIN_DMA: must use a dma domain * - 0: use the default setting * @default_domain_ops: the default ops for domains ...
New iommu_groups can be attached to a container, its vfio_group is created and added to an exist or new created vfio_domain (so as its iommu_domain, and this new iommu_domain will replace the default_domain as effective domain in the iommu_group). In the case of new domain created, ...
IOMMU domain attach and detach is extremely fast, but is nonetheless not currently atomic. This means that a transaction issued over PCIe isn't guaranteed to be translated correctly while swapping to an IOMMU domain with different mappings.
显卡透传本来是工作内容,我自己做完发现还不错挺方便的,物理机是Ubuntu,KVM下的虚拟机是WIN10,完成...