WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 09/10] xen/pci: Remove 'xen_allocate_pirq_gsi'.

To: linux-kernel@xxxxxxxxxxxxxxx, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH 09/10] xen/pci: Remove 'xen_allocate_pirq_gsi'.
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 7 Jul 2011 15:08:25 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 07 Jul 2011 12:18:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1310065706-18797-1-git-send-email-konrad.wilk@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1310065706-18797-1-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
In the past (2.6.38) the 'xen_allocate_pirq_gsi' would allocate
an entry in a Linux IRQ -> {XEN_IRQ, type, event, ..} array. All
of that has been removed in 2.6.39 and the Xen IRQ subsystem uses
an linked list that is populated when the call to
'xen_allocate_irq_gsi' (universally done from any of the xen_bind_*
calls) is done. The 'xen_allocate_pirq_gsi' is a NOP and there is
no need for it anymore so lets remove it.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 arch/x86/pci/xen.c   |   37 ++++++++++++-------------------------
 drivers/xen/events.c |    5 -----
 include/xen/events.h |    2 --
 3 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 6eddc52..f07c419 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -37,14 +37,8 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
                         rc);
                return rc;
        }
-
-       rc = xen_allocate_pirq_gsi(gsi);
-       if (rc < 0) {
-               dev_warn(&dev->dev, "Xen PCI: failed to allocate a PIRQ for 
GSI%d: %d\n",
-                        gsi, rc);
-               return rc;
-       }
-       pirq = rc;
+       /* In PV DomU the Xen PCI backend puts the PIRQ in the interrupt line.*/
+       pirq = gsi;
 
        if (gsi < NR_IRQS_LEGACY)
                share = 0;
@@ -63,18 +57,16 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
 
 #ifdef CONFIG_ACPI
 static int xen_register_pirq(u32 gsi, int gsi_override, int triggering,
-                            bool alloc_pirq)
+                            bool set_pirq)
 {
        int rc, pirq = -1, irq = -1;
        struct physdev_map_pirq map_irq;
        int shareable = 0;
        char *name;
 
-       if (alloc_pirq) {
-               pirq = xen_allocate_pirq_gsi(gsi);
-               if (pirq < 0)
-                       goto out;
-       }
+       if (set_pirq)
+               pirq = gsi;
+
        map_irq.domid = DOMID_SELF;
        map_irq.type = MAP_PIRQ_TYPE_GSI;
        map_irq.index = gsi;
@@ -112,8 +104,8 @@ static int acpi_register_gsi_xen_hvm(struct device *dev, 
u32 gsi,
        if (!xen_hvm_domain())
                return -1;
 
-       return xen_register_pirq(gsi, -1 /* no GSI override */,
-                                trigger, false /* no PIRQ allocation */);
+       return xen_register_pirq(gsi, -1 /* no GSI override */, trigger,
+                                false /* no mapping of GSI to PIRQ */);
 }
 
 #ifdef CONFIG_XEN_DOM0
@@ -430,7 +422,7 @@ static __init void xen_setup_acpi_sci(void)
 
 int __init pci_xen_initial_domain(void)
 {
-       int pirq, irq;
+       int irq;
 
 #ifdef CONFIG_PCI_MSI
        x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
@@ -447,16 +439,11 @@ int __init pci_xen_initial_domain(void)
 
                xen_register_pirq(irq, -1 /* no GSI override */,
                        trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE,
-                       true /* allocate IRQ */);
+                       true /* Map GSI to PIRQ */);
        }
        if (0 == nr_ioapics) {
-               for (irq = 0; irq < NR_IRQS_LEGACY; irq++) {
-                       pirq = xen_allocate_pirq_gsi(irq);
-                       if (WARN(pirq < 0,
-                                "Could not allocate PIRQ for legacy 
interrupt\n"))
-                               break;
-                       irq = xen_bind_pirq_gsi_to_irq(irq, pirq, 0, "xt-pic");
-               }
+               for (irq = 0; irq < NR_IRQS_LEGACY; irq++)
+                       xen_bind_pirq_gsi_to_irq(irq, irq, 0, "xt-pic");
        }
        return 0;
 }
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 23f1b81..da70f5c 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -615,11 +615,6 @@ static int find_irq_by_gsi(unsigned gsi)
        return -1;
 }
 
-int xen_allocate_pirq_gsi(unsigned gsi)
-{
-       return gsi;
-}
-
 /*
  * Do not make any assumptions regarding the relationship between the
  * IRQ number returned here and the Xen pirq argument.
diff --git a/include/xen/events.h b/include/xen/events.h
index 9af21e1..d287997 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -74,8 +74,6 @@ int xen_set_callback_via(uint64_t via);
 void xen_evtchn_do_upcall(struct pt_regs *regs);
 void xen_hvm_evtchn_do_upcall(void);
 
-/* Allocate a pirq for a physical interrupt, given a gsi. */
-int xen_allocate_pirq_gsi(unsigned gsi);
 /* Bind a pirq for a physical interrupt to an irq. */
 int xen_bind_pirq_gsi_to_irq(unsigned gsi,
                             unsigned pirq, int shareable, char *name);
-- 
1.7.4.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel