aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2017-06-29Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170628' ↵Peter Maydell22-44/+61
into staging migration/next for 20170628 # gpg: Signature made Wed 28 Jun 2017 12:16:44 BST # gpg: using RSA key 0xF487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" # gpg: aka "Juan Quintela <quintela@trasno.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/migration/20170628: exec: fix access to ram_list.dirty_memory when sync dirty bitmap migration: add "return-path" capability vmstate: error hint for failed equal checks migration: add comment for TYPE_MIGRATE migration: hmp: dump globals migration: merge enforce_config_section somewhat migration: move skip_section_footers migration: move skip_configuration out migration: move only_migratable to MigrationState migration: move global_state.optional out migration: let MigrationState be a qdev vl: clean up global property registration accel: introduce AccelClass.global_props machine: export register_compat_prop() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-28vmstate: error hint for failed equal checksHalil Pasic17-20/+20
In some cases a failing VMSTATE_*_EQUAL does not mean we detected a bug, but it's actually the best we can do. Especially in these cases a verbose error message is required. Let's introduce infrastructure for specifying a error hint to be used if equal check fails. Let's do this by adding a parameter to the _EQUAL macros called _err_hint. Also change all current users to pass NULL as last parameter so nothing changes for them. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Message-Id: <20170623144823.42936-1-pasic@linux.vnet.ibm.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-06-28migration: move skip_section_footersPeter Xu3-5/+5
Move it into MigrationState, revert its meaning and renaming it to send_section_footer, with a property bound to it. Same trick is played like previous patches. Removing savevm_skip_section_footers(). Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-9-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-06-28migration: move skip_configuration outPeter Xu3-3/+5
It was in SaveState but now moved to MigrationState altogether, reverted its meaning, then renamed to "send_configuration". Again, using HW_COMPAT_2_3 for old PC/SPAPR machines, and accel_register_prop() for xen_init(). Removing savevm_skip_configuration(). Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-8-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-06-28migration: move global_state.optional outPeter Xu3-3/+10
Put it into MigrationState then we can use the properties to specify whether to enable storing global state. Removing global_state_set_optional() since now we can use HW_COMPAT_2_3 for x86/power, and AccelClass.global_props for Xen. Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-6-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-06-28accel: introduce AccelClass.global_propsPeter Xu1-0/+7
Introduce this new field for the accelerator classes so that each specific accelerator in the future can register its own global properties to be used further by the system. It works just like how the old machine compatible properties do, but only tailored for accelerators. Introduce register_compat_props_array() for it. Export it so that it may be used in other codes as well in the future. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-3-git-send-email-peterx@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-06-28machine: export register_compat_prop()Peter Xu2-13/+14
We have HW_COMPAT_*, however that's only bound to machines, not other things (like accelerators). Behind it, it was register_compat_prop() that played the trick. Let's export the function for further use outside HW_COMPAT_* magic. Meanwhile, move it to qdev-properties.c where seems more proper (since it'll be used not only in machine codes). Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-2-git-send-email-peterx@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2017-06-27xen-disk: add support for multi-page shared ringsPaul Durrant1-31/+113
The blkif protocol has had provision for negotiation of multi-page shared rings for some time now and many guest OS have support in their frontend drivers. This patch makes the necessary modifications to xen-disk support a shared ring up to order 4 (i.e. 16 pages). Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2017-06-27xen-disk: only advertize feature-persistent if grant copy is not availablePaul Durrant1-7/+8
If grant copy is available then it will always be used in preference to persistent maps. In this case feature-persistent should not be advertized to the frontend, otherwise it may needlessly copy data into persistently granted buffers. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2017-06-27xen/disk: don't leak stack data via response ringStefano Stabellini1-13/+12
Rather than constructing a local structure instance on the stack, fill the fields directly on the shared ring, just like other (Linux) backends do. Build on the fact that all response structure flavors are actually identical (aside from alignment and padding at the end). This is XSA-216. Reported by: Anthony Perard <anthony.perard@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2017-06-27xilinx_spips: allow mmio executionKONRAD Frederic1-19/+55
This allows to execute from the lqspi area. When the request_ptr is called the device loads 1024bytes from the SPI device. Then this code can be executed by the guest. Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2017-06-27introduce mmio_interfaceKONRAD Frederic2-0/+129
This introduces mmio_interface object which contains a MemoryRegion and can be hotplugged/hotunplugged. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2017-06-26nvme: Add support for Read Data and Write Data in CMBs.Stephen Bates2-26/+58
Add the ability for the NVMe model to support both the RDS and WDS modes in the Controller Memory Buffer. Although not currently supported in the upstreamed Linux kernel a fork with support exists [1] and user-space test programs that build on this also exist [2]. Useful for testing CMB functionality in preperation for real CMB enabled NVMe devices (coming soon). [1] https://github.com/sbates130272/linux-p2pmem [2] https://github.com/sbates130272/p2pmem-test Signed-off-by: Stephen Bates <sbates@raithlin.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-06-23Merge remote-tracking branch 'remotes/kraxel/tags/queue/misc-pull-request' ↵Peter Maydell1-60/+151
into staging # gpg: Signature made Fri 23 Jun 2017 13:48:04 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/queue/misc-pull-request: applesmc: fix port i/o access width applesmc: implement error status port applesmc: cosmetic whitespace and indentation cleanup Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-23applesmc: fix port i/o access widthGabriel L. Somlo1-2/+2
Set access width of all AppleSMC i/o regions to 1 byte, since they all represent 8-bit-wide ports. Signed-off-by: Gabriel Somlo <gsomlo@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de> Message-id: 1497639316-22202-4-git-send-email-gsomlo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-23applesmc: implement error status portGabriel L. Somlo1-26/+115
As of release 10.12.4, OS X (Sierra) refuses to boot unless the AppleSMC supports an additional I/O port, expected to provide an error status code. Update the [cmd|data]_write() and data_read() methods to implement the required state machine, and add I/O region & methods to handle access to the error port. Originally proposed by Eric Shelton <eshelton@pobox.com> based in part on FakeSMC (git://git.assembla.com/fakesmc.git). Signed-off-by: Gabriel Somlo <gsomlo@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Phil Dennis-Jordan <phil@philjordan.eu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 1497639316-22202-3-git-send-email-gsomlo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-23applesmc: cosmetic whitespace and indentation cleanupGabriel L. Somlo1-48/+50
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Phil Dennis-Jordan <phil@philjordan.eu> Message-id: 1497639316-22202-2-git-send-email-gsomlo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-23ps2: reset queue in ps2_reset_keyboardGerd Hoffmann1-0/+1
When the guest resets the keyboard also clear the queue. It is highly unlikely that the guest is still interested in the events stuck in the queue, and it avoids confusing the guest in case the queue is full and the ACK can't be queued up. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1372583 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-4-kraxel@redhat.com
2017-06-23ps2: add ps2_reset_queueGerd Hoffmann1-5/+10
Factor out ps2 queue reset to a separate function. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-3-kraxel@redhat.com
2017-06-23ps2: add and use PS2State typedefGerd Hoffmann1-7/+5
Cleanup: Create and use a typedef for PS2State and stop passing void pointers. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-2-kraxel@redhat.com
2017-06-23hid: Reset kbd modifiers on resetAlexander Graf1-0/+1
When resetting the keyboard, we need to reset not just the pending keystrokes, but also any pending modifiers. Otherwise there's a race when we're getting reset while running an escape sequence (modifier 0x100). Cc: qemu-stable@nongnu.org Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1498117295-162030-1-git-send-email-agraf@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-22Merge remote-tracking branch 'remotes/kraxel/tags/usb-20170621-pull-request' ↵Peter Maydell1-10/+14
into staging # gpg: Signature made Wed 21 Jun 2017 16:43:14 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/usb-20170621-pull-request: usb-host: support devices with sparse/non-sequential USB interfaces Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-22Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-06-09-v2' ↵Peter Maydell27-134/+164
into staging QAPI patches for 2017-06-09 # gpg: Signature made Tue 20 Jun 2017 13:31:39 BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2017-06-09-v2: (41 commits) tests/qdict: check more get_try_int() cases console: use get_uint() for "head" property i386/cpu: use get_uint() for "min-level"/"min-xlevel" properties numa: use get_uint() for "size" property pnv-core: use get_uint() for "core-pir" property pvpanic: use get_uint() for "ioport" property auxbus: use get_uint() for "addr" property arm: use get_uint() for "mp-affinity" property xen: use get_uint() for "max-ram-below-4g" property pc: use get_uint() for "hpet-intcap" property pc: use get_uint() for "apic-id" property pc: use get_uint() for "iobase" property acpi: use get_uint() for "pci-hole*" properties acpi: use get_uint() for various acpi properties acpi: use get_uint() for "acpi-pcihp-io*" properties platform-bus: use get_uint() for "addr" property bcm2835_fb: use {get, set}_uint() for "vcram-size" and "vcram-base" aspeed: use {set, get}_uint() for "ram-size" property pcihp: use get_uint() for "bsel" property pc-dimm: make "size" property uint64 ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-21usb-host: support devices with sparse/non-sequential USB interfacesSamuel Brian1-10/+14
Some USB devices have sparse interface numbering which is not able to be passthroughed. For example, the Sierra Wireless MC7455/MC7430: # lsusb -D /dev/bus/usb/003/003 | egrep '1199|9071|bNumInterfaces|bInterfaceNumber' Device: ID 1199:9071 Sierra Wireless, Inc. idVendor 0x1199 Sierra Wireless, Inc. idProduct 0x9071 bNumInterfaces 5 bInterfaceNumber 0 bInterfaceNumber 2 bInterfaceNumber 3 bInterfaceNumber 8 bInterfaceNumber 10 In this case, the interface numbers are 0, 2, 3, 8, 10 and not the 0, 1, 2, 3, 4 that QEMU tries to claim. This change allows sparse USB interface numbering. Instead of only claiming the interfaces in the range reported by the USB device through bNumInterfaces, QEMU attempts to claim all possible interfaces. v2 to fix broken v1 patch formatting. v3 to fix indentation. Signed-off-by: Samuel Brian <sam.brian@accelerated.com> Message-id: 20170613234039.27201-1-sam.brian@accelerated.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-20Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell5-279/+242
pc: fixes, cleanups, features Some fixes and cleanups. Extended TSEG sizes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 16 Jun 2017 16:45:07 BST # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: hw/i386: fix nvdimm check error path intel_iommu: cleanup vtd_interrupt_remap_msi() intel_iommu: cleanup vtd_{do_}iommu_translate() intel_iommu: switching the rest DPRINTF to trace tests/q35-test: add TSEG size checks tests/q35-test: push down qtest_start / qtest_end to test case(s) q35/mch: implement extended TSEG sizes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-20Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell7-105/+360
* nbd and qemu-nbd fixes (Eric, Max) * nbd refactoring (Vladimir) * vhost-user-scsi, take N+1 (Felipe) * replace memory_region_set_fd with memory_region_init_ram_from_fd (Marc-André) * docs/ movement (Paolo) * megasas TOCTOU fixes (Paolo) * make async_safe_run_on_cpu work on kvm/hax accelerators (Paolo) * Build system and poison.h improvements (Thomas) * -accel thread=xxx fix (Thomas) * move files to accel/ (Yang Zhong) # gpg: Signature made Thu 15 Jun 2017 10:51:55 BST # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (41 commits) vhost-user-scsi: Introduce a vhost-user-scsi sample application vhost-user-scsi: Introduce vhost-user-scsi host device qemu-doc: include version number docs: create interop/ subdirectory include/exec/poison: Mark some CONFIG defines as poisoned, too include/exec/poison: Add missing TARGET defines nbd/server: refactor nbd_trip nbd/server: rename rc to ret nbd/server: get rid of fail: return rc nbd/server: nbd_negotiate: fix error path nbd/server: remove NBDClientNewData nbd/server: refactor nbd_co_receive_request nbd/server: get rid of EAGAIN dead code nbd/server: refactor nbd_co_send_reply nbd/server: get rid of ssize_t nbd/server: get rid of nbd_negotiate_read and friends nbd: make nbd_drop public nbd: rename read_sync and friends accel: move kvm related accelerator files into accel/ tcg: move tcg backend files into accel/tcg/ ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-20pnv-core: use get_uint() for "core-pir" propertyMarc-André Lureau1-1/+1
This is an alias of TYPE_PNV_CORE's property "pir", which is defined with DEFINE_PROP_UINT32() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-38-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pvpanic: use get_uint() for "ioport" propertyMarc-André Lureau1-1/+1
TYPE_ISA_PVPANIC_DEVICE's property PVPANIC_IOPORT_PROP is defined with DEFINE_PROP_UINT16(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-37-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20auxbus: use get_uint() for "addr" propertyMarc-André Lureau1-1/+1
This is TYPE_MEMORY_REGION's property. Its getter memory_region_get_addr() uses visit_type_uint64(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-36-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20arm: use get_uint() for "mp-affinity" propertyMarc-André Lureau1-1/+1
TYPE_ARM_CPU's property "mp-affinity" is defined with DEFINE_PROP_UINT64(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-35-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20xen: use get_uint() for "max-ram-below-4g" propertyMarc-André Lureau1-3/+3
TYPE_PC_MACHINE's property PC_MACHINE_MAX_RAM_BELOW_4G's getter and setter pc_machine_get_max_ram_below_4g() and pc_machine_set_max_ram_below_4g() use visit_type_size() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-34-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pc: use get_uint() for "hpet-intcap" propertyMarc-André Lureau1-1/+1
TYPE_HPET's property HPET_INTCAP is defined with DEFINE_PROP_UINT32(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-33-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pc: use get_uint() for "apic-id" propertyMarc-André Lureau1-1/+1
TYPE_X86_CPU's property "apic-id" is defined with DEFINE_PROP_UINT32(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-32-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pc: use get_uint() for "iobase" propertyMarc-André Lureau1-1/+1
TYPE_ISA_FDC's property "iobase" is defined with DEFINE_PROP_UINT32(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-31-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20acpi: use get_uint() for "pci-hole*" propertiesMarc-André Lureau1-12/+12
Those properties use visit_type_uint*() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-30-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20acpi: use get_uint() for various acpi propertiesMarc-André Lureau1-13/+14
PIIX4: piix4_pm_add_propeties() defines these with object_property_add_uint*_ptr(). Q35: ich9_lpc_add_properties() and ich9_pm_add_properties() define them similarly, except for ACPI_PM_PROP_GPE0_BLK(). That one's getter ich9_pm_get_gpe0_blk() uses visit_type_uint32(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-29-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20acpi: use get_uint() for "acpi-pcihp-io*" propertiesMarc-André Lureau1-2/+2
Those are defined with object_property_add_uint16_ptr() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-28-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20platform-bus: use get_uint() for "addr" propertyMarc-André Lureau1-1/+1
This is TYPE_MEMORY_REGION's property. Its getter memory_region_get_addr() uses visit_type_uint64(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-27-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20bcm2835_fb: use {get, set}_uint() for "vcram-size" and "vcram-base"Marc-André Lureau2-7/+6
Both properties are defined with DEFINE_PROP_UINT32(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-26-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20aspeed: use {set, get}_uint() for "ram-size" propertyMarc-André Lureau1-4/+4
This property is an alias for device TYPE_ASPEED_SDMC's property "ram-size", which is defined with DEFINE_PROP_UINT64(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-25-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pcihp: use get_uint() for "bsel" propertyMarc-André Lureau1-3/+3
The property is defined with object_property_add_uint32_ptr() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-24-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pc-dimm: make "size" property uint64Marc-André Lureau3-15/+16
This carries the memory_region_size() value without implicit cast. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-23-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20pc-dimm: use get_uint() for dimm propertiesMarc-André Lureau4-13/+16
TYPE_PC_DIMM's property PC_DIMM_ADDR_PROP is defined with DEFINE_PROP_UINT64(). TYPE_PC_DIMM's property PC_DIMM_NODE_PROP is defined with DEFINE_PROP_UINT32(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-22-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20qdev: Use appropriate getter/setters typeMarc-André Lureau4-9/+9
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 <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-20-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [More verbose commit message] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20apic-common: make "id" property a uint32Marc-André Lureau1-5/+5
The getter and setter of TYPE_APIC_COMMON property "id" are apic_common_get_id() and apic_common_set_id(). apic_common_get_id() reads either APICCommonState member uint32_t initial_apic_id or uint8_t id into an int64_t local variable. It then passes this variable to visit_type_int(). apic_common_set_id() uses visit_type_int() to read the value into a local variable, which it then assigns both to initial_apic_id and id. While the state backing the property is two unsigned members, 8 and 32 bits wide, the actual visitor is 64 bits signed. Change getter and setter to use visit_type_uint32(). Then everything's uint32_t, except for @id. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-19-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20qdev: avoid type casts between signed and unsignedMarc-André Lureau1-8/+13
Modify the unsigned type for various properties to use QNUM_U64, to avoid type casts. There are a few empty lines added to improve code reading/style. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-18-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Change to set_default_value_enum() dropped] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20qdev: wrap default property value in an unionMarc-André Lureau1-3/+3
Wrap the Property default value (an int64_t) in a union, to prepare for the next patch adding a uint64_t. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-17-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20qdev: Rename DEFINE_PROP_DEFAULT() to DEFINE_PROP_SIGNED()Marc-André Lureau2-12/+12
The rename prepares for the patch after next's DEFINE_PROP_UNSIGNED(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-16-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20object: use more specific property type namesMarc-André Lureau3-10/+10
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 <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170607163635.17635-15-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20q35: fix get_mmcfg_size to use uint64 visitorMarc-André Lureau1-2/+1
e->size is hwaddr, i.e. uint64_t. We silently truncate. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170607163635.17635-14-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>