KVM: x86: do not scan IRR twice on APICv vmentry
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 19 Dec 2016 16:17:11 +0000 (17:17 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Feb 2017 13:54:35 +0000 (14:54 +0100)
commit76dfafd536730ef9b9d99b1cf596916d52be76d1
tree79cefa908a1c5ab21d3d9d21add82c2ab9b56ad4
parent3d92789f69162ee5689f3766e5f50bb46b7e1d97
KVM: x86: do not scan IRR twice on APICv vmentry

Calls to apic_find_highest_irr are scanning IRR twice, once
in vmx_sync_pir_from_irr and once in apic_search_irr.  Change
sync_pir_from_irr to get the new maximum IRR from kvm_apic_update_irr;
now that it does the computation, it can also do the RVI write.

In order to avoid complications in svm.c, make the callback optional.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/lapic.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c