From patchwork Wed May 20 20:45:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nikola Ciprich X-Patchwork-Id: 25085 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 n4KKix8t005396 for ; Wed, 20 May 2009 20:44:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755406AbZETUoz (ORCPT ); Wed, 20 May 2009 16:44:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754944AbZETUoz (ORCPT ); Wed, 20 May 2009 16:44:55 -0400 Received: from gwu.lbox.cz ([62.245.111.132]:50165 "EHLO gwu.lbox.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754839AbZETUoy (ORCPT ); Wed, 20 May 2009 16:44:54 -0400 Received: from linuxbox.linuxbox.cz (server.linuxbox.cz [10.76.66.10]) by gwu.lbox.cz (Sendmail) with ESMTP id n4KKhjZA030052; Wed, 20 May 2009 22:43:45 +0200 Received: from nik-comp.linuxbox.cz (nbnik.linuxbox.cz [10.76.66.65]) (authenticated bits=0) by linuxbox.linuxbox.cz (Sendmail) with ESMTP id n4KKhiIk021556; Wed, 20 May 2009 22:43:45 +0200 Date: Wed, 20 May 2009 22:45:12 +0200 From: Nikola Ciprich To: =?iso-8859-1?Q?Ren=E9?= Pfeiffer Cc: KVM list , nikola.ciprich@linuxbox.cz, Avi Kivity Subject: Re: kvm-86 fails to compile with "'IOMMU_CACHE' undeclared" Message-ID: <20090520204512.GB6154@nik-comp.linuxbox.cz> References: <20090520174858.GA16793@nightfall.luchs.at> <20090520203022.GA6154@nik-comp.linuxbox.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090520203022.GA6154@nik-comp.linuxbox.cz> User-Agent: Mutt/1.5.18 (2008-05-17) X-Antivirus: on proxybox by Kaspersky antivirus, engine 5.5.10, data 1998455 records(20-05-2009) X-Spam-Score: N/A (trusted relay) X-Scanned-By: MIMEDefang v2.56/SpamAssassin v3.002005 on proxybox Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi, KVM-86 IOMMU uses features available since 2.6.30-rcXX, attached patch disables its compilation on older kernels. I'm not sure if this is the best way to disable it, but You can use it as a workaround. Avi, is this OK? if so, please apply. nik On Wed, May 20, 2009 at 10:30:22PM +0200, Nikola Ciprich wrote: > Hi Rene, > as a workaround, You can disable > AMD IOMMU support (AMD_IOMMU) and > Support for DMA Remapping Devices (EXPERIMENTAL) (DMAR) > in Your host kernel. > I'll post patch to disable KVM IOMMU support for kernels <2.6.30 soon. > BR > nik > > On Wed, May 20, 2009 at 07:48:59PM +0200, René Pfeiffer wrote: > > Hello! > > > > I just tried to compile kvm-86 on two test machines and I get the > > following error: > > > > [...] > > CC [M] /usr/src/build/kvm-86/kvm/kernel/x86/iommu.o > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c: In function ‘kvm_iommu_map_pages’: > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c:90: error: ‘IOMMU_CACHE’ undeclared (first use in this function) > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c:90: error: (Each undeclared identifier is reported only once > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c:90: error: for each function it appears in.) > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c: In function ‘kvm_assign_device’: > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c:155: error: implicit declaration of function ‘iommu_domain_has_cap’ > > /usr/src/build/kvm-86/kvm/kernel/x86/iommu.c:156: error: ‘IOMMU_CAP_CACHE_COHERENCY’ undeclared (first use in this function) > > make[4]: *** [/usr/src/build/kvm-86/kvm/kernel/x86/iommu.o] Error 1 > > make[3]: *** [/usr/src/build/kvm-86/kvm/kernel/x86] Error 2 > > make[2]: *** [_module_/usr/src/build/kvm-86/kvm/kernel] Error 2 > > make[1]: *** [all] Error 2 > > make: *** [kvm-kmod] Error 2 > > > > Both machines run Debian Lenny with a custom kernel (2.6.29.1 and > > 2.6.29.3). One machine is Intel-based (Core2Duo), one is AMD-based. Both > > compiled earlier versions of kvm just fine. configure was run without > > options. > > > > Best, > > René. > > > > -- > > )\._.,--....,'``. fL Let GNU/Linux work for you while you take a nap. > > /, _.. \ _\ (`._ ,. R. Pfeiffer + http://web.luchs.at/ > > `._.-(,_..'--(,_..'`-.;.' - System administration + Consulting + Teaching - > > Got mail delivery problems? http://web.luchs.at/information/blockedmail.php > > > > -- > ------------------------------------- > Nikola CIPRICH > LinuxBox.cz, s.r.o. > 28. rijna 168, 709 01 Ostrava > > tel.: +420 596 603 142 > fax: +420 596 621 273 > mobil: +420 777 093 799 > > www.linuxbox.cz > > mobil servis: +420 737 238 656 > email servis: servis@linuxbox.cz > ------------------------------------- > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > 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 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