aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/irq_comm.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-08-24 04:54:26 -0400
committerAvi Kivity <avi@redhat.com>2009-12-03 02:32:08 -0500
commit680b3648ba89c44ac8d0316f78a0d6e147b88809 (patch)
treeb2b40034c4c33affef8b89822673cca835874651 /virt/kvm/irq_comm.c
parenteba0226bdfffe262e72b8360e4d0d12070e9a0f0 (diff)
KVM: Drop kvm->irq_lock lock from irq injection path
The only thing it protects now is interrupt injection into lapic and this can work lockless. Even now with kvm->irq_lock in place access to lapic is not entirely serialized since vcpu access doesn't take kvm->irq_lock. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/irq_comm.c')
-rw-r--r--virt/kvm/irq_comm.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index fadf4408a820..15a83b93566d 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -82,8 +82,6 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
82 int i, r = -1; 82 int i, r = -1;
83 struct kvm_vcpu *vcpu, *lowest = NULL; 83 struct kvm_vcpu *vcpu, *lowest = NULL;
84 84
85 WARN_ON(!mutex_is_locked(&kvm->irq_lock));
86
87 if (irq->dest_mode == 0 && irq->dest_id == 0xff && 85 if (irq->dest_mode == 0 && irq->dest_id == 0xff &&
88 kvm_is_dm_lowest_prio(irq)) 86 kvm_is_dm_lowest_prio(irq))
89 printk(KERN_INFO "kvm: apic: phys broadcast and lowest prio\n"); 87 printk(KERN_INFO "kvm: apic: phys broadcast and lowest prio\n");
@@ -138,7 +136,7 @@ static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
138 return kvm_irq_delivery_to_apic(kvm, NULL, &irq); 136 return kvm_irq_delivery_to_apic(kvm, NULL, &irq);
139} 137}
140 138
141/* This should be called with the kvm->irq_lock mutex held 139/*
142 * Return value: 140 * Return value:
143 * < 0 Interrupt was ignored (masked or not delivered for other reasons) 141 * < 0 Interrupt was ignored (masked or not delivered for other reasons)
144 * = 0 Interrupt was coalesced (previous irq is still pending) 142 * = 0 Interrupt was coalesced (previous irq is still pending)
@@ -153,8 +151,6 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level)
153 151
154 trace_kvm_set_irq(irq, level, irq_source_id); 152 trace_kvm_set_irq(irq, level, irq_source_id);
155 153
156 WARN_ON(!mutex_is_locked(&kvm->irq_lock));
157
158 /* Not possible to detect if the guest uses the PIC or the 154 /* Not possible to detect if the guest uses the PIC or the
159 * IOAPIC. So set the bit in both. The guest will ignore 155 * IOAPIC. So set the bit in both. The guest will ignore
160 * writes to the unused one. 156 * writes to the unused one.