KVM: lapic: do not set KVM_REQ_EVENT unnecessarily on PPR update
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 18 Dec 2016 12:54:58 +0000 (13:54 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Mon, 9 Jan 2017 13:48:02 +0000 (14:48 +0100)
On PPR update, we set KVM_REQ_EVENT unconditionally anytime PPR is lowered.
But we can take into account IRR here already.

Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c

index a878e33119a397bcdef40d211ded8eb9e0abb582..457fb206647d5a371c572e3ed0cda6b609ff3bec 100644 (file)
@@ -607,7 +607,8 @@ static void apic_update_ppr(struct kvm_lapic *apic)
 {
        u32 ppr;
 
-       if (__apic_update_ppr(apic, &ppr))
+       if (__apic_update_ppr(apic, &ppr) &&
+           apic_has_interrupt_for_ppr(apic, ppr) != -1)
                kvm_make_request(KVM_REQ_EVENT, apic->vcpu);
 }