]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
pci: teach pci_default_config_write() ROM bar for normal/bridge device .
authorIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 30 Oct 2009 12:21:21 +0000 (21:21 +0900)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 9 Nov 2009 14:43:10 +0000 (08:43 -0600)
When updated ROM expantion address of header type 0, it missed
to update mappings.
Add PCI_ROM_ADDRESS check whether to call pci_update_mappings()
Also update pci mapping when PCI_ROM_ADDRESS1 is written for header type 1.

pci_update_mapping() path isn't performance critical,
so call it even independent of header type.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pci.c

index d9fd564b49e69e05a89b3e98469d700d88d28347..46b22ec58fdd189d55594daefc0b2dd148f038c3 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -707,6 +707,8 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
         d->config[addr] = (d->config[addr] & ~wmask) | (val & wmask);
     }
     if (ranges_overlap(addr, l, PCI_BASE_ADDRESS_0, 24) ||
+        ranges_overlap(addr, l, PCI_ROM_ADDRESS, 4) ||
+        ranges_overlap(addr, l, PCI_ROM_ADDRESS1, 4) ||
         range_covers_byte(addr, l, PCI_COMMAND))
         pci_update_mappings(d);
 }