[PATCH 2/4] fixes for changes in the iommu and PCI APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These API changes were introduced in 3.18.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 external-module-compat-comm.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index 1717ba3..6866658 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -14,6 +14,7 @@
 #include <linux/kvm_para.h>
 #include <linux/kconfig.h>
 #include <linux/cpu.h>
+#include <linux/pci.h>
 #include <linux/time.h>
 #include <linux/kernel.h>
 #include <asm/processor.h>
@@ -1425,6 +1426,20 @@ extern u64 kvm_get_boot_base_ns(struct timekeeper *tk);
 #undef is_zero_pfn
 #define is_zero_pfn(pfn) ((pfn) == page_to_pfn(ZERO_PAGE(0)))
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18, 0)
+#define iommu_capable(dummy, cap) \
+    iommu_domain_has_cap(kvm->arch.iommu_domain, cap)
+
+static inline void pci_clear_dev_assigned(struct pci_dev *pdev)
+{
+	pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
+}
+
+static inline void pci_set_dev_assigned(struct pci_dev *pdev)
+{
+	pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
+}
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
 void *get_xsave_addr(struct xsave_struct *xsave, int feature);
 #endif
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux