All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@amd.com>
To: ehrhardt@linux.vnet.ibm.com
Cc: aliguori@us.ibm.com, Avi Kivity <avi@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH] qemu: fix configuring kvm probe when using --kerneldir
Date: Fri, 9 Jan 2009 15:36:35 +0100	[thread overview]
Message-ID: <496760F3.7020902@amd.com> (raw)
In-Reply-To: <1231503054-10618-1-git-send-email-ehrhardt@linux.vnet.ibm.com>

ehrhardt@linux.vnet.ibm.com wrote:
> From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> 
> 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 <ehrhardt@linux.vnet.ibm.com>
> ---
> 
> [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


WARNING: multiple messages have this Message-ID (diff)
From: Andre Przywara <andre.przywara@amd.com>
To: ehrhardt@linux.vnet.ibm.com
Cc: aliguori@us.ibm.com, Avi Kivity <avi@redhat.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] qemu: fix configuring kvm probe when using --kerneldir
Date: Fri, 9 Jan 2009 15:36:35 +0100	[thread overview]
Message-ID: <496760F3.7020902@amd.com> (raw)
In-Reply-To: <1231503054-10618-1-git-send-email-ehrhardt@linux.vnet.ibm.com>

ehrhardt@linux.vnet.ibm.com wrote:
> From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> 
> 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 <ehrhardt@linux.vnet.ibm.com>
> ---
> 
> [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

  reply	other threads:[~2009-01-09 14:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 12:10 [PATCH] qemu: fix configuring kvm probe when using --kerneldir ehrhardt
2009-01-09 12:10 ` [Qemu-devel] " ehrhardt
2009-01-09 14:36 ` Andre Przywara [this message]
2009-01-09 14:36   ` [Qemu-devel] " Andre Przywara
2009-01-12  6:42   ` Christian Ehrhardt
2009-01-12  6:42     ` [Qemu-devel] " Christian Ehrhardt
2009-01-09 20:05 ` Anthony Liguori
2009-01-09 20:05   ` [Qemu-devel] " Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496760F3.7020902@amd.com \
    --to=andre.przywara@amd.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=ehrhardt@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.