Skip to content

Commit

Permalink
KVM: read apic->irr with ioapic lock held
Browse files Browse the repository at this point in the history
Read ioapic->irr inside ioapic->lock protected section.

KVM-Stable-Tag
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
matosatti authored and avikivity committed Jun 10, 2010
1 parent 3499f4d commit 07dc726
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virt/kvm/ioapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,13 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)

int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)
{
u32 old_irr = ioapic->irr;
u32 old_irr;
u32 mask = 1 << irq;
union kvm_ioapic_redirect_entry entry;
int ret = 1;

spin_lock(&ioapic->lock);
old_irr = ioapic->irr;
if (irq >= 0 && irq < IOAPIC_NUM_PINS) {
entry = ioapic->redirtbl[irq];
level ^= entry.fields.polarity;
Expand Down

0 comments on commit 07dc726

Please sign in to comment.