From: Gianni Tedesco Subject: Re: MSI badness in xen-unstable Date: Mon, 18 Oct 2010 18:16:39 +0100 Message-ID: <1287422199.12843.820.camel@qabil.uk.xensource.com> References: <1286530426.12843.199.camel@qabil.uk.xensource.com> <1286817142.12843.515.camel@qabil.uk.xensource.com> <1766682273.20101016182926@eikelenboom.it> <895776665.20101016192503@eikelenboom.it> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <895776665.20101016192503@eikelenboom.it> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Sander Eikelenboom Cc: Xen Devel , Stefano Stabellini , Bruce Edge , Keir Fraser List-Id: xen-devel@lists.xenproject.org On Sat, 2010-10-16 at 18:25 +0100, Sander Eikelenboom wrote: > Probably there are more problems, you could also try a xen-unstable > from before the commit that changed this code (msi.c) > Another thing that could make it eassier to debug would be to put some > printk's around the WARN_ON's in msi.c at the linenumbers that gave > the warnings, showing but parts of the equation in the WARN_ON Yes, I am still getting WARN's after the inverted masks patch too. Bruces patch was line-wrap mangled but I instrumented the WARN that I'm hitting based on that. The device in question is a broadcom netXtreme II - there are two installed in the box but only one of them is brought up. The WARN's happen when the interface is brought up for DHCP. (XEN) ================================================= (XEN) msi->table_base != read_pci_mem_bar(bus, slot, func, bir) (XEN) msi->table_base = da000000 (XEN) read_pci_mem_bar = 0 (XEN) bus=2, slot=0, func=0, bir=0 (XEN) ================================================= (XEN) ================================================= (XEN) No pba_addr: bus=2, slot=0, func=0, bir=0 (XEN) ================================================= The problem appears to be as simple as read_pci_mem_bar() returning zero. This can only happen for a few possible reasons and in my case what I got was: pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) is not one of: PCI_HEADER_TYPE_NORMAL PCI_HEADER_TYPE_BRIDGE PCI_HEADER_TYPE_CARDBUS Thereby bailing in the switch statement. It seems that the problem here is that the multi-function bit (0x80) was not being masked out. Does the following patch work for you guys? diff -r fc2242ac90e1 xen/arch/x86/msi.c --- a/xen/arch/x86/msi.c Mon Oct 18 11:31:47 2010 +0100 +++ b/xen/arch/x86/msi.c Mon Oct 18 18:14:22 2010 +0100 @@ -527,7 +527,7 @@ static u64 read_pci_mem_bar(u8 bus, u8 s u8 limit; u32 addr; - switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) ) + switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f ) { case PCI_HEADER_TYPE_NORMAL: limit = 6; FYI: This is function 0 of my multi-function bnx2 NIC. I notice your affected devices were also multi-function 02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20) Subsystem: Dell Device 02a3 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Capabilities: [160 v1] Virtual Channel Caps: LPEVC=0 RefClk=100ns PATEntryBits=1 Arb: Fixed- WRR32- WRR64- WRR128- Ctrl: ArbSelect=Fixed Status: InProgress- VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans- Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256- Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff Status: NegoPending- InProgress- Kernel driver in use: bnx2 02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20) Subsystem: Dell Device 02a3 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Capabilities: [160 v1] Virtual Channel Caps: LPEVC=0 RefClk=100ns PATEntryBits=1 Arb: Fixed- WRR32- WRR64- WRR128- Ctrl: ArbSelect=Fixed Status: InProgress- VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans- Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256- Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff Status: NegoPending- InProgress- Kernel driver in use: bnx2