All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	saso.linux@astim.si, lists2009@fnarfbargle.com,
	Nadav Amit <namit@cs.technion.ac.il>,
	stable@vger.kernel.org
Subject: Re: [PATCH stable] KVM: x86: Fix lost interrupt on irr_pending race
Date: Wed, 22 Apr 2015 14:52:42 +0100	[thread overview]
Message-ID: <20150422135242.GG3671@charon> (raw)
In-Reply-To: <5537A658.5060503@redhat.com>

On Wed, Apr 22, 2015 at 03:47:04PM +0200, Paolo Bonzini wrote:
> 
> 
> On 22/04/2015 15:34, Luis Henriques wrote:
> > Thanks Paolo.  I was going to apply this backport to the 3.16 kernel
> > but it looks like the original commit is a clean cherry-pick.  Shall I
> > still apply your backport, or do you think the original commit should
> > be applied instead?
> 
> Indeed you're right.  I wrote the backport for 3.16(.0).  However,
> commit 56cc2406d68c0f09505c389e276f27a99f495cbd was marked for stable,
> so it's necessary to cherry-pick the entire patch on the stable kernel
> where the buggy commit was backported.
> 
> That should be, according to the stable@vger.kernel.org archives,
> 3.10.54+, 3.13.11.7+, 3.14.18+, 3.16.2+.
> 

Great, thanks for the quick reply.  I'll queue the (entire) fix for
the 3.16 kernel.

Cheers,
--
Luís

> Paolo
> 
> > Cheers,
> > --
> > Luís
> > 
> >> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> >> index 6e8ce5a1a05d..e0e5642dae41 100644
> >> --- a/arch/x86/kvm/lapic.c
> >> +++ b/arch/x86/kvm/lapic.c
> >> @@ -341,8 +341,12 @@ EXPORT_SYMBOL_GPL(kvm_apic_update_irr);
> >>  
> >>  static inline void apic_set_irr(int vec, struct kvm_lapic *apic)
> >>  {
> >> -	apic->irr_pending = true;
> >>  	apic_set_vector(vec, apic->regs + APIC_IRR);
> >> +	/*
> >> +	 * irr_pending must be true if any interrupt is pending; set it after
> >> +	 * APIC_IRR to avoid race with apic_clear_irr
> >> +	 */
> >> +	apic->irr_pending = true;
> >>  }
> >>  
> >>  static inline int apic_search_irr(struct kvm_lapic *apic)
> >>
> >>
> >> Thanks,
> >>
> >> Paolo
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe stable" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Luis Henriques <luis.henriques@canonical.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	saso.linux@astim.si, lists2009@fnarfbargle.com,
	Nadav Amit <namit@cs.technion.ac.il>,
	stable@vger.kernel.org
Subject: Re: [PATCH stable] KVM: x86: Fix lost interrupt on irr_pending race
Date: Wed, 22 Apr 2015 14:52:42 +0100	[thread overview]
Message-ID: <20150422135242.GG3671@charon> (raw)
In-Reply-To: <5537A658.5060503@redhat.com>

On Wed, Apr 22, 2015 at 03:47:04PM +0200, Paolo Bonzini wrote:
> 
> 
> On 22/04/2015 15:34, Luis Henriques wrote:
> > Thanks Paolo.  I was going to apply this backport to the 3.16 kernel
> > but it looks like the original commit is a clean cherry-pick.  Shall I
> > still apply your backport, or do you think the original commit should
> > be applied instead?
> 
> Indeed you're right.  I wrote the backport for 3.16(.0).  However,
> commit 56cc2406d68c0f09505c389e276f27a99f495cbd was marked for stable,
> so it's necessary to cherry-pick the entire patch on the stable kernel
> where the buggy commit was backported.
> 
> That should be, according to the stable@vger.kernel.org archives,
> 3.10.54+, 3.13.11.7+, 3.14.18+, 3.16.2+.
> 

Great, thanks for the quick reply.  I'll queue the (entire) fix for
the 3.16 kernel.

Cheers,
--
Lu�s

> Paolo
> 
> > Cheers,
> > --
> > Lu�s
> > 
> >> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> >> index 6e8ce5a1a05d..e0e5642dae41 100644
> >> --- a/arch/x86/kvm/lapic.c
> >> +++ b/arch/x86/kvm/lapic.c
> >> @@ -341,8 +341,12 @@ EXPORT_SYMBOL_GPL(kvm_apic_update_irr);
> >>  
> >>  static inline void apic_set_irr(int vec, struct kvm_lapic *apic)
> >>  {
> >> -	apic->irr_pending = true;
> >>  	apic_set_vector(vec, apic->regs + APIC_IRR);
> >> +	/*
> >> +	 * irr_pending must be true if any interrupt is pending; set it after
> >> +	 * APIC_IRR to avoid race with apic_clear_irr
> >> +	 */
> >> +	apic->irr_pending = true;
> >>  }
> >>  
> >>  static inline int apic_search_irr(struct kvm_lapic *apic)
> >>
> >>
> >> Thanks,
> >>
> >> Paolo
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe stable" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-04-22 13:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1429602745-29882-1-git-send-email-pbonzini@redhat.com>
2015-04-21  8:47 ` [PATCH stable] KVM: x86: Fix lost interrupt on irr_pending race Paolo Bonzini
2015-04-22 13:34   ` Luis Henriques
2015-04-22 13:34     ` Luis Henriques
2015-04-22 13:47     ` Paolo Bonzini
2015-04-22 13:47       ` Paolo Bonzini
2015-04-22 13:52       ` Luis Henriques [this message]
2015-04-22 13:52         ` Luis Henriques
2015-04-28 16:24   ` Saso Slavicic
2015-04-29 16:45     ` 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=20150422135242.GG3671@charon \
    --to=luis.henriques@canonical.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists2009@fnarfbargle.com \
    --cc=namit@cs.technion.ac.il \
    --cc=pbonzini@redhat.com \
    --cc=saso.linux@astim.si \
    --cc=stable@vger.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 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.