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

[Xen-devel] [PATCH]: hvmloader: fix off-by-one-bit error when initialisi

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]: hvmloader: fix off-by-one-bit error when initialising PCI devices
From: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Date: Wed, 10 Nov 2010 13:25:01 +0000
Cc: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
Delivery-date: Wed, 10 Nov 2010 05:25:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
hvmloader is responsible for - amoungst other things - initialising the PCI
device BARs prior to loading the guest BIOS.  The previous code only probed
for devfn up to 128.  The lower 3 bits are function IDs so this meant that
only devices in slots 0-15 were actually being initialized.

Signed-off-by: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
Acked-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>

diff -r 7188d1e4b0e1 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Tue Nov 09 12:00:05 2010 +0000
+++ b/tools/firmware/hvmloader/hvmloader.c      Wed Nov 10 13:19:59 2010 +0000
@@ -196,7 +196,7 @@ static void pci_setup(void)
     outb(0x4d1, (uint8_t)(PCI_ISA_IRQ_MASK >> 8));
 
     /* Scan the PCI bus and map resources. */
-    for ( devfn = 0; devfn < 128; devfn++ )
+    for ( devfn = 0; devfn < 256; devfn++ )
     {
         class     = pci_readw(devfn, PCI_CLASS_DEVICE);
         vendor_id = pci_readw(devfn, PCI_VENDOR_ID);
@@ -470,7 +470,7 @@ static int scan_etherboot_nic(uint32_t c
     uint16_t class, vendor_id, device_id;
     int rom_size = 0;
 
-    for ( devfn = 0; (devfn < 128) && !rom_size; devfn++ )
+    for ( devfn = 0; (devfn < 256) && !rom_size; devfn++ )
     {
         class     = pci_readw(devfn, PCI_CLASS_DEVICE);
         vendor_id = pci_readw(devfn, PCI_VENDOR_ID);
@@ -497,7 +497,7 @@ static int pci_load_option_roms(uint32_t
     uint16_t vendor_id, device_id;
     uint8_t devfn, class;
 
-    for ( devfn = 0; devfn < 128; devfn++ )
+    for ( devfn = 0; devfn < 256; devfn++ )
     {
         class     = pci_readb(devfn, PCI_CLASS_DEVICE + 1);
         vendor_id = pci_readw(devfn, PCI_VENDOR_ID);



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]: hvmloader: fix off-by-one-bit error when initialising PCI devices, Gianni Tedesco <=