Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1392789ybn; Wed, 25 Sep 2019 17:39:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXT+dv0Vd9o5pWRnjmozjTGxhagPH0hkTG0wfuucOlSdQExdDjZQ/Q4aqUhMjkcWOxn3UE X-Received: by 2002:a17:906:4e8f:: with SMTP id v15mr856472eju.57.1569458397378; Wed, 25 Sep 2019 17:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569458397; cv=none; d=google.com; s=arc-20160816; b=PyOKth+jlt/x9CYAPNPniahoaFpNu+VgRu/4Tm5gNn17vbn7n1v2rP+1MBb/GtRRNM LW9yO9TrWIqQiv/SdNQ+9fMT0YxoWXKbfK/vNvIfhgcq+nqV47k9mRf+iN2TNwZDlrej QP702S07qU+WN/wJ8KONLcaGnXNyKavrvQuxvvRl3cx3tvJfN+8X/kxlFGPxKEusAghx p4ApuSnYpYgRERdqGQ5HwLkw3JZx2tWLxYUuUnpFlu+LCjWzysDN9S6/uTIE3Z4QDTxP L5LdgBoc6V1IEy+rRjmCad/PXGgrsfk3Jr06KIB+CONTHuwO1Fwsd4LK/CHIkBAzfNje ow8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lLQ6xAHRwYKCtvVAPSx0E3v3JhGDPNFXhdY3jmsfM6k=; b=PHgaB4SUqzIhDfTPuIEOpDBe+68Kb7pfM9ifnL6x0U9rKRCFUYeERJYH9AUhNcpSUT pnBv4YfaVxB+7cbxYrVsE+JN8D4KZgLHUICDAWYBHoXdSl33ILR1BiZaYFLYbSJLmbYM BTLPXR+mnaZ2eGljgl/0wdPYMMJOVVhUgLQ/o3FpA+Ph1W/ZNLY29au7oQbm2fvlZzOB 2msPbmq9HenETe+Rd/9+asCR4Q2DmHwuz0LMLoJ6pjwhxxSj6AMEVVSj0fHjbEUKV4kd FanBuvopTb9GrNrGf82WgLTm8zoM7zl9I63L+szJnLaAZrhj/Qjnlc1stG56zNgV7+Fn B/8w== 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 f15si394691edm.414.2019.09.25.17.39.33; Wed, 25 Sep 2019 17:39:57 -0700 (PDT) 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 S2503666AbfIXAiZ (ORCPT + 99 others); Mon, 23 Sep 2019 20:38:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503655AbfIXAiZ (ORCPT ); Mon, 23 Sep 2019 20:38:25 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1663910CC1ED; Tue, 24 Sep 2019 00:38:25 +0000 (UTC) Received: from mail (ovpn-120-159.rdu2.redhat.com [10.10.120.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B0A710013A1; Tue, 24 Sep 2019 00:38:22 +0000 (UTC) Date: Mon, 23 Sep 2019 20:38:21 -0400 From: Andrea Arcangeli To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Peter Xu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 15/17] KVM: retpolines: x86: eliminate retpoline from vmx.c exit handlers Message-ID: <20190924003821.GA4230@redhat.com> References: <20190920212509.2578-1-aarcange@redhat.com> <20190920212509.2578-16-aarcange@redhat.com> <87o8zb8ik1.fsf@vitty.brq.redhat.com> <7329012d-0b3b-ce86-f58d-3d2d5dc5a790@redhat.com> <20190923190514.GB19996@redhat.com> <20190923202349.GL18195@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 24 Sep 2019 00:38:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paolo, On Tue, Sep 24, 2019 at 02:15:39AM +0200, Paolo Bonzini wrote: > Do you really need that? Why couldn't the handle_* functions simply be > exported from nested.c to vmx.c? I prefer the direct call too indeed. If Sean doesn't want to export those generic names to the whole kernel it would be enough to #include "nested.c" from vmx.c, and you'd still have it private but with no additional checks and no additional extern call. It's not like kvm-intel can be built without linking nested.o anyway. This overall is a C shortcoming of some sort if you've to resort to #include "nested.c" to keep the function hidden in kvm-intel.o despite it's implemented in two different object files. One should be able to limit the scope of an extern function declaration per a group of object files and to drop the declaration before linking that object beyond that initial group. Thanks, Andrea