Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934226AbcJZU2o (ORCPT ); Wed, 26 Oct 2016 16:28:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320AbcJZU2m (ORCPT ); Wed, 26 Oct 2016 16:28:42 -0400 Date: Wed, 26 Oct 2016 22:28:38 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, yang.zhang.wz@gmail.com, feng.wu@intel.com, mst@redhat.com Subject: Re: [PATCH 4/5] KVM: x86: remove unnecessary sync_pir_to_irr Message-ID: <20161026202837.GF4212@potion> References: <1476469291-5039-1-git-send-email-pbonzini@redhat.com> <1476469291-5039-5-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1476469291-5039-5-git-send-email-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 26 Oct 2016 20:28:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 795 Lines: 26 2016-10-14 20:21+0200, Paolo Bonzini: > Synchronizing PIR to IRR is not needed in most callers of > apic_find_highest_irr. Move it to the one place that matters, > interrupt acknowledgement. > > Signed-off-by: Paolo Bonzini > --- Reviewed-by: Radim Krčmář > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > @@ -1973,6 +1971,9 @@ int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu) > return -1; > > apic_update_ppr(apic); > + > + if (apic->vcpu->arch.apicv_active) > + kvm_x86_ops->sync_pir_to_irr(apic->vcpu); Btw. do all callers of kvm_apic_has_interrupt() need it? Thanks. > highest_irr = apic_find_highest_irr(apic); > if ((highest_irr == -1) || > ((highest_irr & 0xF0) <= kvm_lapic_get_reg(apic, APIC_PROCPRI)))