From: Chris Wright Subject: Re: kvm-86 fails to compile with "'IOMMU_CACHE' undeclared" Date: Wed, 20 May 2009 22:33:24 -0700 Message-ID: <20090521053324.GP20823@sequoia.sous-sol.org> References: <20090520174858.GA16793@nightfall.luchs.at> <20090520203022.GA6154@nik-comp.linuxbox.cz> <20090520204512.GB6154@nik-comp.linuxbox.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: =?iso-8859-1?Q?Ren=E9?= Pfeiffer , KVM list , nikola.ciprich@linuxbox.cz, Avi Kivity To: Nikola Ciprich Return-path: Received: from sous-sol.org ([216.99.217.87]:36784 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751415AbZEUFgO (ORCPT ); Thu, 21 May 2009 01:36:14 -0400 Content-Disposition: inline In-Reply-To: <20090520204512.GB6154@nik-comp.linuxbox.cz> Sender: kvm-owner@vger.kernel.org List-ID: * Nikola Ciprich (extmaillist@linuxbox.cz) wrote: > diff -Naur kvm-kmod-devel-86/external-module-compat-comm.h kvm-kmod-devel-86-disable-iommu-for-old-kernels/external-module-compat-comm.h > --- kvm-kmod-devel-86/external-module-compat-comm.h 2009-05-20 15:59:56.000000000 +0200 > +++ kvm-kmod-devel-86-disable-iommu-for-old-kernels/external-module-compat-comm.h 2009-05-20 22:37:23.632038570 +0200 > @@ -791,3 +791,7 @@ > } > > #endif > + > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) > +#undef CONFIG_IOMMU_API > +#endif This is too heavy handed. The only thing that's new is newer iommu code provides a query for cache coherency. You could do something as simple as: #ifndef IOMMU_CACHE #define IOMMU_CACHE (4) #define IOMMU_CAP_CACHE_COHERENCY 0x1 static inline int kvm_iommu_domain_has_cap(struct iommu_domain *domain, unsigned long cap) { return 0; } #else #define kvm_iommu_domain_has_cap iommu_domain_has_cap #endif and add it to the compat_api list in the sync script > diff -Naur kvm-kmod-devel-86/x86/iommu.c kvm-kmod-devel-86-disable-iommu-for-old-kernels/x86/iommu.c > --- kvm-kmod-devel-86/x86/iommu.c 2009-05-20 16:00:00.000000000 +0200 > +++ kvm-kmod-devel-86-disable-iommu-for-old-kernels/x86/iommu.c 2009-05-20 22:37:43.840878726 +0200 > @@ -1,3 +1,4 @@ > +#ifdef CONFIG_IOMMU_API > #ifndef KVM_UNIFDEF_H > #define KVM_UNIFDEF_H > > @@ -271,3 +272,4 @@ > iommu_domain_free(domain); > return 0; > } > +#endif BTW, just to clarify something...this file isn't part of kvm-kmod repo, it's a generated file from the 'make sync' process. thanks, -chris