diff options
author | Weidong Han <weidong.han@intel.com> | 2008-12-02 08:03:39 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-01-03 08:02:19 -0500 |
commit | 260782bcfdaaa7850f29d6bb2ec6603019168c57 (patch) | |
tree | 6f0b72f07ee04ad1210aca861dd4ee8c51846609 /virt/kvm/kvm_main.c | |
parent | fe40f1e020d0923f5f35ca15f02a206c75a28053 (diff) |
KVM: use the new intel iommu APIs
intel iommu APIs are updated, use the new APIs.
In addition, change kvm_iommu_map_guest() to just create the domain, let kvm_iommu_assign_device() assign device.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index fc6127cbea1f..c92b63462b79 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -503,7 +503,12 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm, | |||
503 | list_add(&match->list, &kvm->arch.assigned_dev_head); | 503 | list_add(&match->list, &kvm->arch.assigned_dev_head); |
504 | 504 | ||
505 | if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) { | 505 | if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) { |
506 | r = kvm_iommu_map_guest(kvm, match); | 506 | if (!kvm->arch.intel_iommu_domain) { |
507 | r = kvm_iommu_map_guest(kvm); | ||
508 | if (r) | ||
509 | goto out_list_del; | ||
510 | } | ||
511 | r = kvm_assign_device(kvm, match); | ||
507 | if (r) | 512 | if (r) |
508 | goto out_list_del; | 513 | goto out_list_del; |
509 | } | 514 | } |