Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-23 Thread Jan Kiszka
On 2011-06-23 07:37, Stefan Weil wrote:
 Am 22.06.2011 23:37, schrieb Jan Kiszka:
 On 2011-06-22 22:51, Stefan Weil wrote:
 If not, kvm=yes should be restricted to platforms with kvm support.

 Otherwise, QEMU builds will fail very early:

 ERROR: Host kernel lacks signalfd() support,
 but KVM depends on it when the IO thread is disabled.

 Of course, users of those non-kvm platforms can set --disable-kvm,
 but I don't think that is the correct solution.

 Even with kvm disabled, builds still fail for non-kvm systems:

 In file included from /qemu/hw/kvmclock.c:21:
 /qemu/linux-headers/linux/kvm_para.h:26:26: warning: asm/kvm_para.h: No
 such file or directory

 That indicates symlink emulation under Windows does not support
 directories. Can you confirm this (check what
 builddir/linux-headers/asm became)? Then we would have to link all
 files in the arch header dir individually.

 Jan
 
 Even when cross compiling for w32 (on a linux host), kvmclock.c
 does not compile:
 
 $ LANG=C make CFLAGS=-g
   CCi386-softmmu/kvmclock.o
 In file included from /home/stefan/src/qemu/savannah/qemu/hw/kvmclock.c:20:
 /home/stefan/src/qemu/savannah/qemu/linux-headers/linux/kvm.h:10:25:
 warning: linux/types.h: No such file or directory
 /home/stefan/src/qemu/savannah/qemu/linux-headers/linux/kvm.h:12:25:
 warning: linux/ioctl.h: No such file or directory
 In file included from
 /home/stefan/src/qemu/savannah/qemu/linux-headers/linux/kvm.h:13,
  from /home/stefan/src/qemu/savannah/qemu/hw/kvmclock.c:20:
 ../linux-headers/asm/kvm.h:32: error: expected specifier-qualifier-list
 before '__u32'
 ../linux-headers/asm/kvm.h:41: error: expected specifier-qualifier-list
 before '__u8'
 ../linux-headers/asm/kvm.h:61: error: expected specifier-qualifier-list
 before '__u64'
 
 Is kvmclock.c really needed for non-kvm platforms? Or does it simply need
 a obj-i386-$(CONFIG_KVM) in Makefile.target?

It's not needed, specifically as we do not (yet) emulate the pv
interfaces of KVM. But changing the makefile won't suffice, we also need
to stub out kvmclock_create.

Right now I'm fighting to get a mingw build that far at all. The version
I have here (gcc 4.6 based) does not include liberity (but apparently
links fine without as well). Then there are tons of other errors and
warnings. Do you have some tree with recent fixes?

I would suggest you to set up a buildbot for the Windows platform. That
should help to get notifications about breakages a bit earlier. And that
may help to keep their number down (this broken window thing: once the
first few got damaged, no one will bother about smashing another one.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-22 Thread Stefan Weil

Am 08.06.2011 16:10, schrieb Jan Kiszka:

This helps reducing our build-time checks for feature support in the
available Linux kernel headers. And it helps users that do not have
sufficiently recent headers installed on their build machine.

Consequently, the patch removes and build-time checks for kvm and vhost
in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
supposed to be provided by QEMU only.

s390 needs some extra love as it carries redefinitions from kernel
headers.

CC: Alexander Graf ag...@suse.de
Signed-off-by: Jan Kiszka jan.kis...@siemens.com
---
Makefile.target | 4 +-
configure | 151 ++
target-s390x/cpu.h | 10 ---
target-s390x/op_helper.c | 1 +
4 files changed, 21 insertions(+), 145 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index 5c22df8..be9c0e8 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -14,7 +14,7 @@ endif

TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
-QEMU_CFLAGS+= -I.. -I$(TARGET_PATH) -DNEED_CPU_H
+QEMU_CFLAGS+= -I.. -I../linux-headers -I$(TARGET_PATH) -DNEED_CPU_H

include $(SRC_PATH)/Makefile.objs

@@ -37,8 +37,6 @@ ifndef CONFIG_HAIKU
LIBS+=-lm
endif

-kvm.o kvm-all.o vhost.o vhost_net.o kvmclock.o: 
QEMU_CFLAGS+=$(KVM_CFLAGS)

-
config-target.h: config-target.h-timestamp
config-target.h-timestamp: config-target.mak

diff --git a/configure b/configure
index d38b952..0e1dc46 100755
--- a/configure
+++ b/configure
@@ -113,8 +113,7 @@ curl=
curses=
docs=
fdt=
-kvm=
-kvm_para=
+kvm=yes
nptl=


Are you planning to add kvm support for all platforms which don't 
support it today?

If not, kvm=yes should be restricted to platforms with kvm support.

Otherwise, QEMU builds will fail very early:

 ERROR: Host kernel lacks signalfd() support,
 but KVM depends on it when the IO thread is disabled.

Of course, users of those non-kvm platforms can set --disable-kvm,
but I don't think that is the correct solution.

Even with kvm disabled, builds still fail for non-kvm systems:

 In file included from /qemu/hw/kvmclock.c:21:
 /qemu/linux-headers/linux/kvm_para.h:26:26: warning: asm/kvm_para.h: 
No such file or directory


Cheers,

Stefan

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-22 Thread Jan Kiszka
On 2011-06-22 22:51, Stefan Weil wrote:
 Am 08.06.2011 16:10, schrieb Jan Kiszka:
 This helps reducing our build-time checks for feature support in the
 available Linux kernel headers. And it helps users that do not have
 sufficiently recent headers installed on their build machine.

 Consequently, the patch removes and build-time checks for kvm and vhost
 in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
 supposed to be provided by QEMU only.

 s390 needs some extra love as it carries redefinitions from kernel
 headers.

 CC: Alexander Graf ag...@suse.de
 Signed-off-by: Jan Kiszka jan.kis...@siemens.com
 ---
 Makefile.target | 4 +-
 configure | 151 ++
 target-s390x/cpu.h | 10 ---
 target-s390x/op_helper.c | 1 +
 4 files changed, 21 insertions(+), 145 deletions(-)

 diff --git a/Makefile.target b/Makefile.target
 index 5c22df8..be9c0e8 100644
 --- a/Makefile.target
 +++ b/Makefile.target
 @@ -14,7 +14,7 @@ endif

 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
 $(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
 -QEMU_CFLAGS+= -I.. -I$(TARGET_PATH) -DNEED_CPU_H
 +QEMU_CFLAGS+= -I.. -I../linux-headers -I$(TARGET_PATH) -DNEED_CPU_H

 include $(SRC_PATH)/Makefile.objs

 @@ -37,8 +37,6 @@ ifndef CONFIG_HAIKU
 LIBS+=-lm
 endif

 -kvm.o kvm-all.o vhost.o vhost_net.o kvmclock.o:
 QEMU_CFLAGS+=$(KVM_CFLAGS)
 -
 config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak

 diff --git a/configure b/configure
 index d38b952..0e1dc46 100755
 --- a/configure
 +++ b/configure
 @@ -113,8 +113,7 @@ curl=
 curses=
 docs=
 fdt=
 -kvm=
 -kvm_para=
 +kvm=yes
 nptl=
 
 Are you planning to add kvm support for all platforms which don't
 support it today?

That would mean replacing all their kernels with Linux. Will take a bit
longer.

I simply overshot with my cleanups:

diff --git a/configure b/configure
index 3286e33..e6847c4 100755
--- a/configure
+++ b/configure
@@ -113,7 +113,7 @@ curl=
 curses=
 docs=
 fdt=
-kvm=yes
+kvm=
 nptl=
 sdl=
 vnc=yes
@@ -129,7 +129,7 @@ xen=
 xen_ctrl_version=
 linux_aio=
 attr=
-vhost_net=yes
+vhost_net=
 xfs=

 gprof=no
@@ -457,6 +457,8 @@ Haiku)
   linux=yes
   linux_user=yes
   usb=linux
+  kvm=yes
+  vhost_net=yes
   if [ $cpu = i386 -o $cpu = x86_64 ] ; then
 audio_possible_drivers=$audio_possible_drivers fmod
   fi

Will post this as a patch tomorrow.

 If not, kvm=yes should be restricted to platforms with kvm support.
 
 Otherwise, QEMU builds will fail very early:
 
  ERROR: Host kernel lacks signalfd() support,
  but KVM depends on it when the IO thread is disabled.
 
 Of course, users of those non-kvm platforms can set --disable-kvm,
 but I don't think that is the correct solution.
 
 Even with kvm disabled, builds still fail for non-kvm systems:
 
  In file included from /qemu/hw/kvmclock.c:21:
  /qemu/linux-headers/linux/kvm_para.h:26:26: warning: asm/kvm_para.h: No
 such file or directory

That indicates symlink emulation under Windows does not support
directories. Can you confirm this (check what
builddir/linux-headers/asm became)? Then we would have to link all
files in the arch header dir individually.

Jan




signature.asc
Description: OpenPGP digital signature


Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-22 Thread Stefan Weil

Am 22.06.2011 23:37, schrieb Jan Kiszka:

On 2011-06-22 22:51, Stefan Weil wrote:

If not, kvm=yes should be restricted to platforms with kvm support.

Otherwise, QEMU builds will fail very early:

ERROR: Host kernel lacks signalfd() support,
but KVM depends on it when the IO thread is disabled.

Of course, users of those non-kvm platforms can set --disable-kvm,
but I don't think that is the correct solution.

Even with kvm disabled, builds still fail for non-kvm systems:

In file included from /qemu/hw/kvmclock.c:21:
/qemu/linux-headers/linux/kvm_para.h:26:26: warning: asm/kvm_para.h: No
such file or directory


That indicates symlink emulation under Windows does not support
directories. Can you confirm this (check what
builddir/linux-headers/asm became)? Then we would have to link all
files in the arch header dir individually.

Jan


Even when cross compiling for w32 (on a linux host), kvmclock.c
does not compile:

$ LANG=C make CFLAGS=-g
  CCi386-softmmu/kvmclock.o
In file included from /home/stefan/src/qemu/savannah/qemu/hw/kvmclock.c:20:
/home/stefan/src/qemu/savannah/qemu/linux-headers/linux/kvm.h:10:25: 
warning: linux/types.h: No such file or directory
/home/stefan/src/qemu/savannah/qemu/linux-headers/linux/kvm.h:12:25: 
warning: linux/ioctl.h: No such file or directory
In file included from 
/home/stefan/src/qemu/savannah/qemu/linux-headers/linux/kvm.h:13,

 from /home/stefan/src/qemu/savannah/qemu/hw/kvmclock.c:20:
../linux-headers/asm/kvm.h:32: error: expected specifier-qualifier-list 
before '__u32'
../linux-headers/asm/kvm.h:41: error: expected specifier-qualifier-list 
before '__u8'
../linux-headers/asm/kvm.h:61: error: expected specifier-qualifier-list 
before '__u64'


Is kvmclock.c really needed for non-kvm platforms? Or does it simply need
a obj-i386-$(CONFIG_KVM) in Makefile.target?

Stefan

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-14 Thread Jan Kiszka
On 2011-06-14 13:11, Alexander Graf wrote:
 
 On 08.06.2011, at 16:10, Jan Kiszka wrote:
 
 This helps reducing our build-time checks for feature support in the
 available Linux kernel headers. And it helps users that do not have
 sufficiently recent headers installed on their build machine.
 
 Consequently, the patch removes and build-time checks for kvm and vhost
 in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
 supposed to be provided by QEMU only.
 
 s390 needs some extra love as it carries redefinitions from kernel
 headers.
 
 Yes. I was wondering if we should unconditionally include the kernel headers 
 there. The problem I'm seeing there is that I don't know if that would work 
 fine on non-Linux hosts, as that code definitely gets compiled there, while 
 KVM code is not.
 
 
 
 [...]
 
 diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
 index 4e5c391..b5e587f 100644
 --- a/target-s390x/cpu.h
 +++ b/target-s390x/cpu.h
 @@ -313,16 +313,6 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr);
 /* from s390-virtio-bus */
 extern const target_phys_addr_t virtio_size;
 
 -#ifndef KVM_S390_SIGP_STOP
 -#define KVM_S390_SIGP_STOP  0
 -#define KVM_S390_PROGRAM_INT0
 -#define KVM_S390_SIGP_SET_PREFIX0
 -#define KVM_S390_RESTART0
 -#define KVM_S390_INT_VIRTIO 0
 -#define KVM_S390_INT_SERVICE0
 -#define KVM_S390_INT_EMERGENCY  0
 -#endif
 -
 #endif
 void cpu_lock(void);
 void cpu_unlock(void);
 diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
 index db03a79..9429698 100644
 --- a/target-s390x/op_helper.c
 +++ b/target-s390x/op_helper.c
 @@ -23,6 +23,7 @@
 #include helpers.h
 #include string.h
 #include kvm.h
 +#include linux/kvm.h
 
 Have you tried to compile this on non-Linux?

Sorry, I don't have non-Linux around. :) Do you expect build problems
with that header? Why?

BTW, if you depend on KVM_* constants for non-KVM builds, that looks a
bit fishy to me. Why is that code built at all in that setup?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-14 Thread Alexander Graf

On 14.06.2011, at 13:21, Jan Kiszka wrote:

 On 2011-06-14 13:11, Alexander Graf wrote:
 
 On 08.06.2011, at 16:10, Jan Kiszka wrote:
 
 This helps reducing our build-time checks for feature support in the
 available Linux kernel headers. And it helps users that do not have
 sufficiently recent headers installed on their build machine.
 
 Consequently, the patch removes and build-time checks for kvm and vhost
 in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
 supposed to be provided by QEMU only.
 
 s390 needs some extra love as it carries redefinitions from kernel
 headers.
 
 Yes. I was wondering if we should unconditionally include the kernel headers 
 there. The problem I'm seeing there is that I don't know if that would work 
 fine on non-Linux hosts, as that code definitely gets compiled there, while 
 KVM code is not.
 
 
 
 [...]
 
 diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
 index 4e5c391..b5e587f 100644
 --- a/target-s390x/cpu.h
 +++ b/target-s390x/cpu.h
 @@ -313,16 +313,6 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr);
 /* from s390-virtio-bus */
 extern const target_phys_addr_t virtio_size;
 
 -#ifndef KVM_S390_SIGP_STOP
 -#define KVM_S390_SIGP_STOP  0
 -#define KVM_S390_PROGRAM_INT0
 -#define KVM_S390_SIGP_SET_PREFIX0
 -#define KVM_S390_RESTART0
 -#define KVM_S390_INT_VIRTIO 0
 -#define KVM_S390_INT_SERVICE0
 -#define KVM_S390_INT_EMERGENCY  0
 -#endif
 -
 #endif
 void cpu_lock(void);
 void cpu_unlock(void);
 diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
 index db03a79..9429698 100644
 --- a/target-s390x/op_helper.c
 +++ b/target-s390x/op_helper.c
 @@ -23,6 +23,7 @@
 #include helpers.h
 #include string.h
 #include kvm.h
 +#include linux/kvm.h
 
 Have you tried to compile this on non-Linux?
 
 Sorry, I don't have non-Linux around. :) Do you expect build problems
 with that header? Why?

Do you have a git tree handy? I can give a Mac build a try then.

 BTW, if you depend on KVM_* constants for non-KVM builds, that looks a
 bit fishy to me. Why is that code built at all in that setup?

The reason for that is that I didn't want to clutter the emulation code with 
#ifdefs:

static void program_interrupt(CPUState *env, uint32_t code, int ilc)
{
qemu_log(program interrupt at %# PRIx64 \n, env-psw.addr);

if (kvm_enabled()) {
kvm_s390_interrupt(env, KVM_S390_PROGRAM_INT, code);
} else {
env-int_pgm_code = code;
env-int_pgm_ilc = ilc;
env-exception_index = EXCP_PGM;
cpu_loop_exit();
}
}

This breaks compilation when KVM_S390_PROGRAM_INT is not defined. I'm very open 
to suggestions on how to improve this though :).


Alex

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-14 Thread Jan Kiszka
On 2011-06-14 13:28, Alexander Graf wrote:
 
 On 14.06.2011, at 13:21, Jan Kiszka wrote:
 
 On 2011-06-14 13:11, Alexander Graf wrote:

 On 08.06.2011, at 16:10, Jan Kiszka wrote:

 This helps reducing our build-time checks for feature support in the
 available Linux kernel headers. And it helps users that do not have
 sufficiently recent headers installed on their build machine.

 Consequently, the patch removes and build-time checks for kvm and vhost
 in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
 supposed to be provided by QEMU only.

 s390 needs some extra love as it carries redefinitions from kernel
 headers.

 Yes. I was wondering if we should unconditionally include the kernel 
 headers there. The problem I'm seeing there is that I don't know if that 
 would work fine on non-Linux hosts, as that code definitely gets compiled 
 there, while KVM code is not.



 [...]

 diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
 index 4e5c391..b5e587f 100644
 --- a/target-s390x/cpu.h
 +++ b/target-s390x/cpu.h
 @@ -313,16 +313,6 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr);
 /* from s390-virtio-bus */
 extern const target_phys_addr_t virtio_size;

 -#ifndef KVM_S390_SIGP_STOP
 -#define KVM_S390_SIGP_STOP  0
 -#define KVM_S390_PROGRAM_INT0
 -#define KVM_S390_SIGP_SET_PREFIX0
 -#define KVM_S390_RESTART0
 -#define KVM_S390_INT_VIRTIO 0
 -#define KVM_S390_INT_SERVICE0
 -#define KVM_S390_INT_EMERGENCY  0
 -#endif
 -
 #endif
 void cpu_lock(void);
 void cpu_unlock(void);
 diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
 index db03a79..9429698 100644
 --- a/target-s390x/op_helper.c
 +++ b/target-s390x/op_helper.c
 @@ -23,6 +23,7 @@
 #include helpers.h
 #include string.h
 #include kvm.h
 +#include linux/kvm.h

 Have you tried to compile this on non-Linux?

 Sorry, I don't have non-Linux around. :) Do you expect build problems
 with that header? Why?
 
 Do you have a git tree handy? I can give a Mac build a try then.

Try git://git.kiszka.org/qemu-kvm.git queues/kvm-upstream

 
 BTW, if you depend on KVM_* constants for non-KVM builds, that looks a
 bit fishy to me. Why is that code built at all in that setup?
 
 The reason for that is that I didn't want to clutter the emulation code with 
 #ifdefs:
 
 static void program_interrupt(CPUState *env, uint32_t code, int ilc)
 {
 qemu_log(program interrupt at %# PRIx64 \n, env-psw.addr);
 
 if (kvm_enabled()) {
 kvm_s390_interrupt(env, KVM_S390_PROGRAM_INT, code);
 } else {
 env-int_pgm_code = code;
 env-int_pgm_ilc = ilc;
 env-exception_index = EXCP_PGM;
 cpu_loop_exit();
 }
 }
 
 This breaks compilation when KVM_S390_PROGRAM_INT is not defined. I'm very 
 open to suggestions on how to improve this though :).

Callbacks? See cpu_interrupt_handler e.g.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-08 Thread Jan Kiszka
This helps reducing our build-time checks for feature support in the
available Linux kernel headers. And it helps users that do not have
sufficiently recent headers installed on their build machine.

Consequently, the patch removes and build-time checks for kvm and vhost
in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
supposed to be provided by QEMU only.

s390 needs some extra love as it carries redefinitions from kernel
headers.

CC: Alexander Graf ag...@suse.de
Signed-off-by: Jan Kiszka jan.kis...@siemens.com
---
 Makefile.target  |4 +-
 configure|  151 ++
 target-s390x/cpu.h   |   10 ---
 target-s390x/op_helper.c |1 +
 4 files changed, 21 insertions(+), 145 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index 5c22df8..be9c0e8 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -14,7 +14,7 @@ endif
 
 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
 $(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
-QEMU_CFLAGS+= -I.. -I$(TARGET_PATH) -DNEED_CPU_H
+QEMU_CFLAGS+= -I.. -I../linux-headers -I$(TARGET_PATH) -DNEED_CPU_H
 
 include $(SRC_PATH)/Makefile.objs
 
@@ -37,8 +37,6 @@ ifndef CONFIG_HAIKU
 LIBS+=-lm
 endif
 
-kvm.o kvm-all.o vhost.o vhost_net.o kvmclock.o: QEMU_CFLAGS+=$(KVM_CFLAGS)
-
 config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak
 
diff --git a/configure b/configure
index d38b952..0e1dc46 100755
--- a/configure
+++ b/configure
@@ -113,8 +113,7 @@ curl=
 curses=
 docs=
 fdt=
-kvm=
-kvm_para=
+kvm=yes
 nptl=
 sdl=
 vnc=yes
@@ -130,7 +129,7 @@ xen=
 xen_ctrl_version=
 linux_aio=
 attr=
-vhost_net=
+vhost_net=yes
 xfs=
 
 gprof=no
@@ -165,7 +164,6 @@ guest_base=
 uname_release=
 io_thread=no
 mixemu=no
-kerneldir=
 aix=no
 blobs=yes
 pkgversion=
@@ -712,8 +710,6 @@ for opt do
   ;;
   --disable-blobs) blobs=no
   ;;
-  --kerneldir=*) kerneldir=$optarg
-  ;;
   --with-pkgversion=*) pkgversion= ($optarg)
   ;;
   --disable-docs) docs=no
@@ -1001,7 +997,6 @@ echo   --disable-attr   disables attr and xattr 
support
 echo   --enable-attrenable attr and xattr support
 echo   --enable-io-thread   enable IO thread
 echo   --disable-blobs  disable installing provided firmware blobs
-echo   --kerneldir=PATH look for kernel includes in PATH
 echo   --enable-docsenable documentation build
 echo   --disable-docs   disable documentation build
 echo   --disable-vhost-net  disable vhost-net acceleration support
@@ -1766,124 +1761,6 @@ EOF
 fi
 
 ##
-# kvm probe
-if test $kvm != no ; then
-cat  $TMPC EOF
-#include linux/kvm.h
-#if !defined(KVM_API_VERSION) || KVM_API_VERSION  12 || KVM_API_VERSION  12
-#error Invalid KVM version
-#endif
-EOF
-must_have_caps=KVM_CAP_USER_MEMORY \
-KVM_CAP_DESTROY_MEMORY_REGION_WORKS \
-KVM_CAP_COALESCED_MMIO \
-KVM_CAP_SYNC_MMU \
-   
-if test \( $cpu = i386 -o $cpu = x86_64 \) ; then
-  must_have_caps=$caps \
-  KVM_CAP_SET_TSS_ADDR \
-  KVM_CAP_EXT_CPUID \
-  KVM_CAP_CLOCKSOURCE \
-  KVM_CAP_NOP_IO_DELAY \
-  KVM_CAP_PV_MMU \
-  KVM_CAP_MP_STATE \
-  KVM_CAP_USER_NMI \
- 
-fi
-for c in $must_have_caps ; do
-  cat  $TMPC EOF
-#if !defined($c)
-#error Missing KVM capability $c
-#endif
-EOF
-done
-cat  $TMPC EOF
-int main(void) { return 0; }
-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 $cpu = ppc -a -d $kerneldir/arch/powerpc/include ; then
-   kvm_cflags=$kvm_cflags -I$kerneldir/arch/powerpc/include
-   elif test $cpu = s390x -a -d $kerneldir/arch/s390/include ; then
-   kvm_cflags=$kvm_cflags -I$kerneldir/arch/s390/include
-elif test -d $kerneldir/arch/$cpu/include ; then
-kvm_cflags=$kvm_cflags -I$kerneldir/arch/$cpu/include
-  fi
-  else
-kvm_cflags=`$pkg_config --cflags kvm-kmod 2/dev/null`
-  fi
-  if compile_prog $kvm_cflags  ; then
-kvm=yes
-cat  $TMPC EOF
-#include linux/kvm_para.h
-int main(void) { return 0; }
-EOF
-if compile_prog $kvm_cflags  ; then
-  kvm_para=yes
-fi
-  else
-if test $kvm = yes ; then
-  if has awk  has grep; then
-kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 21 \
-   | grep error:  \
-   | awk -F error:  '{if (NR1) printf(, ); printf(%s,$2);}'`
-if test $kvmerr !=  ; then
-  echo -e ${kvmerr}\n\
-NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
-recent