Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3395136ybx; Fri, 8 Nov 2019 19:33:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyX43xJgvcCqjP9qpd1kr9hYvTxxUi96ebjf11NBtamzFlcG4QF/zAqVXrnGvVwsjVcsWKC X-Received: by 2002:a50:9fa4:: with SMTP id c33mr14211606edf.176.1573270383729; Fri, 08 Nov 2019 19:33:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573270383; cv=none; d=google.com; s=arc-20160816; b=LFLZ8dVyIMMbAqNie1S993v4YYRtgOVP2urK9DlZv670iDrbB/tDHa0Jp1p9aBi83Q ZCeN0zzbMXrpS4p/XRMc9GuyUsbe5FWr0nA1McuBqJuY0fC8wVhAGajo41ulv3AcVyjN houf8mr4xCCdvlvFv3+6jXPXLJK7cbuVquWib69vUpKHeGSjVoEIX2kCYGXgTUiUi5F/ FdK/0a6T/+II3BleRBUeglOirlSfU6yFiMF3BV3TaNOKJ2Yy/vdvStru/8Cw2jXPm68E 50sXBEwoFjEYx+0FcFNI3OZiF3JCIl/rjWWwtcRcBxVOmnaAQwBv93kFM6DSAggJKdr0 BYuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=6OHje3sJ3IH4vfH9hJBC9ocohmUm5nws/CQJC/szrJQ=; b=KjO394yHBjNXb9oLxQqsw2Ks2FXEJlpTRKOWfP13BSaeN/vj0U7g+/gODFiYqY4f/t NYpWq/L66nd+kREuvo48/YyreCo2H4bZAiZucsc48TVv3LjLxx5XEjXZ4ySzrAQzVMTG 3TrizG9VMjtRdkiGh5KruxhIr2fHoLdNfBeQ8Ij0CNcsGVto7aGmrZOKmJpCSGzP44Z+ clHJ7pHCgKdONsKx0UOpS1MITWHtnpObSR7QiYYeYD4QVjJsttnY56r4SC7+5yfcShkU EtTi77hhrZo1XBlTsiWov/Hd5SVRgpV17m2891IjwNzZn4xvf9d1/lYQqWQ4/uik99lO V4xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Sx+HneNN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si5448898edh.379.2019.11.08.19.32.28; Fri, 08 Nov 2019 19:33:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Sx+HneNN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbfKIDbt (ORCPT + 99 others); Fri, 8 Nov 2019 22:31:49 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:35601 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbfKIDbs (ORCPT ); Fri, 8 Nov 2019 22:31:48 -0500 Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) (authenticated) by conssluserg-03.nifty.com with ESMTP id xA93VZJr005710; Sat, 9 Nov 2019 12:31:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com xA93VZJr005710 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1573270296; bh=6OHje3sJ3IH4vfH9hJBC9ocohmUm5nws/CQJC/szrJQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Sx+HneNN8cr5CBKlq9ynCzBxH8/Mo1voqRskEijABmx2mUDJM3GEUf8RqIbrCSwcX LuG8PlfCEQWsPXk7isXAxwea9nyV3hgP079wAoDzZ/tVArTyQ1hZj/Wgj4Jcx4CcOI Vbs/2Be3VF2fqdwlnyRYreiKgS4VGuFa9QYeKVj2UHX76aPuHp0I/FVF/CJ+JcUOo9 DYBNk+Cwkn0gCPfok+ZHdxC+oxVpt4sf9vDPT5/yWw59e44DXFwPu9w/iI2hmRh4w/ 4HibnS6QxbJjXYpx1s2Z3IZCS/cY0QdyC/zh3e5JEbQcZ3RTj8GStiL3RokZz9FK44 7+bGB6s2Pvv6Q== X-Nifty-SrcIP: [209.85.221.181] Received: by mail-vk1-f181.google.com with SMTP id k19so1979609vke.10; Fri, 08 Nov 2019 19:31:36 -0800 (PST) X-Gm-Message-State: APjAAAUjgLUpWOx5dcbWQZchYLRF6ohSYw6vXD1QtsfJ6YQpaQFP55jo zcr7lYyAKDVVpqtOPBLD57N6yTKR3N2o+r1zNe4= X-Received: by 2002:a1f:7387:: with SMTP id o129mr10392097vkc.73.1573270294578; Fri, 08 Nov 2019 19:31:34 -0800 (PST) MIME-Version: 1.0 References: <20191104230001.27774-1-aarcange@redhat.com> <20191104230001.27774-4-aarcange@redhat.com> <6ed4a5cd-38b1-04f8-e3d5-3327a1bd5d87@redhat.com> <678358c1-0621-3d2a-186e-b60742b2a286@redhat.com> <20191105135414.GA30717@redhat.com> <330acce5-a527-543b-84c0-f3d8d277a0e2@redhat.com> <20191105145651.GD30717@redhat.com> <20191108135631.GA22507@linux-8ccs> In-Reply-To: From: Masahiro Yamada Date: Sat, 9 Nov 2019 12:30:58 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 03/13] kvm: monolithic: fixup x86-32 build To: Paolo Bonzini Cc: Jessica Yu , Andrea Arcangeli , kvm@vger.kernel.org, Linux Kernel Mailing List , Vitaly Kuznetsov , Sean Christopherson , Matthias Maennich , Lucas De Marchi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (+CC: Lucas De Marchi, the kmod maintainer) On Sat, Nov 9, 2019 at 4:51 AM Paolo Bonzini wrote: > > On 08/11/19 14:56, Jessica Yu wrote: > > And I am > > not sure what Masahiro (who takes care of all things kbuild-related) > > thinks of this idea. But before implementing all this, is there > > absolutely no way around having the duplicated exported symbols? (e.g., > > could the modules be configured/built in a mutally exclusive way? I'm > > lacking the context from the rest of the thread, so not sure which are > > the problematic modules.) I do not think having a white-list in the modpost is maintainable. > > The problematic modules are kvm_intel and kvm_amd, so we cannot build > them in a mutually exclusive way (but we know it won't make sense to > load both). We will have to build only one of them when built into > vmlinux, but the module case must support building both. > > Currently we put the common symbols in kvm.ko, and kvm.ko acts as a kind > of "library" for kvm_intel.ko and kvm_amd.ko. The problem is that > kvm_intel.ko and kvm_amd.ko currently pass a large array of function > pointers to kvm.ko, and Andrea measured a substantial performance > penalty from retpolines when kvm.ko calls back through those pointers. > > Therefore he would like to remove kvm.ko, and that would result in > symbols exported from two modules. If this is a general demand, I think we can relax the 'exported twice' warning; we can show the warning only when the previous export is from vmlinux. However, I am not sure how the module dependency should be handled when the same symbol is exported from multiple modules. Let's say the same symbol is exported from foo.ko and bar.ko and foo.ko appears first in modules.order . In this case, I think the foo.ko should be considered to have a higher priority than bar.ko The modpost records MODULE_INFO(depends, foo.ko) correctly, but modules.{dep, symbols} do not seem to reflect that. Maybe, depmod does not take multiple-export into consideration ?? If we change this, I want this working consistently. Masahiro Yamada > I suppose we could use code patching mechanism to avoid the retpolines. > Andrea, what do you think about that? That would have the advantage > that we won't have to remove kvm_x86_ops. :) > > Thanks, > > Paolo -- Best Regards Masahiro Yamada