aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-21Update version for v6.1.0-rc0 releasev6.1.0-rc0Peter Maydell
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-07-21Merge remote-tracking branch ↵Peter Maydell
'remotes/stefanha-gitlab/tags/block-pull-request' into staging Pull request Stefano's performance regression fix for commit 2558cb8dd4 ("linux-aio: increasing MAX_EVENTS to a larger hardcoded value"). # gpg: Signature made Wed 21 Jul 2021 14:12:47 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha-gitlab/tags/block-pull-request: linux-aio: limit the batch size using `aio-max-batch` parameter iothread: add aio-max-batch parameter iothread: generalize iothread_set_param/iothread_get_param Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-07-21linux-aio: limit the batch size using `aio-max-batch` parameterStefano Garzarella
When there are multiple queues attached to the same AIO context, some requests may experience high latency, since in the worst case the AIO engine queue is only flushed when it is full (MAX_EVENTS) or there are no more queues plugged. Commit 2558cb8dd4 ("linux-aio: increasing MAX_EVENTS to a larger hardcoded value") changed MAX_EVENTS from 128 to 1024, to increase the number of in-flight requests. But this change also increased the potential maximum batch to 1024 elements. When there is a single queue attached to the AIO context, the issue is mitigated from laio_io_unplug() that will flush the queue every time is invoked since there can't be others queue plugged. Let's use the new `aio-max-batch` IOThread parameter to mitigate this issue, limiting the number of requests in a batch. We also define a default value (32): this value is obtained running some benchmarks and it represents a good tradeoff between the latency increase while a request is queued and the cost of the io_submit(2) system call. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-id: 20210721094211.69853-4-sgarzare@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2021-07-21iothread: add aio-max-batch parameterStefano Garzarella
The `aio-max-batch` parameter will be propagated to AIO engines and it will be used to control the maximum number of queued requests. When there are in queue a number of requests equal to `aio-max-batch`, the engine invokes the system call to forward the requests to the kernel. This parameter allows us to control the maximum batch size to reduce the latency that requests might accumulate while queued in the AIO engine queue. If `aio-max-batch` is equal to 0 (default value), the AIO engine will use its default maximum batch size value. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-id: 20210721094211.69853-3-sgarzare@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2021-07-21iothread: generalize iothread_set_param/iothread_get_paramStefano Garzarella
Changes in preparation for next patches where we add a new parameter not related to the poll mechanism. Let's add two new generic functions (iothread_set_param and iothread_get_param) that we use to set and get IOThread parameters. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-id: 20210721094211.69853-2-sgarzare@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2021-07-21Merge remote-tracking branch ↵Peter Maydell
'remotes/cleber-gitlab/tags/python-next-pull-request' into staging Acceptance Tests - Fix for tests/acceptance/virtio-gpu.py to match the change in device name - Fix for failure caught by tests/acceptance/multiprocess.py PS: While not a maintainer for the subsystem in PATCH 7, I'm including it as a one-off to facilitate the landing of the fix as discussed in the mailing list. # gpg: Signature made Wed 21 Jul 2021 00:26:17 BST # gpg: using RSA key 7ABB96EB8B46B94D5E0FE9BB657E8D33A5F209F3 # gpg: Good signature from "Cleber Rosa <crosa@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 * remotes/cleber-gitlab/tags/python-next-pull-request: remote/memory: Replace share parameter with ram_flags tests/acceptance/virtio-gpu.py: provide kernel and initrd hashes tests/acceptance/virtio-gpu.py: use virtio-vga-gl tests/acceptance/virtio-gpu.py: combine kernel command line tests/acceptance/virtio-gpu.py: combine CPU tags tests/acceptance/virtio-gpu.py: combine x86_64 arch tags tests/acceptance/virtio-gpu.py: use require_accelerator() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-07-20remote/memory: Replace share parameter with ram_flagsYang Zhong
Fixes: d5015b801340 ("softmmu/memory: Pass ram_flags to qemu_ram_alloc_from_fd()") Signed-off-by: Yang Zhong <yang.zhong@intel.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com> Reviewed-by: Peter Xu <peterx@redhat.com> Message-Id: <20210709052800.63588-1-yang.zhong@intel.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20tests/acceptance/virtio-gpu.py: provide kernel and initrd hashesCleber Rosa
By providing kernel and initrd hashes, the test guarantees the integrity of the images used and avoids the warnings set by fetch_asset() when hashes are lacking. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-7-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20tests/acceptance/virtio-gpu.py: use virtio-vga-glCleber Rosa
Since 49afbca3b, the use of an optional virgl renderer is not available anymore, and since b36eb8860f, the way to choose a GL based rendered is to use the "virtio-vga-gl" device. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-6-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20tests/acceptance/virtio-gpu.py: combine kernel command lineCleber Rosa
Both tests use the same kernel command line arguments, so there's no need to have a common and then an additional set of arguments. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-5-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20tests/acceptance/virtio-gpu.py: combine CPU tagsCleber Rosa
Like previously done with the arch tags, all tests use the same CPU value so it's possible to combine them at the class level. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-4-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20tests/acceptance/virtio-gpu.py: combine x86_64 arch tagsCleber Rosa
The test class in question is x86_64 specific, so it's possible to set the tags at the class level. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-3-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20tests/acceptance/virtio-gpu.py: use require_accelerator()Cleber Rosa
Since efe30d501 there's a shorthand for requiring specific accelerators, and canceling the test if it's not available. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-2-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2021-07-20Merge remote-tracking branch 'remotes/philmd/tags/kconfig-20210720' into stagingPeter Maydell
Kconfig patches queue Various Kconfig patches collected during v6.1 development cycle. # gpg: Signature made Tue 20 Jul 2021 19:11:32 BST # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * remotes/philmd/tags/kconfig-20210720: hw/tricore: fix inclusion of tricore_testboard hw/ppc/Kconfig: Add dependency PEGASOS2 -> ATI_VGA hw/isa/vt82c686: Add missing Kconfig dependency (runtime error) hw/isa/vt82c686: Add missing Kconfig dependencies (build error) hw/pci-host/Kconfig: Add missing dependency MV64361 -> I8259 hw/ppc/Kconfig: Add missing dependency E500 -> DS1338 RTC hw/riscv/Kconfig: Restrict NUMA to Virt & Spike machines hw/riscv/Kconfig: Add missing dependency MICROCHIP_PFSOC -> SERIAL hw/arm/Kconfig: Add missing SDHCI symbol to FSL_IMX25 hw/arm/Kconfig: Remove unused DS1338 symbol from i.MX25 PDK Board hw/arm/Kconfig: Add missing dependency NPCM7XX -> SMBUS hw/ide/Kconfig: Add missing dependency PCI -> IDE_QDEV hw/i386/Kconfig: Add missing Kconfig dependency (runtime error) hw/acpi/Kconfig: Add missing Kconfig dependencies (build error) hw/acpi: Do not restrict ACPI core routines to x86 architecture hw/mips: Express dependencies of the Boston machine with Kconfig hw/mips: Add dependency MIPS_CPS -> MIPS_ITU Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-07-20hw/tricore: fix inclusion of tricore_testboardAlex Bennée
Because commit f4063f9c319e39 ("meson: Introduce target-specific Kconfig") ended being merged after commit 582079c9d27fc8cfff9f49 ("hw/tricore: Add testdevice for tests in tests/tcg/"), we inadvertently added a symbol clash causing the build not to include the testboard needed for check-tcg. Fixes: f4063f9c31 ("meson: Introduce target-specific Kconfig") Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210720114057.32053-2-alex.bennee@linaro.org> [PMD: Updated description mentioning commits merged] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2021-07-20hw/ppc/Kconfig: Add dependency PEGASOS2 -> ATI_VGAPhilippe Mathieu-Daudé
The ATI VGA device isn't a requisite for the Pegasos2 machine because Linux only uses the serial console; see commit ba7e5ac18e7 ("hw/ppc: Add emulation of Genesi/bPlan Pegasos II") for rationale. Using the default devices we don't have any problem: $ qemu-system-ppc -M pegasos2 qemu-system-ppc: standard VGA not available But when trying to explicitly use the ATI device we get an error: $ qemu-system-ppc -M pegasos2 -vga none -bios pegasos2.rom -device ati-vga,romfile= qemu-system-ppc: -device ati-vga,romfile=: 'ati-vga' is not a valid device model name Add it as an implicit Kconfig dependency. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210515173716.358295-13-philmd@redhat.com> Acked-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2021-07-20hw/isa/vt82c686: Add missing Kconfig dependency (runtime error)Philippe Mathieu-Daudé
When building the Pegasos2 machine stand-alone we get: $ qemu-system-ppc -M pegasos2 -bios pegasos2.rom ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL) Bail out! ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL) Looking at the backtraces: Thread 1 "qemu-system-ppc" received signal SIGABRT, Aborted. (gdb) bt #0 0x00007ffff53877d5 in raise () at /lib64/libc.so.6 #1 0x00007ffff5370895 in abort () at /lib64/libc.so.6 #2 0x00007ffff6dc4b6c in g_assertion_message_expr.cold () at /lib64/libglib-2.0.so.0 #3 0x00007ffff6e229ff in g_assertion_message_expr () at /lib64/libglib-2.0.so.0 #4 0x0000555555a0c8f4 in object_new_with_type (type=0x0) at qom/object.c:714 #5 0x0000555555a0c9d5 in object_new (typename=0x555555c7afe4 "isa-pit") at qom/object.c:747 #6 0x0000555555a053b8 in qdev_new (name=0x555555c7afe4 "isa-pit") at hw/core/qdev.c:153 #7 0x00005555557cdd05 in isa_new (name=0x555555c7afe4 "isa-pit") at hw/isa/isa-bus.c:160 #8 0x00005555557cf518 in i8254_pit_init (bus=0x55555603d140, base=64, isa_irq=0, alt_irq=0x0) at include/hw/timer/i8254.h:54 #9 0x00005555557d12f9 in vt8231_realize (d=0x5555563d9770, errp=0x7fffffffcc28) at hw/isa/vt82c686.c:704 (gdb) bt #0 0x00007ffff54bd7d5 in raise () at /lib64/libc.so.6 #1 0x00007ffff54a6895 in abort () at /lib64/libc.so.6 #2 0x00005555558f7796 in object_new (typename=0x555555ad4889 "isa-parallel") at qom/object.c:749 #3 object_new (typename=type0x555555ad4889 "isa-parallel") at qom/object.c:743 #4 0x00005555558f0d46 in qdev_new (name=0x555555ad4889 "isa-parallel") at hw/core/qdev.c:153 #5 0x000055555576b669 in isa_new (name=0x555555ad4889 "isa-parallel") at hw/isa/isa-bus.c:160 #6 0x000055555576bbe8 in isa_superio_realize (dev=0x555555f15910, errp=<optimized out>) at hw/isa/isa-superio.c:54 #7 0x000055555576d5ed in via_superio_realize (d=0x555555f15910, errp=0x7fffffffcb30) at hw/isa/vt82c686.c:292 #8 0x00005555558f12c1 in device_set_realized (obj=<optimized out>, ...) at hw/core/qdev.c:761 #9 0x00005555558f5066 in property_set_bool (obj=0x555555f15910, ..., errp=0x7fffffffcbb0) at qom/object.c:2262 #10 0x00005555558f7f38 in object_property_set (obj=0x555555f15910, name=0x555555b1b1e3 "realized", ...) at qom/object.c:1407 #11 0x00005555558fb2d0 in object_property_set_qobject (obj=0x555555f15910, name=0x555555b1b1e3 "realized", ...) at qom/qom-qobject.c:28 #12 0x00005555558f8525 in object_property_set_bool (obj=0x555555f15910, name=0x555555b1b1e3 "realized", ...) at qom/object.c:1477 #13 0x00005555558f18ee in qdev_realize (dev=0x555555f15910, bus=0x55555602a610, errp=<optimized out>) at hw/core/qdev.c:389 #14 0x00005555558f197f in qdev_realize_and_unref (dev=0x555555f15910, bus=0x55555602a610, errp=<optimized out>) at hw/core/qdev.c:396 #15 0x000055555576b709 in isa_realize_and_unref (errp=<optimized out>, bus=0x55555602a610, dev=0x555555f15910) at hw/isa/isa-bus.c:179 #16 isa_create_simple (bus=0x55555602a610, name=0x555555adc33b "vt8231-superio") at hw/isa/isa-bus.c:173 #17 0x000055555576d9b7 in vt8231_realize (d=0x555556186a50, errp=<optimized out>) at hw/isa/vt82c686.c:706 The "isa-pit" type (TYPE_I8254) and "isa-parallel" are missing. Add them. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-Id: <20210515173716.358295-12-philmd@redhat.com> [PMD: Added "isa-parallel" later]
2021-07-20hw/isa/vt82c686: Add missing Kconfig dependencies (build error)Philippe Mathieu-Daudé
The VT82C686 device model misses various dependencies: /usr/bin/ld: libcommon.fa.p/hw_isa_vt82c686.c.o: in function `vt82c686b_realize': hw/isa/vt82c686.c:622: undefined reference to `i8259_init' /usr/bin/ld: hw/isa/vt82c686.c:624: undefined reference to `i8257_dma_init' /usr/bin/ld: hw/isa/vt82c686.c:627: undefined reference to `mc146818_rtc_init' Add them. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-Id: <20210515173716.358295-11-philmd@redhat.com>
2021-07-20hw/pci-host/Kconfig: Add missing dependency MV64361 -> I8259Philippe Mathieu-Daudé
Looking at the MV64341 model source, there is a dependency on the 8259 interrupt controller: 523 case MV64340_PCI_1_INTERRUPT_ACKNOWLEDGE_VIRTUAL_REG: 524 /* FIXME: Should this be sent via the PCI bus somehow? */ 525 if (s->gpp_int_level && (s->gpp_value & BIT(31))) { 526 ret = pic_read_irq(isa_pic); 527 } 528 break; Add it to Kconfig to avoid the following build failure: /usr/bin/ld: libcommon.fa.p/hw_pci-host_mv64361.c.o: in function `mv64361_read': hw/pci-host/mv64361.c:526: undefined reference to `isa_pic' /usr/bin/ld: hw/pci-host/mv64361.c:526: undefined reference to `pic_read_irq' Fixes: dcdf98a9015 ("hw/pci-host: Add emulation of Marvell MV64361 PPC system controller") Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20210515173716.358295-10-philmd@redhat.com>
2021-07-20Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell
Block layer patches - mirror: Fix active mirror deadlock - replication: Fix crashes due to operations on wrong BdrvChild - configure: Add option to use driver whitelist even in tools - vvfat: Fix crash when opening image read-write - export: Fix crash in error path with fixed-iothread=false # gpg: Signature made Tue 20 Jul 2021 16:09:23 BST # gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6 # gpg: issuer "kwolf@redhat.com" # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: iotests/307: Test iothread conflict for exports block/export: Conditionally ignore set-context error block/vvfat: fix: drop backing replication: Remove workaround replication: Properly attach children replication: Reduce usage of s->hidden_disk and s->secondary_disk replication: Remove s->active_disk block: Add option to use driver whitelist even in tools block/mirror: fix active mirror dead-lock in mirror_wait_on_conflicts iotest 151: add test-case that shows active mirror dead-lock block/mirror: set .co for active-write MirrorOp objects Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-07-20iotests/307: Test iothread conflict for exportsMax Reitz
Passing fixed-iothread=true should make iothread conflicts fatal, whereas fixed-iothread=false should not. Combine the second case with an error condition that is checked after the iothread is handled, to verify that qemu does not crash if there is such an error after changing the iothread failed. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210624083825.29224-3-mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20block/export: Conditionally ignore set-context errorMax Reitz
When invoking block-export-add with some iothread and fixed-iothread=false, and changing the node's iothread fails, the error is supposed to be ignored. However, it is still stored in *errp, which is wrong. If a second error occurs, the "*errp must be NULL" assertion in error_setv() fails: qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion `*errp == NULL' failed. So if fixed-iothread=false, we should ignore the error by passing NULL to bdrv_try_set_aio_context(). Fixes: f51d23c80af73c95e0ce703ad06a300f1b3d63ef ("block/export: add iothread and fixed-iothread options") Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210624083825.29224-2-mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20block/vvfat: fix: drop backingVladimir Sementsov-Ogievskiy
Most probably this fake backing child doesn't work anyway (see notes about it in a8a4d15c1c34d). Still, since 25f78d9e2de528473d52 drivers are required to set .supports_backing if they want to call bdrv_set_backing_hd, so now vvfat just doesn't work because of this check. Let's finally drop this fake backing file. Fixes: 25f78d9e2de528473d52acfcf7acdfb64e3453d4 Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210715124853.13335-1-vsementsov@virtuozzo.com> Tested-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20replication: Remove workaroundLukas Straub
Remove the workaround introduced in commit 6ecbc6c52672db5c13805735ca02784879ce8285 "replication: Avoid blk_make_empty() on read-only child". It is not needed anymore since s->hidden_disk is guaranteed to be writable when secondary_do_checkpoint() runs. Because replication_start(), _do_checkpoint() and _stop() are only called by COLO migration code and COLO-migration activates all disks via bdrv_invalidate_cache_all() before it calls these functions. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <d3acfad43879e9f376bffa7dd797ae74d0a7c81a.1626619393.git.lukasstraub2@web.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20replication: Properly attach childrenLukas Straub
The replication driver needs access to the children block-nodes of it's child so it can issue bdrv_make_empty() and bdrv_co_pwritev() to manage the replication. However, it does this by directly copying the BdrvChilds, which is wrong. Fix this by properly attaching the block-nodes with bdrv_attach_child() and requesting the required permissions. This ultimatively fixes a potential crash in replication_co_writev(), because it may write to s->secondary_disk if it is in state BLOCK_REPLICATION_FAILOVER_FAILED, without requesting write permissions first. And now the workaround in secondary_do_checkpoint() can be removed. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <5d0539d729afb8072d0d7cde977c5066285591b4.1626619393.git.lukasstraub2@web.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20replication: Reduce usage of s->hidden_disk and s->secondary_diskLukas Straub
In preparation for the next patch, initialize s->hidden_disk and s->secondary_disk later and replace access to them with local variables in the places where they aren't initialized yet. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <1eb9dc179267207d9c7eccaeb30761758e32e9ab.1626619393.git.lukasstraub2@web.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20replication: Remove s->active_diskLukas Straub
s->active_disk is bs->file. Remove it and use local variables instead. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <2534f867ea9be5b666dfce19744b7d4e2b96c976.1626619393.git.lukasstraub2@web.de> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20hw/ppc/Kconfig: Add missing dependency E500 -> DS1338 RTCPhilippe Mathieu-Daudé
Commit 7abb479c7ab ("PPC: E500: Add FSL I2C controller and integrate RTC with it") added a global dependency on the DS1338 model, instead of a machine one (via Kconfig). This gives trouble when building standalone machines not exposing I2C bus: The following clauses were found for DS1338 CONFIG_DS1338=y config DS1338 depends on I2C Fix by selecting the DS1338 symbol in the single machine requiring it, the E500. Fixes: 7abb479c7ab ("PPC: E500: Add FSL I2C controller and integrate RTC with it") Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210513163858.3928976-9-philmd@redhat.com>
2021-07-20hw/riscv/Kconfig: Restrict NUMA to Virt & Spike machinesPhilippe Mathieu-Daudé
Only the Virt and Spike machines use NUMA. Add a RISCV_NUMA Kconfig symbol and only have these machines select it. Adapt the Meson file to only built it if required. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210515173716.358295-8-philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2021-07-20hw/riscv/Kconfig: Add missing dependency MICROCHIP_PFSOC -> SERIALPhilippe Mathieu-Daudé
Commit a8fb0a500a6 ("hw/char: Add Microchip PolarFire SoC MMUART emulation") added a dependency on the SERIAL model, but forgot to add the Kconfig selector. Add the dependency to the MCHP_PFSOC_MMUART symbol to fix when building the MICROCHIP_PFSOC machine stand-alone: /usr/bin/ld: libcommon.fa.p/hw_char_mchp_pfsoc_mmuart.c.o: in function `mchp_pfsoc_mmuart_create': hw/char/mchp_pfsoc_mmuart.c:79: undefined reference to `serial_mm_init' Fixes: a8fb0a500a6 ("hw/char: Add Microchip PolarFire SoC MMUART emulation") Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210515173716.358295-7-philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-07-20hw/arm/Kconfig: Add missing SDHCI symbol to FSL_IMX25Philippe Mathieu-Daudé
Commit bfae1772c43 ("hw/arm/fsl-imx25: Wire up eSDHC controllers") added a dependency on the TYPE_IMX_USDHC model, but forgot to add the Kconfig selector. Fix that to solve when built stand-alone: $ qemu-system-arm -M imx25-pdk qemu-system-arm: missing object type 'imx-usdhc' Aborted (core dumped) Fixes: bfae1772c43 ("hw/arm/fsl-imx25: Wire up eSDHC controllers") Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210515173716.358295-6-philmd@redhat.com>
2021-07-20hw/arm/Kconfig: Remove unused DS1338 symbol from i.MX25 PDK BoardPhilippe Mathieu-Daudé
In commit c4f00daa5b3 ("imx25-pdk: create ds1338 for qtest inside the test") we removed the DS1338 device from the i.MX25 machine but forgot to remove it in the machine Kconfig definitions, do it now. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210515173716.358295-5-philmd@redhat.com>
2021-07-20hw/arm/Kconfig: Add missing dependency NPCM7XX -> SMBUSPhilippe Mathieu-Daudé
The TYPE_NPCM7XX_SMBUS device model exposes an SMBus, but this isn't advertised with proper Kconfig symbol, leading to an early build failure when building NPCM7XX machines standalone: The following clauses were found for AT24C config AT24C depends on I2C select AT24C if NPCM7XX Fix by adding SMBUS to NPCM7XX. Fixes: 94e77879395 ("hw/i2c: Implement NPCM7XX SMBus Module Single Mode") Reviewed-by: Hao Wu <wuhaotsh@google.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210515173716.358295-4-philmd@redhat.com>
2021-07-20hw/ide/Kconfig: Add missing dependency PCI -> IDE_QDEVPhilippe Mathieu-Daudé
The pci_ide_create_devs() function is declared i hw/ide/qdev.c: $ git grep ide_create_drive hw/ide/pci.c:491: ide_create_drive(d->bus + bus[i], unit[i], hd_table[i]); hw/ide/qdev.c:127:IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive) include/hw/ide/internal.h:653:IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive); Fix the correct symbol dependency to avoid build failure when deselecting some machines: /usr/bin/ld: libcommon.fa.p/hw_ide_pci.c.o: in function `pci_ide_create_devs': hw/ide/pci.c:491: undefined reference to `ide_create_drive' Fixes: 8f01b41e109 ("ide: express dependencies with Kconfig") Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210515173716.358295-3-philmd@redhat.com> Acked-by: John Snow <jsnow@redhat.com>
2021-07-20hw/i386/Kconfig: Add missing Kconfig dependency (runtime error)Philippe Mathieu-Daudé
When building the 'microvm' machine stand-alone we get: $ qemu-system-x86_64 -M microvm ** ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL) Bail out! ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL) Aborted (core dumped) Looking at the backtrace: (gdb) bt #3 0x00007ff2330492ff in g_assertion_message_expr () at /lib64/libglib-2.0.so.0 #4 0x000055a878c18341 in object_new_with_type (type=<optimized out>) at qom/object.c:714 #5 0x000055a878c18399 in object_new (typename=typename@entry=0x55a878dec36a "isa-pit") at qom/object.c:747 #6 0x000055a878cc8146 in qdev_new (name=name@entry=0x55a878dec36a "isa-pit") at hw/core/qdev.c:153 #7 0x000055a878a8b439 in isa_new (name=name@entry=0x55a878dec36a "isa-pit") at hw/isa/isa-bus.c:160 #8 0x000055a878adb782 in i8254_pit_init (base=64, isa_irq=0, alt_irq=0x0, bus=0x55a87ab38760) at include/hw/timer/i8254.h:54 #9 microvm_devices_init (mms=0x55a87ac36800) at hw/i386/microvm.c:263 #10 microvm_machine_state_init (machine=<optimized out>) at hw/i386/microvm.c:471 #11 0x000055a878a944ab in machine_run_board_init (machine=machine@entry=0x55a87ac36800) at hw/core/machine.c:1239 The "isa-pit" type (TYPE_I8254) is missing. Add it. Fixes: 0ebf007ddac ("hw/i386: Introduce the microvm machine type") Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20210616204328.2611406-24-philmd@redhat.com>
2021-07-20hw/acpi/Kconfig: Add missing Kconfig dependencies (build error)Philippe Mathieu-Daudé
The 'microvm' machine misses various dependencies: /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_setup_microvm': hw/i386/acpi-microvm.c:247: undefined reference to `acpi_build_tables_init' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_build_microvm': hw/i386/acpi-microvm.c:192: undefined reference to `bios_linker_loader_alloc' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `build_dsdt_microvm': hw/i386/acpi-microvm.c:121: undefined reference to `init_aml_allocator' /usr/bin/ld: hw/i386/acpi-microvm.c:124: undefined reference to `acpi_data_push' /usr/bin/ld: hw/i386/acpi-microvm.c:126: undefined reference to `aml_scope' /usr/bin/ld: hw/i386/acpi-microvm.c:129: undefined reference to `build_ged_aml' /usr/bin/ld: hw/i386/acpi-microvm.c:131: undefined reference to `acpi_dsdt_add_power_button' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_dsdt_add_virtio': hw/i386/acpi-microvm.c:77: undefined reference to `aml_string' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `build_dsdt_microvm': hw/i386/acpi-microvm.c:138: undefined reference to `aml_scope' /usr/bin/ld: hw/i386/acpi-microvm.c:149: undefined reference to `build_header' /usr/bin/ld: hw/i386/acpi-microvm.c:152: undefined reference to `free_aml_allocator' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_build_microvm': hw/i386/acpi-microvm.c:202: undefined reference to `acpi_add_table' /usr/bin/ld: hw/i386/acpi-microvm.c:203: undefined reference to `build_fadt' /usr/bin/ld: hw/i386/acpi-microvm.c:206: undefined reference to `acpi_add_table' /usr/bin/ld: hw/i386/acpi-microvm.c:207: undefined reference to `acpi_build_madt' /usr/bin/ld: hw/i386/acpi-microvm.c:212: undefined reference to `build_xsdt' /usr/bin/ld: hw/i386/acpi-microvm.c:224: undefined reference to `build_rsdp' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_setup_microvm': hw/i386/acpi-microvm.c:251: undefined reference to `acpi_add_rom_blob' /usr/bin/ld: hw/i386/acpi-microvm.c:253: undefined reference to `acpi_add_rom_blob' /usr/bin/ld: hw/i386/acpi-microvm.c:255: undefined reference to `acpi_add_rom_blob' /usr/bin/ld: hw/i386/acpi-microvm.c:258: undefined reference to `acpi_build_tables_cleanup' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_dsdt_add_pci': hw/i386/acpi-microvm.c:105: undefined reference to `acpi_dsdt_add_gpex' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. Update the ACPI_HW_REDUCED symbol to select ACPI_MEMORY_HOTPLUG / ACPI_NVDIMM / ACPI. Fixes: 8045df14bcc ("microvm/acpi: add minimal acpi support") Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20210616204328.2611406-23-philmd@redhat.com>
2021-07-20hw/acpi: Do not restrict ACPI core routines to x86 architecturePhilippe Mathieu-Daudé
ACPI core routines (in core.c) are not really x86-specific. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20210616204328.2611406-21-philmd@redhat.com>
2021-07-20hw/mips: Express dependencies of the Boston machine with KconfigPhilippe Mathieu-Daudé
Boston is built around a Xilinx FPGA, which includes a PCIe root port and an UART. An Intel EG20T PCH connects the I/O peripherals, but only the SATA bus is emulated. Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Paul Burton <pburton@wavecomp.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190311005618.19007-6-philmd@redhat.com>
2021-07-20hw/mips: Add dependency MIPS_CPS -> MIPS_ITUPhilippe Mathieu-Daudé
The Inter-Thread Communication Unit (ITU, introduced in commit 34fa7e83e11) is part of the Coherent Processing System (CPS), as describe in commit 408294352ad: Make ITU available in the system if CPU supports multithreading and is part of CPS. Have CPS select ITU in Kconfig to avoid the following build failure: /usr/bin/ld: libqemu-mips64el-softmmu.fa.p/hw_mips_cps.c.o: in function `mips_cps_realize': hw/mips/cps.c:104: undefined reference to `mips_itu_get_tag_region' Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190311005618.19007-5-philmd@redhat.com>
2021-07-20block: Add option to use driver whitelist even in toolsKevin Wolf
Currently, the block driver whitelists are only applied for the system emulator. All other binaries still give unrestricted access to all block drivers. There are use cases where this made sense because the main concern was avoiding customers running VMs on less optimised block drivers and getting bad performance. Allowing the same image format e.g. as a target for 'qemu-img convert' is not a problem then. However, if the concern is the supportability of the driver in general, either in full or when used read-write, not applying the list driver whitelist in tools doesn't help - especially since qemu-nbd and qemu-storage-daemon now give access to more or less the same operations in block drivers as running a system emulator. In order to address this, introduce a new configure option that enforces the driver whitelist in all binaries. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210709164141.254097-1-kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20block/mirror: fix active mirror dead-lock in mirror_wait_on_conflictsVladimir Sementsov-Ogievskiy
It's possible that requests start to wait each other in mirror_wait_on_conflicts(). To avoid it let's use same technique as in block/io.c in bdrv_wait_serialising_requests_locked() / bdrv_find_conflicting_request(): don't wait on intersecting request if it is already waiting for some other request. For details of the dead-lock look at testIntersectingActiveIO() test-case which we actually fixing now. Fixes: d06107ade0ce74dc39739bac80de84b51ec18546 Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210702211636.228981-4-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20iotest 151: add test-case that shows active mirror dead-lockVladimir Sementsov-Ogievskiy
There is a dead-lock in active mirror: when we have parallel intersecting requests (note that non intersecting requests may be considered intersecting after aligning to mirror granularity), it may happen that request A waits request B in mirror_wait_on_conflicts() and request B waits for A. Look at the test for details. Test now dead-locks, that's why it's disabled. Next commit will fix mirror and enable the test. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210702211636.228981-3-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-20block/mirror: set .co for active-write MirrorOp objectsVladimir Sementsov-Ogievskiy
This field is unused, but it very helpful for debugging. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210702211636.228981-2-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-07-19Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2021-07-19' ↵Peter Maydell
into staging Block patches for 6.1-rc0: - Make blkdebug's suspend/resume handling robust (and thread-safe) # gpg: Signature made Mon 19 Jul 2021 18:25:48 BST # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2021-07-19: blkdebug: protect rules and suspended_reqs with a lock block/blkdebug: remove new_state field and instead use a local variable blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE blkdebug: track all actions blkdebug: move post-resume handling to resume_req_by_tag blkdebug: refactor removal of a suspended request Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-07-19blkdebug: protect rules and suspended_reqs with a lockEmanuele Giuseppe Esposito
First, categorize the structure fields to identify what needs to be protected and what doesn't. We essentially need to protect only .state, and the 3 lists in BDRVBlkdebugState. Then, add the lock and mark the functions accordingly. Co-developed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20210614082931.24925-7-eesposit@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2021-07-19block/blkdebug: remove new_state field and instead use a local variableEmanuele Giuseppe Esposito
There seems to be no benefit in using a field. Replace it with a local variable, and move the state update before the yields. The state update has do be done before the yields because now using a local variable does not allow the new updated state to be visible by the other yields. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20210614082931.24925-6-eesposit@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2021-07-19blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFEEmanuele Giuseppe Esposito
That would be unsafe in case a rule other than the current one is removed while the coroutine has yielded. Keep FOREACH_SAFE because suspend_request deletes the current rule. After this patch, *all* matching rules are deleted before suspending the coroutine, rather than just one. This doesn't affect the existing testcases. Use actions_count to see how many yield to issue. Co-developed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210614082931.24925-5-eesposit@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2021-07-19blkdebug: track all actionsEmanuele Giuseppe Esposito
Add a counter for each action that a rule can trigger. This is mainly used to keep track of how many coroutine_yield() we need to perform after processing all rules in the list. Co-developed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210614082931.24925-4-eesposit@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2021-07-19blkdebug: move post-resume handling to resume_req_by_tagEmanuele Giuseppe Esposito
We want to move qemu_coroutine_yield() after the loop on rules, because QLIST_FOREACH_SAFE is wrong if the rule list is modified while the coroutine has yielded. Therefore move the suspended request to the heap and clean it up from the remove side. All that is left is for blkdebug_debug_event to handle the yielding. Co-developed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210614082931.24925-3-eesposit@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2021-07-19blkdebug: refactor removal of a suspended requestEmanuele Giuseppe Esposito
Extract to a separate function. Do not rely on FOREACH_SAFE, which is only "safe" if the *current* node is removed---not if another node is removed. Instead, just walk the entire list from the beginning when asked to resume all suspended requests with a given tag. Co-developed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210614082931.24925-2-eesposit@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>