diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-10-21 12:37:02 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-10-21 12:37:02 -0400 |
commit | 6bf2dafad18c119beb534cbb3d882fe7a6c3f529 (patch) | |
tree | c78450df76c5c624788aaf81154f1f2070bcd5a7 /arch/x86_64 | |
parent | a1bae67243512ca30ceda48e3e24e25b543f8ab7 (diff) |
[PATCH] x86-64: Use irq_domain in ioapic_retrigger_irq
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>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index b848f4808510..8a9a357875b7 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -1255,12 +1255,15 @@ static int ioapic_retrigger_irq(unsigned int irq) | |||
1255 | { | 1255 | { |
1256 | cpumask_t mask; | 1256 | cpumask_t mask; |
1257 | unsigned vector; | 1257 | unsigned vector; |
1258 | unsigned long flags; | ||
1258 | 1259 | ||
1260 | spin_lock_irqsave(&vector_lock, flags); | ||
1259 | vector = irq_vector[irq]; | 1261 | vector = irq_vector[irq]; |
1260 | cpus_clear(mask); | 1262 | cpus_clear(mask); |
1261 | cpu_set(vector >> 8, mask); | 1263 | cpu_set(first_cpu(irq_domain[irq]), mask); |
1262 | 1264 | ||
1263 | send_IPI_mask(mask, vector & 0xff); | 1265 | send_IPI_mask(mask, vector); |
1266 | spin_unlock_irqrestore(&vector_lock, flags); | ||
1264 | 1267 | ||
1265 | return 1; | 1268 | return 1; |
1266 | } | 1269 | } |