]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commitdiff
passthrough: fix flag for expansion rom base address register.
authorKeir Fraser <kfraser@endor.localdomain>
Fri, 1 Aug 2008 09:06:13 +0000 (10:06 +0100)
committerKeir Fraser <kfraser@endor.localdomain>
Fri, 1 Aug 2008 09:06:13 +0000 (10:06 +0100)
pt_bar_reg_parse() is called for expansion rom base address register.
Currently it returns PT_BAR_FLAG_MEM if bit 0 is 0. It returns
PT_BAR_FLAG_IO if bit 0 is 1.

But bit 0 in expansion rom base address register is enable bit. If bit
0 is 1 for some reason, it returns PT_BAR_FLAG_IO. Expansion rom is
mapped to memory space. It should return PT_BAR_FLAG_MEM.

After applying this patch, it returns PT_BAR_FLAG_MEM regardless
of bit 0, when it is called for expansion rom base address register.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
hw/pass-through.c

index 1ac1c4c189ac23aeb05aa49a2e920a046cd98252..7b462344bbf096252cb60c50f6dc50327cd57f38 100644 (file)
@@ -1526,6 +1526,13 @@ static int pt_bar_reg_parse(
     if (!r->size)
         goto out;
 
+    /* for ExpROM BAR */
+    if (index == PCI_ROM_SLOT)
+    {
+        bar_flag = PT_BAR_FLAG_MEM;
+        goto out;
+    }
+
     /* check BAR I/O indicator */
     if (d->config[reg->offset] & PCI_BASE_ADDRESS_SPACE_IO)
         bar_flag = PT_BAR_FLAG_IO;