From: Jerone Y. <jy...@us...> - 2008-04-14 19:14:35
|
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 <jy...@us...> 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 ----- |
From: Jerone Y. <jy...@us...> - 2008-04-14 08:38:35
|
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 <jy...@us...> 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 |
From: Christoph H. <hc...@in...> - 2008-04-14 08:49:58
|
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. |
From: Avi K. <av...@qu...> - 2008-04-14 11:47:19
|
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 |
From: Christoph H. <hc...@in...> - 2008-04-14 11:54:26
|
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. |
From: Avi K. <av...@qu...> - 2008-04-14 12:04:48
|
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 |
From: Anthony L. <an...@co...> - 2008-04-14 14:23:56
|
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 |
From: Avi K. <av...@qu...> - 2008-04-14 14:44:04
|
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 |
From: Anthony L. <an...@co...> - 2008-04-14 14:20:22
|
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...@li... > https://lists.sourceforge.net/lists/listinfo/kvm-devel > |
From: Anthony L. <an...@co...> - 2008-04-14 14:18:43
|
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 <jy...@us...> > > 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...@li... > https://lists.sourceforge.net/lists/listinfo/kvm-devel > |
From: Avi K. <av...@qu...> - 2008-04-15 08:35:38
|
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 <jy...@us...> > > 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 |
From: Jerone Y. <jy...@us...> - 2008-04-14 08:38:36
|
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 <jy...@us...> 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 |
From: Jerone Y. <jy...@us...> - 2008-04-14 08:38:36
|
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 <jy...@us...> 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 |
From: Avi K. <av...@qu...> - 2008-04-15 08:38:27
|
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 |
From: Jerone Y. <jy...@us...> - 2008-04-14 08:38:40
|
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 <jy...@us...> 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 |