kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: Wanpeng Li <wanpengli@tencent.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" 
	<linux-kernel@vger.kernel.org>, Jim Mattson <jmattson@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Borislav Petkov <bp@alien8.de>,
	Joerg Roedel <joro@8bytes.org>, Ingo Molnar <mingo@redhat.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, Sean Christopherson <seanjc@google.com>,
	Cathy Avery <cavery@redhat.com>
Subject: Re: [PATCH 5/5] KVM: nSVM: set a dummy exit reason in L1 vmcb when loading the nested state
Date: Mon, 03 May 2021 17:26:50 +0300	[thread overview]
Message-ID: <4f0bef0224a947a4ac3862175b4bce21eb0c0701.camel@redhat.com> (raw)
In-Reply-To: <a3a08464-d67c-fe71-6b2a-01b9ee58312c@redhat.com>

On Mon, 2021-05-03 at 16:02 +0200, Paolo Bonzini wrote:
> On 03/05/21 14:54, Maxim Levitsky wrote:
> > Since the nested migration is a result of a VMRUN, this makes it
> > possible to keep a warning that L1 vmcb should always have
> > VMRUN exit reason when switching back to it, which
> > otherwise triggers incorrectly.
> > 
> > Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> 
> Does this fix "KVM: nSVM: If VMRUN is single-stepped, queue the #DB 
> intercept in nested_svm_vmexit()"?  I don't like this, and also vmcb12 
> is not initialized here (nested_load_control_from_vmcb12 is using the 
> state passed in from userspace instead).

> 
> I think you should just remove the WARN instead.
All right, I'll do this!

Best regards,
	Maxim Levitsky


> 
> Paolo
> 
> > ---
> >   arch/x86/kvm/svm/nested.c | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
> > index 12a12ae940fa..146be4b5084b 100644
> > --- a/arch/x86/kvm/svm/nested.c
> > +++ b/arch/x86/kvm/svm/nested.c
> > @@ -1338,6 +1338,12 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
> >   	svm->vmcb01.ptr->save.rip = save->rip;
> >   	svm->vmcb01.ptr->save.cpl = 0;
> >   
> > +	/*
> > +	 * For consistency sake, restore the L1 exit reason
> > +	 * (that happened prior to the migration) to SVM_EXIT_VMRUN.
> > +	 */
> > +	svm->vmcb->control.exit_code = SVM_EXIT_VMRUN;
> > +
> >   	nested_load_control_from_vmcb12(svm, ctl);
> >   
> >   	svm_switch_vmcb(svm, &svm->nested.vmcb02);
> > 



  reply	other threads:[~2021-05-03 14:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 12:54 [PATCH 0/5] KVM: nSVM: few fixes for the nested migration Maxim Levitsky
2021-05-03 12:54 ` [PATCH 1/5] KVM: nSVM: fix a typo in svm_leave_nested Maxim Levitsky
2021-05-03 12:54 ` [PATCH 2/5] KVM: nSVM: fix few bugs in the vmcb02 caching logic Maxim Levitsky
2021-05-03 12:54 ` [PATCH 3/5] KVM: nSVM: leave the guest mode prior to loading a nested state Maxim Levitsky
2021-05-03 12:54 ` [PATCH 4/5] KVM: nSVM: force L1's GIF to 1 when setting the " Maxim Levitsky
2021-05-03 14:00   ` Paolo Bonzini
2021-05-03 14:24     ` Maxim Levitsky
2021-05-03 12:54 ` [PATCH 5/5] KVM: nSVM: set a dummy exit reason in L1 vmcb when loading " Maxim Levitsky
2021-05-03 14:02   ` Paolo Bonzini
2021-05-03 14:26     ` Maxim Levitsky [this message]
2021-05-03 14:03 ` [PATCH 0/5] KVM: nSVM: few fixes for the nested migration Paolo Bonzini

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=4f0bef0224a947a4ac3862175b4bce21eb0c0701.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=bp@alien8.de \
    --cc=cavery@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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 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).