hw/pci-bridge: fix pcie root port's IO hints capability
commitfc67208f228af8e444f74362db1bced56a3daa71
authorMarcel Apfelbaum <marcel@redhat.com>
Wed, 17 Jan 2018 19:19:47 +0000 (17 21:19 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 13 Feb 2018 16:25:48 +0000 (13 18:25 +0200)
treeecb6f3d0bdef955a75d6f723c956040ee85afc53
parent293084a7196b1d7781b6fe19b24e85eb8b7f4de0
hw/pci-bridge: fix pcie root port's IO hints capability

The gen_pcie_root_port mem-reserve and pref32-reserve properties are
defined as size (so uint64_t), but passed as uint32_t when building
the 'IO hints' vendor specific capability.
Passing 4G (or more) gets truncated and passed as a zero reservation.
Is not a huge issue since the guest firmware will always compare the
hints with the default value and take the maximum.

Fix it by passing the values as uint64_t and failing to init the
gen_pcie_root_port id invalid values are used.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci_bridge.c
include/hw/pci/pci_bridge.h