From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LLISM-0003gb-12 for qemu-devel@nongnu.org; Fri, 09 Jan 2009 09:35:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LLISK-0003gG-U0 for qemu-devel@nongnu.org; Fri, 09 Jan 2009 09:35:25 -0500 Received: from [199.232.76.173] (port=50555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LLISK-0003gD-O6 for qemu-devel@nongnu.org; Fri, 09 Jan 2009 09:35:24 -0500 Received: from outbound-wa4.frontbridge.com ([216.32.181.16]:8986 helo=WA4EHSOBE004.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1LLISJ-0002VJ-Ov for qemu-devel@nongnu.org; Fri, 09 Jan 2009 09:35:24 -0500 Message-ID: <496760F3.7020902@amd.com> Date: Fri, 9 Jan 2009 15:36:35 +0100 From: Andre Przywara MIME-Version: 1.0 References: <1231503054-10618-1-git-send-email-ehrhardt@linux.vnet.ibm.com> In-Reply-To: <1231503054-10618-1-git-send-email-ehrhardt@linux.vnet.ibm.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] qemu: fix configuring kvm probe when using --kerneldir Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ehrhardt@linux.vnet.ibm.com Cc: aliguori@us.ibm.com, Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org ehrhardt@linux.vnet.ibm.com wrote: > From: Christian Ehrhardt > > There is already a variable kvm_cflags which gets the path of the kernel > includes when using --kerneldir. But eventually with newer kernels we all will > need arch/$arch/include too (my case was a incldue of asm/kvm.h which was not > found anymore). Headers in a full kernel source are not flattened to > one arch like they are if e.g. installed kernel headers are used. I also stumbled over this recently (in kvm-userspace.git), but I had problems with the qemu part not including KVM support because in qemu/configure the KVM build test failed due to the missing asm/kvm.h. I saw that --kerneldir gets not propagated to qemu, but libkvm_kerneldir instead, which is hardcoded to point to `pwd`/kernel. Shouldn't that be fixed, too? I use kvm-userspace.git and a not-installed kernel from kvm.git for compiling, so I say "./configure --kerneldir=/src/kvm.git --with-patched-kernel". I eventually hacked KVM's configure to propagate --kerneldir to qemu and added arch/x86/include to the include path in qemu/configure. This is of course a hack (that's why I don't append it here), but it worked ;-) If someone proposes a clean and easy way to solve this, I'd be happy to write a patch. > To fix that, the includes added to cflags depending on --kerneldir should also > contian the arch includes. The patch adds a special check for x86 because its > source layout recently changed, all others directly use arch/$cpu/include if > existent. This is one problem I also noticed. $cpu is not the same as the Linux' arch name, is there a suitable variable or do we have to do a large switch/case? Regards, Andre. > > Signed-off-by: Christian Ehrhardt > --- > > [diffstat] > configure | 6 ++++++ > 1 file changed, 6 insertions(+) > > [diff] > diff --git a/configure b/configure > --- a/configure > +++ b/configure > @@ -963,6 +963,12 @@ EOF > EOF > if test "$kerneldir" != "" ; then > kvm_cflags=-I"$kerneldir"/include > + if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \ > + -a -d "$kerneldir/arch/x86/include" ; then > + kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include" > + elif test -d "$kerneldir/arch/$cpu/include" ; then > + kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include" > + fi > else > kvm_cflags="" > fi -- Andre Przywara AMD-OSRC (Dresden) Tel: x84917