aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2013-07-25 03:58:45 -0400
committerGleb Natapov <gleb@redhat.com>2013-07-25 06:42:35 -0400
commit11f5cc051503e54cf786bdbaf0e4ff9cad01df1e (patch)
tree483ba29d66ff9316c3d66220720809bfe450c9fc /arch/x86/kvm/lapic.c
parent103af0a98788592b76ee69a13948b6b3036d7e18 (diff)
KVM: x86: Simplify __apic_accept_irq
If posted interrupts are enabled, we can no longer track if an IRQ was coalesced based on IRR. So drop this logic also from the classic software path and simplify apic_test_and_set_irr to apic_set_irr. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index afc11245827c..9dc3650ac0a3 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -331,10 +331,10 @@ void kvm_apic_update_irr(struct kvm_vcpu *vcpu, u32 *pir)
331} 331}
332EXPORT_SYMBOL_GPL(kvm_apic_update_irr); 332EXPORT_SYMBOL_GPL(kvm_apic_update_irr);
333 333
334static inline int apic_test_and_set_irr(int vec, struct kvm_lapic *apic) 334static inline void apic_set_irr(int vec, struct kvm_lapic *apic)
335{ 335{
336 apic->irr_pending = true; 336 apic->irr_pending = true;
337 return apic_test_and_set_vector(vec, apic->regs + APIC_IRR); 337 apic_set_vector(vec, apic->regs + APIC_IRR);
338} 338}
339 339
340static inline int apic_search_irr(struct kvm_lapic *apic) 340static inline int apic_search_irr(struct kvm_lapic *apic)
@@ -681,28 +681,21 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
681 if (unlikely(!apic_enabled(apic))) 681 if (unlikely(!apic_enabled(apic)))
682 break; 682 break;
683 683
684 result = 1;
685
684 if (dest_map) 686 if (dest_map)
685 __set_bit(vcpu->vcpu_id, dest_map); 687 __set_bit(vcpu->vcpu_id, dest_map);
686 688
687 if (kvm_x86_ops->deliver_posted_interrupt) { 689 if (kvm_x86_ops->deliver_posted_interrupt)
688 result = 1;
689 kvm_x86_ops->deliver_posted_interrupt(vcpu, vector); 690 kvm_x86_ops->deliver_posted_interrupt(vcpu, vector);
690 } else { 691 else {
691 result = !apic_test_and_set_irr(vector, apic); 692 apic_set_irr(vector, apic);
692
693 if (!result) {
694 if (trig_mode)
695 apic_debug("level trig mode repeatedly "
696 "for vector %d", vector);
697 goto out;
698 }
699 693
700 kvm_make_request(KVM_REQ_EVENT, vcpu); 694 kvm_make_request(KVM_REQ_EVENT, vcpu);
701 kvm_vcpu_kick(vcpu); 695 kvm_vcpu_kick(vcpu);
702 } 696 }
703out:
704 trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode, 697 trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode,
705 trig_mode, vector, !result); 698 trig_mode, vector, false);
706 break; 699 break;
707 700
708 case APIC_DM_REMRD: 701 case APIC_DM_REMRD: