From patchwork Fri Oct 9 06:28:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V5,24/29] pci: fix pci_default_write_config() Date: Thu, 08 Oct 2009 20:28:57 -0000 From: Isaku Yamahata X-Patchwork-Id: 35573 Message-Id: <1255069742-15724-25-git-send-email-yamahata@valinux.co.jp> To: qemu-devel@nongnu.org, mst@redhat.com Cc: yamahata@valinux.co.jp 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() Signed-off-by: Isaku Yamahata Acked-by: Michael S. Tsirkin --- hw/pci.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 4436e12..8e396b6 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -700,7 +700,8 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l) uint8_t wmask = d->wmask[addr]; d->config[addr] = (d->config[addr] & ~wmask) | (val & wmask); } - if (memcmp(orig + PCI_BASE_ADDRESS_0, d->config + PCI_BASE_ADDRESS_0, 24) + if ((memcmp(orig + PCI_BASE_ADDRESS_0, d->config + PCI_BASE_ADDRESS_0, 24) || + memcmp(orig + PCI_ROM_ADDRESS, d->config + PCI_ROM_ADDRESS, 4)) || ((orig[PCI_COMMAND] ^ d->config[PCI_COMMAND]) & (PCI_COMMAND_MEMORY | PCI_COMMAND_IO))) pci_update_mappings(d);