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] Re: [PATCH 15/22] x86: Copy-n-paste arch_teardown_msi_irqs f

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 15/22] x86: Copy-n-paste arch_teardown_msi_irqs from msi.c to io_apic.c.
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Date: Tue, 5 Oct 2010 11:07:36 +0200 (CEST)
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>
Delivery-date: Tue, 05 Oct 2010 02:08:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1286216015-9710-16-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: <1286216015-9710-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1286216015-9710-16-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
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

<Prev in Thread] Current Thread [Next in Thread>