public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0 of 4] Sync kernel headers to kvm-userspace
@ 2008-04-14  8:37 Jerone Young
  2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Jerone Young @ 2008-04-14  8:37 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel, hollisb

This patch does several things:
	- Adds "make sync" of kvm kernel headers & required linux headers to kvm-userspace directory
	  from the kernel
	- Modifies build systems of libkvm, user, & qemu so that they now include headers from this now synced includes directory
	- Remove --kerneldir options from user as it is no longer needed.
	- Remove --kernel-path & other refrences used in  qemu as it is no longer needed

This now allows users to include headers from a kernel source that does not require any compilation. It will also work if the kernel source is compiled, as make sync can determines the correct directories to pull headers from.

This patch is to address earlier email that Hollis Blanchard had as he uses O= option when compiling his kernels, so the kernel source is never modified.
http://marc.info/?l=kvm-devel&m=119995898027254&w=2

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
10 files changed, 31 insertions(+), 23 deletions(-)
Makefile                |   21 ++++++++++++++++++++-
configure               |    8 +++++---
libkvm/Makefile         |    6 +++---
qemu/Makefile.target    |    3 +--
qemu/configure          |    7 +------
user/Makefile           |    1 +
user/config-i386.mak    |    1 -
user/config-powerpc.mak |    1 -
user/config-x86_64.mak  |    1 -
user/configure          |    5 -----

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14  8:37 [PATCH 0 of 4] Sync kernel headers to kvm-userspace Jerone Young
@ 2008-04-14  8:37 ` Jerone Young
  2008-04-14  8:50   ` Christoph Hellwig
                     ` (2 more replies)
  2008-04-14  8:37 ` [PATCH 2 of 4] Fix libfdt to include synced headers Jerone Young
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 15+ messages in thread
From: Jerone Young @ 2008-04-14  8:37 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel, hollisb

2 files changed, 25 insertions(+), 4 deletions(-)
Makefile  |   21 ++++++++++++++++++++-
configure |    8 +++++---


This patch adds ability for kvm-userspace build system to sync needed kernel headers locally without the need of compiled kernel source.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ rpmrelease = devel
 
 .PHONY: kernel user libkvm qemu bios vgabios extboot clean libfdt
 
-all: libkvm qemu
+all: sync libkvm qemu
 ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
     all: $(if $(WANT_MODULE), kernel) user
 endif
@@ -69,6 +69,24 @@ install:
 	make -C libkvm DESTDIR="$(DESTDIR)" install
 	make -C qemu DESTDIR="$(DESTDIR)" install
 
+
+ASM_DIR=$(ARCH)
+ifneq '$(filter $(ARCH), i386 x86_64)' ''
+	ASM_DIR=x86
+endif
+
+sync:
+	mkdir -p $(INCLUDES_DIR)
+	mkdir -p $(INCLUDES_DIR)/asm-$(ASM_DIR)
+	mkdir -p $(INCLUDES_DIR)/linux
+	cp -f $(KERNELDIR)/include/asm-$(ASM_DIR)/kvm*.h \
+		$(INCLUDES_DIR)/asm-$(ASM_DIR)/
+	cp -f $(KERNELDIR)/include/linux/kvm*.h \
+		$(KERNELDIR)/include/linux/compiler*.h \
+		$(INCLUDES_DIR)/linux
+	ln -sf  $(INCLUDES_DIR)/asm-$(ASM_DIR) $(INCLUDES_DIR)/asm
+
+
 tmpspec = .tmp.kvm.spec
 RPMTOPDIR = $$(pwd)/rpmtop
 
@@ -99,3 +117,4 @@ clean:
 
 distclean: clean
 	rm -f config.mak user/config.mak
+	rm -rf $(INCLUDES_DIR)
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -10,6 +10,7 @@ cross_prefix=
 cross_prefix=
 arch=`uname -m`
 target_exec=
+local_kernel_includes_dir=$PWD/includes
 
 usage() {
     cat <<-EOF
@@ -108,16 +109,16 @@ fi
 fi
 
 #configure user dir
-(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
+(cd user; ./configure --prefix="$prefix" \
           --arch="$arch" \
           ${cross_prefix:+"--cross-prefix=$cross_prefix"})
 
 #configure qemu
 (cd qemu; ./configure --target-list=$target_exec \
     --disable-kqemu \
-    --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
+    --extra-cflags="-I $PWD/../libkvm $qemu_cflags \
+               -I $local_kernel_includes_dir" \
     --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
-    --kernel-path="$libkvm_kerneldir" \
     --prefix="$prefix" \
     ${qemu_cc:+"--cc=$qemu_cc"} \
     ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
@@ -131,4 +132,5 @@ KERNELDIR=$kerneldir
 KERNELDIR=$kerneldir
 WANT_MODULE=$want_module
 CROSS_COMPILE=$cross_prefix
+INCLUDES_DIR=$local_kernel_includes_dir
 EOF

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 2 of 4] Fix libfdt to include synced headers
  2008-04-14  8:37 [PATCH 0 of 4] Sync kernel headers to kvm-userspace Jerone Young
  2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
@ 2008-04-14  8:37 ` Jerone Young
  2008-04-14  8:37 ` [PATCH 3 of 4] Fix user to include synced headers & remove kerneldir option Jerone Young
  2008-04-14  8:37 ` [PATCH 4 of 4] Remove kvm kernel-path option from qemu Jerone Young
  3 siblings, 0 replies; 15+ messages in thread
From: Jerone Young @ 2008-04-14  8:37 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel, hollisb

1 file changed, 3 insertions(+), 3 deletions(-)
libkvm/Makefile |    6 +++---


This modifies libfdt makefile to now include from synced header directory.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

diff --git a/libkvm/Makefile b/libkvm/Makefile
--- a/libkvm/Makefile
+++ b/libkvm/Makefile
@@ -10,7 +10,7 @@ CFLAGS += $(autodepend-flags) -g -fomit-
 CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall
 CFLAGS += $(call cc-option, -fno-stack-protector, "")
 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
-CFLAGS += -I $(KERNELDIR)/include
+CFLAGS += -I $(INCLUDES_DIR)
 
 LDFLAGS += $(CFLAGS)
 
@@ -26,9 +26,9 @@ libkvm.a: libkvm.o $(libkvm-$(ARCH)-objs
 
 install:
 	install -D libkvm.h $(DESTDIR)/$(PREFIX)/include/libkvm.h
-	install -D $(KERNELDIR)/include/linux/kvm.h \
+	install -D $(INCLUDES_DIR)/linux/kvm.h \
 		$(DESTDIR)/$(PREFIX)/include/linux/kvm.h
-	install -D $(KERNELDIR)/include/linux/kvm_para.h \
+	install -D $(INCLUDES_DIR)/linux/kvm_para.h \
 		$(DESTDIR)/$(PREFIX)/include/linux/kvm_para.h
 	install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a
 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 3 of 4] Fix user to include synced headers & remove kerneldir option
  2008-04-14  8:37 [PATCH 0 of 4] Sync kernel headers to kvm-userspace Jerone Young
  2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
  2008-04-14  8:37 ` [PATCH 2 of 4] Fix libfdt to include synced headers Jerone Young
@ 2008-04-14  8:37 ` Jerone Young
  2008-04-14  8:37 ` [PATCH 4 of 4] Remove kvm kernel-path option from qemu Jerone Young
  3 siblings, 0 replies; 15+ messages in thread
From: Jerone Young @ 2008-04-14  8:37 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel, hollisb

5 files changed, 1 insertion(+), 8 deletions(-)
user/Makefile           |    1 +
user/config-i386.mak    |    1 -
user/config-powerpc.mak |    1 -
user/config-x86_64.mak  |    1 -
user/configure          |    5 -----


This patch fixes user directory to now include synced headers. It also removes the kerneldir option, as it is no longer needed.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

diff --git a/user/Makefile b/user/Makefile
--- a/user/Makefile
+++ b/user/Makefile
@@ -28,6 +28,7 @@ CFLAGS += $(call cc-option, -fno-stack-p
 CFLAGS += $(call cc-option, -fno-stack-protector, "")
 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
 CFLAGS += -I ../libkvm
+CFLAGS += $(INCLUDES_DIR)
 
 LDFLAGS += $(CFLAGS) -L ../libkvm
 
diff --git a/user/config-i386.mak b/user/config-i386.mak
--- a/user/config-i386.mak
+++ b/user/config-i386.mak
@@ -4,7 +4,6 @@ ldarch = elf32-i386
 ldarch = elf32-i386
 CFLAGS += -m32
 CFLAGS += -D__i386__
-CFLAGS += -I $(KERNELDIR)/include
 
 tests=
 
diff --git a/user/config-powerpc.mak b/user/config-powerpc.mak
--- a/user/config-powerpc.mak
+++ b/user/config-powerpc.mak
@@ -30,7 +30,6 @@ all: kvmctl $(tests) $(simpletests)
 
 CFLAGS += -m32
 CFLAGS += -D__powerpc__
-CFLAGS += -I $(KERNELDIR)/include
 CFLAGS += -Wa,-mregnames
 
 $(simpletests): %.bin: %.o
diff --git a/user/config-x86_64.mak b/user/config-x86_64.mak
--- a/user/config-x86_64.mak
+++ b/user/config-x86_64.mak
@@ -4,7 +4,6 @@ ldarch = elf64-x86-64
 ldarch = elf64-x86-64
 CFLAGS += -m64
 CFLAGS += -D__x86_64__
-CFLAGS += -I $(KERNELDIR)/include
 
 tests = $(TEST_DIR)/access.flat $(TEST_DIR)/irq.flat $(TEST_DIR)/sieve.flat \
       $(TEST_DIR)/simple.flat $(TEST_DIR)/stringio.flat \
diff --git a/user/configure b/user/configure
--- a/user/configure
+++ b/user/configure
@@ -18,7 +18,6 @@ usage() {
 	    --cc=CC		   c compiler to use ($cc)
 	    --ld=LD		   ld linker to use ($ld)
 	    --prefix=PREFIX        where to install things ($prefix)
-	    --kerneldir=DIR        kernel build directory for kvm.h ($kerneldir)
 EOF
     exit 1
 }
@@ -33,9 +32,6 @@ while [[ "$1" = -* ]]; do
     case "$opt" in
 	--prefix)
 	    prefix="$arg"
-	    ;;
-	--kerneldir)
-	    kerneldir="$arg"
 	    ;;
         --arch)
 	    arch="$arg"
@@ -60,7 +56,6 @@ done
 
 cat <<EOF > config.mak
 PREFIX=$prefix
-KERNELDIR=$(readlink -f $kerneldir)
 ARCH=$arch
 CC=$cross_prefix$cc
 LD=$cross_prefix$ld

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 4 of 4] Remove kvm kernel-path option from qemu
  2008-04-14  8:37 [PATCH 0 of 4] Sync kernel headers to kvm-userspace Jerone Young
                   ` (2 preceding siblings ...)
  2008-04-14  8:37 ` [PATCH 3 of 4] Fix user to include synced headers & remove kerneldir option Jerone Young
@ 2008-04-14  8:37 ` Jerone Young
  2008-04-15  8:38   ` Avi Kivity
  3 siblings, 1 reply; 15+ messages in thread
From: Jerone Young @ 2008-04-14  8:37 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel, hollisb

2 files changed, 2 insertions(+), 8 deletions(-)
qemu/Makefile.target |    3 +--
qemu/configure       |    7 +------


Now that kvm headers are synced locally, qemu does not need a specific option to find the kernel headers as they can now be specified in the  --extra-cflags option.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

diff --git a/qemu/Makefile.target b/qemu/Makefile.target
--- a/qemu/Makefile.target
+++ b/qemu/Makefile.target
@@ -546,8 +546,7 @@ SOUND_HW += gus.o gusemu_hal.o gusemu_mi
 SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
 endif
 
-ifdef CONFIG_KVM_KERNEL_INC
-CFLAGS += -I $(CONFIG_KVM_KERNEL_INC)
+ifeq ($(USE_KVM), 1)
 LIBS += -lkvm
 DEPLIBS += ../libkvm/libkvm.a
 endif
diff --git a/qemu/configure b/qemu/configure
--- a/qemu/configure
+++ b/qemu/configure
@@ -102,7 +102,6 @@ kvm="no"
 kvm="no"
 kvm_cap_pit="no"
 profiler="no"
-kernel_path=""
 cocoa="no"
 check_gfx="yes"
 check_gcc="yes"
@@ -305,8 +304,6 @@ for opt do
   ;;
   --enable-profiler) profiler="yes"
   ;;
-  --kernel-path=*) kernel_path="$optarg"
-  ;;
   --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
   ;;
   --disable-gfx-check) check_gfx="no"
@@ -418,7 +415,6 @@ echo ""
 echo ""
 echo "kqemu kernel acceleration support:"
 echo "  --disable-kqemu          disable kqemu support"
-echo "  --kernel-path=PATH       set the kernel path (configure probes it)"
 echo "  --disable-kvm            disable kernel virtual machine support"
 echo ""
 echo "Advanced options (experts only):"
@@ -627,7 +623,7 @@ cat > $TMPC <<EOF
 #endif
 int main(void) { return 0; }
 EOF
-    if $cc $ARCH_CFLAGS $CFLAGS -I"$kernel_path"/include -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
+    if $cc $ARCH_CFLAGS $CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
 	kvm_cap_pit="yes"
     fi
 fi
@@ -1184,7 +1180,6 @@ configure_kvm() {
           \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
     echo "#define USE_KVM 1" >> $config_h
     echo "USE_KVM=1" >> $config_mak
-    echo "CONFIG_KVM_KERNEL_INC=$kernel_path/include" >> $config_mak
     if test $kvm_cap_pit = "yes" ; then
 	echo "USE_KVM_PIT=1" >> $config_mak
     fi

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
@ 2008-04-14  8:50   ` Christoph Hellwig
  2008-04-14 11:47     ` Avi Kivity
  2008-04-14 14:20     ` Anthony Liguori
  2008-04-14 14:18   ` Anthony Liguori
  2008-04-15  7:29   ` Avi Kivity
  2 siblings, 2 replies; 15+ messages in thread
From: Christoph Hellwig @ 2008-04-14  8:50 UTC (permalink / raw)
  To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel, hollisb

On Mon, Apr 14, 2008 at 03:37:04AM -0500, Jerone Young wrote:
> 2 files changed, 25 insertions(+), 4 deletions(-)
> Makefile  |   21 ++++++++++++++++++++-
> configure |    8 +++++---
> 
> 
> This patch adds ability for kvm-userspace build system to sync needed kernel headers locally without the need of compiled kernel source.

Please just keep a copy of the kernel headers in the userspace tree so
it can be built standalone.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14  8:50   ` Christoph Hellwig
@ 2008-04-14 11:47     ` Avi Kivity
  2008-04-14 11:54       ` Christoph Hellwig
  2008-04-14 14:20     ` Anthony Liguori
  1 sibling, 1 reply; 15+ messages in thread
From: Avi Kivity @ 2008-04-14 11:47 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: kvm-devel, kvm-ppc-devel, Jerone Young, hollisb

Christoph Hellwig wrote:
> On Mon, Apr 14, 2008 at 03:37:04AM -0500, Jerone Young wrote:
>   
>> 2 files changed, 25 insertions(+), 4 deletions(-)
>> Makefile  |   21 ++++++++++++++++++++-
>> configure |    8 +++++---
>>
>>
>> This patch adds ability for kvm-userspace build system to sync needed kernel headers locally without the need of compiled kernel source.
>>     
>
> Please just keep a copy of the kernel headers in the userspace tree so
> it can be built standalone.
>
>   

The tarballs do contain a copy of the kernel headers; the 'make sync' 
mechanism is for developers to generate the tarballs without keeping the 
sources duplicated in git.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14 11:47     ` Avi Kivity
@ 2008-04-14 11:54       ` Christoph Hellwig
  2008-04-14 12:04         ` Avi Kivity
  0 siblings, 1 reply; 15+ messages in thread
From: Christoph Hellwig @ 2008-04-14 11:54 UTC (permalink / raw)
  To: Avi Kivity
  Cc: Christoph Hellwig, kvm-devel, Jerone Young, kvm-ppc-devel,
	hollisb

On Mon, Apr 14, 2008 at 02:47:16PM +0300, Avi Kivity wrote:
>> Please just keep a copy of the kernel headers in the userspace tree so
>> it can be built standalone.
>>
>>   
>
> The tarballs do contain a copy of the kernel headers; the 'make sync' 
> mechanism is for developers to generate the tarballs without keeping the 
> sources duplicated in git.

It would be nice to just be able to build kvm from git without a kernel
around.  The lack of that is what in fact keeps from hacking kvm
userspace currently.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14 11:54       ` Christoph Hellwig
@ 2008-04-14 12:04         ` Avi Kivity
  2008-04-14 14:23           ` Anthony Liguori
  0 siblings, 1 reply; 15+ messages in thread
From: Avi Kivity @ 2008-04-14 12:04 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: kvm-devel, kvm-ppc-devel, Jerone Young, hollisb

Christoph Hellwig wrote:
> It would be nice to just be able to build kvm from git without a kernel
> around.  The lack of that is what in fact keeps from hacking kvm
> userspace currently.
>   

It would be nice, but committing all header changes twice is not so nice 
and error prone as well.

Anyone serious about hacking kvm-userspace would not be deterred by the 
additional clone.

[maybe we can provide an automatically-generated git tree that has only 
the kernel headers?]

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
  2008-04-14  8:50   ` Christoph Hellwig
@ 2008-04-14 14:18   ` Anthony Liguori
  2008-04-15  7:29   ` Avi Kivity
  2 siblings, 0 replies; 15+ messages in thread
From: Anthony Liguori @ 2008-04-14 14:18 UTC (permalink / raw)
  To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel, hollisb

Jerone Young wrote:
> 2 files changed, 25 insertions(+), 4 deletions(-)
> Makefile  |   21 ++++++++++++++++++++-
> configure |    8 +++++---
>
>
> This patch adds ability for kvm-userspace build system to sync needed kernel headers locally without the need of compiled kernel source.
>   

make sync in kernel/ already does this.  Why not just add PPC support there.

Regards,

Anthony Liguori

> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -7,7 +7,7 @@ rpmrelease = devel
>  
>  .PHONY: kernel user libkvm qemu bios vgabios extboot clean libfdt
>  
> -all: libkvm qemu
> +all: sync libkvm qemu
>  ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
>      all: $(if $(WANT_MODULE), kernel) user
>  endif
> @@ -69,6 +69,24 @@ install:
>  	make -C libkvm DESTDIR="$(DESTDIR)" install
>  	make -C qemu DESTDIR="$(DESTDIR)" install
>  
> +
> +ASM_DIR=$(ARCH)
> +ifneq '$(filter $(ARCH), i386 x86_64)' ''
> +	ASM_DIR=x86
> +endif
> +
> +sync:
> +	mkdir -p $(INCLUDES_DIR)
> +	mkdir -p $(INCLUDES_DIR)/asm-$(ASM_DIR)
> +	mkdir -p $(INCLUDES_DIR)/linux
> +	cp -f $(KERNELDIR)/include/asm-$(ASM_DIR)/kvm*.h \
> +		$(INCLUDES_DIR)/asm-$(ASM_DIR)/
> +	cp -f $(KERNELDIR)/include/linux/kvm*.h \
> +		$(KERNELDIR)/include/linux/compiler*.h \
> +		$(INCLUDES_DIR)/linux
> +	ln -sf  $(INCLUDES_DIR)/asm-$(ASM_DIR) $(INCLUDES_DIR)/asm
> +
> +
>  tmpspec = .tmp.kvm.spec
>  RPMTOPDIR = $$(pwd)/rpmtop
>  
> @@ -99,3 +117,4 @@ clean:
>  
>  distclean: clean
>  	rm -f config.mak user/config.mak
> +	rm -rf $(INCLUDES_DIR)
> diff --git a/configure b/configure
> --- a/configure
> +++ b/configure
> @@ -10,6 +10,7 @@ cross_prefix=
>  cross_prefix=
>  arch=`uname -m`
>  target_exec=
> +local_kernel_includes_dir=$PWD/includes
>  
>  usage() {
>      cat <<-EOF
> @@ -108,16 +109,16 @@ fi
>  fi
>  
>  #configure user dir
> -(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
> +(cd user; ./configure --prefix="$prefix" \
>            --arch="$arch" \
>            ${cross_prefix:+"--cross-prefix=$cross_prefix"})
>  
>  #configure qemu
>  (cd qemu; ./configure --target-list=$target_exec \
>      --disable-kqemu \
> -    --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
> +    --extra-cflags="-I $PWD/../libkvm $qemu_cflags \
> +               -I $local_kernel_includes_dir" \
>      --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
> -    --kernel-path="$libkvm_kerneldir" \
>      --prefix="$prefix" \
>      ${qemu_cc:+"--cc=$qemu_cc"} \
>      ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
> @@ -131,4 +132,5 @@ KERNELDIR=$kerneldir
>  KERNELDIR=$kerneldir
>  WANT_MODULE=$want_module
>  CROSS_COMPILE=$cross_prefix
> +INCLUDES_DIR=$local_kernel_includes_dir
>  EOF
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14  8:50   ` Christoph Hellwig
  2008-04-14 11:47     ` Avi Kivity
@ 2008-04-14 14:20     ` Anthony Liguori
  1 sibling, 0 replies; 15+ messages in thread
From: Anthony Liguori @ 2008-04-14 14:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: kvm-devel, kvm-ppc-devel, Jerone Young, hollisb

Christoph Hellwig wrote:
> On Mon, Apr 14, 2008 at 03:37:04AM -0500, Jerone Young wrote:
>   
>> 2 files changed, 25 insertions(+), 4 deletions(-)
>> Makefile  |   21 ++++++++++++++++++++-
>> configure |    8 +++++---
>>
>>
>> This patch adds ability for kvm-userspace build system to sync needed kernel headers locally without the need of compiled kernel source.
>>     
>
> Please just keep a copy of the kernel headers in the userspace tree so
> it can be built standalone.
>   

This is what make sync in kernel/ does FWIW and what we distribute for 
releases.

Regards,

Anthony Liguori

> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14 12:04         ` Avi Kivity
@ 2008-04-14 14:23           ` Anthony Liguori
  2008-04-14 14:43             ` Avi Kivity
  0 siblings, 1 reply; 15+ messages in thread
From: Anthony Liguori @ 2008-04-14 14:23 UTC (permalink / raw)
  To: Avi Kivity
  Cc: Christoph Hellwig, kvm-devel, Jerone Young, kvm-ppc-devel,
	hollisb

Avi Kivity wrote:
> Christoph Hellwig wrote:
>   
>> It would be nice to just be able to build kvm from git without a kernel
>> around.  The lack of that is what in fact keeps from hacking kvm
>> userspace currently.
>>   
>>     
>
> It would be nice, but committing all header changes twice is not so nice 
> and error prone as well.
>
> Anyone serious about hacking kvm-userspace would not be deterred by the 
> additional clone.
>
> [maybe we can provide an automatically-generated git tree that has only 
> the kernel headers?]
>   

Then people will simply find something else to complain about :-)

I think as we split libkvm into it's own library and remove the 
dependency of kernel headers from libkvm consumers, this will stop being 
a problem in practice.

Regards,

Anthony Liguori



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14 14:23           ` Anthony Liguori
@ 2008-04-14 14:43             ` Avi Kivity
  0 siblings, 0 replies; 15+ messages in thread
From: Avi Kivity @ 2008-04-14 14:43 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Christoph Hellwig, kvm-devel, Jerone Young, kvm-ppc-devel,
	hollisb

Anthony Liguori wrote:
>
> I think as we split libkvm into it's own library and remove the 
> dependency of kernel headers from libkvm consumers, this will stop 
> being a problem in practice.
>

That will take a while, as there are many structures used for 
libkvm<->user communications which are provided by the kernel headers, 
and our TODO queue is not quite empty.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1 of 4] Add "make sync" to sync need kernel headers to kvm-userspace
  2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
  2008-04-14  8:50   ` Christoph Hellwig
  2008-04-14 14:18   ` Anthony Liguori
@ 2008-04-15  7:29   ` Avi Kivity
  2 siblings, 0 replies; 15+ messages in thread
From: Avi Kivity @ 2008-04-15  7:29 UTC (permalink / raw)
  To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel, hollisb

Jerone Young wrote:
> 2 files changed, 25 insertions(+), 4 deletions(-)
> Makefile  |   21 ++++++++++++++++++++-
> configure |    8 +++++---
>
>
> This patch adds ability for kvm-userspace build system to sync needed kernel headers locally without the need of compiled kernel source.
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -7,7 +7,7 @@ rpmrelease = devel
>  
>  .PHONY: kernel user libkvm qemu bios vgabios extboot clean libfdt
>  
> -all: libkvm qemu
> +all: sync libkvm qemu
>   

'all' shouldn't include 'sync', since it's run by end users that have 
just the tarball, not an entire kernel.

>  ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
>      all: $(if $(WANT_MODULE), kernel) user
>  endif
> @@ -69,6 +69,24 @@ install:
>  	make -C libkvm DESTDIR="$(DESTDIR)" install
>  	make -C qemu DESTDIR="$(DESTDIR)" install
>  
> +
> +ASM_DIR=$(ARCH)
> +ifneq '$(filter $(ARCH), i386 x86_64)' ''
> +	ASM_DIR=x86
> +endif
> +
> +sync:
> +	mkdir -p $(INCLUDES_DIR)
> +	mkdir -p $(INCLUDES_DIR)/asm-$(ASM_DIR)
> +	mkdir -p $(INCLUDES_DIR)/linux
> +	cp -f $(KERNELDIR)/include/asm-$(ASM_DIR)/kvm*.h \
> +		$(INCLUDES_DIR)/asm-$(ASM_DIR)/
> +	cp -f $(KERNELDIR)/include/linux/kvm*.h \
> +		$(KERNELDIR)/include/linux/compiler*.h \
> +		$(INCLUDES_DIR)/linux
> +	ln -sf  $(INCLUDES_DIR)/asm-$(ASM_DIR) $(INCLUDES_DIR)/asm
> +
> +
>   

Please use the existing infrastructure in kernel/Makefile.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4 of 4] Remove kvm kernel-path option from qemu
  2008-04-14  8:37 ` [PATCH 4 of 4] Remove kvm kernel-path option from qemu Jerone Young
@ 2008-04-15  8:38   ` Avi Kivity
  0 siblings, 0 replies; 15+ messages in thread
From: Avi Kivity @ 2008-04-15  8:38 UTC (permalink / raw)
  To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel, hollisb

Jerone Young wrote:
> 2 files changed, 2 insertions(+), 8 deletions(-)
> qemu/Makefile.target |    3 +--
> qemu/configure       |    7 +------
>
>
> Now that kvm headers are synced locally, qemu does not need a specific option to find the kernel headers as they can now be specified in the  --extra-cflags option.
>
>   

I find it quite useful to compile qemu without running 'make sync' too 
often (using --with-patched-kernel).

These days the headers don't change so often, so maybe this is less of 
an issue.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-04-15  8:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-14  8:37 [PATCH 0 of 4] Sync kernel headers to kvm-userspace Jerone Young
2008-04-14  8:37 ` [PATCH 1 of 4] Add "make sync" to sync need " Jerone Young
2008-04-14  8:50   ` Christoph Hellwig
2008-04-14 11:47     ` Avi Kivity
2008-04-14 11:54       ` Christoph Hellwig
2008-04-14 12:04         ` Avi Kivity
2008-04-14 14:23           ` Anthony Liguori
2008-04-14 14:43             ` Avi Kivity
2008-04-14 14:20     ` Anthony Liguori
2008-04-14 14:18   ` Anthony Liguori
2008-04-15  7:29   ` Avi Kivity
2008-04-14  8:37 ` [PATCH 2 of 4] Fix libfdt to include synced headers Jerone Young
2008-04-14  8:37 ` [PATCH 3 of 4] Fix user to include synced headers & remove kerneldir option Jerone Young
2008-04-14  8:37 ` [PATCH 4 of 4] Remove kvm kernel-path option from qemu Jerone Young
2008-04-15  8:38   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox