aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 34a8ca845280..d197579435d0 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -468,6 +468,15 @@ static inline int apic_find_highest_isr(struct kvm_lapic *apic)
468 return result; 468 return result;
469} 469}
470 470
471void kvm_apic_update_tmr(struct kvm_vcpu *vcpu, u32 *tmr)
472{
473 struct kvm_lapic *apic = vcpu->arch.apic;
474 int i;
475
476 for (i = 0; i < 8; i++)
477 apic_set_reg(apic, APIC_TMR + 0x10 * i, tmr[i]);
478}
479
471static void apic_update_ppr(struct kvm_lapic *apic) 480static void apic_update_ppr(struct kvm_lapic *apic)
472{ 481{
473 u32 tpr, isrv, ppr, old_ppr; 482 u32 tpr, isrv, ppr, old_ppr;
@@ -661,12 +670,6 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
661 if (dest_map) 670 if (dest_map)
662 __set_bit(vcpu->vcpu_id, dest_map); 671 __set_bit(vcpu->vcpu_id, dest_map);
663 672
664 if (trig_mode) {
665 apic_debug("level trig mode for vector %d", vector);
666 apic_set_vector(vector, apic->regs + APIC_TMR);
667 } else
668 apic_clear_vector(vector, apic->regs + APIC_TMR);
669
670 result = !apic_test_and_set_irr(vector, apic); 673 result = !apic_test_and_set_irr(vector, apic);
671 trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode, 674 trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode,
672 trig_mode, vector, !result); 675 trig_mode, vector, !result);