From patchwork Thu Apr 23 08:43:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 19586 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3N8hQ8D012248 for ; Thu, 23 Apr 2009 08:43:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752727AbZDWInX (ORCPT ); Thu, 23 Apr 2009 04:43:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752538AbZDWInX (ORCPT ); Thu, 23 Apr 2009 04:43:23 -0400 Received: from mga11.intel.com ([192.55.52.93]:29978 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbZDWInW (ORCPT ); Thu, 23 Apr 2009 04:43:22 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 23 Apr 2009 01:38:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.40,235,1239001200"; d="scan'208";a="450640038" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.52]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2009 01:38:13 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1LwuWU-0006qE-V9; Thu, 23 Apr 2009 16:43:10 +0800 From: Sheng Yang To: Avi Kivity Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH] kvm: add iommu_domain_has_cap to module compatible Date: Thu, 23 Apr 2009 16:43:10 +0800 Message-Id: <1240476190-26280-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Sheng Yang --- kernel/external-module-compat-comm.h | 13 +++++++++++++ kernel/external-module-compat.c | 7 +++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h index c955927..5fb34c4 100644 --- a/kernel/external-module-compat-comm.h +++ b/kernel/external-module-compat-comm.h @@ -757,3 +757,16 @@ 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) +#endif + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + +int iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap); + +#endif diff --git a/kernel/external-module-compat.c b/kernel/external-module-compat.c index 0d858be..ac8bff7 100644 --- a/kernel/external-module-compat.c +++ b/kernel/external-module-compat.c @@ -352,3 +352,10 @@ unsigned kvm_get_tsc_khz(void) } #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) +int iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap) +{ + return 0; +} +#endif