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

[Xen-bugs] [Bug 1767] New: Incorrect Error about "Non-Paged aligned MMIO

To: xen-bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-bugs] [Bug 1767] New: Incorrect Error about "Non-Paged aligned MMIO BAR in PCI Config Space" when attempting HW Passthrough to a VM.
From: bugzilla-daemon@xxxxxxxxxxxxxxxxxxx
Date: Tue, 31 May 2011 22:05:12 -0700
Delivery-date: Tue, 31 May 2011 22:06:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-bugs-request@lists.xensource.com?subject=help>
List-id: Xen Bugzilla <xen-bugs.lists.xensource.com>
List-post: <mailto:xen-bugs@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=unsubscribe>
Reply-to: bugs@xxxxxxxxxxxxxxxxxx
Sender: xen-bugs-bounces@xxxxxxxxxxxxxxxxxxx
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1767

           Summary: Incorrect Error about "Non-Paged aligned MMIO BAR in PCI
                    Config Space" when attempting HW Passthrough to a VM.
           Product: Xen
           Version: unspecified
          Platform: x86-64
               URL: http://lxr.xensource.com/lxr/source/tools/python/xen/uti
                    l/pci.py#L1119
        OS/Version: Linux-2.6
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Tools
        AssignedTo: xen-bugs@xxxxxxxxxxxxxxxxxxx
        ReportedBy: paulamonson@xxxxxxxxx


The reason for this error is incorrect parsing of the PCI config space in the
file [root]/tools/python/xen/util/pci.py.  It assumes ALL BARs registers are
32-bit even though most modern PCIe hardware supports 32-bit and 64-bit BARs.

The current code is arount line 1119 in the file inside the function
'detect_dev_info()':

       while bar_addr <= PCI_BAR_5:
           bar = self.pci_conf_read32(bar_addr)
           if (bar & PCI_BAR_SPACE) == PCI_BAR_MEM:
               bar = bar & PCI_BAR_MEM_MASK
               bar = bar & ~PAGE_MASK
               if bar != 0:
                   self.has_non_page_aligned_bar = True
                   break 
           bar_addr = bar_addr + 4

This is not checking for a 64 bit BAR in PCI config space.  The correct code
should read:

        while bar_addr <= PCI_BAR_5:
            bar = self.pci_conf_read32(bar_addr)
            if (bar & PCI_BAR_SPACE) == PCI_BAR_MEM:
                if(bar & PCI_MEM_BAR_LOCATABLE) != 0: # 64-bit BAR
                    barpt2 = self.pci_conf_read32(bar_addr+4)
                    bar = (bar & PCI_BAR_MEM_MASK) + ((barpt2 & 0xffffffff) <<
32)
                    bar = bar & ~PAGE_MASK
                    if bar != 0:
                        self.has_non_page_aligned_bar = True
                        break 
                    bar_addr = bar_addr + 8
                                else: # 32-bit BAR
                    bar = bar & PCI_BAR_MEM_MASK
                    bar = bar & ~PAGE_MASK
                    if bar != 0:
                        self.has_non_page_aligned_bar = True
                        break 
                    bar_addr = bar_addr + 4
            else:
                bar_addr = bar_addr + 4

This bug blocks all HW using 64 bit BARs whose incorrectly parsed address is
not page aligned (appears randomly because not all HW will fail this test).


This may be related to bug #1359 and has been seen in Xen 3.3, 4.0, 4.1
installs.

Hope the information given helps! :)

BTW: I used the PCIe 3.0 Spec for reference. 

Paul


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Xen-bugs mailing list
Xen-bugs@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-bugs

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-bugs] [Bug 1767] New: Incorrect Error about "Non-Paged aligned MMIO BAR in PCI Config Space" when attempting HW Passthrough to a VM., bugzilla-daemon <=