aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/iommu.c
diff options
context:
space:
mode:
authorZhai, Edwin <edwin.zhai@intel.com>2010-01-29 01:38:44 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:36:06 -0500
commitab9f4ecbb6d39a18e300a0d10a4968c37404aa76 (patch)
tree1f7fba2feaeca2f6d643437167c7b9036c909c98 /virt/kvm/iommu.c
parent6d3e435e708fa32f99b780caf6c5508a606a513b (diff)
KVM: enable PCI multiple-segments for pass-through device
Enable optional parameter (default 0) - PCI segment (or domain) besides BDF, when assigning PCI device to guest. Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> Acked-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/iommu.c')
-rw-r--r--virt/kvm/iommu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 65a51432c8e5..80fd3ad3b2de 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -106,7 +106,8 @@ int kvm_assign_device(struct kvm *kvm,
106 106
107 r = iommu_attach_device(domain, &pdev->dev); 107 r = iommu_attach_device(domain, &pdev->dev);
108 if (r) { 108 if (r) {
109 printk(KERN_ERR "assign device %x:%x.%x failed", 109 printk(KERN_ERR "assign device %x:%x:%x.%x failed",
110 pci_domain_nr(pdev->bus),
110 pdev->bus->number, 111 pdev->bus->number,
111 PCI_SLOT(pdev->devfn), 112 PCI_SLOT(pdev->devfn),
112 PCI_FUNC(pdev->devfn)); 113 PCI_FUNC(pdev->devfn));
@@ -127,7 +128,8 @@ int kvm_assign_device(struct kvm *kvm,
127 goto out_unmap; 128 goto out_unmap;
128 } 129 }
129 130
130 printk(KERN_DEBUG "assign device: host bdf = %x:%x:%x\n", 131 printk(KERN_DEBUG "assign device %x:%x:%x.%x\n",
132 assigned_dev->host_segnr,
131 assigned_dev->host_busnr, 133 assigned_dev->host_busnr,
132 PCI_SLOT(assigned_dev->host_devfn), 134 PCI_SLOT(assigned_dev->host_devfn),
133 PCI_FUNC(assigned_dev->host_devfn)); 135 PCI_FUNC(assigned_dev->host_devfn));
@@ -154,7 +156,8 @@ int kvm_deassign_device(struct kvm *kvm,
154 156
155 iommu_detach_device(domain, &pdev->dev); 157 iommu_detach_device(domain, &pdev->dev);
156 158
157 printk(KERN_DEBUG "deassign device: host bdf = %x:%x:%x\n", 159 printk(KERN_DEBUG "deassign device %x:%x:%x.%x\n",
160 assigned_dev->host_segnr,
158 assigned_dev->host_busnr, 161 assigned_dev->host_busnr,
159 PCI_SLOT(assigned_dev->host_devfn), 162 PCI_SLOT(assigned_dev->host_devfn),
160 PCI_FUNC(assigned_dev->host_devfn)); 163 PCI_FUNC(assigned_dev->host_devfn));