From 98ba59c4f900539c68a3e600729849d2afe61291 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 20 Jul 2008 12:12:45 +0300 Subject: kvm: external module: adjust for on_each_cpu() changes in 2.6.27 Signed-off-by: Avi Kivity --- kvm/kernel/external-module-compat.h | 11 +++++++++++ kvm/kernel/hack-module.awk | 2 ++ 2 files changed, 13 insertions(+) diff --git a/kvm/kernel/external-module-compat.h b/kvm/kernel/external-module-compat.h index 4ba4bac9d..dfd90cf9d 100644 --- a/kvm/kernel/external-module-compat.h +++ b/kvm/kernel/external-module-compat.h @@ -53,6 +53,17 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), #endif +/* on_each_cpu() lost an argument in 2.6.27. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) + +#define kvm_on_each_cpu(func, info, wait) on_each_cpu(func, info, 0, wait) + +#else + +#define kvm_on_each_cpu(func, info, wait) on_each_cpu(func, info, wait) + +#endif + /* * The cpu hotplug stubs are broken if !CONFIG_CPU_HOTPLUG */ diff --git a/kvm/kernel/hack-module.awk b/kvm/kernel/hack-module.awk index fd23ec3ce..4a9379c8c 100644 --- a/kvm/kernel/hack-module.awk +++ b/kvm/kernel/hack-module.awk @@ -58,6 +58,8 @@ { sub(/\/, "kvm_desc_ptr") } { sub(/\<__user\>/, " ") } +{ sub(/\/, "kvm_on_each_cpu") } + /^\t\.name = "kvm"/ { $0 = "\tset_kset_name(\"kvm\")," } /#include / { $0 = "" } -- cgit v1.2.3