mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krish Sadhukhan <krish.sadhukhan@oracle.com>
To: Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH] KVM: SVM: Analyze is_guest_mode() in svm_vcpu_run()
Date: Mon, 14 Sep 2020 13:43:07 -0700	[thread overview]
Message-ID: <b39b1599-9e1e-8ef6-1b97-a4910d9c3784@oracle.com> (raw)
In-Reply-To: <1600066548-4343-1-git-send-email-wanpengli@tencent.com>


On 9/13/20 11:55 PM, Wanpeng Li wrote:
> From: Wanpeng Li <wanpengli@tencent.com>
>
> Analyze is_guest_mode() in svm_vcpu_run() instead of svm_exit_handlers_fastpath()
> in conformity with VMX version.
>
> Suggested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
> ---
>   arch/x86/kvm/svm/svm.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 3da5b2f..009035a 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -3393,8 +3393,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
>   
>   static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
>   {
> -	if (!is_guest_mode(vcpu) &&
> -	    to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
> +	if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
>   	    to_svm(vcpu)->vmcb->control.exit_info_1)
>   		return handle_fastpath_set_msr_irqoff(vcpu);
>   
> @@ -3580,6 +3579,10 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
>   		svm_handle_mce(svm);
>   
>   	svm_complete_interrupts(svm);
> +
> +	if (is_guest_mode(vcpu))
> +		return EXIT_FASTPATH_NONE;
> +
>   	exit_fastpath = svm_exit_handlers_fastpath(vcpu);
>   	return exit_fastpath;

Not related to your changes, but should we get rid of the variable 
'exit_fastpath' and just do,

         return svm_exit_handler_fastpath(vcpu);

It seems the variable isn't used anywhere else and svm_vcpu_run() 
doesn't return from anywhere else either.

Also, svm_exit_handlers_fastpath() doesn't have any other caller.  
Should we get rid of it as well ?


For your changes,

     Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>

>   }

  reply	other threads:[~2020-09-14 20:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  6:55 Wanpeng Li
2020-09-14 20:43 ` Krish Sadhukhan [this message]
2020-09-15 11:29   ` Haiwei Li
2020-09-22 13:43   ` Paolo Bonzini
2020-09-22 14:54     ` Haiwei Li
2020-09-22 14:56       ` Paolo Bonzini
2020-09-22 15:04         ` Haiwei Li

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=b39b1599-9e1e-8ef6-1b97-a4910d9c3784@oracle.com \
    --to=krish.sadhukhan@oracle.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®