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/i386 | |
parent | e689f7c668cbd9d08f330e17c3dd3a059c9553d3 (diff) | |
download | qemu-83d08f2673504a299194dcac1657a13754b5932a.tar.gz qemu-83d08f2673504a299194dcac1657a13754b5932a.tar.bz2 qemu-83d08f2673504a299194dcac1657a13754b5932a.zip |
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/i386')
-rw-r--r-- | hw/i386/pc.c | 20 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 2 |
2 files changed, 6 insertions, 16 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 12c436e7f1..6c82ada3d4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1093,21 +1093,13 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size, return guest_info; } -void pc_init_pci64_hole(PcPciInfo *pci_info, uint64_t pci_hole64_start, - uint64_t pci_hole64_size) +/* setup pci memory address space mapping into system address space */ +void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, + MemoryRegion *pci_address_space) { - if ((sizeof(hwaddr) == 4) || (!pci_hole64_size)) { - return; - } - /* - * BIOS does not set MTRR entries for the 64 bit window, so no need to - * align address to power of two. Align address at 1G, this makes sure - * it can be exactly covered with a PAT entry even when using huge - * pages. - */ - pci_info->w64.begin = ROUND_UP(pci_hole64_start, 0x1ULL << 30); - pci_info->w64.end = pci_info->w64.begin + pci_hole64_size; - assert(pci_info->w64.begin <= pci_info->w64.end); + /* Set to lower priority than RAM */ + memory_region_add_subregion_overlap(system_memory, 0x0, + pci_address_space, -1); } void pc_acpi_init(const char *default_dsdt) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ab562853b8..636f59ffd3 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -149,8 +149,6 @@ static void pc_init1(QEMUMachineInitArgs *args, if (pci_enabled) { pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi, system_memory, system_io, args->ram_size, - below_4g_mem_size, - 0x100000000ULL - below_4g_mem_size, above_4g_mem_size, pci_memory, ram_memory); } else { |