public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Oliver Upton <oupton@google.com>,
	kvm@vger.kernel.org, Jim Mattson <jmattson@google.com>,
	Peter Shier <pshier@google.com>
Subject: Re: [PATCH] kvm: x86: get vmcs12 pages before checking pending interrupts
Date: Wed, 6 May 2020 08:25:55 -0700	[thread overview]
Message-ID: <20200506152555.GA3329@linux.intel.com> (raw)
In-Reply-To: <262881d0-cc24-99c2-2895-c5cbdc3487d0@redhat.com>

On Wed, May 06, 2020 at 02:07:17PM +0200, Paolo Bonzini wrote:
> On 06/05/20 01:22, Oliver Upton wrote:
> > +	/*
> > +	 * We must first get the vmcs12 pages before checking for interrupts
> > +	 * (done in kvm_arch_vcpu_runnable) in case L1 is using
> > +	 * virtual-interrupt delivery.
> > +	 */
> > +	if (kvm_check_request(KVM_REQ_GET_VMCS12_PAGES, vcpu)) {
> > +		if (unlikely(!kvm_x86_ops.nested_ops->get_vmcs12_pages(vcpu)))
> > +			return 0;
> > +	}
> > +
> 
> 
> The patch is a bit ad hoc, I'd rather move the whole "if
> (kvm_request_pending(vcpu))" from vcpu_enter_guest to vcpu_run (via a
> new function).

It might make sense to go with an ad hoc patch to get the thing fixed, then
worry about cleaning up the pending request crud.  It'd be nice to get rid
of the extra nested_ops->check_events() call in kvm_vcpu_running(), as well
as all of the various request checks in (or triggered by) vcpu_block().

I was very tempted to dive into that mess when working on the nested events
stuff, but was afraid that I would be opening up pandora's box.

  reply	other threads:[~2020-05-06 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 23:22 [PATCH] kvm: x86: get vmcs12 pages before checking pending interrupts Oliver Upton
2020-05-06 12:07 ` Paolo Bonzini
2020-05-06 15:25   ` Sean Christopherson [this message]
2020-05-06 16:00     ` Paolo Bonzini
2020-05-06 16:48       ` Sean Christopherson
2020-05-06 17:19         ` Oliver Upton
2020-05-06 17:43         ` 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=20200506152555.GA3329@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=oupton@google.com \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.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