aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/irq.c11
-rw-r--r--arch/x86/kvm/irq.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c
index 76d736b5f664..0d9e55275af1 100644
--- a/arch/x86/kvm/irq.c
+++ b/arch/x86/kvm/irq.c
@@ -100,3 +100,14 @@ void __kvm_migrate_timers(struct kvm_vcpu *vcpu)
100 __kvm_migrate_apic_timer(vcpu); 100 __kvm_migrate_apic_timer(vcpu);
101 __kvm_migrate_pit_timer(vcpu); 101 __kvm_migrate_pit_timer(vcpu);
102} 102}
103
104/* This should be called with the kvm->lock mutex held */
105void kvm_set_irq(struct kvm *kvm, int irq, int level)
106{
107 /* Not possible to detect if the guest uses the PIC or the
108 * IOAPIC. So set the bit in both. The guest will ignore
109 * writes to the unused one.
110 */
111 kvm_ioapic_set_irq(kvm->arch.vioapic, irq, level);
112 kvm_pic_set_irq(pic_irqchip(kvm), irq, level);
113}
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index 7ca47cbb48bb..07ff2aef0c13 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -82,6 +82,8 @@ static inline int irqchip_in_kernel(struct kvm *kvm)
82 82
83void kvm_pic_reset(struct kvm_kpic_state *s); 83void kvm_pic_reset(struct kvm_kpic_state *s);
84 84
85void kvm_set_irq(struct kvm *kvm, int irq, int level);
86
85void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec); 87void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
86void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu); 88void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
87void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu); 89void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);