From: "Jan Beulich" Subject: Re: MSI badness in xen-unstable Date: Mon, 18 Oct 2010 09:24:17 +0100 Message-ID: <4CBC2051020000780001DA58@vpn.id2.novell.com> References: <1286530426.12843.199.camel@qabil.uk.xensource.com> <1286817142.12843.515.camel@qabil.uk.xensource.com> <1766682273.20101016182926@eikelenboom.it> <1868325440.20101016192611@eikelenboom.it> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Bruce Edge Cc: Sander Eikelenboom , Xen Devel , Keir Fraser , Gianni Tedesco , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org >>> On 18.10.10 at 00:33, Bruce Edge wrote: > diff -r 3a5755249361 xen/arch/x86/msi.c > --- a/xen/arch/x86/msi.c Thu Oct 14 12:46:29 2010 +0100 > +++ b/xen/arch/x86/msi.c Sun Oct 17 15:32:05 2010 -0700 > @@ -549,14 +549,14 @@ > return 0; > if ( (addr & PCI_BASE_ADDRESS_MEM_TYPE_MASK) =3D=3D PCI_BASE_ADDRESS= _MEM_TYPE_64 ) > { > - addr &=3D ~PCI_BASE_ADDRESS_MEM_MASK; > + addr &=3D PCI_BASE_ADDRESS_MEM_MASK; > if ( ++bir >=3D limit ) > return 0; > return addr | > ((u64)pci_conf_read32(bus, slot, func, > PCI_BASE_ADDRESS_0 + bir * 4) << = 32); > } > - return addr & ~PCI_BASE_ADDRESS_MEM_MASK; > + return addr & PCI_BASE_ADDRESS_MEM_MASK; > } >=20 > /** > @@ -634,6 +634,14 @@ >=20 > ASSERT(!dev->msix_used_entries); > WARN_ON(msi->table_base !=3D read_pci_mem_bar(bus, slot, func, = bir)); > + if(msi->table_base =3D=3D read_pci_mem_bar(bus, slot, func, = bir)) { // XXX Did you perhaps mean !=3D here? The log you provided shows the two values to be identical when these printk()s get executed (which raises the question how the warning could get triggered, the more on line 635 when it sits on line 636 according to the patch). > + printk( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); > + printk( "msi->table_base !=3D read_pci_mem_bar(bu= s, slot, func, bir)\n"); > + printk( "msi->table_base =3D %0lx\n", msi->table_= base ); > + printk( "read_pci_mem_bar =3D %0lx\n", read_pci_m= em_bar(bus, slot, func, bir) ); > + printk( "bus=3D%0x, slot=3D%0x, func=3D%0x, = bir=3D%0x\n", bus, slot, func, bir); > + printk( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n\n"); > + } >=20 > dev->msix_nr_entries =3D nr_entries; > dev->msix_table.first =3D PFN_DOWN(table_paddr); > @@ -647,6 +655,11 @@ > bir =3D (u8)(pba_offset & PCI_MSIX_BIRMASK); > pba_paddr =3D read_pci_mem_bar(bus, slot, func, bir); > WARN_ON(!pba_paddr); Similar here: the warning sits on line 657, but the log shows warnings only on lines 635, 639, and 660. Something's out of sync here. > + if (!pba_paddr) { // XXX > + printk( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); > + printk( "No pba_addr: bus=3D%0x, slot=3D%0x, = func=3D%0x, bir=3D%0x\n", bus, slot, func, bir); > + printk( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n\n"); > + } > pba_paddr +=3D pba_offset & ~PCI_MSIX_BIRMASK; >=20 > dev->msix_pba.first =3D PFN_DOWN(pba_paddr); > @@ -654,6 +667,14 @@ > BITS_TO_LONGS(nr_entries) - 1); > WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, dev->msix_pba.fi= rst, > dev->msix_pba.last)); > + if ( rangeset_overlaps_range(mmio_ro_ranges, dev->msix_pba.first= , > + dev->msix_pba.last)) { // XXX > + printk( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); > + printk( "rangeset_overlaps_range\n" ); > + printk( "mmio_ro_ranges =3D %p, dev->msix_pba.fir= st =3D %0lx, dev->msix_pba.last =3D %0lx\n", > + mmio_ro_ranges, dev->msix_pba.fir= st, dev->msix_pba.last); > + printk( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n\n"); > + } >=20 > if ( rangeset_add_range(mmio_ro_ranges, dev->msix_table.first, > dev->msix_table.last) ) Jan