public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RESEND] Make "make sync" in kernel dir work for multiple archs
@ 2008-04-23 22:46 Jerone Young
  2008-04-23 23:02 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Jerone Young @ 2008-04-23 22:46 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel

1 file changed, 36 insertions(+), 20 deletions(-)
kernel/Makefile |   56 +++++++++++++++++++++++++++++++++++--------------------


	- This adapts perviously sent patch to new changes to kernel/Makefile

This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86.

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

diff --git a/kernel/Makefile b/kernel/Makefile
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -1,5 +1,10 @@ include ../config.mak
 include ../config.mak
 
+ARCH_DIR=$(ARCH)
+ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
+	ARCH_DIR=x86
+endif
+ 
 KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
 
 DESTDIR=
@@ -18,11 +23,25 @@ _hack = mv $1 $1.orig && \
 	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
 
 _unifdef = mv $1 $1.orig && \
-	  unifdef -DCONFIG_X86 $1.orig > $1; \
+	unifdef -DCONFIG_$(shell echo $(ARCH_DIR)|tr '[:lower:]' '[:upper:]') $1.orig > $1; \
           [ $$? -le 1 ] && rm $1.orig
 
 hack = $(call _hack,$T/$(strip $1))
 unifdef = $(call _unifdef,$T/$(strip $1))
+
+ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
+UNIFDEF_FILES = include/linux/kvm.h \
+		include/linux/kvm_para.h \
+		include/asm-$(ARCH_DIR)/kvm.h \
+		include/asm-x86/kvm_para.h
+
+HACK_FILES = kvm_main.c \
+		mmu.c \
+		vmx.c \
+		svm.c \
+		x86.c \
+		irq.h 
+endif
 
 all::
 #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
@@ -39,17 +58,16 @@ header-sync:
 	rm -rf $T
 	rsync -R \
 	     "$(LINUX)"/./include/linux/kvm*.h \
-	     "$(LINUX)"/./include/asm-x86/kvm*.h \
-             $T/
-	mkdir -p include/linux include/asm-x86
-	ln -sf asm-x86 include/asm
-	ln -sf asm-x86 include-compat/asm
+	     "$(LINUX)"/./include/asm-$(ARCH_DIR)/kvm*.h \
+	     $T/
 
-	$(call unifdef, include/linux/kvm.h)
-	$(call unifdef, include/linux/kvm_para.h)
-	$(call unifdef, include/asm-x86/kvm.h)
-	$(call unifdef, include/asm-x86/kvm_para.h)
-	$(call hack, include/linux/kvm.h)
+	mkdir -p include/linux include/asm-$(ARCH_DIR)
+	ln -s asm-$(ARCH_DIR) include/asm
+	ln -sf asm-$(ARCH_DIR) include-compat/asm
+
+	for i in $(UNIFDEF_FILES); \
+		do $(call unifdef, $$i); done
+
 	for i in $$(find $T -type f -printf '%P '); \
 		do cmp -s $$i $T/$$i || cp $T/$$i $$i; done
 	rm -rf $T
@@ -57,15 +75,13 @@ source-sync:
 source-sync:
 	rm -rf $T
 	rsync --exclude='*.mod.c' -R \
-             "$(LINUX)"/arch/x86/kvm/./*.[ch] \
-             "$(LINUX)"/virt/kvm/./*.[ch] \
-             $T/
-	$(call hack, kvm_main.c)
-	$(call hack, mmu.c)
-	$(call hack, vmx.c)
-	$(call hack, svm.c)
-	$(call hack, x86.c)
-	$(call hack, irq.h)
+	     "$(LINUX)"/arch/$(ARCH_DIR)/kvm/./*.[ch] \
+	     "$(LINUX)"/virt/kvm/./*.[ch] \
+	     $T/
+
+	for i in $(HACK_FILES); \
+		do $(call hack, $$i); done
+
 	for i in $$(find $T -type f -printf '%P '); \
 		do cmp -s $$i $T/$$i || cp $T/$$i $$i; done
 	rm -rf $T

-------------------------------------------------------------------------
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] 3+ messages in thread

* Re: [PATCH] [RESEND] Make "make sync" in kernel dir work for multiple archs
  2008-04-23 22:46 [PATCH] [RESEND] Make "make sync" in kernel dir work for multiple archs Jerone Young
@ 2008-04-23 23:02 ` Anthony Liguori
  2008-04-24  4:35   ` Jerone Young
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2008-04-23 23:02 UTC (permalink / raw)
  To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel


> diff --git a/kernel/Makefile b/kernel/Makefile
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -1,5 +1,10 @@ include ../config.mak
>  include ../config.mak
>  
> +ARCH_DIR=$(ARCH)
> +ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
> +	ARCH_DIR=x86
> +endif
> +
>   

This sets ARCH_DIR to x86

>  KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
>  
>  DESTDIR=
> @@ -18,11 +23,25 @@ _hack = mv $1 $1.orig && \
>  	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
>  
>  _unifdef = mv $1 $1.orig && \
> -	  unifdef -DCONFIG_X86 $1.orig > $1; \
> +	unifdef -DCONFIG_$(shell echo $(ARCH_DIR)|tr '[:lower:]' '[:upper:]') $1.orig > $1; \
>            [ $$? -le 1 ] && rm $1.orig
>  
>  hack = $(call _hack,$T/$(strip $1))
>  unifdef = $(call _unifdef,$T/$(strip $1))
> +
> +ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
>   

And I'm not quite sure what this is supposed to do but it doesn't look 
right.  ARCH_DIR is going to equal 'x86' so this is going to break 
things on x86 sinc ethe filter will return an empty string.

Regards,

Anthony Liguori

> +UNIFDEF_FILES = include/linux/kvm.h \
> +		include/linux/kvm_para.h \
> +		include/asm-$(ARCH_DIR)/kvm.h \
> +		include/asm-x86/kvm_para.h
> +
> +HACK_FILES = kvm_main.c \
> +		mmu.c \
> +		vmx.c \
> +		svm.c \
> +		x86.c \
> +		irq.h 
> +endif
>  
>  all::
>  #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
> @@ -39,17 +58,16 @@ header-sync:
>  	rm -rf $T
>  	rsync -R \
>  	     "$(LINUX)"/./include/linux/kvm*.h \
> -	     "$(LINUX)"/./include/asm-x86/kvm*.h \
> -             $T/
> -	mkdir -p include/linux include/asm-x86
> -	ln -sf asm-x86 include/asm
> -	ln -sf asm-x86 include-compat/asm
> +	     "$(LINUX)"/./include/asm-$(ARCH_DIR)/kvm*.h \
> +	     $T/
>  
> -	$(call unifdef, include/linux/kvm.h)
> -	$(call unifdef, include/linux/kvm_para.h)
> -	$(call unifdef, include/asm-x86/kvm.h)
> -	$(call unifdef, include/asm-x86/kvm_para.h)
> -	$(call hack, include/linux/kvm.h)
> +	mkdir -p include/linux include/asm-$(ARCH_DIR)
> +	ln -s asm-$(ARCH_DIR) include/asm
> +	ln -sf asm-$(ARCH_DIR) include-compat/asm
> +
> +	for i in $(UNIFDEF_FILES); \
> +		do $(call unifdef, $$i); done
> +
>  	for i in $$(find $T -type f -printf '%P '); \
>  		do cmp -s $$i $T/$$i || cp $T/$$i $$i; done
>  	rm -rf $T
> @@ -57,15 +75,13 @@ source-sync:
>  source-sync:
>  	rm -rf $T
>  	rsync --exclude='*.mod.c' -R \
> -             "$(LINUX)"/arch/x86/kvm/./*.[ch] \
> -             "$(LINUX)"/virt/kvm/./*.[ch] \
> -             $T/
> -	$(call hack, kvm_main.c)
> -	$(call hack, mmu.c)
> -	$(call hack, vmx.c)
> -	$(call hack, svm.c)
> -	$(call hack, x86.c)
> -	$(call hack, irq.h)
> +	     "$(LINUX)"/arch/$(ARCH_DIR)/kvm/./*.[ch] \
> +	     "$(LINUX)"/virt/kvm/./*.[ch] \
> +	     $T/
> +
> +	for i in $(HACK_FILES); \
> +		do $(call hack, $$i); done
> +
>  	for i in $$(find $T -type f -printf '%P '); \
>  		do cmp -s $$i $T/$$i || cp $T/$$i $$i; done
>  	rm -rf $T
>
> -------------------------------------------------------------------------
> 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] 3+ messages in thread

* Re: [PATCH] [RESEND] Make "make sync" in kernel dir work for multiple archs
  2008-04-23 23:02 ` Anthony Liguori
@ 2008-04-24  4:35   ` Jerone Young
  0 siblings, 0 replies; 3+ messages in thread
From: Jerone Young @ 2008-04-24  4:35 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel, kvm-ppc-devel

On Wed, 2008-04-23 at 18:02 -0500, Anthony Liguori wrote:
> > diff --git a/kernel/Makefile b/kernel/Makefile
> > --- a/kernel/Makefile
> > +++ b/kernel/Makefile
> > @@ -1,5 +1,10 @@ include ../config.mak
> >  include ../config.mak
> >  
> > +ARCH_DIR=$(ARCH)
> > +ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
> > +	ARCH_DIR=x86
> > +endif
> > +
> >   
> 
> This sets ARCH_DIR to x86

yeap.

> 
> >  KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
> >  
> >  DESTDIR=
> > @@ -18,11 +23,25 @@ _hack = mv $1 $1.orig && \
> >  	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
> >  
> >  _unifdef = mv $1 $1.orig && \
> > -	  unifdef -DCONFIG_X86 $1.orig > $1; \
> > +	unifdef -DCONFIG_$(shell echo $(ARCH_DIR)|tr '[:lower:]' '[:upper:]') $1.orig > $1; \
> >            [ $$? -le 1 ] && rm $1.orig
> >  
> >  hack = $(call _hack,$T/$(strip $1))
> >  unifdef = $(call _unifdef,$T/$(strip $1))
> > +
> > +ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
> >   

Doh! Yeap again. This was caused when things where need to change in a
respin of the last patch. I just didn't notice it.

I'll change it and resend ... again.
> 
> And I'm not quite sure what this is supposed to do but it doesn't look 
> right.  ARCH_DIR is going to equal 'x86' so this is going to break 
> things on x86 sinc ethe filter will return an empty string.
> 
> Regards,
> 
> Anthony Liguori
> 
> > +UNIFDEF_FILES = include/linux/kvm.h \
> > +		include/linux/kvm_para.h \
> > +		include/asm-$(ARCH_DIR)/kvm.h \
> > +		include/asm-x86/kvm_para.h
> > +
> > +HACK_FILES = kvm_main.c \
> > +		mmu.c \
> > +		vmx.c \
> > +		svm.c \
> > +		x86.c \
> > +		irq.h 
> > +endif
> >  
> >  all::
> >  #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
> > @@ -39,17 +58,16 @@ header-sync:
> >  	rm -rf $T
> >  	rsync -R \
> >  	     "$(LINUX)"/./include/linux/kvm*.h \
> > -	     "$(LINUX)"/./include/asm-x86/kvm*.h \
> > -             $T/
> > -	mkdir -p include/linux include/asm-x86
> > -	ln -sf asm-x86 include/asm
> > -	ln -sf asm-x86 include-compat/asm
> > +	     "$(LINUX)"/./include/asm-$(ARCH_DIR)/kvm*.h \
> > +	     $T/
> >  
> > -	$(call unifdef, include/linux/kvm.h)
> > -	$(call unifdef, include/linux/kvm_para.h)
> > -	$(call unifdef, include/asm-x86/kvm.h)
> > -	$(call unifdef, include/asm-x86/kvm_para.h)
> > -	$(call hack, include/linux/kvm.h)
> > +	mkdir -p include/linux include/asm-$(ARCH_DIR)
> > +	ln -s asm-$(ARCH_DIR) include/asm
> > +	ln -sf asm-$(ARCH_DIR) include-compat/asm
> > +
> > +	for i in $(UNIFDEF_FILES); \
> > +		do $(call unifdef, $$i); done
> > +
> >  	for i in $$(find $T -type f -printf '%P '); \
> >  		do cmp -s $$i $T/$$i || cp $T/$$i $$i; done
> >  	rm -rf $T
> > @@ -57,15 +75,13 @@ source-sync:
> >  source-sync:
> >  	rm -rf $T
> >  	rsync --exclude='*.mod.c' -R \
> > -             "$(LINUX)"/arch/x86/kvm/./*.[ch] \
> > -             "$(LINUX)"/virt/kvm/./*.[ch] \
> > -             $T/
> > -	$(call hack, kvm_main.c)
> > -	$(call hack, mmu.c)
> > -	$(call hack, vmx.c)
> > -	$(call hack, svm.c)
> > -	$(call hack, x86.c)
> > -	$(call hack, irq.h)
> > +	     "$(LINUX)"/arch/$(ARCH_DIR)/kvm/./*.[ch] \
> > +	     "$(LINUX)"/virt/kvm/./*.[ch] \
> > +	     $T/
> > +
> > +	for i in $(HACK_FILES); \
> > +		do $(call hack, $$i); done
> > +
> >  	for i in $$(find $T -type f -printf '%P '); \
> >  		do cmp -s $$i $T/$$i || cp $T/$$i $$i; done
> >  	rm -rf $T
> >
> > -------------------------------------------------------------------------
> > 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
> _______________________________________________
> 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] 3+ messages in thread

end of thread, other threads:[~2008-04-24  4:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 22:46 [PATCH] [RESEND] Make "make sync" in kernel dir work for multiple archs Jerone Young
2008-04-23 23:02 ` Anthony Liguori
2008-04-24  4:35   ` Jerone Young

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