Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941011AbcLWMJC (ORCPT ); Fri, 23 Dec 2016 07:09:02 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:36233 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762167AbcLWMI7 (ORCPT ); Fri, 23 Dec 2016 07:08:59 -0500 Subject: Re: [PATCH 2/6] KVM: lapic: do not set KVM_REQ_EVENT unnecessarily on EOI To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <1482140838-6303-1-git-send-email-pbonzini@redhat.com> <1482140838-6303-3-git-send-email-pbonzini@redhat.com> Cc: rkrcmar@redhat.com, rkagan@virtuozzo.com, dplotnikov@virtuozzo.com From: Paolo Bonzini Message-ID: Date: Fri, 23 Dec 2016 13:08:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482140838-6303-3-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1359 Lines: 41 On 19/12/2016 10:47, Paolo Bonzini wrote: > On EOI, there is no need to set KVM_REQ_EVENT unconditionally. The PPR > update is already setting it if resetting the ISR bit causes PPR to > decrease. Even a level-triggered IOAPIC interrupt will set KVM_REQ_EVENT > on a reinjection (ioapic_service -> kvm_irq_delivery_to_apic and from > there to __apic_accept_irq). > > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/lapic.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > index e35cbd44c505..70c7428b7a57 100644 > --- a/arch/x86/kvm/lapic.c > +++ b/arch/x86/kvm/lapic.c > @@ -1066,7 +1066,6 @@ static int apic_set_eoi(struct kvm_lapic *apic) > kvm_hv_synic_send_eoi(apic->vcpu, vector); > > kvm_ioapic_send_eoi(apic, vector); > - kvm_make_request(KVM_REQ_EVENT, apic->vcpu); > return vector; > } > > @@ -1081,7 +1080,6 @@ void kvm_apic_set_eoi_accelerated(struct kvm_vcpu *vcpu, int vector) > trace_kvm_eoi(apic, vector); > > kvm_ioapic_send_eoi(apic, vector); > - kvm_make_request(KVM_REQ_EVENT, apic->vcpu); > } > EXPORT_SYMBOL_GPL(kvm_apic_set_eoi_accelerated); > > This patch breaks Windows XP and 2003 (reverting it while keeping the others results in 3 successful installs, compared to a failure rate of 12/13 with the patch included). Paolo