linux-kernel.vger.kernel.org archive mirror
 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,
	Maxim Levitsky <mlevitsk@redhat.com>
Subject: Re: [PATCH] KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest
Date: Wed, 26 Jan 2022 16:45:56 +0100	[thread overview]
Message-ID: <e570f7d2-03fc-1498-bd91-6fd7aabae766@redhat.com> (raw)
In-Reply-To: <20220125221725.2101126-1-seanjc@google.com>

On 1/25/22 23:17, Sean Christopherson wrote:
> Don't skip the vmcall() in l2_guest_code() prior to re-entering L2, doing
> so will result in L2 running to completion, popping '0' off the stack for
> RET, jumping to address '0', and ultimately dying with a triple fault
> shutdown.
> 
> It's not at all obvious why the test re-enters L2 and re-executes VMCALL,
> but presumably it serves a purpose.  The VMX path doesn't skip vmcall(),
> and the test can't possibly have passed on SVM, so just do what VMX does.
> 
> Fixes: d951b2210c1a ("KVM: selftests: smm_test: Test SMM enter from L2")
> Cc: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>   tools/testing/selftests/kvm/x86_64/smm_test.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/x86_64/smm_test.c b/tools/testing/selftests/kvm/x86_64/smm_test.c
> index 2da8eb8e2d96..a626d40fdb48 100644
> --- a/tools/testing/selftests/kvm/x86_64/smm_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/smm_test.c
> @@ -105,7 +105,6 @@ static void guest_code(void *arg)
>   
>   		if (cpu_has_svm()) {
>   			run_guest(svm->vmcb, svm->vmcb_gpa);
> -			svm->vmcb->save.rip += 3;
>   			run_guest(svm->vmcb, svm->vmcb_gpa);
>   		} else {
>   			vmlaunch();
> 
> base-commit: e2e83a73d7ce66f62c7830a85619542ef59c90e4

Queued, thanks.

Paolo


      parent reply	other threads:[~2022-01-26 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 22:17 [PATCH] KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest Sean Christopherson
2022-01-26 15:23 ` Vitaly Kuznetsov
2022-01-26 15:45 ` 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=e570f7d2-03fc-1498-bd91-6fd7aabae766@redhat.com \
    --to=pbonzini@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;
as well as URLs for NNTP newsgroup(s).