Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1390879ybn; Wed, 25 Sep 2019 17:38:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdza4p7oj3j8PTBEDA19Epd+FKM8cQMqALd+lVjuK83Stum+DVWe8lkO0frIubANGSasSP X-Received: by 2002:a50:a557:: with SMTP id z23mr782702edb.99.1569458283450; Wed, 25 Sep 2019 17:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569458283; cv=none; d=google.com; s=arc-20160816; b=TR/A2PD238UHo2OL4ISLvFRQCkKZL/T54CyDv+skvcbwj83IjpBldXxyo0G6f6djFz nTUN8OzJyAA2qjksnVQk6x8ZHAWq4WbN+/RvdjG9Ux77pQ5a3QCqBnEN1tktSObHG4h3 sIjRF/Z2b4PEi/28LJYT4Cob/RTt5rSts1xEcI6jnl1U2kY1g33foEcBK76d8tQ0QfTc Xtdspw7hDBMyyLKrJtT7gkG3J5UGILtVyMDOujmA4guWpDIyu1nIx9+ajfwFQ+KiE5vi keS80ennYYD315loClg68wlacfBLG6NgbLvArY04jMPzSKA/WRKhcvu1wsVot7+C9sJ4 sKtQ== 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=yLdZEL3K+/wYvSfPfPK4HdQYdCf4CX6cUGdvl4noKz8=; b=p5ir2icl3EzJPXQtAUcelCavbIdRJlYNZp082YAfgZVwADOQoL+SszhBwLPB3wYfHt wYrK0eMgOFC3rDfT43ua4T0TUxuhRi4fyMRAp+U/SC8iqDDKuGfUkmHCP6XL5hY2qvH0 zxdAhRTGuot7j+iuSFnyfpIxbhluxfKVKtyOcGmDcNmaIlW99KrHRcE/M/9batZqkQrV 4wlOT6r5DbfC4/dzDPf2D7we5fVf3nBdzANHlWypF6BoLVSosHAngJf0FSZCjPdXETnJ NG72qh6q3uH2zYDR+wWkRVxvltniQn+PQCt18c5tHyBwUG+p3U/A4EoFr3bq2uQOi29t uniw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si453673edj.107.2019.09.25.17.37.40; Wed, 25 Sep 2019 17:38:03 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503543AbfIWXw7 (ORCPT + 99 others); Mon, 23 Sep 2019 19:52:59 -0400 Received: from mga03.intel.com ([134.134.136.65]:33600 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729276AbfIWXw7 (ORCPT ); Mon, 23 Sep 2019 19:52:59 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Sep 2019 16:52:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,542,1559545200"; d="scan'208";a="213498370" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga004.fm.intel.com with ESMTP; 23 Sep 2019 16:52:57 -0700 Date: Mon, 23 Sep 2019 16:52:57 -0700 From: Sean Christopherson To: Andrea Arcangeli Cc: Paolo Bonzini , 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: <20190923235257.GS18195@linux.intel.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> <20190923210838.GA23063@redhat.com> <20190923212435.GO18195@linux.intel.com> <20190923234307.GG19996@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190923234307.GG19996@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 23, 2019 at 07:43:07PM -0400, Andrea Arcangeli wrote: > On Mon, Sep 23, 2019 at 02:24:35PM -0700, Sean Christopherson wrote: > > An extra CALL+RET isn't going to be noticeable, especially on modern > > hardware as the high frequency VMWRITE/VMREAD fields should hit the > > shadow VMCS. > > In your last email with regard to the inlining optimizations made > possible by the monolithic KVM model you said "That'd likely save a > few CALL/RET/JMP instructions", that kind of directly contradicts the > above. I think neither one if taken at face value can be possibly > measured. However the above only is relevant for nested KVM so I'm > fine if there's an agreement that it's better to hide the nested vmx > handlers in nested.c at the cost of some call/ret. For the immediate exit case, eliminating the CALL/RET/JMP instructions is a bonus. The real goal was to eliminate the oddity of bouncing through vendor code to invoke a one-line x86 function. Having a separate __kvm_request_immediate_exit() made sense when overwriting kvm_ops_x86, but not so much when using direct calls.