From patchwork Fri Jan 23 15:03:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3794 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0NEx69l004485 for ; Fri, 23 Jan 2009 06:59:07 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752307AbZAWPDu (ORCPT ); Fri, 23 Jan 2009 10:03:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752378AbZAWPDu (ORCPT ); Fri, 23 Jan 2009 10:03:50 -0500 Received: from lizzard.sbs.de ([194.138.37.39]:24498 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbZAWPDt (ORCPT ); Fri, 23 Jan 2009 10:03:49 -0500 Received: from mail1.sbs.de (localhost [127.0.0.1]) by lizzard.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n0NF3PPh000876; Fri, 23 Jan 2009 16:03:25 +0100 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n0NF3Pf3001379; Fri, 23 Jan 2009 16:03:25 +0100 Message-ID: <4979DC40.9090506@siemens.com> Date: Fri, 23 Jan 2009 16:03:28 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity CC: kvm-devel Subject: [PATCH] kvm-userspace: Fix external modules for pre-2.6.27 UP kernels Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- kernel/external-module-compat-comm.h | 2 +- kernel/external-module-compat.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h index 981dc96..06af36d 100644 --- a/kernel/external-module-compat-comm.h +++ b/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/kernel/external-module-compat.c b/kernel/external-module-compat.c index c0a0355..823ce82 100644 --- a/kernel/external-module-compat.c +++ b/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; }