From d015c4ea6ff49a164cad68992e529716bc1f5311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 7 Jun 2017 20:36:05 +0400 Subject: q35: fix get_mmcfg_size to use uint64 visitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e->size is hwaddr, i.e. uint64_t. We silently truncate. Signed-off-by: Marc-André Lureau Suggested-by: Markus Armbruster Reviewed-by: Markus Armbruster Message-Id: <20170607163635.17635-14-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster --- hw/pci-host/q35.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/pci-host/q35.c') diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index cd5c49616e..e8a04d31d1 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -129,9 +129,8 @@ static void q35_host_get_mmcfg_size(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { PCIExpressHost *e = PCIE_HOST_BRIDGE(obj); - uint32_t value = e->size; - visit_type_uint32(v, name, &value, errp); + visit_type_uint64(v, name, &e->size, errp); } static Property mch_props[] = { -- cgit v1.2.3 From 1e507bb0fd0a858c3e310fb62e45b0e01a75013f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 7 Jun 2017 20:36:06 +0400 Subject: object: use more specific property type names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the actual unsigned integer type name. The type name change impacts the following externally visible area: * vl.c's machine_help_func() puts it in help for -machine NAME,help. * QMP command qom-list exposes it in ObjectPropertyInfo member @type. * QMP command device-list-properties exposes it in DevicePropertyInfo member @type. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Message-Id: <20170607163635.17635-15-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster --- hw/pci-host/q35.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/pci-host/q35.c') diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index e8a04d31d1..c2f2af5d9a 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -175,23 +175,23 @@ static void q35_host_initfn(Object *obj) qdev_prop_set_uint32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0)); qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false); - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "int", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", q35_host_get_pci_hole_start, NULL, NULL, NULL, NULL); - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "int", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", q35_host_get_pci_hole_end, NULL, NULL, NULL, NULL); - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "int", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", q35_host_get_pci_hole64_start, NULL, NULL, NULL, NULL); - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "int", + object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", q35_host_get_pci_hole64_end, NULL, NULL, NULL, NULL); - object_property_add(obj, PCIE_HOST_MCFG_SIZE, "int", + object_property_add(obj, PCIE_HOST_MCFG_SIZE, "uint64", q35_host_get_mmcfg_size, NULL, NULL, NULL, NULL); -- cgit v1.2.3 From 446de8b68a33834b9130f5ba182e8cdf8749c759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 7 Jun 2017 20:36:11 +0400 Subject: qdev: Use appropriate getter/setters type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on the underlying type of the data accessed, use the appropriate getters/setters: * AcpiPmInfo members s3_disabled, s4_disabled are bool, member s4_val is an uint8_t * Property ACPI_PCIHP_IO_PROP is defined with object_property_add_uint32_ptr() * Property PCIE_HOST_MCFG_SIZE is implemented with visit_type_uint64() * PCIDevice property "addr" is backed by PCIDevice member devfn, which is an int32_t Signed-off-by: Marc-André Lureau Message-Id: <20170607163635.17635-20-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster [More verbose commit message] Signed-off-by: Markus Armbruster --- hw/pci-host/q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/pci-host/q35.c') diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index c2f2af5d9a..564f6cbb14 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -172,7 +172,7 @@ static void q35_host_initfn(Object *obj) object_initialize(&s->mch, sizeof(s->mch), TYPE_MCH_PCI_DEVICE); object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch), NULL); - qdev_prop_set_uint32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0)); + qdev_prop_set_int32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0)); qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false); object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", -- cgit v1.2.3