Skip to content
Browse files

kvm: external module: adjust for smp_call_function_single() changes i…

…n 2.6.27.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information...
1 parent 64677b7 commit 3b2f4bd38c813ce112bbaa6dc90be7a3cc142b74 Avi Kivity committed Jul 20, 2008
Showing with 23 additions and 7 deletions.
  1. +20 −4 kvm/kernel/external-module-compat.c
  2. +3 −3 kvm/kernel/external-module-compat.h
View
24 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();
View
6 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

0 comments on commit 3b2f4bd

Please sign in to comment.
Something went wrong with that request. Please try again.