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: Sean Christopherson <seanjc@google.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	Vineeth Pillai <viremana@linux.microsoft.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] KVM: SVM: Drop stale comment from svm_hv_vmcb_dirty_nested_enlightenments()
Date: Tue, 25 Jan 2022 16:57:05 +0100	[thread overview]
Message-ID: <21da89ed-fe72-f824-902c-a7c4999a908e@redhat.com> (raw)
In-Reply-To: <20211220152139.418372-2-vkuznets@redhat.com>

On 12/20/21 16:21, Vitaly Kuznetsov wrote:
> Commit 3fa5e8fd0a0e4 ("KVM: SVM: delay svm_vcpu_init_msrpm after
> svm->vmcb is initialized") re-arranged svm_vcpu_init_msrpm() call in
> svm_create_vcpu() making the comment about vmcb being NULL
> obsolete. Drop it.
> 
> While on it, drop superfluous vmcb_is_clean() check: vmcb_mark_dirty()
> is a bit flip, an extra check is unlikely to bring any performance gain.
> Drop now-unneeded vmcb_is_clean() helper as well.
> 
> Fixes: 3fa5e8fd0a0e4 ("KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized")
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Queued, but with subject changed to "KVM: SVM: clean up beginning of 
svm_hv_vmcb_dirty_nested_enlightenments()".

Paolo

>   arch/x86/kvm/svm/svm.h          | 5 -----
>   arch/x86/kvm/svm/svm_onhyperv.h | 9 +--------
>   2 files changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
> index daa8ca84afcc..5d197aae3a19 100644
> --- a/arch/x86/kvm/svm/svm.h
> +++ b/arch/x86/kvm/svm/svm.h
> @@ -305,11 +305,6 @@ static inline void vmcb_mark_all_clean(struct vmcb *vmcb)
>   			       & ~VMCB_ALWAYS_DIRTY_MASK;
>   }
>   
> -static inline bool vmcb_is_clean(struct vmcb *vmcb, int bit)
> -{
> -	return (vmcb->control.clean & (1 << bit));
> -}
> -
>   static inline void vmcb_mark_dirty(struct vmcb *vmcb, int bit)
>   {
>   	vmcb->control.clean &= ~(1 << bit);
> diff --git a/arch/x86/kvm/svm/svm_onhyperv.h b/arch/x86/kvm/svm/svm_onhyperv.h
> index c53b8bf8d013..cdbcfc63d171 100644
> --- a/arch/x86/kvm/svm/svm_onhyperv.h
> +++ b/arch/x86/kvm/svm/svm_onhyperv.h
> @@ -83,14 +83,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments(
>   	struct hv_enlightenments *hve =
>   		(struct hv_enlightenments *)vmcb->control.reserved_sw;
>   
> -	/*
> -	 * vmcb can be NULL if called during early vcpu init.
> -	 * And its okay not to mark vmcb dirty during vcpu init
> -	 * as we mark it dirty unconditionally towards end of vcpu
> -	 * init phase.
> -	 */
> -	if (vmcb_is_clean(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS) &&
> -	    hve->hv_enlightenments_control.msr_bitmap)
> +	if (hve->hv_enlightenments_control.msr_bitmap)
>   		vmcb_mark_dirty(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS);
>   }
>   


  reply	other threads:[~2022-01-25 15:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 15:21 [PATCH 0/5] KVM: SVM: nSVM: Implement Enlightened MSR-Bitmap for Hyper-V-on-KVM and fix it for KVM-on-Hyper-V Vitaly Kuznetsov
2021-12-20 15:21 ` [PATCH 1/5] KVM: SVM: Drop stale comment from svm_hv_vmcb_dirty_nested_enlightenments() Vitaly Kuznetsov
2022-01-25 15:57   ` Paolo Bonzini [this message]
2021-12-20 15:21 ` [PATCH 2/5] KVM: SVM: hyper-v: Enable Enlightened MSR-Bitmap support for real Vitaly Kuznetsov
2022-01-25 15:53   ` Paolo Bonzini
2021-12-20 15:21 ` [PATCH 3/5] KVM: nSVM: Track whether changes in L0 require MSR bitmap for L2 to be rebuilt Vitaly Kuznetsov
2021-12-20 15:21 ` [PATCH 4/5] KVM: x86: Make kvm_hv_hypercall_enabled() static inline Vitaly Kuznetsov
2021-12-20 15:21 ` [PATCH 5/5] KVM: nSVM: Implement Enlightened MSR-Bitmap feature Vitaly Kuznetsov
2022-02-01 13:49 ` [PATCH 0/5] KVM: SVM: nSVM: Implement Enlightened MSR-Bitmap for Hyper-V-on-KVM and fix it for KVM-on-Hyper-V Paolo Bonzini
2022-02-01 14:31   ` Vitaly Kuznetsov
2022-02-01 18:30     ` Paolo Bonzini
2022-02-01 18:58       ` Vitaly Kuznetsov
2022-02-01 19:22         ` Paolo Bonzini
2022-02-02  9:52           ` 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=21da89ed-fe72-f824-902c-a7c4999a908e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=seanjc@google.com \
    --cc=viremana@linux.microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /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.