mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bandan Das <bsd@redhat.com>, Maxim Levitsky <mlevitsk@redhat.com>
Subject: Re: [PATCH] KVM: SVM: Remove bogus WARN and emulation if guest #GPs with EFER.SVME=1
Date: Thu, 4 Feb 2021 09:20:24 +0100	[thread overview]
Message-ID: <dde46009-10b6-9274-fb36-a57c04bf1df5@redhat.com> (raw)
In-Reply-To: <20210204023536.3397005-1-seanjc@google.com>

On 04/02/21 03:35, Sean Christopherson wrote:
> Immediately reinject #GP (if intercepted) if the VMware backdoor is
> disabled and the instruction is not affected by the erratum that causes
> bogus #GPs on SVM instructions.  It is completely reasonable for the
> guest to take a #GP(0) with EFER.SVME=1, e.g. when probing an MSR, and
> attempting emulation on an unknown instruction is obviously not good.
> 
> Fixes: b3f4e11adc7d ("KVM: SVM: Add emulation support for #GP triggered by SVM instructions")
> Cc: Bandan Das <bsd@redhat.com>
> Cc: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>   arch/x86/kvm/svm/svm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index f53e6377a933..707a2f85bcc6 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -2263,7 +2263,8 @@ static int gp_interception(struct vcpu_svm *svm)
>   	opcode = svm_instr_opcode(vcpu);
>   
>   	if (opcode == NONE_SVM_INSTR) {
> -		WARN_ON_ONCE(!enable_vmware_backdoor);
> +		if (!enable_vmware_backdoor)
> +			goto reinject;
>   
>   		/*
>   		 * VMware backdoor emulation on #GP interception only handles
> 

Squashed, thanks.

Paolo


      reply	other threads:[~2021-02-04  8:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  2:35 Sean Christopherson
2021-02-04  8:20 ` Paolo Bonzini [this message]

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=dde46009-10b6-9274-fb36-a57c04bf1df5@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bsd@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=seanjc@google.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®