Skip to contentSkip to conversation

Enable Pass Through Feature in Intel IOMMU

PATCH New Fenghua Yu 1 participant 1 message Nov 24, 2008 4 messages not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): A6AD88C3F2289247BE726C37303E1EB884780E2A@orsmsx505.amr.corp.intel.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): A6AD88C3F2289247BE726C37303E1EB884876541@orsmsx505.amr.corp.intel.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

Fenghua Yu

author
#4 lore raw

PATCH 2/2 Enable Pass Through Feature in Intel IOMMU

The patch set adds kernel parameter intel_iommu=pt to set up pass through mode in context mapping entry. This disables DMAR in linux kernel; but KVM still runs on VT-d. In this mode, kernel uses swiotlb for DMA API functions but other VT-d functionalities are enabled for KVM. By default, pass though mode is disabled in kernel.

This second patch changes context mapping interface called in KVM vtd.c. KVM always uses multi level translation page table in VT-d.

---

 vtd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
virt/kvm/vtd.c +1 -1
index a770874..7b753d7 100644
@@ -124,7 +124,7 @@ int kvm_iommu_map_guest(struct kvm *kvm,
 			       pdev->bus->number, pdev->devfn);
 
 	r = intel_iommu_context_mapping(kvm->arch.intel_iommu_domain,
-					pdev);
+					pdev, CONTEXT_TT_MULTI_LEVEL);
 	if (r) {
 		printk(KERN_ERR "Domain context map for %s failed",
 		       pci_name(pdev));