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]
Date:	Tue, 12 Aug 2014 19:11:53 +0800
From:	Yijing Wang <wangyijing@...wei.com>
To:	David Vrabel <david.vrabel@...rix.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	<linux-mips@...ux-mips.org>, <linux-ia64@...r.kernel.org>,
	<linux-pci@...r.kernel.org>, Xinwei Hu <huxinwei@...wei.com>,
	"H. Peter Anvin" <hpa@...or.com>, <sparclinux@...r.kernel.org>,
	<linux-s390@...r.kernel.org>,
	Russell King <linux@....linux.org.uk>,
	"Joerg Roedel" <joro@...tes.org>, <x86@...nel.org>,
	Sebastian Ott <sebott@...ux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	<xen-devel@...ts.xenproject.org>, <arnab.basu@...escale.com>,
	Arnd Bergmann <arnd@...db.de>,
	Marc Zyngier <marc.zyngier@....com>,
	Chris Metcalf <cmetcalf@...era.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	<linux-arm-kernel@...ts.infradead.org>,
	Tony Luck <tony.luck@...el.com>,
	<linux-kernel@...r.kernel.org>, <iommu@...ts.linux-foundation.org>,
	Wuyun <wuyun.wu@...wei.com>, <linuxppc-dev@...ts.ozlabs.org>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [Xen-devel] [RFC PATCH 01/20] x86/xen/MSI: Eliminate arch_msix_mask_irq()
 and arch_msi_mask_irq()

On 2014/8/12 17:09, David Vrabel wrote:
> On 12/08/14 08:25, Yijing Wang wrote:
>> Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq()
>> and arch_msi_mask_irq() to fix a bug found when running xen in x86.
>> Introduced these two funcntions make MSI code complex. This patch
>> reverted commit 0e4ccb150 and add #ifdef for x86 msi_chip to fix this
>> bug for simplicity. Also this is preparation for using struct
>> msi_chip instead of weak arch MSI functions in all platforms.
> [...]
>>  static struct irq_chip msi_chip = {
>>  	.name			= "PCI-MSI",
>> +#ifdef CONFIG_XEN
>> +	.irq_unmask		= nop_unmask_msi_irq,
>> +	.irq_mask		= nop_mask_msi_irq,
>> +#else
>>  	.irq_unmask		= unmask_msi_irq,
>>  	.irq_mask		= mask_msi_irq,
>> +#endif
> 
> No.  CONFIG_XEN kernels can run on Xen and bare metal so this must be a
> runtime option.

Hi David, that's my mistake, what about export struct irq_chip msi_chip, then
change the msi_chip->irq_mask/irq_unmask() in xen init functions.


Eg.

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 19b0eba..bb6af00 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -43,6 +43,10 @@ static inline void generic_apic_probe(void)
 }
 #endif

+#ifdef CONFIG_PCI_MSI
+extern struct irq_chip msi_chip;
+#endif
+
 #ifdef CONFIG_X86_LOCAL_APIC
[...]
+
+#ifdef CONFIG_PCI_MSI
+void xen_nop_msi_mask(struct irq_data *data)
 {
-       return 0;
 }
 #endif

@@ -424,8 +423,8 @@ int __init pci_xen_init(void)
        x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
        x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
        x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
-       x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
-       x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
+       msi_chip.irq_mask = xen_nop_msi_mask;
+       msi_chip.irq_unmask = xen_nop_msi_mask;
 #endif
        return 0;
 }
@@ -505,8 +504,8 @@ int __init pci_xen_initial_domain(void)
        x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
        x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
        x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs;
-       x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
-       x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
+       msi_chip.irq_mask = xen_nop_msi_mask;
+       msi_chip.irq_unmask = xen_nop_msi_mask;
 #endif
        xen_setup_acpi_sci();


> 
> David
> 
> .
> 


-- 
Thanks!
Yijing

--
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