From: Paolo Bonzini Subject: [PATCH 2/4] fixes for changes in the iommu and PCI APIs Date: Thu, 8 Jan 2015 11:32:37 +0100 Message-ID: <1420713159-25947-3-git-send-email-pbonzini@redhat.com> References: <1420713159-25947-1-git-send-email-pbonzini@redhat.com> Cc: jan.kiszka@siemens.com To: kvm@vger.kernel.org Return-path: Received: from mail-wg0-f49.google.com ([74.125.82.49]:49866 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756086AbbAHKct (ORCPT ); Thu, 8 Jan 2015 05:32:49 -0500 Received: by mail-wg0-f49.google.com with SMTP id n12so1791840wgh.8 for ; Thu, 08 Jan 2015 02:32:48 -0800 (PST) In-Reply-To: <1420713159-25947-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: These API changes were introduced in 3.18. Signed-off-by: Paolo Bonzini --- 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 #include #include +#include #include #include #include @@ -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