aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 17:09:43 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-09 06:17:30 -0500
commit792dc4f6cdacf50d3f2b93756d282fc04ee34bd5 (patch)
treec65e8bc1324e5ba62b268bcd1fbe1b4b90342ecd
parenteca217b36e5d7d4377493d5cedd89105e66a5a72 (diff)
xen: use our own eventchannel->irq path
Rather than overloading vectors for event channels, take full responsibility for mapping an event channel to irq directly. With this patch Xen has its own irq allocator. When the kernel gets an event channel upcall, it maps the event channel number to an irq and injects it into the normal interrupt path. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/include/asm/xen/events.h6
-rw-r--r--arch/x86/xen/irq.c17
-rw-r--r--drivers/xen/events.c22
3 files changed, 21 insertions, 24 deletions
diff --git a/arch/x86/include/asm/xen/events.h b/arch/x86/include/asm/xen/events.h
index 19144184983a..1df35417c412 100644
--- a/arch/x86/include/asm/xen/events.h
+++ b/arch/x86/include/asm/xen/events.h
@@ -15,10 +15,4 @@ static inline int xen_irqs_disabled(struct pt_regs *regs)
15 return raw_irqs_disabled_flags(regs->flags); 15 return raw_irqs_disabled_flags(regs->flags);
16} 16}
17 17
18static inline void xen_do_IRQ(int irq, struct pt_regs *regs)
19{
20 regs->orig_ax = ~irq;
21 do_IRQ(regs);
22}
23
24#endif /* _ASM_X86_XEN_EVENTS_H */ 18#endif /* _ASM_X86_XEN_EVENTS_H */
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
index 5a070900ad35..cfd17799bd6d 100644
--- a/arch/x86/xen/irq.c
+++ b/arch/x86/xen/irq.c
@@ -19,21 +19,6 @@ void xen_force_evtchn_callback(void)
19 (void)HYPERVISOR_xen_version(0, NULL); 19 (void)HYPERVISOR_xen_version(0, NULL);
20} 20}
21 21
22static void __init __xen_init_IRQ(void)
23{
24 int i;
25
26 /* Create identity vector->irq map */
27 for(i = 0; i < NR_VECTORS; i++) {
28 int cpu;
29
30 for_each_possible_cpu(cpu)
31 per_cpu(vector_irq, cpu)[i] = i;
32 }
33
34 xen_init_IRQ();
35}
36
37static unsigned long xen_save_fl(void) 22static unsigned long xen_save_fl(void)
38{ 23{
39 struct vcpu_info *vcpu; 24 struct vcpu_info *vcpu;
@@ -127,7 +112,7 @@ static void xen_halt(void)
127} 112}
128 113
129static const struct pv_irq_ops xen_irq_ops __initdata = { 114static const struct pv_irq_ops xen_irq_ops __initdata = {
130 .init_IRQ = __xen_init_IRQ, 115 .init_IRQ = xen_init_IRQ,
131 116
132 .save_fl = PV_CALLEE_SAVE(xen_save_fl), 117 .save_fl = PV_CALLEE_SAVE(xen_save_fl),
133 .restore_fl = PV_CALLEE_SAVE(xen_restore_fl), 118 .restore_fl = PV_CALLEE_SAVE(xen_restore_fl),
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 7c3705479ea1..2c8d710713f5 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/ptrace.h> 31#include <asm/ptrace.h>
32#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm/idle.h>
33#include <asm/sync_bitops.h> 34#include <asm/sync_bitops.h>
34#include <asm/xen/hypercall.h> 35#include <asm/xen/hypercall.h>
35#include <asm/xen/hypervisor.h> 36#include <asm/xen/hypervisor.h>
@@ -517,6 +518,24 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
517} 518}
518 519
519 520
521static void xen_do_irq(unsigned irq, struct pt_regs *regs)
522{
523 struct pt_regs *old_regs = set_irq_regs(regs);
524
525 if (WARN_ON(irq == -1))
526 return;
527
528 exit_idle();
529 irq_enter();
530
531 //printk("cpu %d handling irq %d\n", smp_processor_id(), info->irq);
532 handle_irq(irq, regs);
533
534 irq_exit();
535
536 set_irq_regs(old_regs);
537}
538
520/* 539/*
521 * Search the CPUs pending events bitmasks. For each one found, map 540 * Search the CPUs pending events bitmasks. For each one found, map
522 * the event number to an irq, and feed it into do_IRQ() for 541 * the event number to an irq, and feed it into do_IRQ() for
@@ -557,8 +576,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
557 int port = (word_idx * BITS_PER_LONG) + bit_idx; 576 int port = (word_idx * BITS_PER_LONG) + bit_idx;
558 int irq = evtchn_to_irq[port]; 577 int irq = evtchn_to_irq[port];
559 578
560 if (irq != -1) 579 xen_do_irq(irq, regs);
561 xen_do_IRQ(irq, regs);
562 } 580 }
563 } 581 }
564 582