]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Deassign device in kvm_free_assgined_device
authorWeidong Han <weidong.han@intel.com>
Mon, 8 Dec 2008 15:29:53 +0000 (23:29 +0800)
committerJoerg Roedel <joerg.roedel@amd.com>
Sat, 3 Jan 2009 13:10:08 +0000 (14:10 +0100)
In kvm_iommu_unmap_memslots(), assigned_dev_head is already empty.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
include/linux/kvm_host.h
virt/kvm/kvm_main.c
virt/kvm/vtd.c

index ce5d1c17ce26fafdade59b824a241bf461d2d7b9..e62a4629e51c4d9a1318473135da50ae27516719 100644 (file)
@@ -316,6 +316,7 @@ struct kvm_assigned_dev_kernel {
 #define KVM_ASSIGNED_DEV_HOST_MSI      (1 << 9)
        unsigned long irq_requested_type;
        int irq_source_id;
+       int flags;
        struct pci_dev *dev;
        struct kvm *kvm;
 };
index 3238e08e4651b1467744ecd8103d38cb2d8fa995..4ef0fb43d1f9a0583f17b5d379c1736467cbaf1f 100644 (file)
@@ -496,6 +496,7 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm,
        match->assigned_dev_id = assigned_dev->assigned_dev_id;
        match->host_busnr = assigned_dev->busnr;
        match->host_devfn = assigned_dev->devfn;
+       match->flags = assigned_dev->flags;
        match->dev = dev;
        match->irq_source_id = -1;
        match->kvm = kvm;
index 174ea1f8cee5f19b0c8213b5e76ca883bafc8c5b..d46de9af838bee778c4bdf060872dcf37dabe2db 100644 (file)
@@ -205,22 +205,12 @@ static int kvm_iommu_unmap_memslots(struct kvm *kvm)
 
 int kvm_iommu_unmap_guest(struct kvm *kvm)
 {
-       struct kvm_assigned_dev_kernel *entry;
        struct dmar_domain *domain = kvm->arch.intel_iommu_domain;
 
        /* check if iommu exists and in use */
        if (!domain)
                return 0;
 
-       list_for_each_entry(entry, &kvm->arch.assigned_dev_head, list) {
-               printk(KERN_DEBUG "VT-d unmap: host bdf = %x:%x:%x\n",
-                      entry->host_busnr,
-                      PCI_SLOT(entry->host_devfn),
-                      PCI_FUNC(entry->host_devfn));
-
-               /* detach kvm dmar domain */
-               intel_iommu_detach_device(domain, entry->dev);
-       }
        kvm_iommu_unmap_memslots(kvm);
        intel_iommu_free_domain(domain);
        return 0;