Re: [PATCH 4/5] KVM: x86: remove unnecessary sync_pir_to_irr
From: Radim KrÄmÃÅ
Date: Wed Oct 26 2016 - 16:28:54 EST
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 <pbonzini@xxxxxxxxxx>
> ---
Reviewed-by: Radim KrÄmÃÅ <rkrcmar@xxxxxxxxxx>
> 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)))