From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754330AbdBTQvd (ORCPT ); Mon, 20 Feb 2017 11:51:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58932 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754047AbdBTQva (ORCPT ); Mon, 20 Feb 2017 11:51:30 -0500 Subject: Re: RFC: Getting rid of LTR in VMX To: Andy Lutomirski References: <38d613dc-5b46-1f4f-04d1-53c01932e6d6@redhat.com> Cc: kvm list , "linux-kernel@vger.kernel.org" , X86 ML , "H. Peter Anvin" , Borislav Petkov From: Paolo Bonzini Message-ID: Date: Mon, 20 Feb 2017 17:51:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 20 Feb 2017 16:51:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/02/2017 17:46, Andy Lutomirski wrote: > On Mon, Feb 20, 2017 at 3:05 AM, Paolo Bonzini wrote: >> >> >> On 18/02/2017 04:29, Andy Lutomirski wrote: >>> There's no code here because the patch is trivial, but I want to run >>> the idea by you all first to see if there are any issues. >>> >>> VMX is silly and forces the TSS limit to the minimum on VM exits. KVM >>> wastes lots of cycles bumping it back up to accomodate the io bitmap. >> >> Actually looked at the code now... >> >> reload_tss is only invoked for userspace exits, so it is a nice-to-have >> but it wouldn't show on most workloads. Still it does save 150-200 >> clock cycles to remove it (I just commented out reload_tss() from >> __vmx_load_host_state to test). > > That's for anything involving userspace or preemption, right? Yes. But 150-200 clock cycles are nothing compared to the cache misses you get from preemption, so I'd ignore that. Saving 300 clock cycles on userspace exits from TR+GSBASE would be about 5% on my Haswell. > That being said, vmx_save_host_state() is, um, poorly optimized. Yeah, but again it doesn't run that often in practical cases. Paolo