diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2010-11-08 14:26:36 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-04-14 11:17:54 -0400 |
commit | c7c2c3a28657cfdcef50c02b18ccca3761209e17 (patch) | |
tree | fc2a2c0652a61d9b0f582c33cfa4c75b3bd8a654 | |
parent | beafbdc1df02877612dc9039c1de0639921fddec (diff) |
xen/irq: Add support to check if IRQ line is shared with other domains.
We do this via the PHYSDEVOP_irq_status_query support hypervisor call.
We will get a positive value if another domain has binded its
PIRQ to the specified GSI (IRQ line).
[v2: Deal with v2.6.37-rc1 rebase fallout]
[v3: Deal with stable/irq.cleanup fallout]
[v4: xen_ignore_irq->xen_test_irq_shared]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | drivers/xen/events.c | 12 | ||||
-rw-r--r-- | include/xen/events.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index ac0e22826357..0ac7a149e7f2 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -1508,6 +1508,18 @@ void xen_poll_irq(int irq) | |||
1508 | xen_poll_irq_timeout(irq, 0 /* no timeout */); | 1508 | xen_poll_irq_timeout(irq, 0 /* no timeout */); |
1509 | } | 1509 | } |
1510 | 1510 | ||
1511 | /* Check whether the IRQ line is shared with other guests. */ | ||
1512 | int xen_test_irq_shared(int irq) | ||
1513 | { | ||
1514 | struct irq_info *info = info_for_irq(irq); | ||
1515 | struct physdev_irq_status_query irq_status = { .irq = info->u.pirq.pirq }; | ||
1516 | |||
1517 | if (HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status)) | ||
1518 | return 0; | ||
1519 | return !(irq_status.flags & XENIRQSTAT_shared); | ||
1520 | } | ||
1521 | EXPORT_SYMBOL_GPL(xen_test_irq_shared); | ||
1522 | |||
1511 | void xen_irq_resume(void) | 1523 | void xen_irq_resume(void) |
1512 | { | 1524 | { |
1513 | unsigned int cpu, evtchn; | 1525 | unsigned int cpu, evtchn; |
diff --git a/include/xen/events.h b/include/xen/events.h index 9aecc0b5a0e6..932e54051d3e 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
@@ -95,4 +95,7 @@ int xen_destroy_irq(int irq); | |||
95 | /* Return irq from pirq */ | 95 | /* Return irq from pirq */ |
96 | int xen_irq_from_pirq(unsigned pirq); | 96 | int xen_irq_from_pirq(unsigned pirq); |
97 | 97 | ||
98 | /* Determine whether to ignore this IRQ if it is passed to a guest. */ | ||
99 | int xen_test_irq_shared(int irq); | ||
100 | |||
98 | #endif /* _XEN_EVENTS_H */ | 101 | #endif /* _XEN_EVENTS_H */ |