All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, kvm@vger.kernel.org
Cc: x86@kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	"Roman Kagan" <rkagan@virtuozzo.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"Stephen Hemminger" <sthemmin@microsoft.com>,
	"Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>,
	"Mohammed Gamal" <mmorsy@redhat.com>,
	"Cathy Avery" <cavery@redhat.com>,
	"Tianyu Lan" <Tianyu.Lan@microsoft.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: VMX: hyper-v: Enlightened MSR-Bitmap support
Date: Fri, 13 Apr 2018 15:52:30 +0200	[thread overview]
Message-ID: <ef082ed6-1af9-a578-d9da-e0874cc4769c@redhat.com> (raw)
In-Reply-To: <20180412152508.27617-1-vkuznets@redhat.com>

On 12/04/2018 17:25, Vitaly Kuznetsov wrote:
> @@ -5335,6 +5353,9 @@ static void __always_inline vmx_disable_intercept_for_msr(unsigned long *msr_bit
>  	if (!cpu_has_vmx_msr_bitmap())
>  		return;
>  
> +	if (static_branch_unlikely(&enable_emsr_bitmap))
> +		evmcs_touch_msr_bitmap();
> +
>  	/*
>  	 * See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
>  	 * have the write-low and read-high bitmap offsets the wrong way round.
> @@ -5370,6 +5391,9 @@ static void __always_inline vmx_enable_intercept_for_msr(unsigned long *msr_bitm
>  	if (!cpu_has_vmx_msr_bitmap())
>  		return;
>  
> +	if (static_branch_unlikely(&enable_emsr_bitmap))
> +		evmcs_touch_msr_bitmap();

I'm not sure about the "unlikely".  Can you just check current_evmcs
instead (dropping the static key completely)?

The function, also, is small enough that inlining should be beneficial.

Paolo

  parent reply	other threads:[~2018-04-13 13:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 15:25 [PATCH] KVM: x86: VMX: hyper-v: Enlightened MSR-Bitmap support Vitaly Kuznetsov
2018-04-13  6:55 ` Tianyu Lan
2018-04-13 13:52 ` Paolo Bonzini [this message]
2018-04-13 14:23   ` Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef082ed6-1af9-a578-d9da-e0874cc4769c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Michael.H.Kelley@microsoft.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=cavery@redhat.com \
    --cc=haiyangz@microsoft.com \
    --cc=kvm@vger.kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmorsy@redhat.com \
    --cc=rkagan@virtuozzo.com \
    --cc=rkrcmar@redhat.com \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.