kvm: iommu: Convert to use new iommu_capable() API function
Cc: Gleb Natapov <gleb@kernel.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
7c2aa6441e
commit
ee5ba30ff7
|
@ -191,8 +191,7 @@ int kvm_assign_device(struct kvm *kvm,
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
noncoherent = !iommu_domain_has_cap(kvm->arch.iommu_domain,
|
noncoherent = !iommu_capable(&pci_bus_type, IOMMU_CAP_CACHE_COHERENCY);
|
||||||
IOMMU_CAP_CACHE_COHERENCY);
|
|
||||||
|
|
||||||
/* Check if need to update IOMMU page table for guest memory */
|
/* Check if need to update IOMMU page table for guest memory */
|
||||||
if (noncoherent != kvm->arch.iommu_noncoherent) {
|
if (noncoherent != kvm->arch.iommu_noncoherent) {
|
||||||
|
@ -254,8 +253,7 @@ int kvm_iommu_map_guest(struct kvm *kvm)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allow_unsafe_assigned_interrupts &&
|
if (!allow_unsafe_assigned_interrupts &&
|
||||||
!iommu_domain_has_cap(kvm->arch.iommu_domain,
|
!iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP)) {
|
||||||
IOMMU_CAP_INTR_REMAP)) {
|
|
||||||
printk(KERN_WARNING "%s: No interrupt remapping support,"
|
printk(KERN_WARNING "%s: No interrupt remapping support,"
|
||||||
" disallowing device assignment."
|
" disallowing device assignment."
|
||||||
" Re-enble with \"allow_unsafe_assigned_interrupts=1\""
|
" Re-enble with \"allow_unsafe_assigned_interrupts=1\""
|
||||||
|
|
Loading…
Reference in a new issue