lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1010051055470.2556@localhost6.localdomain6>
Date:	Tue, 5 Oct 2010 11:07:36 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
cc:	linux-kernel@...r.kernel.org, xen-devel@...ts.xensource.com,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	Jesse Barnes <jbarnes@...tuousgeek.org>
Subject: 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ