Received: by 10.213.65.68 with SMTP id h4csp1058099imn; Wed, 14 Mar 2018 08:22:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELs58A7BdONRVxgEVtS2O2PUG8aIHZzUv0y5taLeCwnhfHTU/9JbVb7CZ/FOqLG+G+h1U91s X-Received: by 2002:a17:902:42a3:: with SMTP id h32-v6mr4336107pld.231.1521040937105; Wed, 14 Mar 2018 08:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521040937; cv=none; d=google.com; s=arc-20160816; b=uL1mUaj6kkYkkuNhP+GeQd9Tw/l80dfXoIhmg8nm6h1KxoHt2BAAn7ZTtxmpJdS9ri jAqmG1Yj3ZCLp5ZZPN8fyQKrpLsiVQxQ2AyDXCg4XS0fMnc4CRAoqFDlJL7tsbLP4LNC 9DwObUNQu261+wslle+gA5KvNq1DAsLwvSgjIlbmZ6P7yCRrT6XhitkRIjWYadVwAOWv tIpCwFIDq/ysNdn9ra4DTassSxfYvmNqO4qTEQcjclMChDOOoaGjNAlpjjPSdYuus/Vp v5Ej2zBHz8m10RRbO+ktlBY6sZGpKdN6Zo2+KrlvMiRxcW0ozbWnkhL68vIZzm4hvQ7n Bc0w== 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=Eur2VDxCKJxIq1v+CaawhRHjL5U+hu9N2Ykw+X3Sm6s=; b=f6bGUm4iphvfXyP89qXArY8bkwQSZk1UVy1ENyiRLk6POr5vF1AaKNdmM0pBnXueHE ZDKHoXxX+fRNxtZHZsilpB0qX9ItAyFBGJm6ai9YpOLK4MqUPHP+xbfvhAq/Kc8/KgXx A0V2AiHEk3H5vW7wkf5ZGD9/J6azkctrXtP/TFhTMdgJK/BYq4qE/JGS9B9iUDwnKSV2 cbIAvkIhyYwuXxnqGuOxT4XVkbrNKTgu/sOHNT21uQiDsN/WTDFuw0dv//wqYFV8XXX2 Cyx++SuGraVTB+FeOfD3obnU/aaQtG8fBH4jJKkMp6O+pQ2F3PH0PpnsPxmIDOzjOSE8 kULw== 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 x3-v6si2120042plv.81.2018.03.14.08.22.02; Wed, 14 Mar 2018 08:22:17 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbeCNPUD (ORCPT + 99 others); Wed, 14 Mar 2018 11:20:03 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51534 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbeCNPUB (ORCPT ); Wed, 14 Mar 2018 11:20:01 -0400 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 1ew8C5-0003vX-0D; Wed, 14 Mar 2018 16:19:57 +0100 Date: Wed, 14 Mar 2018 16:19:56 +0100 (CET) From: Thomas Gleixner To: Vitaly Kuznetsov cc: Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , kvm@vger.kernel.org, x86@kernel.org, "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: <87r2opcr6u.fsf@vitty.brq.redhat.com> Message-ID: References: <20180309140249.2840-1-vkuznets@redhat.com> <20180309140249.2840-8-vkuznets@redhat.com> <87r2opcr6u.fsf@vitty.brq.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 Mon, 12 Mar 2018, Vitaly Kuznetsov wrote: > Thomas Gleixner writes: > > On Fri, 9 Mar 2018, Vitaly Kuznetsov wrote: > >> 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 for the tip, > > with a single kernel user of these APIs it was easy to miss :-) > > Unfortunately, these APIs are only present if HAVE_JUMP_LABEL and > (afaiu) we still care about KVM on !HAVE_JUMP_LABEL builds. It would be > nice if we can make them behave the same way static_branch_likely() and > friends do: compile into something else when !HAVE_JUMP_LABEL so we can > avoid nasty #ifdefs in C code. What's the reason for !jump label builds of a recent kernel? Old compilers? Thanks, tglx