From 3b2f4bd38c813ce112bbaa6dc90be7a3cc142b74 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 20 Jul 2008 12:03:53 +0300 Subject: [PATCH] kvm: external module: adjust for smp_call_function_single() changes in 2.6.27. Signed-off-by: Avi Kivity --- kvm/kernel/external-module-compat.c | 24 ++++++++++++++++++++---- kvm/kernel/external-module-compat.h | 6 +++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/kvm/kernel/external-module-compat.c b/kvm/kernel/external-module-compat.c index 84cdd40f6f..084234d3d4 100644 --- a/kvm/kernel/external-module-compat.c +++ b/kvm/kernel/external-module-compat.c @@ -25,7 +25,7 @@ static void scfs_thunk(void *_thunk) } int kvm_smp_call_function_single(int cpu, void (*func)(void *info), - void *info, int nonatomic, int wait) + void *info, int wait) { int r, this_cpu; struct scfs_thunk_info thunk; @@ -59,7 +59,7 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), #include int kvm_smp_call_function_single(int cpu, void (*func)(void *info), - void *info, int nonatomic, int wait) + void *info, int wait) { int this_cpu, r; @@ -71,13 +71,29 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), func(info); local_irq_enable(); } else - r = smp_call_function_single(cpu, func, info, nonatomic, wait); + r = smp_call_function_single(cpu, func, info, 0, wait); put_cpu(); return r; } #define smp_call_function_single kvm_smp_call_function_single +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) + +/* The 'nonatomic' argument was removed in 2.6.27. */ + +#undef smp_call_function_single + +#include + +int kvm_smp_call_function_single(int cpu, void (*func)(void *info), + void *info, int wait) +{ + return smp_call_function_single(cpu, func, info, 0, wait); +} + +#define smp_call_function_single kvm_smp_call_function_single + #endif /* div64_u64 is fairly new */ @@ -171,7 +187,7 @@ int kvm_smp_call_function_mask(cpumask_t mask, atomic_set(&data.finished, 0); for (cpu = first_cpu(mask); cpu != NR_CPUS; cpu = next_cpu(cpu, mask)) - smp_call_function_single(cpu, kvm_ack_smp_call, &data, 1, 0); + smp_call_function_single(cpu, kvm_ack_smp_call, &data, 0); while (atomic_read(&data.started) != cpus) { cpu_relax(); diff --git a/kvm/kernel/external-module-compat.h b/kvm/kernel/external-module-compat.h index e0a6f9218e..4ba4bac9d1 100644 --- a/kvm/kernel/external-module-compat.h +++ b/kvm/kernel/external-module-compat.h @@ -42,12 +42,12 @@ /* * smp_call_function_single() is not exported below 2.6.20, and has different - * semantics below 2.6.23. + * semantics below 2.6.23. The 'nonatomic' argument was removed in 2.6.27. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) int kvm_smp_call_function_single(int cpu, void (*func)(void *info), - void *info, int nonatomic, int wait); + void *info, int wait); #define smp_call_function_single kvm_smp_call_function_single -- 2.11.4.GIT