Received: by 10.223.185.111 with SMTP id b44csp354273wrg; Fri, 9 Mar 2018 06:10:08 -0800 (PST) X-Google-Smtp-Source: AG47ELuIgZOYw2xuz2QjlGOSw97VYb3OpQMdAVrWPdewz41bniUhxUer+s+RYll9LGHbCT0KWyNd X-Received: by 10.101.90.140 with SMTP id c12mr23902484pgt.56.1520604608095; Fri, 09 Mar 2018 06:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520604608; cv=none; d=google.com; s=arc-20160816; b=qJFJp4R+2ZNHEqc8bEMLR6jAlekrHYndu/AooSJAdrFSkeiZC5HvaLCbliLcXbutZr HCJjzij8LJ1anUZ1Ntknr3ZeBLQ21vnT/FHN0SIX3WfUqovOjE7lwpqgc1k9YFW1gjU9 ovQiBWqqHpetx0rB9YmDY+XhoLbB/9nbS+oqElWDGGWWGaY9NTPvyihFF1TfVIQ1jtqp yiNuX+WGZBtXaJ9gwxvpIwMcDoqrwAF2eSVOpGCu/eIp97TXTH6T+lQJRm4GhTwoXaYZ 8PqQ1lzMUgrbJgzsMj7yOrvHqfvoHR2Srx6V6PnKW8DApp3l2QI4GZmHLFq5rQpdNYt8 CzbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=PNkH5Ut9FTiAcB4mCyEejk+EiV4w0DJADhEyY/xu9lE=; b=OIRXCQnWBBPGmRyGBuXRF9K5u/G1OHAJXURpL8LijZO8Bh64/GWHFBn3xYBnEmb/GS 2OSH5Jo8Eb12Bi4IDao2QOOreXaQL3gXMIoAddC3lL9at8dgi6kH9Iuj8lD7N/L08edg X++5lY5RW2pyTkB0yCr7v3yN5Ex5ZsCQpHDWhhYyCEnRN+bJCnjMB6qWzKzLe9Hlr19l KDik5RJGh0awQDn/Q3NQwWkEhbZtqypll9BtMV3DtQqFmc9FnlUOi8MM8O0zFed45Y/L aEGmGHsqEesD9MlTYPn2qi8ODLzpQf48WquTDI9aaPsSHc4MZCQQ1khYLHKJSlA9d1Ox zUfg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si942604pli.210.2018.03.09.06.09.53; Fri, 09 Mar 2018 06:10:08 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751200AbeCIOIk (ORCPT + 99 others); Fri, 9 Mar 2018 09:08:40 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:41380 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751056AbeCIOIi (ORCPT ); Fri, 9 Mar 2018 09:08:38 -0500 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1euIhG-0000hN-Rv; Fri, 09 Mar 2018 15:08:35 +0100 Date: Fri, 9 Mar 2018 15:08:34 +0100 (CET) From: Thomas Gleixner To: Vitaly Kuznetsov cc: kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V In-Reply-To: <20180309140249.2840-8-vkuznets@redhat.com> Message-ID: References: <20180309140249.2840-1-vkuznets@redhat.com> <20180309140249.2840-8-vkuznets@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Mar 2018, Vitaly Kuznetsov wrote: > Enlightened VMCS is just a structure in memory, the main benefit > besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > mask: we tell the underlying hypervisor which fields were modified > since VMEXIT so there's no need to inspect them all. > > Tight CPUID loop test shows significant speedup: > Before: 18890 cycles > After: 8304 cycles > > Static key is being used to avoid performance penalty for non-Hyper-V > deployments. Tests show we add around 3 (three) CPU cycles on each > VMEXIT (1077.5 cycles before, 1080.7 cycles after for the same CPUID > loop on bare metal). We can probably avoid one test/jmp in vmx_vcpu_run() > but I don't see a clean way to use static key in assembly. STATIC_JUMP_IF_TRUE, STATIC_JUMP_IF_FALSE are your friends. Thanks, tglx