From 93b76074b88e87c51216209c462a93d60cede09d Mon Sep 17 00:00:00 2001 From: Zhang Xiantao Date: Wed, 27 Aug 2008 09:33:45 +0800 Subject: kvm: external module: ia64 compatibility with 2.6.26 hosts Add one hack-module.awk scripts to hack ia64 source. Signed-off-by: Zhang Xiantao Signed-off-by: Avi Kivity --- kvm/kernel/Makefile | 2 +- kvm/kernel/ia64/Kbuild | 3 ++- kvm/kernel/ia64/external-module-compat.h | 16 ++++++++++++++++ kvm/kernel/ia64/hack-module.awk | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 kvm/kernel/ia64/hack-module.awk diff --git a/kvm/kernel/Makefile b/kvm/kernel/Makefile index d2913a926..3f5f6da9a 100644 --- a/kvm/kernel/Makefile +++ b/kvm/kernel/Makefile @@ -29,7 +29,7 @@ unifdef = mv $1 $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 -hack-files-ia64 = +hack-files-ia64 = kvm_main.c kvm_fw.c hack-files = $(hack-files-$(ARCH_DIR)) diff --git a/kvm/kernel/ia64/Kbuild b/kvm/kernel/ia64/Kbuild index 764a49354..856147652 100644 --- a/kvm/kernel/ia64/Kbuild +++ b/kvm/kernel/ia64/Kbuild @@ -1,6 +1,7 @@ obj-m := kvm.o kvm-intel.o -kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o +kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o \ + ../anon_inodes.o ../external-module-compat.o 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 \ diff --git a/kvm/kernel/ia64/external-module-compat.h b/kvm/kernel/ia64/external-module-compat.h index 3c4001c1c..d6b67feca 100644 --- a/kvm/kernel/ia64/external-module-compat.h +++ b/kvm/kernel/ia64/external-module-compat.h @@ -2,8 +2,11 @@ * Compatibility header for building as an external module. */ +#ifndef __ASSEMBLY__ #include +#include "../external-module-compat-comm.h" + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) #error "KVM/IA-64 Can't be compiled if kernel version < 2.6.26" #endif @@ -13,3 +16,16 @@ TODO: Implement it later! */ #error "KVM/IA-64 depends on preempt notifiers in kernel." #endif + +/* smp_call_function() lost an argument in 2.6.27. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) + +#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, 0, wait) + +#else + +#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, wait) + +#endif + +#endif diff --git a/kvm/kernel/ia64/hack-module.awk b/kvm/kernel/ia64/hack-module.awk new file mode 100644 index 000000000..b9b24c063 --- /dev/null +++ b/kvm/kernel/ia64/hack-module.awk @@ -0,0 +1,14 @@ +BEGIN { split("INIT_WORK on_each_cpu smp_call_function" , compat_apis); } + +/MODULE_AUTHOR/ { + printf("MODULE_INFO(version, \"%s\");\n", version) +} + +{ + for (i in compat_apis) { + ident = compat_apis[i] + sub("\\<" ident "\\>", "kvm_" ident) + } +} + +{ print } -- cgit v1.2.3