All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Bandan Das <bsd@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	kvm@vger.kernel.org, "Dirk Müller" <dmueller@suse.com>
Subject: Re: [PATCH] kvm: svm: Only propagate next_rip when guest supports it
Date: Wed, 7 Oct 2015 18:14:31 +0200	[thread overview]
Message-ID: <20151007161431.GJ28811@8bytes.org> (raw)
In-Reply-To: <jpgfv1mof1n.fsf@linux.bootlegged.copy>

On Wed, Oct 07, 2015 at 11:48:36AM -0400, Bandan Das wrote:
> Ok, understood now. The warn_on would trigger in L1 only if it has
> decided to disable nrips for some reason as was the case here. So,
> my reasoning behind putting the warning was incorrect.

Okay, so I think the warning can be removed.

> > +
> > +	if (guest_cpuid_has_nrips(vcpu))
> > +		nested_vmcb->control.next_rip  = vmcb->control.next_rip;

Note that there is a bug here, instead of vcpu it must be &svm->vcpu.
Somehow I missed to at least compile-test this.

Dirk is currently testing whether this (fixed) patch solves the problem
in his setup.

> >  
> >  	/*
> >  	 * If we emulate a VMRUN/#VMEXIT in the same host #vmexit cycle we have
> > @@ -2714,6 +2716,9 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
> >  	svm->vmcb->control.event_inj = nested_vmcb->control.event_inj;
> >  	svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err;
> >  
> > +	/* Clear next_rip, as real hardware would do */
> > +	nested_vmcb->control.next_rip = 0;
> > +
> 
> Why do we need this ? And are you sure this is what real hardware does ?
> I couldn't find anything in the spec.

Yeah, probably right. Since we only write guests next_rip when the guest
supports it via cpuid, there is probably no point in resetting it at
vmrun emulation.


	Joerg


  reply	other threads:[~2015-10-07 16:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 11:43 [PATCH] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS Dirk Müller
2015-10-01 12:25 ` Paolo Bonzini
2015-10-01 12:45   ` Dirk Müller
2015-10-01 12:31 ` Paolo Bonzini
2015-10-01 22:31   ` Bandan Das
2015-10-02  6:43     ` Dirk Müller
2015-10-05  1:15       ` Bandan Das
2015-10-05  9:50     ` Joerg Roedel
2015-10-05 16:54       ` Bandan Das
2015-10-05 17:15         ` Joerg Roedel
2015-10-05 17:42           ` Bandan Das
2015-10-06 10:23             ` Joerg Roedel
2015-10-06 18:02               ` Bandan Das
2015-10-05 20:12           ` Dirk Müller
2015-10-05 22:00             ` Bandan Das
2015-10-06 10:28     ` Joerg Roedel
2015-10-06 17:59       ` Bandan Das
2015-10-07 11:03         ` Joerg Roedel
2015-10-07 12:47           ` [PATCH] kvm: svm: Only propagate next_rip when guest supports it Joerg Roedel
2015-10-07 12:57             ` kbuild test robot
2015-10-07 15:48             ` Bandan Das
2015-10-07 16:14               ` Joerg Roedel [this message]
2015-10-07 17:03                 ` Dirk Müller
2015-10-07 14:58           ` [PATCH] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS Bandan Das
2015-10-07 15:24             ` Joerg Roedel
  -- strict thread matches above, loose matches on Subject: below --
2015-10-09  9:51 [PATCH] kvm: svm: Only propagate next_rip when guest supports it Joerg Roedel
2015-10-09 11:15 ` 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=20151007161431.GJ28811@8bytes.org \
    --to=joro@8bytes.org \
    --cc=bsd@redhat.com \
    --cc=dmueller@suse.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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.