[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 5/9] Pass PIRQ values obtained from pci_frontend_enable_[msi|msix] in xen_create_msi_irq.



When running in non-privileged PV domain, we will obtain an array of
PIRQ values to be passed in to xen_create_msi_irq. For privileged PV domains
we don't use those values, so we can safely ignore them.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 arch/x86/xen/pci.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
index 00b8b09..dc02241 100644
--- a/arch/x86/xen/pci.c
+++ b/arch/x86/xen/pci.c
@@ -90,22 +90,39 @@ void __init xen_setup_pirqs(void)
 #ifdef CONFIG_PCI_MSI
 int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
-       int irq, ret;
+       int irq, ret, i;
        struct msi_desc *msidesc;
+       int *v;
 
+       v = kzalloc(sizeof(int) * min(1, nvec), GFP_KERNEL);
+       if (!v)
+               return -ENOMEM;
+
+       if (!xen_initial_domain()) {
+               if (type == PCI_CAP_ID_MSIX)
+                       ret = pci_frontend_enable_msix(dev, &v, nvec);
+               else
+                       ret = pci_frontend_enable_msi(dev, &v);
+               if (ret)
+                       goto error;
+       }
+       i = 0;
        list_for_each_entry(msidesc, &dev->msi_list, list) {
-               irq = xen_create_msi_irq(dev, msidesc, type, 0 /* for now. */);
+               irq = xen_create_msi_irq(dev, msidesc, type, v[i]);
                if (irq < 0)
                        return -1;
 
                ret = set_irq_msi(irq, msidesc);
                if (ret)
-                       goto error;
+                       goto error_while;
        }
+       kfree(v);
        return 0;
 
-error:
+error_while:
        xen_destroy_irq(irq);
+error:
+       kfree(v);
        return ret;
 }
 #endif
-- 
1.6.2.5


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.