From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Cathy Avery <cavery@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
vkuznets@redhat.com, wei.huang2@amd.com
Subject: Re: [PATCH 2/2] KVM: x86: check_nested_events if there is an injectable NMI
Date: Thu, 23 Apr 2020 08:35:31 -0700 [thread overview]
Message-ID: <20200423153531.GC17824@linux.intel.com> (raw)
In-Reply-To: <ae2d4f5d-cb96-f63a-7742-a7f46ad0d1a8@redhat.com>
On Thu, Apr 23, 2020 at 05:10:45PM +0200, Paolo Bonzini wrote:
> On 23/04/20 16:42, Sean Christopherson wrote:
> > On Tue, Apr 14, 2020 at 04:11:07PM -0400, Cathy Avery wrote:
> >> With NMI intercept moved to check_nested_events there is a race
> >> condition where vcpu->arch.nmi_pending is set late causing
> > How is nmi_pending set late? The KVM_{G,S}ET_VCPU_EVENTS paths can't set
> > it because the current KVM_RUN thread holds the mutex, and the only other
> > call to process_nmi() is in the request path of vcpu_enter_guest, which has
> > already executed.
> >
>
> I think the actual cause is priority inversion between NMI and
> interrupts, because NMI is added last in patch 1.
Ah, that makes more sense. I stared/glared at this exact code for a long
while and came to the conclusion that the "late" behavior was exclusive to
interrupts, would have been a shame if all that glaring was for naught.
next prev parent reply other threads:[~2020-04-23 15:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 20:11 [PATCH 0/2] KVM: SVM: Implement check_nested_events for NMI Cathy Avery
2020-04-14 20:11 ` [PATCH 1/2] " Cathy Avery
2020-04-14 20:11 ` [PATCH 2/2] KVM: x86: check_nested_events if there is an injectable NMI Cathy Avery
2020-04-23 14:42 ` Sean Christopherson
2020-04-23 15:10 ` Paolo Bonzini
2020-04-23 15:35 ` Sean Christopherson [this message]
2020-04-23 15:43 ` Paolo Bonzini
2020-04-23 18:32 ` Paolo Bonzini
2020-04-23 15:36 ` Cathy Avery
2020-04-23 15:45 ` Paolo Bonzini
2020-04-23 18:33 ` Sean Christopherson
2020-04-23 18:47 ` Paolo Bonzini
2020-04-15 9:49 ` [PATCH 0/2] KVM: SVM: Implement check_nested_events for NMI Vitaly Kuznetsov
2020-04-15 12:45 ` Paolo Bonzini
2020-04-23 13: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=20200423153531.GC17824@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=cavery@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wei.huang2@amd.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