From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH] KVM: SVM: fix interrupt injection (apic->isr_count always 0) Date: Thu, 26 Feb 2015 13:04:57 +0100 Message-ID: <20150226120457.GB3314@pd.tnic> References: <20150225160056.GF3226@pd.tnic> <20150225194140.GA9777@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Tiejun Chen , Paolo Bonzini , kvm ML , lkml To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Content-Disposition: inline In-Reply-To: <20150225194140.GA9777@potion.brq.redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Feb 25, 2015 at 08:41:41PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > this patch should fix it. Yap, seems so :-) > ---8<--- > In commit b4eef9b36db4, we started to use hwapic_isr_update() !=3D NU= LL > instead of kvm_apic_vid_enabled(vcpu->kvm). This didn't work because > SVM had it defined and "apicv" path in apic_{set,clear}_isr() does no= t > change apic->isr_count, because it should always be 1. The initial > value of apic->isr_count was based on kvm_apic_vid_enabled(vcpu->kvm)= , > which is always 0 for SVM, so KVM could have injected interrupts when= it > shouldn't. >=20 > Fix it by setting SVM's hwapic_isr_update to NULL and make the initia= l > isr_count depend on hwapic_isr_update() for good measure. >=20 > Fixes: b4eef9b36db4 ("kvm: x86: vmx: NULL out hwapic_isr_update() in = case of !enable_apicv") > Reported-by: Borislav Petkov Reported-and-tested-by: Borislav Petkov > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 Thanks. --=20 Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --