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 5/9] Pass PIRQ values obtained from pci_frontend_enab

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