ioemu: Fix I/O BAR mapping problem
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 6 Aug 2008 09:54:55 +0000 (10:54 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 6 Aug 2008 09:54:55 +0000 (10:54 +0100)
Check BAR type indicator to avoid I/O BAR being mistaken as 64-bit =
memory BAR.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
tools/ioemu/hw/pass-through.c

index ce24034de0248b6b52b39fd010516c9cbad252b3..3903a0a1fc4e60948c3825b80c19ecbc09dc648c 100644 (file)
@@ -1513,7 +1513,9 @@ static int pt_bar_reg_parse(
     /* check 64bit BAR */
     index = pt_bar_offset_to_index(reg->offset);
     if ((index > 0) && (index < PCI_ROM_SLOT) &&
-        (d->config[bar_64] & PCI_BASE_ADDRESS_MEM_TYPE_64))
+        ((d->config[bar_64] & (PCI_BASE_ADDRESS_SPACE |
+                               PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
+         (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)))
     {
         region = &ptdev->bases[index-1];
         if (region->bar_flag != PT_BAR_FLAG_UPPER)