diff mbox

kvm: add iommu_domain_has_cap to module compatible

Message ID 1241494930-14553-1-git-send-email-sheng@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sheng Yang May 5, 2009, 3:42 a.m. UTC
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 kvm/kernel/external-module-compat-comm.h |   10 ++++++++++
 kvm/kernel/external-module-compat.c      |    9 +++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/kvm/kernel/external-module-compat-comm.h b/kvm/kernel/external-module-compat-comm.h
index c955927..13c3492 100644
--- a/kvm/kernel/external-module-compat-comm.h
+++ b/kvm/kernel/external-module-compat-comm.h
@@ -757,3 +757,13 @@  static inline struct page *compound_head(struct page *page)
 }
 
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#define IOMMU_CAP_CACHE_COHERENCY      0x1
+#define IOMMU_CACHE                    (4)
+
+#include <linux/iommu.h>
+
+int iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap);
+
+#endif
diff --git a/kvm/kernel/external-module-compat.c b/kvm/kernel/external-module-compat.c
index 0d858be..03d1149 100644
--- a/kvm/kernel/external-module-compat.c
+++ b/kvm/kernel/external-module-compat.c
@@ -292,6 +292,15 @@  int intel_iommu_found()
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#include <linux/iommu.h>
+
+int iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap)
+{
+       return 0;
+}
+
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)