Intel VT-d IOMMU passthrough
Posted: Fri Oct 15, 2021 2:04 am
Hi,
I've some confusion about the linux kernel boot options iommu=on and iommu=pt in the context of virtualization environments (e.g. QEMU/KVM). From my understanding iommu=on turns on the IOMMU device unit (if it exists in HW of course) for all uses. Adding further the option iommu=pt does mean the following:
ps. from the Intel manual 'vt-directed-io-spec - rev 3.3' section 10.4.3 the PT bit into Extended Capability Register is set if HW does support IOMMU passthrough. For each PCI device identified by its B/D/F the looked up Context Entry (or Scalable-Mode PASID Table Entry) specifies the Translation Type in TT (or GPTT) field (see section 9.3 - 9.6). Pass-through mode (TT = 10b or GPTT = 100b) actually means IOMMU does not perform any form of DMA target address translation -- i.e. DMA target addresses are actually system physical addresses.
I've some confusion about the linux kernel boot options iommu=on and iommu=pt in the context of virtualization environments (e.g. QEMU/KVM). From my understanding iommu=on turns on the IOMMU device unit (if it exists in HW of course) for all uses. Adding further the option iommu=pt does mean the following:
- from Host OS point of view the IOMMU unit is actually disabled (DMA target addresses are the same as host system physical addresses)
physical devices (e.g. NIC) configured in passthrough (e.g. NIC PCI passthrough) assigned to a Guest running in a VM, continue to use the IOMMU unit (their DMA target addresses are actually I/O virtual addresses assigned to the DMA-capable passthrough NIC by the Guest and translated by IOMMU DMARs to access memory)
ps. from the Intel manual 'vt-directed-io-spec - rev 3.3' section 10.4.3 the PT bit into Extended Capability Register is set if HW does support IOMMU passthrough. For each PCI device identified by its B/D/F the looked up Context Entry (or Scalable-Mode PASID Table Entry) specifies the Translation Type in TT (or GPTT) field (see section 9.3 - 9.6). Pass-through mode (TT = 10b or GPTT = 100b) actually means IOMMU does not perform any form of DMA target address translation -- i.e. DMA target addresses are actually system physical addresses.