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

[Xen-devel] Re: [PATCH 15/22] x86: Copy-n-paste arch_teardown_msi_irqs from msi.c to io_apic.c.



On Mon, 4 Oct 2010, Konrad Rzeszutek Wilk wrote:

> In preparation for non-privileged domains to disable PCI devices'
> MSI/MSIx, we need to augment arch_teardown_msi_irqs to make
> a call to the privileged domain (patch to follow).

Can't we find a more clever solution than just copying stuff around ?

Something like this:

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 69b7be3..36d607c 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -60,7 +60,12 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int 
type)
 #endif
 
 #ifndef arch_teardown_msi_irqs
-void arch_teardown_msi_irqs(struct pci_dev *dev)
+# define arch_teardown_msi_irqs default_teardown_msi_irqs
+# define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
+#endif
+
+#ifdef HAVE_DEFAULT_MSI_TEARDOWN_IRQS
+void default_teardown_msi_irqs(struct pci_dev *dev)
 {
        struct msi_desc *entry;
 
That way you can override arch_teardown_msi_irqs with x86_msi_ops, define
HAVE_DEFAULT_MSI_TEARDOWN_IRQS in asm/msi.h and set the default
pointer to default_teardown_msi_irqs().

Thanks,

        tglx

_______________________________________________
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®.