diff options
| author | Marcelo Tosatti <mtosatti@redhat.com> | 2010-06-02 10:26:26 -0400 |
|---|---|---|
| committer | Avi Kivity <avi@redhat.com> | 2010-06-10 13:29:03 -0400 |
| commit | 07dc7263b99e4ddad2b4c69765a428ccb7d48938 (patch) | |
| tree | a1c5cd9a50362b03c60c93f11ed34739d4f9da0f | |
| parent | 3499f4d0d1159a21245d6071f8af6a71b86a78bc (diff) | |
KVM: read apic->irr with ioapic lock held
Read ioapic->irr inside ioapic->lock protected section.
KVM-Stable-Tag
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| -rw-r--r-- | virt/kvm/ioapic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 7c79c1d76d0c..3500dee9cf2b 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
| @@ -192,12 +192,13 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq) | |||
| 192 | 192 | ||
| 193 | int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) | 193 | int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) |
| 194 | { | 194 | { |
| 195 | u32 old_irr = ioapic->irr; | 195 | u32 old_irr; |
| 196 | u32 mask = 1 << irq; | 196 | u32 mask = 1 << irq; |
| 197 | union kvm_ioapic_redirect_entry entry; | 197 | union kvm_ioapic_redirect_entry entry; |
| 198 | int ret = 1; | 198 | int ret = 1; |
| 199 | 199 | ||
| 200 | spin_lock(&ioapic->lock); | 200 | spin_lock(&ioapic->lock); |
| 201 | old_irr = ioapic->irr; | ||
| 201 | if (irq >= 0 && irq < IOAPIC_NUM_PINS) { | 202 | if (irq >= 0 && irq < IOAPIC_NUM_PINS) { |
| 202 | entry = ioapic->redirtbl[irq]; | 203 | entry = ioapic->redirtbl[irq]; |
| 203 | level ^= entry.fields.polarity; | 204 | level ^= entry.fields.polarity; |
