Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2958009ybx; Fri, 8 Nov 2019 11:52:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxjwsefVtw6RHo3q4TRAzIsDkv5DLRgyDrCQ7onKfZht2DXdyfBnL74YJj0iephTVME7hhv X-Received: by 2002:aa7:d4d8:: with SMTP id t24mr12415856edr.40.1573242733649; Fri, 08 Nov 2019 11:52:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573242733; cv=none; d=google.com; s=arc-20160816; b=YeVJzPxDo1HYQQIihUgXCP4Azjf9/Q0MbADyznaRLmJjUGrhFGfhvRUX69Jx+8CSOv 0EiMn2WtzkgHXKdmp69+c8uANUKo0gytrH4FQnAbCwTSoza+myZtNMGyLPA7g3cPxtFM v7nsL4jRdP7dclZ4OK+FInZ+jPFrW125E/yK0Ypsm9t0dVH2QZCEGwgUcCDv0wyDlGh5 Qsfwph3jXPRNV9zye8Be+cRZmKYjhKEt+cuMN3b/ASG8TUsxq9V1MTrABPNaVgPtxcbO SXjPwakqutiN+wYo5RWDhJ7Yl9Eaxu51xEfrrtGmSIQyklHhV4h/vIfUYEJuHvi4XBu3 me4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=HVIeOx6nzmd9djN2e4574H+maZm9DfsxWD4R9Q206x0=; b=Bw2OnDlak7Q1atVXHGYGjN1IgDgg2xpACuoVtTUZ/oC/NyCBh3WeeS/Ldw0lp6JWJS 1nXa1Vb1nqWxR2Ws5U5DJYgLHSh2oqUoSdyl57yDkkJzQ09RQNWDK42b6a+/xLLDvYxI bTNPJnFC/Lvl1NBbURRaHpcAEkXKe65muXWu8f0UTthDTdRuIdiPAHC4ht/nvLCsmcew sx7i6zS53MNyprPlW+6m/hvlxI6xFUvoVB6LxkIK4nUHO2C6hQFmPmhCLtdSWgcTv5fd OZhrbRhZkJwtGcuIB2+mJ5L4AK+mKHfUNVKyQxGccow8hB4rSa/2VwRHvvkoh4xNxgCX boyg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q44si5162146eda.242.2019.11.08.11.51.50; Fri, 08 Nov 2019 11:52:13 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732532AbfKHTvH (ORCPT + 99 others); Fri, 8 Nov 2019 14:51:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53582 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731864AbfKHTvH (ORCPT ); Fri, 8 Nov 2019 14:51:07 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD301C04BD48 for ; Fri, 8 Nov 2019 19:51:06 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id u2so3870915wrm.7 for ; Fri, 08 Nov 2019 11:51:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HVIeOx6nzmd9djN2e4574H+maZm9DfsxWD4R9Q206x0=; b=o6U9lIBo0vWK98k70k1YCIAnki23OjzLILoDLQs6PDhq57VpgGByEsnT6yy2f2kgtD Xk41/+5nftt4tcH3Pj4NJuqS+/tLvD08jouqQ8F+JSam5la10CCzYPk1uDnDX4LJeZ+8 oDaJzH7NSW0rrxg91gYVrlFjvgjYEwjzj7PPLTnWtNYnqGdEHN/jty26uRFGnsrEIsGJ 9xZqklXViXWaM1CISY9koIQ+0a379k93FvcsGq4jsCZ70Tl4TIMfwVXjrFoUuY9d7YLm mYDwdxWtJJePjm+0QcGhpGhHn6uH7e0tsKt/5ls5NdBJBZmSY5HkZPwV1NWWVKvWloJ9 EMUg== X-Gm-Message-State: APjAAAUsWzjpwgNQZf4s7bVCua7d1QD4lOL83GZ3JWfPMH6GJYt66nDc 8ru5XlOi0T1C/vEav2fkuL1aUQGTA0CEfIi6kUa8i99KKOpC9KgMTYn8fEr8IIQULJd0amcxuQ6 tO9J7+mgJzquHnj/sJ3eVRc5a X-Received: by 2002:a5d:4ecd:: with SMTP id s13mr10517844wrv.216.1573242665047; Fri, 08 Nov 2019 11:51:05 -0800 (PST) X-Received: by 2002:a5d:4ecd:: with SMTP id s13mr10517822wrv.216.1573242664769; Fri, 08 Nov 2019 11:51:04 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:e8cd:9f0f:a5dc:7ad5? ([2001:b07:6468:f312:e8cd:9f0f:a5dc:7ad5]) by smtp.gmail.com with ESMTPSA id y16sm6599496wro.25.2019.11.08.11.51.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 11:51:04 -0800 (PST) Subject: Re: [PATCH 03/13] kvm: monolithic: fixup x86-32 build To: Jessica Yu Cc: Andrea Arcangeli , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vitaly Kuznetsov , Sean Christopherson , Masahiro Yamada , Matthias Maennich 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> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Fri, 8 Nov 2019 20:51:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191108135631.GA22507@linux-8ccs> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.) 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. 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