diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2009-04-12 12:47:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-12 13:23:53 -0400 |
commit | 08306ce61d6848e6fbf74fa4cc693c3fb29e943f (patch) | |
tree | f61e7f9061e5fa11447b5ab7fd473bfe8985bb99 /arch/x86/kernel/irq.c | |
parent | c0eaa4536f08b98fbcfa7fce5b7b0de1bebcb0e1 (diff) |
x86: apic - introduce dummy apic operations
Impact: refactor, speed up and robustize code
In case if apic was disabled by kernel option
or by hardware limits we can use dummy operations
in apic->write to simplify the ack_APIC_irq() code.
At the lame time the patch fixes the missed EOI in
do_IRQ function (which has place if kernel is compiled
as X86-32 and interrupt without handler happens where
apic was not asked to be disabled via kernel option).
Note that native_apic_write_dummy() consists of
WARN_ON_ONCE to catch any buggy writes on enabled
APICs. Could be removed after some time of testing.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
LKML-Reference: <20090412165058.724788431@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/irq.c')
-rw-r--r-- | arch/x86/kernel/irq.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 6603492e8b71..fd57bf35d0fc 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -27,7 +27,6 @@ void ack_bad_irq(unsigned int irq) | |||
27 | if (printk_ratelimit()) | 27 | if (printk_ratelimit()) |
28 | pr_err("unexpected IRQ trap at vector %02x\n", irq); | 28 | pr_err("unexpected IRQ trap at vector %02x\n", irq); |
29 | 29 | ||
30 | #ifdef CONFIG_X86_LOCAL_APIC | ||
31 | /* | 30 | /* |
32 | * Currently unexpected vectors happen only on SMP and APIC. | 31 | * Currently unexpected vectors happen only on SMP and APIC. |
33 | * We _must_ ack these because every local APIC has only N | 32 | * We _must_ ack these because every local APIC has only N |
@@ -37,9 +36,7 @@ void ack_bad_irq(unsigned int irq) | |||
37 | * completely. | 36 | * completely. |
38 | * But only ack when the APIC is enabled -AK | 37 | * But only ack when the APIC is enabled -AK |
39 | */ | 38 | */ |
40 | if (cpu_has_apic) | 39 | ack_APIC_irq(); |
41 | ack_APIC_irq(); | ||
42 | #endif | ||
43 | } | 40 | } |
44 | 41 | ||
45 | #define irq_stats(x) (&per_cpu(irq_stat, x)) | 42 | #define irq_stats(x) (&per_cpu(irq_stat, x)) |
@@ -214,10 +211,7 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs) | |||
214 | irq = __get_cpu_var(vector_irq)[vector]; | 211 | irq = __get_cpu_var(vector_irq)[vector]; |
215 | 212 | ||
216 | if (!handle_irq(irq, regs)) { | 213 | if (!handle_irq(irq, regs)) { |
217 | #ifdef CONFIG_X86_64 | 214 | ack_APIC_irq(); |
218 | if (!disable_apic) | ||
219 | ack_APIC_irq(); | ||
220 | #endif | ||
221 | 215 | ||
222 | if (printk_ratelimit()) | 216 | if (printk_ratelimit()) |
223 | pr_emerg("%s: %d.%d No irq handler for vector (irq %d)\n", | 217 | pr_emerg("%s: %d.%d No irq handler for vector (irq %d)\n", |