summaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 14:09:46 -0800
committerIngo Molnar <mingo@elte.hu>2009-02-09 12:18:09 +0100
commit3445a8fd7c6868bd9db0d1bea7d6e89004552122 (patch)
treee702ab02c72392cda5ee80e8cc12db60e2b0f271 /drivers/xen
parentd77bbd4db475e2edc78edb7f94a258159c140b54 (diff)
downloadlinux-3445a8fd7c6868bd9db0d1bea7d6e89004552122.tar.bz2
xen: make sure that softirqs get handled at the end of event processing
Make sure that irq_enter()/irq_exit() wrap the entire event processing loop, rather than each individual event invokation. This makes sure that softirq processing is deferred until the end of event processing, rather than in the middle with interrupts disabled. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 459121c53251..e53fd60fe4b8 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -595,25 +595,6 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-
-static void xen_do_irq(unsigned irq, struct pt_regs *regs)
-{
- struct pt_regs *old_regs = set_irq_regs(regs);
-
- if (WARN_ON(irq == -1))
- return;
-
- exit_idle();
- irq_enter();
-
- //printk("cpu %d handling irq %d\n", smp_processor_id(), info->irq);
- handle_irq(irq, regs);
-
- irq_exit();
-
- set_irq_regs(old_regs);
-}
-
/*
* Search the CPUs pending events bitmasks. For each one found, map
* the event number to an irq, and feed it into do_IRQ() for
@@ -626,11 +607,15 @@ static void xen_do_irq(unsigned irq, struct pt_regs *regs)
void xen_evtchn_do_upcall(struct pt_regs *regs)
{
int cpu = get_cpu();
+ struct pt_regs *old_regs = set_irq_regs(regs);
struct shared_info *s = HYPERVISOR_shared_info;
struct vcpu_info *vcpu_info = __get_cpu_var(xen_vcpu);
static DEFINE_PER_CPU(unsigned, nesting_count);
unsigned count;
+ exit_idle();
+ irq_enter();
+
do {
unsigned long pending_words;
@@ -654,7 +639,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
int port = (word_idx * BITS_PER_LONG) + bit_idx;
int irq = evtchn_to_irq[port];
- xen_do_irq(irq, regs);
+ if (irq != -1)
+ handle_irq(irq, regs);
}
}
@@ -665,6 +651,9 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
} while(count != 1);
out:
+ irq_exit();
+ set_irq_regs(old_regs);
+
put_cpu();
}