qemu-patch-raspberry4/hw/pci-host
Markus Armbruster 97a83ec3a9 piix: Set I440FXState member pci_info.w32 in one place
Range pci_info.w32 records the location of the PCI hole.

It's initialized to empty when QOM zeroes I440FXState.  That's a fine
value for a still unknown PCI hole.

i440fx_init() sets pci_info.w32.begin = below_4g_mem_size.  Changes
the PCI hole from empty to [below_4g_mem_size, UINT64_MAX].  That's a
bogus value.

i440fx_pcihost_initfn() sets pci_info.end = IO_APIC_DEFAULT_ADDRESS.
Since i440fx_init() ran already, this changes the PCI hole to
[below_4g_mem_size, IO_APIC_DEFAULT_ADDRESS-1].  That's the correct
value.

Setting the bounds of the PCI hole in two separate places is
confusing, and begs the question whether the bogus intermediate value
could be used by something, or what would happen if we somehow managed
to realize an i440FX device without having run the board init function
i440fx_init() first.

Avoid the confusion by setting the (constant) upper bound along with
the lower bound in i440fx_init().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2016-07-04 14:50:59 +03:00
..
apb.c hw: explicitly include qemu/log.h 2016-05-19 16:42:29 +02:00
bonito.c pci: Clean up includes 2016-01-29 15:07:24 +00:00
gpex.c pci: Clean up includes 2016-01-29 15:07:24 +00:00
grackle.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
Makefile.objs pci: Add generic PCIe host bridge 2015-02-13 05:46:07 +00:00
pam.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
piix.c piix: Set I440FXState member pci_info.w32 in one place 2016-07-04 14:50:59 +03:00
ppce500.c pci: Clean up includes 2016-01-29 15:07:24 +00:00
prep.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
q35.c machine: remove iommu property 2016-07-04 14:50:58 +03:00
uninorth.c coccinelle: Remove unnecessary variables for function return value 2016-06-20 16:38:13 +02:00
versatile.c hw: explicitly include qemu/log.h 2016-05-19 16:42:29 +02:00