Skip to contentSkip to conversation

kvm-userspace: Fix external modules for pre-2.6.27 UP kernels

PATCH Applied Jan Kiszka 2 participants 3 messages Jan 23, 2009 – Feb 5, 2009 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 kvm-userspace: Fix external modules for pre-2.6.27 UP kernels

When disabling SMP on kernels older than 2.6.27, the compat wrapping fails due to unresolved SMP dependencies. This patch fixes the build.

---

 kernel/external-module-compat-comm.h |    2 +-
 kernel/external-module-compat.c      |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)
kernel/external-module-compat-comm.h +1 -1
index 981dc96..06af36d 100644
@@ -54,7 +54,7 @@
 
 int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
 				 void *info, int wait);
-
+#undef smp_call_function_single
 #define smp_call_function_single kvm_smp_call_function_single
 
 #endif
kernel/external-module-compat.c +15 -0
index c0a0355..823ce82 100644
@@ -86,11 +86,24 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
 
 #include <linux/smp.h>
 
+#ifdef CONFIG_SMP
 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);
 }
+#else /* !CONFIG_SMP */
+int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
+				 void *info, int wait)
+{
+	WARN_ON(cpu != 0);
+	local_irq_disable();
+	func(info);
+	local_irq_enable();
+	return 0;
+
+}
+#endif /* !CONFIG_SMP */
 
 #define smp_call_function_single kvm_smp_call_function_single
 
@@ -162,6 +175,7 @@ static void kvm_ack_smp_call(void *_data)
 int kvm_smp_call_function_mask(cpumask_t mask,
 			       void (*func) (void *info), void *info, int wait)
 {
+#ifdef CONFIG_SMP
 	struct kvm_call_data_struct data;
 	cpumask_t allbutself;
 	int cpus;
@@ -203,6 +217,7 @@ int kvm_smp_call_function_mask(cpumask_t mask,
 	}
 out:
 	put_cpu();
+#endif /* CONFIG_SMP */
 	return 0;
 }
 
author
#1 lore raw
Quoted 61 lines · Jan Kiszka

When disabling SMP on kernels older than 2.6.27, the compat wrapping fails due to unresolved SMP dependencies. This patch fixes the build.

---

 kernel/external-module-compat-comm.h |    2 +-
 kernel/external-module-compat.c      |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)
kernel/external-module-compat-comm.h +1 -1
index 981dc96..06af36d 100644
@@ -54,7 +54,7 @@
 
 int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
 				 void *info, int wait);
-
+#undef smp_call_function_single
 #define smp_call_function_single kvm_smp_call_function_single
 
 #endif
kernel/external-module-compat.c +14 -0
index c0a0355..823ce82 100644
@@ -86,11 +86,24 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
 
 #include <linux/smp.h>
 
+#ifdef CONFIG_SMP
 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);
 }
+#else /* !CONFIG_SMP */
+int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
+				 void *info, int wait)
+{
+	WARN_ON(cpu != 0);
+	local_irq_disable();
+	func(info);
+	local_irq_enable();
+	return 0;
+
+}
+#endif /* !CONFIG_SMP */
 
 #define smp_call_function_single kvm_smp_call_function_single
 
@@ -162,6 +175,7 @@ static void kvm_ack_smp_call(void *_data)
 int kvm_smp_call_function_mask(cpumask_t mask,
 			       void (*func) (void *info), void *info, int wait)
 {
+#ifdef CONFIG_SMP
 	struct kvm_call_data_struct data;
 	cpumask_t allbutself;
 	int cpus;

kernel/external-module-compat.c int kvm_smp_call_function_mask(cpumask_t mask, · line 223

Quoted 7 lines
kernel/external-module-compat.c +1 -0
@@ -203,6 +217,7 @@ int kvm_smp_call_function_mask(cpumask_t mask,
 	}
 out:
 	put_cpu();
+#endif /* CONFIG_SMP */
 	return 0;
 }
 

Still applies, still required.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
Applied
#2 lore raw
Quoted 8 lines · Jan Kiszka
Quoted 4 lines · Jan Kiszka

When disabling SMP on kernels older than 2.6.27, the compat wrapping fails due to unresolved SMP dependencies. This patch fixes the build.

Still applies, still required.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function