aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2023-03-02hw/timer/hpet: Fix expiration time overflowAkihiko Odaki1-6/+13
The expiration time provided for timer_mod() can overflow if a ridiculously large value is set to the comparator register. The resulting value can represent a past time after rounded, forcing the timer to fire immediately. If the timer is configured as periodic, it will rearm the timer again, and form an endless loop. Check if the expiration value will overflow, and if it will, stop the timer instead of rearming the timer with the overflowed time. This bug was found by Alexander Bulekov when fuzzing igb, a new network device emulation: https://patchew.org/QEMU/20230129053316.1071513-1-alxndr@bu.edu/ The fixed test case is: fuzz/crash_2d7036941dcda1ad4380bb8a9174ed0c949bcefd Fixes: 16b29ae180 ("Add HPET emulation to qemu (Beth Kon)") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20230131030037.18856-1-akihiko.odaki@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-02virtio-rng-pci: fix transitional migration compat for vectorsDr. David Alan Gilbert1-0/+2
In bad9c5a516 ("virtio-rng-pci: fix migration compat for vectors") I fixed the virtio-rng-pci migration compatibility, but it was discovered that we also need to fix the other aliases of the device for the transitional cases. Fixes: 9ea02e8f1 ('virtio-rng-pci: Allow setting nvectors, so we can use MSI-X') bz: https://bugzilla.redhat.com/show_bug.cgi?id=2162569 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20230207174944.138255-1-dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-02vhost-user-rng: Back up vqs before cleaning up vhost_devAkihiko Odaki1-2/+3
vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free the memory pointed by the member. Fixes: 821d28b88f ("vhost-user-rng: Add vhost-user-rng implementation") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20230130140516.78078-1-akihiko.odaki@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-02vhost-user-i2c: Back up vqs before cleaning up vhost_devAkihiko Odaki1-2/+3
vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free the memory pointed by the member. Fixes: 7221d3b634 ("hw/virtio: add boilerplate for vhost-user-i2c device") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20230130140435.78049-1-akihiko.odaki@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-02vhost-user-gpio: Configure vhost_dev when connectingAkihiko Odaki1-4/+6
vhost_dev_cleanup(), called from vu_gpio_disconnect(), clears vhost_dev so vhost-user-gpio must set the members of vhost_dev each time connecting. do_vhost_user_cleanup() should also acquire the pointer to vqs directly from VHostUserGPIO instead of referring to vhost_dev as it can be called after vhost_dev_cleanup(). Fixes: 27ba7b027f ("hw/virtio: add boilerplate for vhost-user-gpio device") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20230130140320.77999-1-akihiko.odaki@daynix.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-02virtio-net: clear guest_announce feature if no cvq backendEugenio Pérez1-0/+15
Since GUEST_ANNOUNCE is emulated the feature bit could be set without backend support. This happens in the vDPA case. However, backend vDPA parent may not have CVQ support. This causes an incoherent feature set, and the driver may refuse to start. This happens in virtio-net Linux driver. This may be solved differently in the future. Qemu is able to emulate a CVQ just for guest_announce purposes, helping guest to notify the new location with vDPA devices that does not support it. However, this is left as a TODO as it is way more complex to backport. Tested with vdpa_net_sim, toggling manually VIRTIO_NET_F_CTRL_VQ in the driver and migrating it with x-svq=on. Fixes: 980003debddd ("vdpa: do not handle VIRTIO_NET_F_GUEST_ANNOUNCE in vhost-vdpa") Reported-by: Dawar, Gautam <gautam.dawar@amd.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230124161159.2182117-1-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: David Edmondson <david.edmondson@oracle.com> Reviewed-by: Gautam Dawar <gautam.dawar@amd.com> Tested-by: Gautam Dawar <gautam.dawar@amd.com> Tested-by: Lei Yang <leiyang@redhat.com>
2023-03-02Revert "hw/i386: pass RNG seed via setup_data entry"Michael S. Tsirkin5-29/+7
This reverts commit 67f7e426e53833a5db75b0d813e8d537b8a75bd2. Additionally to the automatic revert, I went over the code and dropped all mentions of legacy_no_rng_seed manually, effectively reverting a combination of 2 additional commits: commit ffe2d2382e5f1aae1abc4081af407905ef380311 Author: Jason A. Donenfeld <Jason@zx2c4.com> Date: Wed Sep 21 11:31:34 2022 +0200 x86: re-enable rng seeding via SetupData commit 3824e25db1a84fadc50b88dfbe27047aa2f7f85d Author: Gerd Hoffmann <kraxel@redhat.com> Date: Wed Aug 17 10:39:40 2022 +0200 x86: disable rng seeding via setup_data Fixes: 67f7e426e5 ("hw/i386: pass RNG seed via setup_data entry") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02Revert "x86: return modified setup_data only if read as memory, not as file"Michael S. Tsirkin2-42/+16
This reverts commit e935b735085dfa61d8e6d276b6f9e7687796a3c7. Fixes: e935b73508 ("x86: return modified setup_data only if read as memory, not as file") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02Revert "x86: use typedef for SetupData struct"Michael S. Tsirkin1-7/+7
This reverts commit eebb38a5633a77f5fa79d6486d5b2fcf8fbe3c07. Fixes: eebb38a563 ("x86: use typedef for SetupData struct") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02Revert "x86: reinitialize RNG seed on system reboot"Michael S. Tsirkin1-7/+0
This reverts commit 763a2828bf313ed55878b09759dc435355035f2e. Fixes: 763a2828bf ("x86: reinitialize RNG seed on system reboot") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02Revert "x86: re-initialize RNG seed when selecting kernel"Michael S. Tsirkin1-4/+1
This reverts commit cc63374a5a7c240b7d3be734ef589dabbefc7527. Fixes: cc63374a5a ("x86: re-initialize RNG seed when selecting kernel") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02Revert "x86: do not re-randomize RNG seed on snapshot load"Michael S. Tsirkin1-1/+1
This reverts commit 14b29fea742034186403914b4d013d0e83f19e78. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Fixes: 14b29fea74 ("x86: do not re-randomize RNG seed on snapshot load") Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02Revert "x86: don't let decompressed kernel image clobber setup_data"Michael S. Tsirkin3-47/+29
This reverts commit eac7a7791bb6d719233deed750034042318ffd56. Fixes: eac7a7791b ("x86: don't let decompressed kernel image clobber setup_data") Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-03-02hw/smbios: fix field corruption in type 4 tableJulia Suvorova1-3/+5
Since table type 4 of SMBIOS version 2.6 is shorter than 3.0, the strings which follow immediately after the struct fields have been overwritten by unconditional filling of later fields such as core_count2. Make these fields dependent on the SMBIOS version. Fixes: 05e27d74c7 ("hw/smbios: add core_count2 to smbios table type 4") Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2169904 Signed-off-by: Julia Suvorova <jusual@redhat.com> Message-Id: <20230223125747.254914-1-jusual@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Ani Sinha <ani@anisinha.ca> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-02-27hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVSPhilippe Mathieu-Daudé1-6/+6
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20210511041848.2743312-5-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/piix: Refactor pci_piix_init_ports as pci_piix_init_bus per busPhilippe Mathieu-Daudé1-20/+19
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-21-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msgPhilippe Mathieu-Daudé1-8/+7
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-20-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/piix: Remove unused includesPhilippe Mathieu-Daudé1-6/+1
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-19-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/pci: Unexport bmdma_active_if()Bernhard Beschow1-0/+6
The function is only used inside ide/pci.c, so doesn't need to be exported. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-18-philmd@linaro.org>
2023-02-27hw/ide/ioport: Remove unnecessary includesPhilippe Mathieu-Daudé1-10/+0
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-17-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h'Philippe Mathieu-Daudé1-1/+2
ide_get_geometry() and ide_get_bios_chs_trans() are only used by the TYPE_PC_MACHINE. "hw/ide.h" is a mixed bag of lost IDE declarations. In order to remove this (almost) pointless header soon, move these declarations to "hw/ide/internal.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230220091358.17038-18-philmd@linaro.org>
2023-02-27hw/ide: Rename idebus_active_if() -> ide_bus_active_if()Philippe Mathieu-Daudé4-16/+16
idebus_active_if() operates on a IDEBus; rename it as ide_bus_active_if() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/idebus_active_if/ide_bus_active_if/g' \ $(git grep -l idebus_active_if) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-16-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_init2() -> ide_bus_init_output_irq()Philippe Mathieu-Daudé10-11/+12
ide_init2() initializes a IDEBus, and set its output IRQ. To emphasize this, rename it as ide_bus_init_output_irq(). Mechanical change using: $ sed -i -e 's/ide_init2/ide_bus_init_output_irq/g' \ $(git grep -l ide_init2) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-15-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd()Philippe Mathieu-Daudé3-5/+5
ide_exec_cmd() operates on a IDEBus; rename it as ide_bus_exec_cmd() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_exec_cmd/ide_bus_exec_cmd/g' \ $(git grep -wl ide_exec_cmd) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-14-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_register_restart_cb -> ide_bus_register_restart_cbPhilippe Mathieu-Daudé7-7/+7
ide_register_restart_cb() operates on a IDEBus; rename it as ide_bus_register_restart_cb() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_register_restart_cb/ide_bus_register_restart_cb/g' \ $(git grep -l ide_register_restart_cb) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-13-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_create_drive() -> ide_bus_create_drive()Philippe Mathieu-Daudé8-10/+10
ide_create_drive() operates on a IDEBus; rename it as ide_bus_create_drive() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_create_drive/ide_bus_create_drive/g' \ $(git grep -wl ide_create_drive) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-12-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_set_irq() -> ide_bus_set_irq()Philippe Mathieu-Daudé3-29/+29
ide_set_irq() operates on a IDEBus; rename it as ide_bus_set_irq() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_set_irq/ide_bus_set_irq/g' \ $(git grep -l ide_set_irq) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-11-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Un-inline ide_set_irq()Philippe Mathieu-Daudé8-0/+15
Only include "hw/irq.h" where appropriate. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-10-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/atapi: Restrict 'scsi/constants.h' inclusionPhilippe Mathieu-Daudé1-0/+1
Only atapi.c requires the SCSI constants. No need to include it in all files including "hw/ide/internal.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-7-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2023-02-27hw/ide/isa: Remove intermediate ISAIDEState::irq variablePhilippe Mathieu-Daudé1-3/+1
The intermediate ISAIDEState::irq variable just add noise, remove it. Message-Id: <20230215112712.23110-6-philmd@linaro.org> Reviewed-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/isa: Extract TYPE_ISA_IDE declarations to 'hw/ide/isa.h'Philippe Mathieu-Daudé2-8/+7
"hw/ide.h" is a mixed bag of lost IDE declarations. Extract isa_ide_init() and the TYPE_ISA_IDE QOM declarations to a new "hw/ide/isa.h" header. Rename ISAIDEState::isairq as 'irqnum' to emphasize this is not a qemu_irq object but the number (index) of an ISA IRQ. Message-Id: <20230215112712.23110-5-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h'Philippe Mathieu-Daudé2-5/+2
"hw/ide.h" is a mixed bag of lost IDE declarations. Extract mmio_ide_init_drives() and the TYPE_MMIO_IDE QOM declarations to a new "hw/ide/mmio.h" header. Document the SysBus interface. Message-Id: <20230215112712.23110-4-philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/mmio: Use CamelCase for MMIO_IDE state namePhilippe Mathieu-Daudé1-15/+13
Following docs/devel/style.rst guidelines, rename MMIOIDEState as IdeMmioState. Having the structure name and its typedef named equally, we can manually convert from the old DECLARE_INSTANCE_CHECKER() macro to the more recent OBJECT_DECLARE_SIMPLE_TYPE(). Note, due to that name mismatch, this macro wasn't automatically converted during commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible"). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230220091358.17038-3-philmd@linaro.org>
2023-02-27hw/ide/ahci: Trace ncq write command as write instead of readFiona Ebner2-2/+3
Fixes: e4baa9f00b ("AHCI: Replace DPRINTF with trace-events") Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230217103130.42077-1-f.ebner@proxmox.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/i386/xen: Remove unused 'hw/ide.h' include from headerPhilippe Mathieu-Daudé1-1/+0
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20230220092707.22584-1-philmd@linaro.org>
2023-02-27hw/ppc/sam460ex: Correctly set MAL propertiesPhilippe Mathieu-Daudé1-2/+2
MAL properties are declared as uint8_t: static Property ppc4xx_mal_properties[] = { DEFINE_PROP_UINT8("txc-num", Ppc4xxMalState, txcnum, 0), DEFINE_PROP_UINT8("rxc-num", Ppc4xxMalState, rxcnum, 0), DEFINE_PROP_END_OF_LIST(), }; Correct the API use by setting the property using qdev_prop_set_uint8(). No behavioral change. Fixes: da116a8aab ("ppc/ppc405: QOM'ify MAL") Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230203145536.17585-7-philmd@linaro.org>
2023-02-27hw/display/sm501: Add fallbacks to pixman routinesBALATON Zoltan1-23/+52
Pixman may return false if it does not have a suitable implementation. Add fallbacks to handle such cases. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reported-by: Rene Engel <ReneEngel80@emailn.de> Tested-by: Rene Engel <ReneEngel80@emailn.de> Message-Id: <20ed9442a0146238254ccc340c0d1efa226c6356.1677445307.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/display/sm501: Implement more 2D raster operationsBALATON Zoltan1-1/+29
Add simple implementation for two raster operations that are used by AmigaOS which fixes graphics problems in some programs using these. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reported-by: Rene Engel <ReneEngel80@emailn.de> Tested-by: Rene Engel <ReneEngel80@emailn.de> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <17ef3c59dc7868f75034e9ebe21e2999c8f718d4.1677445307.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/display/sm501: Alias 'dma-offset' QOM property in chipset objectPhilippe Mathieu-Daudé2-6/+3
No need to use an intermediate 'dma-offset' property in the chipset object. Alias the property, so when the machine (here r2d-plus) sets the value on the chipset, it is propagated to the OHCI object. Note we can rename the chipset 'base' property as 'dma-offset' since the object is a non-user-creatable sysbus type. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <20230203145536.17585-12-philmd@linaro.org>
2023-02-27hw/display/sm501: Embed OHCI QOM child in chipsetPhilippe Mathieu-Daudé1-7/+10
Note this device doesn't implement unrealize(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <20230203145536.17585-11-philmd@linaro.org>
2023-02-27hw/usb/xhci-nec: Replace container_of() by NEC_XHCI() QOM cast macroPhilippe Mathieu-Daudé1-1/+1
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-8-philmd@linaro.org>
2023-02-27hw/usb/xhci-nec: Declare QOM macros for NEC_XHCIPhilippe Mathieu-Daudé1-2/+4
NEC_XHCI is a QOM object type. Declare its macros / typedefs using OBJECT_DECLARE_SIMPLE_TYPE(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-7-philmd@linaro.org>
2023-02-27hw/usb/uhci: Replace container_of() by UHCI_GET_CLASS() QOM macroPhilippe Mathieu-Daudé1-3/+2
By using the QOM UHCI_GET_CLASS() cast macro we don't to use the intermediate PCIDeviceClass variable. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-6-philmd@linaro.org>
2023-02-27hw/usb/uhci: Declare QOM macros using OBJECT_DECLARE_TYPE()Philippe Mathieu-Daudé2-3/+1
The automatic conversion done during commit a489d1951c ("Use OBJECT_DECLARE_TYPE when possible") missed this model because the typedefs are in a different file unit (hcd-uhci.c) than where the DECLARE_INSTANCE_CHECKER() is (hcd-uhci.h). Manually convert to OBJECT_DECLARE_TYPE(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-5-philmd@linaro.org>
2023-02-27hw/usb/ohci: Fix typoPhilippe Mathieu-Daudé1-6/+6
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <03599fd4db313ac4f651cceb43340109ad6a14b8.1676916640.git.balaton@eik.bme.hu>
2023-02-27hw/usb/ohci: Add trace points for register accessBALATON Zoltan2-0/+31
To help debugging add trace points that print values read from or written to the device's registers. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <1bb4985e5dfc1df5a290e77f76fd827ae3592ab7.1676916640.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/usb/ohci: Move a function next to where it is usedBALATON Zoltan1-30/+30
The ohci_port_set_if_connected() function is only used by ohci_port_set_status(), move next to it to have them at the same place. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <46411d4980ab0fba61ab0d2209a939fdc41eb573.1676916640.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/usb/ohci: Code style fix missing braces and extra parenthesisBALATON Zoltan1-46/+60
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <aaa3ddee99c7677d6cc137f637982e94267b99b6.1676916640.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/usb/ohci: Code style fix white space errorsBALATON Zoltan1-81/+79
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <c9b99b3555dcd03194a8950b810f5e1b4b4bd5d3.1676916640.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/usb/ohci: Code style fix commentsBALATON Zoltan1-50/+49
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <9b0aadedc7c4780fefdc27f14f72ac9003032fbf.1676916639.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>