[PATCH] KVM: external module: Fix for printk support.

"Zhang, Xiantao" <[email protected]>
Newsgroups org.kernel.vger.kvm-ia64,org.kernel.vger.kvm
Message-ID <706158FABBBA044BAD4FE898A02E4BC219BCA9F6@pdsmsx503.ccr.corp.intel.com>
From b1fc7f3303d9e141e27bff593fb05ada59910b09 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Thu, 27 Nov 2008 17:27:05 +0800
Subject: [PATCH] KVM: external module: Fix for printk support.

kvm-intel module added printk support in kernel, this patch
fix build failure with it.
Signed-off-by: Xiantao Zhang <[email protected]>
---
 kernel/Makefile             |    2 +-
 kernel/ia64/Kbuild          |    2 +-
 kernel/ia64/Makefile.pre    |    8 ++++++++
 kernel/ia64/hack-module.awk |    8 ++++++++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index eaf1c8e..41449d6 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -30,7 +30,7 @@ unifdef = mv $1 $1.orig && cat unifdef.h $1.orig > $1 && rm $1.orig
 hack = $(call _hack,$T/$(strip $1))
 
 hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c i8254.c kvm_trace.c
-hack-files-ia64 = kvm_main.c kvm_fw.c
+hack-files-ia64 = kvm_main.c kvm_fw.c kvm_lib.c
 
 hack-files = $(hack-files-$(ARCH_DIR))
 
diff --git a/kernel/ia64/Kbuild b/kernel/ia64/Kbuild
index 88eaa39..130ec45 100644
--- a/kernel/ia64/Kbuild
+++ b/kernel/ia64/Kbuild
@@ -9,4 +9,4 @@ endif
 
 EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
-               vtlb.o process.o memset.o memcpy.o
+               vtlb.o process.o memset.o memcpy.o kvm_lib.o
diff --git a/kernel/ia64/Makefile.pre b/kernel/ia64/Makefile.pre
index fa8cefd..3c8b4b3 100644
--- a/kernel/ia64/Makefile.pre
+++ b/kernel/ia64/Makefile.pre
@@ -1,7 +1,15 @@
 prerequisite: asm-offsets.h ia64/memset.S ia64/memcpy.S
 	cp -f $(KERNELDIR)/arch/ia64/lib/memcpy.S ia64/memcpy.S
 	cp -f $(KERNELDIR)/arch/ia64/lib/memset.S ia64/memset.S
+	cp -f $(KERNELDIR)/lib/vsprintf.c ia64/vsprintf.c
+	cp -f $(KERNELDIR)/lib/ctype.c ia64/ctype.c
+	sed -i /^EXPORT_SYMBOL/d ia64/vsprintf.c
+	sed -i /^EXPORT_SYMBOL/d ia64/ctype.c
 	cmp -s asm-offset.h ia64/asm-offset.h || mv -f asm-offsets.* ia64/
+	cp -f $(KERNELDIR)/lib/vsprintf.c ia64/vsprintf.c
+	cp -f $(KERNELDIR)/lib/ctype.c ia64/ctype.c
+	sed -i /^EXPORT_SYMBOL/d ia64/vsprintf.c
+	sed -i /^EXPORT_SYMBOL/d ia64/ctype.c
 
 asm-offsets.h: asm-offsets.s
 	@(set -e; \
diff --git a/kernel/ia64/hack-module.awk b/kernel/ia64/hack-module.awk
index 38db00f..3dd2260 100644
--- a/kernel/ia64/hack-module.awk
+++ b/kernel/ia64/hack-module.awk
@@ -5,6 +5,10 @@ BEGIN { split("INIT_WORK on_each_cpu smp_call_function " \
     printf("MODULE_INFO(version, \"%s\");\n", version)
 }
 
+{ sub(/..\/..\/..\/lib\/vsprintf\.c/, "vsprintf.c") }
+{ sub(/..\/..\/..\/lib\/ctype\.c/, "ctype.c") }
+/#undef CONFIG_MODULES/ { $0 = "" }
+
 {
     for (i in compat_apis) {
 	ident = compat_apis[i]
@@ -14,4 +18,8 @@ BEGIN { split("INIT_WORK on_each_cpu smp_call_function " \
 
 /#include <linux\/compiler.h>/ { $0 = "" }
 
+{ sub(/linux\/mm_types\.h/, "linux/mm.h") }
+
+{ sub(/\<__user\>/, " ") }
+
 { print }
-- 
1.6.0
0003-KVM-external-module-Fix-for-printk-support.patch (application/octet-stream, 2.9 KB)
From b1fc7f3303d9e141e27bff593fb05ada59910b09 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Thu, 27 Nov 2008 17:27:05 +0800
Subject: [PATCH] KVM: external module: Fix for printk support.

kvm-intel module added printk support in kernel, this patch
fix build failure with it.
Signed-off-by: Xiantao Zhang <[email protected]>
---
 kernel/Makefile             |    2 +-
 kernel/ia64/Kbuild          |    2 +-
 kernel/ia64/Makefile.pre    |    8 ++++++++
 kernel/ia64/hack-module.awk |    8 ++++++++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index eaf1c8e..41449d6 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -30,7 +30,7 @@ unifdef = mv $1 $1.orig && cat unifdef.h $1.orig > $1 && rm $1.orig
 hack = $(call _hack,$T/$(strip $1))
 
 hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c i8254.c kvm_trace.c
-hack-files-ia64 = kvm_main.c kvm_fw.c
+hack-files-ia64 = kvm_main.c kvm_fw.c kvm_lib.c
 
 hack-files = $(hack-files-$(ARCH_DIR))
 
diff --git a/kernel/ia64/Kbuild b/kernel/ia64/Kbuild
index 88eaa39..130ec45 100644
--- a/kernel/ia64/Kbuild
+++ b/kernel/ia64/Kbuild
@@ -9,4 +9,4 @@ endif
 
 EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
-               vtlb.o process.o memset.o memcpy.o
+               vtlb.o process.o memset.o memcpy.o kvm_lib.o
diff --git a/kernel/ia64/Makefile.pre b/kernel/ia64/Makefile.pre
index fa8cefd..3c8b4b3 100644
--- a/kernel/ia64/Makefile.pre
+++ b/kernel/ia64/Makefile.pre
@@ -1,7 +1,15 @@
 prerequisite: asm-offsets.h ia64/memset.S ia64/memcpy.S
 	cp -f $(KERNELDIR)/arch/ia64/lib/memcpy.S ia64/memcpy.S
 	cp -f $(KERNELDIR)/arch/ia64/lib/memset.S ia64/memset.S
+	cp -f $(KERNELDIR)/lib/vsprintf.c ia64/vsprintf.c
+	cp -f $(KERNELDIR)/lib/ctype.c ia64/ctype.c
+	sed -i /^EXPORT_SYMBOL/d ia64/vsprintf.c
+	sed -i /^EXPORT_SYMBOL/d ia64/ctype.c
 	cmp -s asm-offset.h ia64/asm-offset.h || mv -f asm-offsets.* ia64/
+	cp -f $(KERNELDIR)/lib/vsprintf.c ia64/vsprintf.c
+	cp -f $(KERNELDIR)/lib/ctype.c ia64/ctype.c
+	sed -i /^EXPORT_SYMBOL/d ia64/vsprintf.c
+	sed -i /^EXPORT_SYMBOL/d ia64/ctype.c
 
 asm-offsets.h: asm-offsets.s
 	@(set -e; \
diff --git a/kernel/ia64/hack-module.awk b/kernel/ia64/hack-module.awk
index 38db00f..3dd2260 100644
--- a/kernel/ia64/hack-module.awk
+++ b/kernel/ia64/hack-module.awk
@@ -5,6 +5,10 @@ BEGIN { split("INIT_WORK on_each_cpu smp_call_function " \
     printf("MODULE_INFO(version, \"%s\");\n", version)
 }
 
+{ sub(/..\/..\/..\/lib\/vsprintf\.c/, "vsprintf.c") }
+{ sub(/..\/..\/..\/lib\/ctype\.c/, "ctype.c") }
+/#undef CONFIG_MODULES/ { $0 = "" }
+
 {
     for (i in compat_apis) {
 	ident = compat_apis[i]
@@ -14,4 +18,8 @@ BEGIN { split("INIT_WORK on_each_cpu smp_call_function " \
 
 /#include <linux\/compiler.h>/ { $0 = "" }
 
+{ sub(/linux\/mm_types\.h/, "linux/mm.h") }
+
+{ sub(/\<__user\>/, " ") }
+
 { print }
-- 
1.6.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.