Received: by 10.213.65.68 with SMTP id h4csp1128343imn; Wed, 14 Mar 2018 10:23:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELv5RP+LZABqkU9R/rgTCGgK3gbIo6h76/zlI1/h9oCMqj2qKAoTTisEmDmcrxlViTC8AAUQ X-Received: by 10.99.163.1 with SMTP id s1mr4440218pge.47.1521048215638; Wed, 14 Mar 2018 10:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521048215; cv=none; d=google.com; s=arc-20160816; b=ZuUhgYbe240pYlC2LyEZ5lxB9cl9ep0W3kWU2z9KijrVFblKf/R5JCq4trIaeBOTct jVLsFkUbTSr4XqKM8Yo1E7ZejA1CN1ZR2tJXr2Qhcf5jGT9pGiFyrPQ4J/gkBz6Sb8Rm xkhM5mSJgbZ76udC+shMSZHQ8MAqALIE98ACAaU/jXjp0ZrvUlagm1QI6JPBIHEADR0C /uw6ecP9TiLormM0lpRMPfTPapcO+6rsNsz6h6N+EXFsROxewvqgyJzTeH7AFH1NGase kFqttg5oL9do6qlXC2VDCmizk92KlDAN1vSs4cF6k3Kf+dqNzQsbGO0ITGTYG/T/z93r gt3g== 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:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=FT/hS707LPSnjS0+VPthZT+yq+08zzfY7EaO2cyKRTk=; b=xN73P+G8CAyshyHtUNg4+AIa7J1QmCZ6QDaNm1w/IqbMzVNxUrF/ynNAhmbIDFCN5D y0jYpIP0hhSgZZAXtCX4Tvk5X8Mqafi61O9JtpLoIBGEUWueEs8z1Ai0YQqEkE1B2shg u5oEIAo1Rgzurxu3Qd+qPF+nghw1UA8H03WXFcwByka+pvluc4xFULDLVNANpxxrDHXH NckiQf/egGp40AXPLqCJnASsfXIqpwNUajvUIkYD++QrZjBGdRAE/8QbIyyt3jhvOilj zdRkCJ+RCQNWssysWCqshtwO+wEBwzRdUKPYgc0UWczBNqImrxarx6Mrt+fVJ3sz8BY+ OIYA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6-v6si2212368plt.186.2018.03.14.10.23.21; Wed, 14 Mar 2018 10:23:35 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbeCNRWI (ORCPT + 99 others); Wed, 14 Mar 2018 13:22:08 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34856 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751414AbeCNRWF (ORCPT ); Wed, 14 Mar 2018 13:22:05 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70B974040859; Wed, 14 Mar 2018 17:22:04 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.40.205.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45022202322B; Wed, 14 Mar 2018 17:22:02 +0000 (UTC) From: Vitaly Kuznetsov To: Thomas Gleixner Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , 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 References: <20180309140249.2840-1-vkuznets@redhat.com> <20180309140249.2840-8-vkuznets@redhat.com> <87r2opcr6u.fsf@vitty.brq.redhat.com> Date: Wed, 14 Mar 2018 18:22:01 +0100 In-Reply-To: (Thomas Gleixner's message of "Wed, 14 Mar 2018 16:19:56 +0100 (CET)") Message-ID: <87k1uebmiu.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Mar 2018 17:22:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Mar 2018 17:22:04 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Gleixner writes: > 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? > To be honest I don't see any, we can start depending on HAVE_JUMP_LABEL for CONFIG_KVM I guess. -- Vitaly