Re: [PATCH v2 1/3] tests/tcg: Make the QEMU headers available to the tests

2023-04-25 Thread Ilya Leoshkevich
On Tue, 2023-04-25 at 09:19 +0200, Thomas Huth wrote: > On 24/04/2023 15.10, Ilya Leoshkevich wrote: > > On Mon, 2023-04-24 at 14:00 +0100, Alex Bennée wrote: > > > > > > Ilya Leoshkevich writes: > > > > > > > The QEMU headers contain macros and functions that are useful > > > > in > > > > the >

Re: [PATCH] pci: make ROM memory resizable

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On 24.04.23 23:36, Vladimir Sementsov-Ogievskiy wrote: On migration, on target we load local ROM file. But actual ROM content migrates through migration channel. Original ROM content from local file doesn't matter. But when size mismatch - we have an error like Size mismatch: :00:03.0/virt

[PATCH 0/3] ROM migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
Hi all! That's a substitution for my first attempt: [PATCH] pci: make ROM memory resizable <20230424203647.94614-1-vsement...@yandex-team.ru> Here I suggest another way to solve a problem, when we have existing running QEMU with old option ROM of small size and want to migrate to new environmen

[PATCH 1/3] pci: pci_add_option_rom(): improve style

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
Fix over-80 lines and missing curly brackets for if-operators, which are required by QEMU coding style. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pci.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index def5000

[PATCH 2/3] pci: pci_add_option_rom(): refactor: use g_autofree for path variable

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pci.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 4a61c8d24a..a442f8fce1 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2292,7 +2292,7 @@ static void pci_add_option_rom(PCIDev

[PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On incoming migration we have the following sequence to load option ROM: 1. On device realize we do normal load ROM from the file 2. Than, on incoming migration we rewrite ROM from the incoming RAM block. If sizes mismatch we fail. This is not ideal when we migrate to updated distribution: we

Re: [PULL 00/31] virtio,pc,pci: fixes, features, cleanups

2023-04-25 Thread Richard Henderson
On 4/25/23 08:44, Michael S. Tsirkin wrote: The following changes since commit c1eb2ddf0f8075faddc5f7c3d39feae3e8e9d6b4: Update version for v8.0.0 release (2023-04-19 17:27:13 +0100) are available in the Git repository at: https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_up

Re: [PULL 0/2] Block patches

2023-04-25 Thread Richard Henderson
On 4/24/23 18:55, Stefan Hajnoczi wrote: The following changes since commit ac5f7bf8e208cd7893dbb1a9520559e569a4677c: Merge tag 'migration-20230424-pull-request' ofhttps://gitlab.com/juan.quintela/qemu into staging (2023-04-24 15:00:39 +0100) are available in the Git repository at: ht

Re: [PATCH v19 02/21] s390x/cpu topology: add topology entries on CPU hotplug

2023-04-25 Thread Pierre Morel
On 4/25/23 11:27, Nina Schoetterl-Glausch wrote: On Tue, 2023-04-25 at 10:45 +0200, Pierre Morel wrote: On 4/24/23 17:32, Nina Schoetterl-Glausch wrote: On Fri, 2023-04-21 at 12:20 +0200, Pierre Morel wrote: On 4/20/23 10:59, Nina Schoetterl-Glausch wrote: On Mon, 2023-04-03 at 18:28 +0200,

Warning on Fedora 38

2023-04-25 Thread Juan Quintela
Hi I got this warning/error when switching to F38: In file included from /mnt/code/qemu/full/include/block/aio.h:21, from ../../../../mnt/code/qemu/full/util/async.c:28: ../../../../mnt/code/qemu/full/util/async.c: In function ‘aio_bh_poll’: /mnt/code/qemu/full/include/qemu/que

Re: [RFC PATCH 13/13] HACK: schedule fence return on main AIO context

2023-04-25 Thread Stefan Hajnoczi
On Fri, 21 Apr 2023 at 19:21, Gurchetan Singh wrote: > > On Fri, Apr 21, 2023 at 9:00 AM Stefan Hajnoczi wrote: > > > > On Thu, 20 Apr 2023 at 21:13, Gurchetan Singh > > wrote: > > > > > > gfxstream and both cross-domain (and even newer versions > > > virglrenderer: see VIRGL_RENDERER_ASYNC_FENC

Re: [PATCH v3 1/3] qapi: support updating expected test output via make

2023-04-25 Thread Markus Armbruster
Daniel P. Berrangé writes: > It is possible to pass --update to tests/qapi-schema/test-qapi.py > to make it update the output files on error. This is inconvenient > to achieve though when test-qapi.py is run indirectly by make/meson. > > Instead simply allow for an env variable to be set: > > $

Re: [PATCH v3 2/3] qapi: improve specificity of type/member descriptions

2023-04-25 Thread Markus Armbruster
Daniel P. Berrangé writes: > When describing member types always include the context of the > containing type. Although this is often redundant, in some cases > it will help to reduce ambiguity. This is no longer true. It was in v2. Suggest: Error messages describe object members, enumerati

Re: [PATCH v2] block/monitor/block-hmp-cmds.c: Fix crash when execute hmp_commit

2023-04-25 Thread Kevin Wolf
Am 24.04.2023 um 12:39 hat wanglian...@126.com geschrieben: > From: Wang Liang > > hmp_commit() calls blk_is_available() from a non-coroutine context (and in > the main loop). blk_is_available() is a co_wrapper_mixed_bdrv_rdlock > function, and in the non-coroutine context it calls AIO_WAIT_WHILE

Re: [PATCH] pci: make ROM memory resizable

2023-04-25 Thread Gerd Hoffmann
On Tue, Apr 25, 2023 at 03:26:50AM -0400, Michael S. Tsirkin wrote: > On Mon, Apr 24, 2023 at 11:36:47PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > On migration, on target we load local ROM file. But actual ROM content > > migrates through migration channel. Original ROM content from local > >

Re: Warning on Fedora 38

2023-04-25 Thread Peter Maydell
On Tue, 25 Apr 2023 at 12:37, Juan Quintela wrote: > > > Hi > > I got this warning/error when switching to F38: > > In file included from /mnt/code/qemu/full/include/block/aio.h:21, > from ../../../../mnt/code/qemu/full/util/async.c:28: > ../../../../mnt/code/qemu/full/util/async.

Re: [PATCH v3 10/10] hmp: Deprecate 'singlestep' member of StatusInfo

2023-04-25 Thread Peter Maydell
On Tue, 25 Apr 2023 at 13:10, Markus Armbruster wrote: > > Peter Maydell writes: > > > -# Notes: @singlestep is enabled through the GDB stub > > +# Notes: @singlestep is enabled on the command line with > > +#'-accel tcg,one-insn-per-tb=on', or with the HMP > > +#'one-insn-per-tb'

Re: [PATCH] pci: make ROM memory resizable

2023-04-25 Thread Igor Mammedov
On Tue, 25 Apr 2023 13:55:55 +0300 Vladimir Sementsov-Ogievskiy wrote: > On 24.04.23 23:36, Vladimir Sementsov-Ogievskiy wrote: > > On migration, on target we load local ROM file. But actual ROM content > > migrates through migration channel. Original ROM content from local > > file doesn't matte

Re: [PATCH v3 2/3] qapi: improve specificity of type/member descriptions

2023-04-25 Thread Daniel P . Berrangé
On Mon, Apr 24, 2023 at 01:38:21PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > When describing member types always include the context of the > > containing type. Although this is often redundant, in some cases > > it will help to reduce ambiguity. > > This is no longer tr

Re: [PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Michael S. Tsirkin
On Tue, Apr 25, 2023 at 01:56:03PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On incoming migration we have the following sequence to load option > ROM: > > 1. On device realize we do normal load ROM from the file > > 2. Than, on incoming migration we rewrite ROM from the incoming RAM >bloc

[PATCH 5/6] iotests: Fix cluster size in parallels images tests (131)

2023-04-25 Thread Alexander Ivanov
In this test cluster size is 64k, but modern tools generate images with cluster size 1M. Calculate cluster size using track field from image header. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/131 | 5 - tests/qemu-iotests/131.out | 44 +++---

[PATCH 4/6] iotests: Refactor tests of parallels images checks (131)

2023-04-25 Thread Alexander Ivanov
Replace hardcoded numbers by variables. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/131 | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/tests/qemu-iotests/131 b/tests/qemu-iotests/131 index a847692b4c..601546c84c 100755 --- a/tests/q

[PATCH 3/6] iotests: Add test for BAT entries duplication check

2023-04-25 Thread Alexander Ivanov
Fill a parallels image with a pattern and write another pattern to the second cluster. Corrupt the image and check if the pattern changes. Repair the image and check the patterns on guest and host sides. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-checks | 32 +

[PATCH 2/6] iotests: Add leak check test for parallels format

2023-04-25 Thread Alexander Ivanov
Write a pattern to the last cluster, extend the image by 1 claster, repair and check that the last cluster still has the same pattern. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-checks | 27 +++ tests/qemu-iotests/tests/parallels-checks.out | 22 ++

[PATCH 6/6] iotests/parallels: Fix test 131 after repair was added to parallels_open()

2023-04-25 Thread Alexander Ivanov
Images repairing in parallels_open() was added, thus parallels tests fail. Access to an image leads to repairing the image. Further image check don't detect any corruption. Remove reads after image creation in test 131. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/131 | 6 ++

[PATCH 6/6] iotests: Fix test 131 after repair was added to parallels_open()

2023-04-25 Thread Alexander Ivanov
Images repairing in parallels_open() was added, thus parallels tests fail. Access to an image leads to repairing the image. Further image check don't detect any corruption. Remove reads after image creation in test 131. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/131 | 6 ++

[PATCH 0/6] iotests: Add and fix tests for parallels images

2023-04-25 Thread Alexander Ivanov
Add iotests for new functionality for parallels images. Fix existing tests. Alexander Ivanov (6): iotests: Add out-of-image check test for parallels format iotests: Add leak check test for parallels format iotests: Add test for BAT entries duplication check iotests: Refactor tests of paral

[PATCH 1/6] iotests: Add out-of-image check test for parallels format

2023-04-25 Thread Alexander Ivanov
Fill the image with a pattern to generate entries in the BAT, set the first BAT entry outside the image, try to read the corrupted image. At the image opening it should be repaired, check for zeroes in the first cluster. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-chec

Re: [PATCH] pci: make ROM memory resizable

2023-04-25 Thread Michael S. Tsirkin
On Tue, Apr 25, 2023 at 11:34:09AM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 25.04.23 10:43, Michael S. Tsirkin wrote: > > On Tue, Apr 25, 2023 at 03:26:54AM -0400, Michael S. Tsirkin wrote: > > > On Mon, Apr 24, 2023 at 11:36:47PM +0300, Vladimir Sementsov-Ogievskiy > > > wrote: > > > > On

[PULL 10/25] include/block: fixup typos

2023-04-25 Thread Kevin Wolf
From: Wilfred Mallawa Fixup a few minor typos Signed-off-by: Wilfred Mallawa Message-Id: <20230313003744.55476-1-wilfred.mall...@opensource.wdc.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/aio-wait.h | 2 +- include/blo

[PULL 23/25] qcow2: mark various functions as coroutine_fn and GRAPH_RDLOCK

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Functions that can do I/O (including calling bdrv_is_allocated and bdrv_block_status functions) are prime candidates for being coroutine_fns. Make the change for those that are themselves called only from coroutine_fns. Also annotate that they are called with the graph rdloc

[PULL 03/25] block: protect BlockBackend->queued_requests with a lock

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi The CoQueue API offers thread-safety via the lock argument that qemu_co_queue_wait() and qemu_co_enter_next() take. BlockBackend currently does not make use of the lock argument. This means that multiple threads submitting I/O requests can corrupt the CoQueue's QSIMPLEQ. Ad

[PULL 09/25] monitor: convert monitor_cleanup() to AIO_WAIT_WHILE_UNLOCKED()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi monitor_cleanup() is called from the main loop thread. Calling AIO_WAIT_WHILE(qemu_get_aio_context(), ...) from the main loop thread is equivalent to AIO_WAIT_WHILE_UNLOCKED(NULL, ...) because neither unlocks the AioContext and the latter's assertion that we're in the main l

[PULL 13/25] io_uring: use LuringState from the running thread

2023-04-25 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Remove usage of aio_context_acquire by always submitting asynchronous AIO to the current thread's LuringState. In order to prevent mistakes from the caller side, avoid passing LuringState in luring_io_{plug/unplug} and luring_co_submit, and document the functions

[PULL 08/25] hmp: convert handle_hmp_command() to AIO_WAIT_WHILE_UNLOCKED()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi The HMP monitor runs in the main loop thread. Calling AIO_WAIT_WHILE(qemu_get_aio_context(), ...) from the main loop thread is equivalent to AIO_WAIT_WHILE_UNLOCKED(NULL, ...) because neither unlocks the AioContext and the latter's assertion that we're in the main loop succe

[PULL 20/25] 9pfs: mark more coroutine_fns

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Message-Id: <20230309084456.304669-6-pbonz...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/9pfs/9p.h| 4 ++-- hw/9pfs/codir.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/9p.h b/

Re: [PATCH v3 10/10] hmp: Deprecate 'singlestep' member of StatusInfo

2023-04-25 Thread Markus Armbruster
Peter Maydell writes: > On Tue, 25 Apr 2023 at 13:10, Markus Armbruster wrote: >> >> Peter Maydell writes: >> >> > -# Notes: @singlestep is enabled through the GDB stub >> > +# Notes: @singlestep is enabled on the command line with >> > +#'-accel tcg,one-insn-per-tb=on', or with the HMP

[PULL 04/25] block: don't acquire AioContext lock in bdrv_drain_all()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi There is no need for the AioContext lock in bdrv_drain_all() because nothing in AIO_WAIT_WHILE() needs the lock and the condition is atomic. AIO_WAIT_WHILE_UNLOCKED() has no use for the AioContext parameter other than performing a check that is nowadays already done by the

[PULL 12/25] linux-aio: use LinuxAioState from the running thread

2023-04-25 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Remove usage of aio_context_acquire by always submitting asynchronous AIO to the current thread's LinuxAioState. In order to prevent mistakes from the caller side, avoid passing LinuxAioState in laio_io_{plug/unplug} and laio_co_submit, and document the functions

[PULL 16/25] vvfat: mark various functions as coroutine_fn

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Functions that can do I/O are prime candidates for being coroutine_fns. Make the change for those that are themselves called only from coroutine_fns. In addition, coroutine_fns should do I/O using bdrv_co_*() functions, for which it is required to hold the BlockDriverState

[PULL 11/25] block: add missing coroutine_fn to bdrv_sum_allocated_file_size()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi Not a coroutine_fn, you say? static int64_t bdrv_sum_allocated_file_size(BlockDriverState *bs) { BdrvChild *child; int64_t child_size, sum = 0; QLIST_FOREACH(child, &bs->children, next) { if (child->role & (BDRV_CHILD_DATA | BDRV_CHILD_METAD

[PULL 02/25] block: make BlockBackend->disable_request_queuing atomic

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi This field is accessed by multiple threads without a lock. Use explicit qatomic_read()/qatomic_set() calls. There is no need for acquire/release because blk_set_disable_request_queuing() doesn't provide any guarantees (it helps that it's used at BlockBackend creation time an

Re: [PATCH] pci: make ROM memory resizable

2023-04-25 Thread Gerd Hoffmann
Hi, > > If you supply your own versions for some reason you must make sure > > they have identical size on all host machines. > > on my ubuntu 22.04: > > dpkg -L ipxe-qemu | grep efi-virtio > /usr/lib/ipxe/qemu/efi-virtio.rom > > ls -lthr /usr/lib/ipxe/qemu/efi-virtio.rom > -rw-r--r-- 1 roo

[PULL 01/25] block: make BlockBackend->quiesce_counter atomic

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi The main loop thread increments/decrements BlockBackend->quiesce_counter when drained sections begin/end. The counter is read in the I/O code path. Therefore this field is used to communicate between threads without a lock. Acquire/release are not necessary because the Bloc

[PULL 15/25] thread-pool: avoid passing the pool parameter every time

2023-04-25 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito thread_pool_submit_aio() is always called on a pool taken from qemu_get_current_aio_context(), and that is the only intended use: each pool runs only in the same thread that is submitting work to it, it can't run anywhere else. Therefore simplify the thread_pool_

[PULL 19/25] nbd: mark more coroutine_fns, do not use co_wrappers

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- nbd/server.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 4f5c42f84d..e239c2890f 1

Re: [PATCH v3 2/3] qapi: improve specificity of type/member descriptions

2023-04-25 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Mon, Apr 24, 2023 at 01:38:21PM +0200, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> >> > When describing member types always include the context of the >> > containing type. Although this is often redundant, in some cases >> > it will help to reduce

[PULL 06/25] block: convert bdrv_graph_wrlock() to AIO_WAIT_WHILE_UNLOCKED()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi The following conversion is safe and does not change behavior: GLOBAL_STATE_CODE(); ... - AIO_WAIT_WHILE(qemu_get_aio_context(), ...); + AIO_WAIT_WHILE_UNLOCKED(NULL, ...); Since we're in GLOBAL_STATE_CODE(), qemu_get_aio_context() is our home thread's AioC

[PULL 18/25] mirror: make mirror_flush a coroutine_fn, do not use co_wrappers

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini mirror_flush calls a mixed function blk_flush but it is only called from mirror_run; so call the coroutine version and make mirror_flush a coroutine_fn too. Signed-off-by: Paolo Bonzini Message-Id: <20230309084456.304669-4-pbonz...@redhat.com> Reviewed-by: Kevin Wolf Signed

Re: [PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On 25.04.23 16:07, Vladimir Sementsov-Ogievskiy wrote: On 25.04.23 15:43, Michael S. Tsirkin wrote: On Tue, Apr 25, 2023 at 01:56:03PM +0300, Vladimir Sementsov-Ogievskiy wrote: On incoming migration we have the following sequence to load option ROM: 1. On device realize we do normal load ROM

[PULL 17/25] blkdebug: add missing coroutine_fn annotation

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Message-Id: <20230309084456.304669-3-pbonz...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/blkdebug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 9

[PATCH] hw/arm/bcm2835_property: Implement "get command line" message

2023-04-25 Thread Daniel Bertalan
This query copies the kernel command line into the message buffer. It was previously stubbed out to return empty, this commit makes it reflect the arguments specified with `-append`. I observed the following peculiarities on my Pi 3B+: - If the buffer is shorter than the string, the response heade

[PULL 22/25] tests: mark more coroutine_fns

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Message-Id: <20230309084456.304669-8-pbonz...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/unit/test-thread-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-thread-pool.c b/te

[PULL 14/25] thread-pool: use ThreadPool from the running thread

2023-04-25 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Use qemu_get_current_aio_context() where possible, since we always submit work to the current thread anyways. We want to also be sure that the thread submitting the work is the same as the one processing the pool, to avoid adding synchronization to the pool list.

Re: [PATCH v3 2/3] qapi: improve specificity of type/member descriptions

2023-04-25 Thread Daniel P . Berrangé
On Tue, Apr 25, 2023 at 03:17:52PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Mon, Apr 24, 2023 at 01:38:21PM +0200, Markus Armbruster wrote: > >> Daniel P. Berrangé writes: > >> > >> > When describing member types always include the context of the > >> > containing t

[PULL 05/25] block: convert blk_exp_close_all_type() to AIO_WAIT_WHILE_UNLOCKED()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi There is no change in behavior. Switch to AIO_WAIT_WHILE_UNLOCKED() instead of AIO_WAIT_WHILE() to document that this code has already been audited and converted. The AioContext argument is already NULL so aio_context_release() is never called anyway. Reviewed-by: Philippe

[PULL 24/25] vmdk: make vmdk_is_cid_valid a coroutine_fn

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini Functions that can do I/O are prime candidates for being coroutine_fns. Make the change for the one that is itself called only from coroutine_fns. Unfortunately vmdk does not use a coroutine_fn for the bulk of the open (like qcow2 does) so vmdk_read_cid cannot have the same

[PULL 07/25] block: convert bdrv_drain_all_begin() to AIO_WAIT_WHILE_UNLOCKED()

2023-04-25 Thread Kevin Wolf
From: Stefan Hajnoczi Since the AioContext argument was already NULL, AIO_WAIT_WHILE() was never going to unlock the AioContext. Therefore it is possible to replace AIO_WAIT_WHILE() with AIO_WAIT_WHILE_UNLOCKED(). Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-b

[PULL 21/25] qemu-pr-helper: mark more coroutine_fns

2023-04-25 Thread Kevin Wolf
From: Paolo Bonzini do_sgio can suspend via the coroutine function thread_pool_submit_co, so it has to be coroutine_fn as well---and the same is true of all its direct and indirect callers. Signed-off-by: Paolo Bonzini Message-Id: <20230309084456.304669-7-pbonz...@redhat.com> Reviewed-by: Kevin

[PULL 00/25] Block layer patches

2023-04-25 Thread Kevin Wolf
The following changes since commit ac5f7bf8e208cd7893dbb1a9520559e569a4677c: Merge tag 'migration-20230424-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-04-24 15:00:39 +0100) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstr

[PULL 25/25] block/monitor/block-hmp-cmds.c: Fix crash when execute hmp_commit

2023-04-25 Thread Kevin Wolf
From: Wang Liang hmp_commit() calls blk_is_available() from a non-coroutine context (and in the main loop). blk_is_available() is a co_wrapper_mixed_bdrv_rdlock function, and in the non-coroutine context it calls AIO_WAIT_WHILE(), which crashes if the aio_context lock is not taken before. Resolv

Re: [PATCH] async: Suppress GCC13 false positive in aio_bh_poll()

2023-04-25 Thread Juan Quintela
Cédric Le Goater wrote: > From: Cédric Le Goater > > GCC13 reports an error : > > ../util/async.c: In function ‘aio_bh_poll’: > include/qemu/queue.h:303:22: error: storing the address of local > variable ‘slice’ in ‘*ctx.bh_slice_list.sqh_last’ > [-Werror=dangling-pointer=] > 303 | (head)->

Re: [PATCH] async: Suppress GCC13 false positive in aio_bh_poll()

2023-04-25 Thread Daniel P . Berrangé
On Tue, Apr 25, 2023 at 03:22:15PM +0200, Juan Quintela wrote: > Cédric Le Goater wrote: > > From: Cédric Le Goater > > > > GCC13 reports an error : > > > > ../util/async.c: In function ‘aio_bh_poll’: > > include/qemu/queue.h:303:22: error: storing the address of local > > variable ‘slice’ in ‘*c

Re: [PATCH v3 0/3] qapi: allow unions to contain further unions

2023-04-25 Thread Markus Armbruster
Daniel P. Berrangé writes: > Currently it is not possible for a union type to contain a > further union as one (or more) of its branches. This relaxes > that restriction and adds the calls needed to validate field > name uniqueness as unions are flattened. Queued. Thanks!

Re: [PATCH v2 0/3] qapi: allow unions to contain further unions

2023-04-25 Thread Markus Armbruster
Het Gala writes: > Hi, this is just a reminder mail to check if Daniel has plan to post v3 > patches in the coming days. Would like these patches to get merged in qemu as > soon as possible, so that we all can focus on restructuring of 'migrate' QAPI > :) I just queued v3. Expect a pull requ

Re: [PATCH v3 2/7] target/i386: Add new EPYC CPU versions with updated cache_info

2023-04-25 Thread Maksim Davydov
On 4/24/23 19:33, Babu Moger wrote: From: Michael Roth Introduce new EPYC cpu versions: EPYC-v4 and EPYC-Rome-v3. The only difference vs. older models is an updated cache_info with the 'complex_indexing' bit unset, since this bit is not currently defined for AMD and may cause problems should

Re: [PATCH] async: Suppress GCC13 false positive in aio_bh_poll()

2023-04-25 Thread Daniel P . Berrangé
On Tue, Apr 25, 2023 at 02:24:59PM +0100, Daniel P. Berrangé wrote: > On Tue, Apr 25, 2023 at 03:22:15PM +0200, Juan Quintela wrote: > > Cédric Le Goater wrote: > > > From: Cédric Le Goater > > > > > > GCC13 reports an error : > > > > > > ../util/async.c: In function ‘aio_bh_poll’: > > > include/

Re: [PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Michael S. Tsirkin
On Tue, Apr 25, 2023 at 04:19:12PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 25.04.23 16:07, Vladimir Sementsov-Ogievskiy wrote: > > On 25.04.23 15:43, Michael S. Tsirkin wrote: > > > On Tue, Apr 25, 2023 at 01:56:03PM +0300, Vladimir Sementsov-Ogievskiy > > > wrote: > > > > On incoming migr

[RFC PATCH 3/3] docs/about/deprecated: Deprecate the qemu-system-i386 binary

2023-04-25 Thread Thomas Huth
Aside from not supporting KVM on 32-bit hosts, the qemu-system-x86_64 binary is a proper superset of the qemu-system-i386 binary. And with the 32-bit x86 host support being deprecated now, it is possible to deprecate the qemu-system-i386 binary now, too. With regards to 32-bit KVM support in the x

[RFC PATCH 0/3] Deprecate the qemu-system-i386 binary

2023-04-25 Thread Thomas Huth
Allow running qemu-system-x86_64 in 32-bit-only mode (by renaming or symlinking the binary to "qemu-system-i386"). After doing this, qemu-system-x86_64 should be a proper superset of qemu-system-i386 (apart from 32-bit KVM support, which however is not really required anymore, see https://lore.kern

[RFC PATCH 1/3] cpu: Add a way to detect 32-bit mode from argv0

2023-04-25 Thread Thomas Huth
In the future, we might want to avoid compiling certain targets separately for 32-bit mode (i.e. -i386, -arm and -ppc) where the 64-bit variant is a superset of the 32-bit variant. But it would be good to provide a way to mimic the 32-bit behavior via the program name in case the users need this co

[RFC PATCH 2/3] target/i386/cpu: Allow to limit the 64-bit binary to 32-bit mode only

2023-04-25 Thread Thomas Huth
qemu-system-x86_64 is pretty much a proper superset of qemu-system-i386, so in the long run, it does not make too much sense that we continuously build two binaries here. However, some people still might want to start QEMU in a mode that limits the environment to 32-bit. Thus allow qemu-system-x86_

Re: [PATCH 0/3] hw/arm: Fix raspi, aspeed bootloaders on big-endian hosts

2023-04-25 Thread Cédric Le Goater
On 4/24/23 17:27, Peter Maydell wrote: Both the raspi and aspeed boards load their secondary CPU bootloader code in a way that only works on little-endian hosts. This patchset fixes that by making them both use the write_bootloader() function in boot.c, which gets endianness-handling right. Patc

Re: [PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On 25.04.23 15:43, Michael S. Tsirkin wrote: On Tue, Apr 25, 2023 at 01:56:03PM +0300, Vladimir Sementsov-Ogievskiy wrote: On incoming migration we have the following sequence to load option ROM: 1. On device realize we do normal load ROM from the file 2. Than, on incoming migration we rewrite

Re: [PATCH] pci: make ROM memory resizable

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On 25.04.23 15:10, Gerd Hoffmann wrote: On Tue, Apr 25, 2023 at 03:26:50AM -0400, Michael S. Tsirkin wrote: On Mon, Apr 24, 2023 at 11:36:47PM +0300, Vladimir Sementsov-Ogievskiy wrote: On migration, on target we load local ROM file. But actual ROM content migrates through migration channel. Or

Re: [PATCH v3 13/57] tcg/aarch64: Introduce HostAddress

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 07:40, Richard Henderson wrote: Collect the 3 potential parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 86 +--- 1 file changed, 59 insertions(

Re: [PATCH v3 19/57] tcg/loongarch64: Introduce HostAddress

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 07:40, Richard Henderson wrote: Collect the 2 parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 55 +--- 1 file changed, 30 insertions(+), 25 del

Re: [PATCH v3 24/57] tcg/ppc: Introduce HostAddress

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 07:40, Richard Henderson wrote: Collect the parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st} to use it. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 90 +--- 1 file changed, 47 insertions(+), 43 deletions(-)

Re: [PATCH v3 30/57] tcg/s390x: Introduce HostAddress

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 07:40, Richard Henderson wrote: Collect the 3 potential parts of the host address into a struct. Reorg tcg_out_qemu_{ld,st}_direct to use it. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 109 - 1 file changed, 60 insertions(

newbie

2023-04-25 Thread slack uj
Hello World! I am a total newbie!

Re: [PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Igor Mammedov
On Tue, 25 Apr 2023 09:32:54 -0400 "Michael S. Tsirkin" wrote: > On Tue, Apr 25, 2023 at 04:19:12PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > On 25.04.23 16:07, Vladimir Sementsov-Ogievskiy wrote: > > > On 25.04.23 15:43, Michael S. Tsirkin wrote: > > > > On Tue, Apr 25, 2023 at 01:56:03

Re: [QEMU][PATCH v4 1/4] MAINTAINERS: Include canfd tests under Xilinx CAN

2023-04-25 Thread Francisco Iglesias
On [2023 Apr 24] Mon 23:34:30, Vikram Garhwal wrote: > Signed-off-by: Vikram Garhwal > Reviewed-by: Peter Maydell Reviewed-by: Francisco Iglesias > --- > MAINTAINERS | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 24154f5721..c3dbacb

Re: [PATCH v19 14/21] tests/avocado: s390x cpu topology core

2023-04-25 Thread Pierre Morel
On 4/4/23 11:21, Cédric Le Goater wrote: On 4/3/23 18:28, Pierre Morel wrote: Introduction of the s390x cpu topology core functions and basic tests. We test the corelation between the command line and the QMP results in query-cpus-fast for various CPU topology. Signed-off-by: Pierre Morel

Re: [PATCH v2 1/3] hw/i2c: add mctp core

2023-04-25 Thread Corey Minyard
On Tue, Apr 25, 2023 at 08:35:38AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add an abstract MCTP over I2C endpoint model. This implements MCTP > control message handling as well as handling the actual I2C transport > (packetization). > > Devices are intended to derive from this and im

Re: [PATCH v3 1/7] target/i386: allow versioned CPUs to specify new cache_info

2023-04-25 Thread Moger, Babu
Hi Robert, On 4/25/23 00:42, Robert Hoo wrote: > Babu Moger 于2023年4月25日周二 00:42写道: >> >> From: Michael Roth >> >> New EPYC CPUs versions require small changes to their cache_info's. > > Do you mean, for the real HW of EPYC CPU, each given model, e.g. Rome, > has HW version updates periodically?

Re: [PATCH v3 2/7] target/i386: Add new EPYC CPU versions with updated cache_info

2023-04-25 Thread Moger, Babu
Hi Maksim, On 4/25/23 07:51, Maksim Davydov wrote: > > On 4/24/23 19:33, Babu Moger wrote: >> From: Michael Roth >> >> Introduce new EPYC cpu versions: EPYC-v4 and EPYC-Rome-v3. >> The only difference vs. older models is an updated cache_info with >> the 'complex_indexing' bit unset, since this

Re: [QEMU][PATCH v4 3/4] xlnx-versal: Connect Xilinx VERSAL CANFD controllers

2023-04-25 Thread Francisco Iglesias
Hi Vikram, On [2023 Apr 24] Mon 23:34:32, Vikram Garhwal wrote: > Connect CANFD0 and CANFD1 on the Versal-virt machine and update > xlnx-versal-virt > document with CANFD command line examples. > > Signed-off-by: Vikram Garhwal > Reviewed-by: Peter Maydell > --- > docs/system/arm/xlnx-versal-

Re: [PATCH 2/2] hw/net/allwinner-sun8i-emac: Correctly byteswap descriptor fields

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 18:50, Peter Maydell wrote: In allwinner-sun8i-emac we just read directly from guest memory into a host FrameDescriptor struct and back. This only works on little-endian hosts. Reading and writing of descriptors is already abstracted into functions; make those functions also handle t

Re: [PATCH 1/2] hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 18:50, Peter Maydell wrote: In allwinner_sdhost_process_desc() we just read directly from guest memory into a host TransferDescriptor struct and back. This only works on little-endian hosts. Abstract the reading and writing of descriptors into functions that handle the byte-swapping so

Re: [PATCH] hw/intc/allwinner-a10-pic: Don't use set_bit()/clear_bit()

2023-04-25 Thread Philippe Mathieu-Daudé
On 24/4/23 17:28, Peter Maydell wrote: The Allwinner PIC model uses set_bit() and clear_bit() to update the values in its irq_pending[] array when an interrupt arrives. However it is using these functions wrongly: they work on an array of type 'long', and it is passing an array of type 'uint32_t

Re: [PATCH 0/3] hw/arm: Fix raspi, aspeed bootloaders on big-endian hosts

2023-04-25 Thread Philippe Mathieu-Daudé
Cédric Le Goater (2): hw/arm/boot: Make write_bootloader() public as arm_write_bootloader() hw/arm/aspeed: Use arm_write_bootloader() to write the bootloader Peter Maydell (1): hw/arm/raspi: Use arm_write_bootloader() to write boot code include/hw/arm/boot.h | 49 +

Re: [PATCH 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On 25.04.23 17:55, Igor Mammedov wrote: On Tue, 25 Apr 2023 09:32:54 -0400 "Michael S. Tsirkin" wrote: On Tue, Apr 25, 2023 at 04:19:12PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 25.04.23 16:07, Vladimir Sementsov-Ogievskiy wrote: On 25.04.23 15:43, Michael S. Tsirkin wrote: On Tue, Ap

[PATCH] multifd: Avoid busy-wait in multifd_send_pages()

2023-04-25 Thread manish.mishra
multifd_send_sync_main() posts request on the multifd channel but does not call sem_wait() on channels_ready semaphore, making the channels_ready semaphore count keep increasing. As a result, sem_wait() on channels_ready in multifd_send_pages() is always non-blocking hence multifd_send_pages() keep

[PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
On incoming migration we have the following sequence to load option ROM: 1. On device realize we do normal load ROM from the file 2. Than, on incoming migration we rewrite ROM from the incoming RAM block. If sizes mismatch we fail. This is not ideal when we migrate to updated distribution: we

[PATCH v2 0/3] ROM migration

2023-04-25 Thread Vladimir Sementsov-Ogievskiy
Hi all! v2: simply ignore romfile on incoming migration when romsize is specified. Here I suggest a way to solve a problem, when we have existing running QEMU with old option ROM of small size and want to migrate to new environment where we don't have this ROM file. All the details are in patch

[PATCH v20 07/21] target/s390x/cpu topology: activate CPU topology

2023-04-25 Thread Pierre Morel
The KVM capability KVM_CAP_S390_CPU_TOPOLOGY is used to activate the S390_FEAT_CONFIGURATION_TOPOLOGY feature and the topology facility in the host CPU model for the guest in the case the topology is available in QEMU and in KVM. The feature is disabled by default and fenced for SE (secure executi

[PATCH v20 17/21] tests/avocado: s390x cpu topology test dedicated CPU

2023-04-25 Thread Pierre Morel
A dedicated CPU in vertical polarization can only have a high entitlement. Let's check this. Signed-off-by: Pierre Morel --- tests/avocado/s390_topology.py | 34 ++ 1 file changed, 34 insertions(+) diff --git a/tests/avocado/s390_topology.py b/tests/avocado/s390_

[PATCH v20 10/21] machine: adding s390 topology to info hotpluggable-cpus

2023-04-25 Thread Pierre Morel
S390 topology adds books and drawers topology containers. Let's add these to the HMP information for hotpluggable cpus. Signed-off-by: Pierre Morel --- hw/core/machine-hmp-cmds.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c ind

[PATCH v20 06/21] s390x/cpu topology: interception of PTF instruction

2023-04-25 Thread Pierre Morel
When the host supports the CPU topology facility, the PTF instruction with function code 2 is interpreted by the SIE, provided that the userland hypervisor activates the interpretation by using the KVM_CAP_S390_CPU_TOPOLOGY KVM extension. The PTF instructions with function code 0 and 1 are interce

[PATCH v20 02/21] s390x/cpu topology: add topology entries on CPU hotplug

2023-04-25 Thread Pierre Morel
The topology information are attributes of the CPU and are specified during the CPU device creation. On hot plug we: - calculate the default values for the topology for drawers, books and sockets in the case they are not specified. - verify the CPU attributes - check that we have still room on t

<    1   2   3   4   5   >