diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-10-29 13:57:34 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-12-10 12:29:56 +0200 |
commit | 83d08f2673504a299194dcac1657a13754b5932a (patch) | |
tree | e2eb542fd701cc4a956774cbcf8473e83327b2c9 /hw/pci-host/q35.c | |
parent | e689f7c668cbd9d08f330e17c3dd3a059c9553d3 (diff) | |
download | qemu-83d08f2673504a299194dcac1657a13754b5932a.zip qemu-83d08f2673504a299194dcac1657a13754b5932a.tar.gz qemu-83d08f2673504a299194dcac1657a13754b5932a.tar.bz2 |
pc: map PCI address space as catchall region for not mapped addresses
With a help of negative memory region priority PCI address space
is mapped underneath RAM regions effectively catching every access
to addresses not mapped by any other region.
It simplifies PCI address space mapping into system address space.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Diffstat (limited to 'hw/pci-host/q35.c')
-rw-r--r-- | hw/pci-host/q35.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index c043998..81c8240 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -356,28 +356,11 @@ static int mch_init(PCIDevice *d) { int i; MCHPCIState *mch = MCH_PCI_DEVICE(d); - uint64_t pci_hole64_size; - - /* setup pci memory regions */ - memory_region_init_alias(&mch->pci_hole, OBJECT(mch), "pci-hole", - mch->pci_address_space, - mch->below_4g_mem_size, - 0x100000000ULL - mch->below_4g_mem_size); - memory_region_add_subregion(mch->system_memory, mch->below_4g_mem_size, - &mch->pci_hole); - - pci_hole64_size = pci_host_get_hole64_size(mch->pci_hole64_size); - pc_init_pci64_hole(&mch->pci_info, 0x100000000ULL + mch->above_4g_mem_size, - pci_hole64_size); - memory_region_init_alias(&mch->pci_hole_64bit, OBJECT(mch), "pci-hole64", - mch->pci_address_space, - mch->pci_info.w64.begin, - pci_hole64_size); - if (pci_hole64_size) { - memory_region_add_subregion(mch->system_memory, - mch->pci_info.w64.begin, - &mch->pci_hole_64bit); - } + + /* setup pci memory mapping */ + pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory, + mch->pci_address_space); + /* smram */ cpu_smm_register(&mch_set_smm, mch); memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-region", |