diff options
author | Avi Kivity <avi@qumranet.com> | 2008-07-20 12:03:53 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-07-20 12:05:40 +0300 |
commit | 3b2f4bd38c813ce112bbaa6dc90be7a3cc142b74 (patch) | |
tree | 9133df1e226f3bbc13d474ad69f70f1a9878fb15 | |
parent | 64677b70405c520d9f4e6624e554f9699cb84f1e (diff) |
kvm: external module: adjust for smp_call_function_single() changes in 2.6.27.
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | kvm/kernel/external-module-compat.c | 24 | ||||
-rw-r--r-- | 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 84cdd40f6..084234d3d 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 <linux/smp.h> 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 <linux/smp.h> + +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 e0a6f9218..4ba4bac9d 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 |