From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH stable] KVM: x86: Fix lost interrupt on irr_pending race Date: Wed, 22 Apr 2015 15:47:04 +0200 Message-ID: <5537A658.5060503@redhat.com> References: <1429602745-29882-1-git-send-email-pbonzini@redhat.com> <55360EA9.2030806@redhat.com> <20150422133401.GE3671@charon> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, saso.linux@astim.si, lists2009@fnarfbargle.com, Nadav Amit , stable@vger.kernel.org To: Luis Henriques Return-path: In-Reply-To: <20150422133401.GE3671@charon> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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+. Paolo > Cheers, > -- > Lu=EDs >=20 >> 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); >> =20 >> static inline void apic_set_irr(int vec, struct kvm_lapic *apic) >> { >> - apic->irr_pending =3D true; >> apic_set_vector(vec, apic->regs + APIC_IRR); >> + /* >> + * irr_pending must be true if any interrupt is pending; set it af= ter >> + * APIC_IRR to avoid race with apic_clear_irr >> + */ >> + apic->irr_pending =3D true; >> } >> =20 >> 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