pci: implement bridge filtering

Support bridge filtering on top of the memory
API as suggested by Avi Kivity:

Create a memory region for the bridge's address space.  This region is
not directly added to system_memory or its descendants.  Devices under
the bridge see this region as its pci_address_space().  The region is
as large as the entire address space - it does not take into account
any windows.

For each of the three windows (pref, non-pref, vga), create an alias
with the appropriate start and size.  Map the alias into the bridge's
parent's pci_address_space(), as subregions.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2011-09-04 16:50:55 +03:00
parent 778d179939
commit 7df32ca08a
4 changed files with 91 additions and 76 deletions

View file

@ -41,6 +41,9 @@ struct PCIBridge {
/* private member */
PCIBus sec_bus;
MemoryRegion alias_pref_mem;
MemoryRegion alias_mem;
MemoryRegion alias_io;
pci_map_irq_fn map_irq;
const char *bus_name;
};