From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932093AbbCBWPz (ORCPT ); Mon, 2 Mar 2015 17:15:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33177 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753851AbbCBWPy (ORCPT ); Mon, 2 Mar 2015 17:15:54 -0500 Date: Mon, 2 Mar 2015 19:04:58 -0300 From: Marcelo Tosatti To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Borislav Petkov , Tiejun Chen Subject: Re: [PATCH v2] KVM: SVM: fix interrupt injection (apic->isr_count always 0) Message-ID: <20150302220457.GA3055@amt.cnet> References: <1425051158-32472-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1425051158-32472-1-git-send-email-rkrcmar@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 27, 2015 at 04:32:38PM +0100, Radim Krčmář wrote: > In commit b4eef9b36db4, we started to use hwapic_isr_update() != NULL > 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 not > 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. > > Fix it by implicitly setting SVM's hwapic_isr_update to NULL and make the > initial isr_count depend on hwapic_isr_update() for good measure. > > Fixes: b4eef9b36db4 ("kvm: x86: vmx: NULL out hwapic_isr_update() in case of !enable_apicv") > Reported-and-tested-by: Borislav Petkov > Signed-off-by: Radim Krčmář > --- > v2: set hwapic_isr_update to NULL implicitly [Paolo] > > arch/x86/kvm/lapic.c | 4 ++-- > arch/x86/kvm/svm.c | 6 ------ > 2 files changed, 2 insertions(+), 8 deletions(-) Applied, thanks.