pci: set memory type for memory behind the bridge
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 21 Feb 2012 13:49:01 +0000 (15:49 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 15 Mar 2012 22:41:39 +0000 (00:41 +0200)
As we make upper bits in IO and prefetcheable memory
registers writeable, we should declare support
for 64 bit prefetcheable memory and 32 bit io
in the bridge.

This changes the default for apb, dec, but I'm guessing
they got the defaults wrong by accident.
Alternatively, we could let bridges declare lack of
64 bit support and make the upper bits read-only zero.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci.c

index 3ca5f4c820555c6da5cdace88200d949792a8f2a..fee27fcf87dc8ddbe2587341aa5b33c14e70b02d 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -663,8 +663,11 @@ static void pci_init_mask_bridge(PCIDevice *d)
     pci_set_word(d->w1cmask + PCI_BRIDGE_CONTROL,
                  PCI_BRIDGE_CTL_DISCARD_STATUS);
     d->cmask[PCI_IO_BASE] |= PCI_IO_RANGE_TYPE_MASK;
+    d->cmask[PCI_IO_LIMIT] |= PCI_IO_RANGE_TYPE_MASK;
     pci_word_test_and_set_mask(d->cmask + PCI_PREF_MEMORY_BASE,
                                PCI_PREF_RANGE_TYPE_MASK);
+    pci_word_test_and_set_mask(d->cmask + PCI_PREF_MEMORY_LIMIT,
+                               PCI_PREF_RANGE_TYPE_MASK);
 }
 
 static int pci_init_multifunction(PCIBus *bus, PCIDevice *dev)