Skip to content

Commit

Permalink
[PATCH] x86-64: Use irq_domain in ioapic_retrigger_irq
Browse files Browse the repository at this point in the history
Thanks to YH Lu for spotting this.  It appears I missed this function when I
refactored allocate_irq_vector and introduced irq_domain, with the result that
all retriggered irqs would go to cpu 0 even if we were not prepared to receive
them there.

While reviewing YH's patch I also noticed that this function was missing
locking, and since I am now reading two values from two diffrent arrays that
looks like a race we might be able to hit in the real world.

Cc: Yinghai Lu <yinghai.lu@amd.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Eric W. Biederman authored and Andi Kleen committed Oct 21, 2006
1 parent a1bae67 commit 6bf2daf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/x86_64/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,12 +1255,15 @@ static int ioapic_retrigger_irq(unsigned int irq)
{
cpumask_t mask;
unsigned vector;
unsigned long flags;

spin_lock_irqsave(&vector_lock, flags);
vector = irq_vector[irq];
cpus_clear(mask);
cpu_set(vector >> 8, mask);
cpu_set(first_cpu(irq_domain[irq]), mask);

send_IPI_mask(mask, vector & 0xff);
send_IPI_mask(mask, vector);
spin_unlock_irqrestore(&vector_lock, flags);

return 1;
}
Expand Down

0 comments on commit 6bf2daf

Please sign in to comment.