From: Marcelo Tosatti Date: Mon, 2 Feb 2015 17:26:08 +0000 (-0200) Subject: KVM: x86: fix lapic_timer_int_injected with APIC-v X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f9339860384aaa104d85f59b75921941b39a45fc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git KVM: x86: fix lapic_timer_int_injected with APIC-v With APICv, LAPIC timer interrupt is always delivered via IRR: apic_find_highest_irr syncs PIR to IRR. Signed-off-by: Marcelo Tosatti Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 555956c3c473..3481e9eee8f4 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1086,13 +1086,13 @@ static bool lapic_timer_int_injected(struct kvm_vcpu *vcpu) if (kvm_apic_hw_enabled(apic)) { int vec = reg & APIC_VECTOR_MASK; + void *bitmap = apic->regs + APIC_ISR; - if (kvm_x86_ops->test_posted_interrupt) - return kvm_x86_ops->test_posted_interrupt(vcpu, vec); - else { - if (apic_test_vector(vec, apic->regs + APIC_ISR)) - return true; - } + if (kvm_x86_ops->deliver_posted_interrupt) + bitmap = apic->regs + APIC_IRR; + + if (apic_test_vector(vec, bitmap)) + return true; } return false; }