From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753898AbdLMVIp (ORCPT ); Wed, 13 Dec 2017 16:08:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbdLMVIm (ORCPT ); Wed, 13 Dec 2017 16:08:42 -0500 Date: Wed, 13 Dec 2017 16:08:41 -0500 (EST) From: Paolo Bonzini To: Konrad Rzeszutek Wilk Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jim Mattson , Wanpeng Li Message-ID: <420706749.26867429.1513199321742.JavaMail.zimbra@redhat.com> In-Reply-To: <20171213155947.GN10097@char.us.oracle.com> References: <1513167237-39162-1-git-send-email-pbonzini@redhat.com> <20171213155947.GN10097@char.us.oracle.com> Subject: Re: [PATCH] KVM: vmx: shadow more fields that are read/written on every vmexits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [78.12.251.125, 10.4.196.18, 10.4.195.17] Thread-Topic: shadow more fields that are read/written on every vmexits Thread-Index: T8iXwQ0OAIF2WSnSeWZYeBZup0EAZg== X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 13 Dec 2017 21:08:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > From: "Konrad Rzeszutek Wilk" > To: "Paolo Bonzini" > Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Jim Mattson" , "Wanpeng Li" > > Sent: Wednesday, December 13, 2017 4:59:47 PM > Subject: Re: [PATCH] KVM: vmx: shadow more fields that are read/written on every vmexits > > On Wed, Dec 13, 2017 at 01:13:56PM +0100, Paolo Bonzini wrote: > > Compared to when VMCS shadowing was added to KVM, we are reading/writing > > a few more fields: the PML index, the interrupt status and the preemption > > timer value. The first two are because we are exposing more features > > to nested guests, the preemption timer is simply because we have grown > > a new optimization. Adding them to the shadow VMCS field lists reduces > > the cost of a vmexit by about 1000 clock cycles for each field that exists > > on bare metal. > > > > On the other hand, the guest BNDCFGS and TSC offset are not written on > > fast paths, so remove them. > > Which guest types? Linux? What about Windows Hyper-V /VMWare and such? Only KVM, but I don't see why any other hypervisor would have to write them more than once per MSR access. VMWRITEs do have a (small but visible) cost. > Does it hurt to have them retained? It does cost a little, though another patch I posted decreases that cost. Paolo