From patchwork Mon May 25 06:56:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 25734 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 n4P6uqgi013900 for ; Mon, 25 May 2009 06:56:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbZEYG4r (ORCPT ); Mon, 25 May 2009 02:56:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751413AbZEYG4r (ORCPT ); Mon, 25 May 2009 02:56:47 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:34279 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbZEYG4r (ORCPT ); Mon, 25 May 2009 02:56:47 -0400 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id D7899103D7DD7; Mon, 25 May 2009 08:56:47 +0200 (CEST) Received: from [92.74.56.143] (helo=[192.168.1.3]) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1M8U75-000535-00; Mon, 25 May 2009 08:56:47 +0200 Message-ID: <4A1A412E.2090106@web.de> Date: Mon, 25 May 2009 08:56:46 +0200 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 v2] kvm-kmod: x86: Drop duplicate external-module-compat objects References: <4A170535.3090007@web.de> <4A19021E.8080205@redhat.com> In-Reply-To: <4A19021E.8080205@redhat.com> X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX18OenZ2RDgFIX5/D35MIdNcZFceE4NFDvySfKMU sKwXRD9U53G56DxsCyS5pzS9k3+kwJNEH9NpbW9VPcvvO8vvvI 2cwTm9ClU= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Avi Kivity wrote: > Jan Kiszka wrote: >> This redundancy breaks subtly when building against recent OpenSUSE >> kernels. >> >> Signed-off-by: Jan Kiszka >> --- >> >> x86/Kbuild | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/x86/Kbuild b/x86/Kbuild >> index e304c79..ade87fc 100644 >> --- a/x86/Kbuild >> +++ b/x86/Kbuild >> @@ -13,7 +13,7 @@ endif >> ifeq ($(CONFIG_IOMMU_API),y) >> kvm-objs += iommu.o >> endif >> -kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o >> -kvm-amd-objs := svm.o ../external-module-compat.o >> +kvm-intel-objs := vmx.o vmx-debug.o >> +kvm-amd-objs := svm.o >> >> > > IIRC, for really old kernels, some symbols are defined in > external-module-compat.c and needed by kvm-$arch.ko. So we'll have to > export those symbols if we drop the double link (which is a good idea > regardless of the build problem). > Checked against 2.6.18 (2.6.16 doesn't build build with my gcc-4.3 and x86/x86_emulate.o sends my gcc-3.3 into some stack overflow): We only need to export kvm_smp_call_function_single. More patches to fix various old kernel build breakages are now also in my queue... ------------> This redundancy breaks subtly when building against recent OpenSUSE kernels. Somehow scripts/basic/hash gets called with multiple modname arguments, causing it to fail and produce invalid output. Changes in v2: - export kvm_smp_call_function_single required by vendor module Signed-off-by: Jan Kiszka --- external-module-compat.c | 3 +++ x86/Kbuild | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/external-module-compat.c b/external-module-compat.c index f6013f3..6b69127 100644 --- a/external-module-compat.c +++ b/external-module-compat.c @@ -46,6 +46,7 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), put_cpu(); return r; } +EXPORT_SYMBOL_GPL(kvm_smp_call_function_single); #define smp_call_function_single kvm_smp_call_function_single @@ -75,6 +76,7 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), put_cpu(); return r; } +EXPORT_SYMBOL_GPL(kvm_smp_call_function_single); #define smp_call_function_single kvm_smp_call_function_single @@ -104,6 +106,7 @@ int kvm_smp_call_function_single(int cpu, void (*func)(void *info), } #endif /* !CONFIG_SMP */ +EXPORT_SYMBOL_GPL(kvm_smp_call_function_single); #define smp_call_function_single kvm_smp_call_function_single diff --git a/x86/Kbuild b/x86/Kbuild index e304c79..ade87fc 100644 --- a/x86/Kbuild +++ b/x86/Kbuild @@ -13,7 +13,7 @@ endif ifeq ($(CONFIG_IOMMU_API),y) kvm-objs += iommu.o endif -kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o -kvm-amd-objs := svm.o ../external-module-compat.o +kvm-intel-objs := vmx.o vmx-debug.o +kvm-amd-objs := svm.o CFLAGS_kvm_main.o = -DKVM_MAIN