From e50c59a4d59a389e7fed069bfb489a371b3ec6dc Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 23 Jan 2009 16:03:28 +0100 Subject: [PATCH] kvm: external module: fix 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. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- kvm/kernel/external-module-compat-comm.h | 2 +- kvm/kernel/external-module-compat.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/kvm/kernel/external-module-compat-comm.h b/kvm/kernel/external-module-compat-comm.h index 37eb6a4fe8..c3c1c0ec1a 100644 --- a/kvm/kernel/external-module-compat-comm.h +++ b/kvm/kernel/external-module-compat-comm.h @@ -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 diff --git a/kvm/kernel/external-module-compat.c b/kvm/kernel/external-module-compat.c index c0a035525f..823ce8272f 100644 --- a/kvm/kernel/external-module-compat.c +++ b/kvm/kernel/external-module-compat.c @@ -86,11 +86,24 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), #include +#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; } -- 2.11.4.GIT