|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 06/12] xen: events: assume PHYSDEVOP_get_free_pirq ex
The find_unbound_pirq is called only from xen_allocate_pirq_msi and
only if alloc_pirq is true. The only caller which does this is
xen_hvm_setup_msi_irqs. The use of this function is gated, in
pci_xen_hvm_init, on XENFEAT_hvm_pirqs.
The PHYSDEVOP_get_free_pirq interfaces was added to the hypervisor in
22410:be96f6058c05 while XENFEAT_hvm_pirqs was added a couple of
minutes prior in 22409:6663214f06ac. Therefore we do not need to
concern ourselves with hypervisors which support XENFEAT_hvm_pirqs but
not PHYSDEVOP_get_free_pirq.
This eliminates the fallback path in find_unbound_pirq which walks to
pirq_to_irq array looking for a free pirq. Unlike the
PHYSDEVOP_get_free_pirq interface this fallback only looks up a free
pirq but does not reserve it. Removing this fallback will simplify
locking in the future.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
drivers/xen/events.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 71d40bf..9995a1f 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -639,19 +639,16 @@ out:
static int find_unbound_pirq(int type)
{
- int rc, i;
+ int rc;
struct physdev_get_free_pirq op_get_free_pirq;
- op_get_free_pirq.type = type;
+ op_get_free_pirq.type = type;
rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq);
- if (!rc)
- return op_get_free_pirq.pirq;
- for (i = 0; i < nr_irqs; i++) {
- if (pirq_to_irq[i] < 0)
- return i;
- }
- return -1;
+ WARN_ONCE(rc == -ENOSYS,
+ "hypervisor does not support the PHYSDEVOP_get_free_pirq
interface\n");
+
+ return rc ? -1 : op_get_free_pirq.pirq;
}
int xen_allocate_pirq_msi(char *name, int *pirq, int alloc_pirq)
--
1.5.6.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- Re: [Xen-devel] [PATCH 1/3] pci/xen: Use xen_allocate_pirq_msi, (continued)
- [Xen-devel] [PATCH 03/12] xen: events: drop XEN_ALLOC_IRQ flag to xen_allocate_pirq_msi, Ian Campbell
- [Xen-devel] [PATCH 04/12] xen: events: return irq from xen_allocate_pirq_msi, Ian Campbell
- [Xen-devel] [PATCH 05/12] xen: pci: collapse apic_register_gsi_xen_hvm and xen_hvm_register_pirq, Ian Campbell
- [Xen-devel] [PATCH 06/12] xen: events: assume PHYSDEVOP_get_free_pirq exists,
Ian Campbell <=
- [Xen-devel] [PATCH 07/12] xen: events: separate MSI PIRQ allocation from PIRQ binding to IRQ, Ian Campbell
- [Xen-devel] Re: [PATCH 07/12] xen: events: separate MSI PIRQ allocation from PIRQ binding to IRQ, Stefano Stabellini
- [Xen-devel] Re: [PATCH 07/12] xen: events: separate MSI PIRQ allocation from PIRQ binding to IRQ, Ian Campbell
- [Xen-devel] [PATCH 08/12] xen: events: refactor xen_create_msi_irq slightly, Ian Campbell
- [Xen-devel] [PATCH 09/12] xen: events: update pirq_to_irq in xen_create_msi_irq, Ian Campbell
- [Xen-devel] Re: [PATCH 09/12] xen: events: update pirq_to_irq in xen_create_msi_irq, Konrad Rzeszutek Wilk
- [Xen-devel] Re: [PATCH 09/12] xen: events: update pirq_to_irq in xen_create_msi_irq, Ian Campbell
- Re: [Xen-devel] Re: [PATCH 09/12] xen: events: update pirq_to_irq in xen_create_msi_irq, Konrad Rzeszutek Wilk
- Re: [Xen-devel] Re: [PATCH 09/12] xen: events: update pirq_to_irq in xen_create_msi_irq, Ian Campbell
- [Xen-devel] [PATCH 10/12] xen: events: push set_irq_msi down into xen_create_msi_irq, Ian Campbell
|
|
|
|
|