Skip to content

Commit

Permalink
xen: use percpu interrupts for IPIs and VIRQs
Browse files Browse the repository at this point in the history
commit aaca496 upstream.

IPIs and VIRQs are inherently per-cpu event types, so treat them as such:
 - use a specific percpu irq_chip implementation, and
 - handle them with handle_percpu_irq

This makes the path for delivering these interrupts more efficient
(no masking/unmasking, no locks), and it avoid problems with attempts
to migrate them.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jeremy Fitzhardinge authored and Greg Kroah-Hartman committed Sep 20, 2010
1 parent 62b1700 commit fb412a1
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static inline unsigned long *cpu_evtchn_mask(int cpu)
#define VALID_EVTCHN(chn) ((chn) != 0)

static struct irq_chip xen_dynamic_chip;
static struct irq_chip xen_percpu_chip;

/* Constructor for packed IRQ information. */
static struct irq_info mk_unbound_info(void)
Expand Down Expand Up @@ -389,8 +390,8 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
if (irq < 0)
goto out;

set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
handle_level_irq, "ipi");
set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
handle_percpu_irq, "ipi");

bind_ipi.vcpu = cpu;
if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
Expand Down Expand Up @@ -430,8 +431,8 @@ static int bind_virq_to_irq(unsigned int virq, unsigned int cpu)

irq = find_unbound_irq();

set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
handle_level_irq, "virq");
set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
handle_percpu_irq, "virq");

evtchn_to_irq[evtchn] = irq;
irq_info[irq] = mk_virq_info(evtchn, virq);
Expand Down Expand Up @@ -934,6 +935,16 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
.retrigger = retrigger_dynirq,
};

static struct irq_chip en_percpu_chip __read_mostly = {
.name = "xen-percpu",

.disable = disable_dynirq,
.mask = disable_dynirq,
.unmask = enable_dynirq,

.ack = ack_dynirq,
};

void __init xen_init_IRQ(void)
{
int i;
Expand Down

0 comments on commit fb412a1

Please sign in to comment.