Re: [PATCH v3A 1/6] target/i386: add support for FRED in CPUID enumeration

2023-12-21 Thread Zhao Liu
On Thu, Dec 21, 2023 at 07:03:36PM -0800, Xin Li wrote: > Date: Thu, 21 Dec 2023 19:03:36 -0800 > From: Xin Li > Subject: [PATCH v3A 1/6] target/i386: add support for FRED in CPUID > enumeration > X-Mailer: git-send-email 2.43.0 > > FRED, i.e., the Intel flexible return and event delivery

Re: [PATCH 11/16] target/riscv: move 'cbom_blocksize' to riscv_cpu_properties[]

2023-12-21 Thread Richard Henderson
On 12/22/23 04:51, Daniel Henrique Barboza wrote: +const PropertyInfo prop_cbom_blksize = { static? Same for cboz in the next patch. r~

Re: [PATCH 17/24] target/ppc/excp_helper: Avoid 'abi_ptr' in system emulation

2023-12-21 Thread Nicholas Piggin
On Tue Dec 12, 2023 at 7:19 AM AEST, Philippe Mathieu-Daudé wrote: > 'abi_ptr' is a user specific type. The system emulation > equivalent is 'target_ulong'. Use it in ppc_ldl_code() > to emphasis this is not an user emulation function. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas

Re: [PATCH 03/24] target: Define TCG_GUEST_DEFAULT_MO in 'cpu-param.h'

2023-12-21 Thread Nicholas Piggin
On Tue Dec 12, 2023 at 7:19 AM AEST, Philippe Mathieu-Daudé wrote: > accel/tcg/ files requires the following definitions: > > - TARGET_LONG_BITS > - TARGET_PAGE_BITS > - TARGET_PHYS_ADDR_SPACE_BITS > - TCG_GUEST_DEFAULT_MO > > The first 3 are defined in "cpu-param.h". The last one > in

Re: [PATCH 09/24] hw/ppc/spapr_hcall: Remove unused 'exec/exec-all.h' included header

2023-12-21 Thread Nicholas Piggin
On Tue Dec 12, 2023 at 7:19 AM AEST, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin > --- > hw/ppc/spapr_hcall.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c > index 522a2396c7..fcefd1d1c7

Re: [PATCH] ppc/spapr: Fix ubsan warning with unaligned pointer access

2023-12-21 Thread Alexey Kardashevskiy
On 20/12/2023 12:45, Richard Henderson wrote: On 12/16/23 16:14, Daniel Hoffman wrote: Found while running QTest with UBsan. Unaligned pointers appear to be valid, so moving the read to an explicit memcpy to an intermediate. ---   hw/ppc/vof.c | 5 -   1 file changed, 4 insertions(+), 1

[PATCH v3A 1/6] target/i386: add support for FRED in CPUID enumeration

2023-12-21 Thread Xin Li
FRED, i.e., the Intel flexible return and event delivery architecture, defines simple new transitions that change privilege level (ring transitions). The new transitions defined by the FRED architecture are FRED event delivery and, for returning from events, two FRED return instructions. FRED

Re: [PATCH v3 52/70] i386/tdx: handle TDG.VP.VMCALL

2023-12-21 Thread Xiaoyao Li
On 12/21/2023 7:05 PM, Daniel P. Berrangé wrote: On Wed, Nov 15, 2023 at 02:15:01AM -0500, Xiaoyao Li wrote: From: Isaku Yamahata For GetQuote, delegate a request to Quote Generation Service. Add property "quote-generation-socket" to tdx-guest, whihc is a property of type SocketAddress to

Re: [PATCH v2 65/71] cpu-target: Constify VMState

2023-12-21 Thread Zhao Liu
On Thu, Dec 21, 2023 at 02:16:46PM +1100, Richard Henderson wrote: > Date: Thu, 21 Dec 2023 14:16:46 +1100 > From: Richard Henderson > Subject: [PATCH v2 65/71] cpu-target: Constify VMState > X-Mailer: git-send-email 2.34.1 > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard

RE: [PULL 20/47] backends/iommufd: Introduce the iommufd object

2023-12-21 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Friday, December 22, 2023 12:01 AM >Subject: Re: [PULL 20/47] backends/iommufd: Introduce the iommufd object > >[ ... ] > > >> +static void iommufd_backend_init(Object *obj) >> +{ >> +IOMMUFDBackend *be =

Re: [PATCH v2 31/71] hw/i386: Constify VMState

2023-12-21 Thread Zhao Liu
On Thu, Dec 21, 2023 at 02:16:12PM +1100, Richard Henderson wrote: > Date: Thu, 21 Dec 2023 14:16:12 +1100 > From: Richard Henderson > Subject: [PATCH v2 31/71] hw/i386: Constify VMState > X-Mailer: git-send-email 2.34.1 > > Signed-off-by: Richard Henderson > --- Reviewed-by: Zhao Liu >

Re: [PATCH v2 08/71] target/i386: Constify VMState in machine.c

2023-12-21 Thread Zhao Liu
On Thu, Dec 21, 2023 at 02:15:49PM +1100, Richard Henderson wrote: > Date: Thu, 21 Dec 2023 14:15:49 +1100 > From: Richard Henderson > Subject: [PATCH v2 08/71] target/i386: Constify VMState in machine.c > X-Mailer: git-send-email 2.34.1 > > Signed-off-by: Richard Henderson > --- Reviewed-by:

Re: [PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname()

2023-12-21 Thread Zhao Liu
On Thu, Dec 21, 2023 at 04:29:31PM -0500, Eric Farman wrote: > Date: Thu, 21 Dec 2023 16:29:31 -0500 > From: Eric Farman > Subject: Re: [PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname() > > On Fri, 2023-12-22 at 01:19 +0800, Zhao Liu wrote: > > From: Zhao Liu > > > > As commit

[PULL v2 00/33] Block layer patches

2023-12-21 Thread Kevin Wolf
The following changes since commit 191710c221f65b1542f6ea7fa4d30dde6e134fd7: Merge tag 'pull-request-2023-12-20' of https://gitlab.com/thuth/qemu into staging (2023-12-20 09:40:16 -0500) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

Re: [PATCH 3/6] target/riscv: Add pointer masking tb flags

2023-12-21 Thread Richard Henderson
On 12/21/23 21:40, Alexey Baturo wrote: From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h| 19 +-- target/riscv/cpu_helper.c | 4 target/riscv/translate.c | 10 ++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git

Re: virtio-pci in qemu-system-arm is broken in 8.2

2023-12-21 Thread Alex Bennée
Alex Bennée writes: > Michael Tokarev writes: > >> It looks like virtio-pci is entirely broke in qemu-system-arm, at least in >> tcg >> mode running on x86. The guest (current linux system) just does not detect >> any virtio-pci devices at all. >> >> When 8.1 is booting, the following

[PATCH v4 1/2] hw/arm: Add minimal support for the STM32L4x5 SoC

2023-12-21 Thread Inès Varhol
This patch adds a new STM32L4x5 SoC, it is necessary to add support for the B-L475E-IOT01A board. The implementation is derived from the STM32F405 SoC. The implementation contains no peripherals, only memory regions are implemented. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Arnaud

[PATCH v4 2/2] hw/arm: Add minimal support for the B-L475E-IOT01A board

2023-12-21 Thread Inès Varhol
This commit adds a new B-L475E-IOT01A board using the STM32L475VG SoC as well as a dedicated documentation file. The implementation is derived from the Netduino Plus 2 machine. There are no peripherals implemented yet, only memory regions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by:

[PATCH v4 0/2] Add minimal support for the B-L475E-IOT01A board

2023-12-21 Thread Inès Varhol
This patch adds a new STM32L4x5 SoC, it is necessary to add support for the B-L475E-IOT01A board. The implementation is derived from the STM32F405 SoC and NetduinoPlus2 board. The implementation contains no peripherals, only memory regions are implemented. Changes from v3 to v4: - adding a

Re: [PATCH v2] target/i386: Fix physical address truncation

2023-12-21 Thread Richard Henderson
On 12/22/23 02:49, Michael Brown wrote: The address translation logic in get_physical_address() will currently truncate physical addresses to 32 bits unless long mode is enabled. This is incorrect when using physical address extensions (PAE) outside of long mode, with the result that a 32-bit

Re: [PATCH 0/2] hw/s390x/ccw: Cleanup basename() and dirname()

2023-12-21 Thread Eric Farman
On Fri, 2023-12-22 at 01:19 +0800, Zhao Liu wrote: > From: Zhao Liu > > As commit 3e015d815b3f ("use g_path_get_basename instead of > basename") > said, g_path_get_basename() and g_path_get_dirname() should be > preferred > over basename() and dirname(), since g_path_get_basename() and >

[PULL 30/33] string-output-visitor: show structs as ""

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi StringOutputVisitor crashes when it visits a struct because ->start_struct() is NULL. Show "" instead of crashing. This is necessary because the virtio-blk-pci iothread-vq-mapping parameter that I'd like to introduce soon is a list of IOThreadMapping structs. This patch

[PULL 13/33] scsi: don't lock AioContext in I/O code path

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi blk_aio_*() doesn't require the AioContext lock and the SCSI subsystem's internal state also does not anymore. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Acked-by: Kevin Wolf Message-ID: <20231204164259.1515217-4-stefa...@redhat.com> Signed-off-by: Kevin

[PULL 29/33] block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Use qemu_get_current_aio_context() in mixed wrappers and coroutine wrappers so that code runs in the caller's AioContext instead of moving to the BlockDriverState's AioContext. This change is necessary for the multi-queue block layer where any thread can call into the block

[PULL 15/33] virtio-scsi: replace AioContext lock with tmf_bh_lock

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Protect the Task Management Function BH state with a lock. The TMF BH runs in the main loop thread. An IOThread might process a TMF at the same time as the TMF BH is running. Therefore tmf_bh_list and tmf_bh must be protected by a lock. Run TMF request completion in the

[PULL 33/33] virtio-blk: add iothread-vq-mapping parameter

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. Store the vq:AioContext mapping in the new struct VirtIOBlockDataPlane->vq_aio_context[] field and refactor the code to use the per-vq AioContext instead of the BlockDriverState's AioContext.

[PULL 31/33] qdev-properties: alias all object class properties

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi qdev_alias_all_properties() aliases a DeviceState's qdev properties onto an Object. This is used for VirtioPCIProxy types so that --device virtio-blk-pci has properties of its embedded --device virtio-blk-device object. Currently this function is implemented using qdev

[PULL 08/33] block: Fix crash when loading snapshot on inactive node

2023-12-21 Thread Kevin Wolf
bdrv_is_read_only() only checks if the node is configured to be read-only eventually, but even if it returns false, writing to the node may not be permitted at the moment (because it's inactive). bdrv_is_writable() checks that the node can be written to right now, and this is what the snapshot

[PULL 32/33] qdev: add IOThreadVirtQueueMappingList property type

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi virtio-blk and virtio-scsi devices will need a way to specify the mapping between IOThreads and virtqueues. At the moment all virtqueues are assigned to a single IOThread or the main loop. This single thread can be a CPU bottleneck, so it is necessary to allow finer-grained

[PULL 21/33] block: remove bdrv_co_lock()

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The bdrv_co_lock() and bdrv_co_unlock() functions are already no-ops. Remove them. Signed-off-by: Stefan Hajnoczi Message-ID: <20231205182011.1976568-8-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 14

[PULL 17/33] tests: remove aio_context_acquire() tests

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The aio_context_acquire() API is being removed. Drop the test case that calls the API. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Message-ID: <20231205182011.1976568-4-stefa...@redhat.com> Signed-off-by: Kevin Wolf ---

[PULL 28/33] block: remove outdated AioContext locking comments

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The AioContext lock no longer exists. There is one noteworthy change: - * More specifically, these functions use BDRV_POLL_WHILE(bs), which - * requires the caller to be either in the main thread and hold - * the BlockdriverState (bs) AioContext lock, or directly in

[PULL 23/33] aio-wait: draw equivalence between AIO_WAIT_WHILE() and AIO_WAIT_WHILE_UNLOCKED()

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Now that the AioContext lock no longer exists, AIO_WAIT_WHILE() and AIO_WAIT_WHILE_UNLOCKED() are equivalent. A future patch will get rid of AIO_WAIT_WHILE_UNLOCKED(). Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-ID:

[PULL 26/33] scsi: remove outdated AioContext lock comment

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The SCSI subsystem no longer uses the AioContext lock. Request processing runs exclusively in the BlockBackend's AioContext since "scsi: only access SCSIDevice->requests from one thread" and hence the lock is unnecessary. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric

[PULL 10/33] iotests: Basic tests for internal snapshots

2023-12-21 Thread Kevin Wolf
We have a few test cases that include tests for corner case aspects of internal snapshots, but nothing that tests that they actually function as snapshots or that involves deleting a snapshot. Add a test for this kind of basic internal snapshot functionality. The error cases include a regression

[PULL 25/33] docs: remove AioContext lock from IOThread docs

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Encourage the use of locking primitives and stop mentioning the AioContext lock since it is being removed. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-ID: <20231205182011.1976568-12-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin

[PULL 05/33] virtio-blk: add lock to protect s->rq

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi s->rq is accessed from IO_CODE and GLOBAL_STATE_CODE. Introduce a lock to protect s->rq and eliminate reliance on the AioContext lock. Signed-off-by: Stefan Hajnoczi Message-ID: <20230914140101.1065008-3-stefa...@redhat.com> Reviewed-by: Kevin Wolf Reviewed-by: Eric

[PULL 20/33] block: remove AioContext locking

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi This is the big patch that removes aio_context_acquire()/aio_context_release() from the block layer and affected block layer users. There isn't a clean way to split this patch and the reviewers are likely the same group of people, so I decided to do it in one patch.

[PULL 07/33] virtio-blk: don't lock AioContext in the submission code path

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi There is no need to acquire the AioContext lock around blk_aio_*() or blk_get_geometry() anymore. I/O plugging (defer_call()) also does not require the AioContext lock anymore. Signed-off-by: Stefan Hajnoczi Message-ID: <20230914140101.1065008-5-stefa...@redhat.com>

[PULL 22/33] scsi: remove AioContext locking

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The AioContext lock no longer has any effect. Remove it. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-ID: <20231205182011.1976568-9-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/hw/virtio/virtio-scsi.h | 14

[PULL 14/33] dma-helpers: don't lock AioContext in dma_blk_cb()

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Commit abfcd2760b3e ("dma-helpers: prevent dma_blk_cb() vs dma_aio_cancel() race") acquired the AioContext lock inside dma_blk_cb() to avoid a race with scsi_device_purge_requests() running in the main loop thread. The SCSI code no longer calls dma_aio_cancel() from the

[PULL 27/33] job: remove outdated AioContext locking comments

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The AioContext lock no longer exists. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-ID: <20231205182011.1976568-14-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/qemu/job.h | 20 1 file changed,

[PULL 01/33] nbd/server: avoid per-NBDRequest nbd_client_get/put()

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi nbd_trip() processes a single NBD request from start to finish and holds an NBDClient reference throughout. NBDRequest does not outlive the scope of nbd_trip(). Therefore it is unnecessary to ref/unref NBDClient for each NBDRequest. Removing these

[PULL 19/33] graph-lock: remove AioContext locking

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Stop acquiring/releasing the AioContext lock in bdrv_graph_wrlock()/bdrv_graph_unlock() since the lock no longer has any effect. The distinction between bdrv_graph_wrunlock() and bdrv_graph_wrunlock_ctx() becomes meaningless and they can be collapsed into one function.

[PULL 18/33] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi aio_context_acquire()/aio_context_release() has been replaced by fine-grained locking to protect state shared by multiple threads. The AioContext lock still plays the role of balancing locking in AIO_WAIT_WHILE() and many functions in QEMU either require that the AioContext

[PULL 12/33] virtio-scsi: don't lock AioContext around virtio_queue_aio_attach_host_notifier()

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi virtio_queue_aio_attach_host_notifier() does not require the AioContext lock. Stop taking the lock and add an explicit smp_wmb() because we were relying on the implicit barrier in the AioContext lock before. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake

[PULL 24/33] aio: remove aio_context_acquire()/aio_context_release() API

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Delete these functions because nothing calls these functions anymore. I introduced these APIs in commit 98563fc3ec44 ("aio: add aio_context_acquire() and aio_context_release()") in 2014. It's with a sigh of relief that I delete these APIs almost 10 years later. Thanks to

[PULL 16/33] scsi: assert that callbacks run in the correct AioContext

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Since the removal of AioContext locking, the correctness of the code relies on running requests from a single AioContext at any given time. Add assertions that verify that callbacks are invoked in the correct AioContext. Signed-off-by: Stefan Hajnoczi Message-ID:

[PULL 00/33] Block layer patches

2023-12-21 Thread Kevin Wolf
The following changes since commit 191710c221f65b1542f6ea7fa4d30dde6e134fd7: Merge tag 'pull-request-2023-12-20' of https://gitlab.com/thuth/qemu into staging (2023-12-20 09:40:16 -0500) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[PULL 03/33] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi NBDClient has a number of fields that are accessed by both the export AioContext and the main loop thread. When the AioContext lock is removed these fields will need another form of protection. Add NBDClient->lock and protect fields that are accessed by both threads. Also

[PULL 04/33] block/file-posix: set up Linux AIO and io_uring in the current thread

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The file-posix block driver currently only sets up Linux AIO and io_uring in the BDS's AioContext. In the multi-queue block layer we must be able to submit I/O requests in AioContexts that do not have Linux AIO and io_uring set up yet since any thread can call into the

[PULL 11/33] scsi: only access SCSIDevice->requests from one thread

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Stop depending on the AioContext lock and instead access SCSIDevice->requests from only one thread at a time: - When the VM is running only the BlockBackend's AioContext may access the requests list. - When the VM is stopped only the main loop may access the requests

[PULL 06/33] virtio-blk: don't lock AioContext in the completion code path

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi Nothing in the completion code path relies on the AioContext lock anymore. Virtqueues are only accessed from one thread at any moment and the s->rq global state is protected by its own lock now. Signed-off-by: Stefan Hajnoczi Message-ID:

[PULL 09/33] vl: Improve error message for conflicting -incoming and -loadvm

2023-12-21 Thread Kevin Wolf
Currently, the conflict between -incoming and -loadvm is only detected when loading the snapshot fails because the image is still inactive for the incoming migration. This results in a suboptimal error message: $ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer

[PULL 02/33] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Kevin Wolf
From: Stefan Hajnoczi The NBD clients list is currently accessed from both the export AioContext and the main loop thread. When the AioContext lock is removed there will be nothing protecting the clients list. Adding a lock around the clients list is tricky because NBDClient structs are

Re: [PULL 20/47] backends/iommufd: Introduce the iommufd object

2023-12-21 Thread Cédric Le Goater
On 12/21/23 18:14, Eric Auger wrote: Hi Cédric, On 12/21/23 17:00, Cédric Le Goater wrote: [ ... ] +static void iommufd_backend_init(Object *obj) +{ +    IOMMUFDBackend *be = IOMMUFD_BACKEND(obj); + +    be->fd = -1; +    be->users = 0; +    be->owned = true; +    qemu_mutex_init(>lock);>

Re: [PULL 0/3] Memory/SDHCI/ParallelFlash patches for v7.2.0-rc0

2023-12-21 Thread Salvatore Bonaccorso
Hi Philippe, On Wed, Nov 09, 2022 at 08:43:19AM +0100, Philippe Mathieu-Daudé wrote: > On 8/11/22 21:57, Stefan Hajnoczi wrote: > > I've dropped the SDHCI CVE fix due to the CI failure. > > > > The rest of the commits are still in the staging tree and I plan to > > include them in v7.2.0-rc0. >

Re: [PATCH v4 0/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-21 Thread Kevin Wolf
Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > v4: > - Use DummyVirtioForceArrays naming in QAPI schema [Markus] > v3: > - Rebased onto Kevin's block branch > - Add StringOutputVisitor "" patch to fix "info qtree" crash > - Fix QAPI schema formatting [Markus] > - Eliminate unnecessary

Re: [PATCH v3 0/6] qemu-iotests fixes for Kevin's block tree

2023-12-21 Thread Kevin Wolf
Am 21.12.2023 um 20:24 hat Stefan Hajnoczi geschrieben: > v3: > - Add aio_wait_kick() into nbd_read_eof() to avoid race with > nbd_drained_poll() > [Kevin] > > v2: > - Drop useless if (client->quiesing) check [Kevin] > - run qio_channel_read_wake() in export AioContext to avoid race [Kevin] >

[PATCH v3 1/6] fixup block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-12-21 Thread Stefan Hajnoczi
qemu-iotests 051 fails on my machine so the change to 051.pc.out made by the above commit appears to be incorrect, at least against the current QEMU source tree. Revert it so that 051 passes again. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2

[PATCH v3 4/6] nbd/server: avoid per-NBDRequest nbd_client_get/put()

2023-12-21 Thread Stefan Hajnoczi
nbd_trip() processes a single NBD request from start to finish and holds an NBDClient reference throughout. NBDRequest does not outlive the scope of nbd_trip(). Therefore it is unnecessary to ref/unref NBDClient for each NBDRequest. Removing these nbd_client_get()/nbd_client_put() calls will make

[PATCH v3 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
NBDClient has a number of fields that are accessed by both the export AioContext and the main loop thread. When the AioContext lock is removed these fields will need another form of protection. Add NBDClient->lock and protect fields that are accessed by both threads. Also add assertions where

[PATCH v3 2/6] fixup block: remove AioContext locking

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- migration/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/migration/block.c b/migration/block.c index 2bcfcbfdf6..6ec6a1d6e6 100644 --- a/migration/block.c +++ b/migration/block.c @@ -311,10 +311,17 @@ static int mig_save_device_bulk(QEMUFile

[PATCH v3 3/6] fixup scsi: only access SCSIDevice->requests from one thread

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index df68a44b6a..5b08cbf60a 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -127,7 +127,8

[PATCH v3 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Stefan Hajnoczi
The NBD clients list is currently accessed from both the export AioContext and the main loop thread. When the AioContext lock is removed there will be nothing protecting the clients list. Adding a lock around the clients list is tricky because NBDClient structs are refcounted and may be freed

[PATCH v3 0/6] qemu-iotests fixes for Kevin's block tree

2023-12-21 Thread Stefan Hajnoczi
v3: - Add aio_wait_kick() into nbd_read_eof() to avoid race with nbd_drained_poll() [Kevin] v2: - Drop useless if (client->quiesing) check [Kevin] - run qio_channel_read_wake() in export AioContext to avoid race [Kevin] - Introduce nbd_client_put_nonzero() optimization [Paolo] - Reach goto

Re: [PATCH v2 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 06:38:16PM +0100, Kevin Wolf wrote: > Am 21.12.2023 um 16:35 hat Stefan Hajnoczi geschrieben: > > NBDClient has a number of fields that are accessed by both the export > > AioContext and the main loop thread. When the AioContext lock is removed > > these fields will need

Re: virtio-pci in qemu-system-arm is broken in 8.2

2023-12-21 Thread Alex Bennée
Michael Tokarev writes: > It looks like virtio-pci is entirely broke in qemu-system-arm, at least in tcg > mode running on x86. The guest (current linux system) just does not detect > any virtio-pci devices at all. > > When 8.1 is booting, the following messages are displayed (debian

[PATCH 16/16] target/riscv/cpu.c: move 'marchid' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Keep all class properties in riscv_cpu_properties[]. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 110 +++-- 1 file changed, 57 insertions(+), 53 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index

[PATCH 13/16] target/riscv: remove riscv_cpu_options[]

2023-12-21 Thread Daniel Henrique Barboza
The array is empty and can be removed. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 5 - target/riscv/cpu.h | 1 - target/riscv/kvm/kvm-cpu.c | 9 - target/riscv/tcg/tcg-cpu.c | 4 4 files changed, 19 deletions(-) diff --git

[PATCH 14/16] target/riscv/cpu.c: move 'mvendorid' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Keep all class properties in riscv_cpu_properties[]. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 69 +- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index

[PATCH 15/16] target/riscv/cpu.c: move 'mimpid' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Keep all class properties in riscv_cpu_properties[]. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 68 -- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index

[PATCH 05/16] target/riscv: move 'pmp' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Move 'pmp' to riscv_cpu_properties[], creating a new setter() for it that forbids 'pmp' to be changed in vendor CPUs, like we did with the 'mmu' option. We'll also have to manually set 'pmp = true' to generic CPUs that were still relying on the previous default to set it. Signed-off-by: Daniel

[PATCH 03/16] target/riscv: make riscv_cpu_is_generic() public

2023-12-21 Thread Daniel Henrique Barboza
We'll use this function in target/riscv/cpu.c to implement setters that won't allow vendor CPU options to be changed. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 5 + target/riscv/cpu.h | 1 + target/riscv/tcg/tcg-cpu.c | 5 - 3 files changed, 6

[PATCH 10/16] target/riscv: create finalize_features() for KVM

2023-12-21 Thread Daniel Henrique Barboza
To turn cbom_blocksize and cboz_blocksize into class properties we need KVM specific changes. KVM is creating its own version of these options with a customized setter() that prevents users from picking an invalid value during init() time. This comes at the cost of duplicating each option that

[PATCH 09/16] target/riscv: move 'elen' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Do the same thing we did with 'vlen' in the previous patch with 'elen'. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 52 -- target/riscv/tcg/tcg-cpu.c | 5 2 files changed, 50 insertions(+), 7 deletions(-) diff --git

[PATCH 11/16] target/riscv: move 'cbom_blocksize' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
After adding a KVM finalize() implementation, turn cbom_blocksize into a class property. Follow the same design we used with 'vlen' and 'elen'. The duplicated 'cbom_blocksize' KVM property can be removed from kvm_riscv_add_cpu_user_properties(). Signed-off-by: Daniel Henrique Barboza ---

[PATCH 07/16] target/riscv: rework 'vext_spec'

2023-12-21 Thread Daniel Henrique Barboza
The same rework did in 'priv_spec' is done for 'vext_spec'. This time is simpler, since we only accept one value ("v1.0") and we'll always have env->vext_ver set to VEXT_VERSION_1_00_0, thus we don't need helpers to convert string to 'vext_ver' back and forth like we needed for 'priv_spec'.

[PATCH 08/16] target/riscv: move 'vlen' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Turning 'vlen' into a class property will allow its default value to be overwritten by cpu_init() later on, solving the issue we have now where CPU specific settings are getting overwritten by the default. For 'vlen', 'elen' and the blocksize options we need a way of tracking if the user set a

[PATCH 04/16] target/riscv: move 'mmu' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Commit 7f0bdfb5bfc ("target/riscv/cpu.c: remove cfg setup from riscv_cpu_init()") already did some of the work by making some cpu_init() functions to explictly enable their own 'mmu' default. The generic CPUs didn't get update by that commit, so they are still relying on the defaults set by the

[PATCH 06/16] target/riscv: rework 'priv_spec'

2023-12-21 Thread Daniel Henrique Barboza
'priv_spec' and 'vext_spec' are two string options used as a fancy way of setting integers in the CPU state (cpu->env.priv_ver and cpu->env.vext_ver). It requires us to deal with string parsing and to store them in cpu_cfg. We must support these string options, but we don't need to store them. We

[PATCH 12/16] target/riscv: move 'cboz_blocksize' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Do the same we did with 'cbom_blocksize' in the previous patch. Remove the now unused kvm_cpu_set_cbomz_blksize() setter. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 45 +- target/riscv/kvm/kvm-cpu.c | 28

[PATCH 01/16] target/riscv/cpu_cfg.h: remove user_spec and bext_spec

2023-12-21 Thread Daniel Henrique Barboza
They aren't being used. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu_cfg.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/riscv/cpu_cfg.h b/target/riscv/cpu_cfg.h index f4605fb190..c67a8731d3 100644 --- a/target/riscv/cpu_cfg.h +++ b/target/riscv/cpu_cfg.h @@ -136,8

[PATCH 02/16] target/riscv: move 'pmu-mask' and 'pmu-num' to riscv_cpu_properties[]

2023-12-21 Thread Daniel Henrique Barboza
Every property in riscv_cpu_options[] will be migrated to riscv_cpu_properties[]. This will make their default values init earlier, allowing cpu_init() functions to overwrite them. We'll also implement common getters and setters that both accelerators will use, allowing them to share validations

[PATCH 00/16] target/riscv: deprecate riscv_cpu_options[]

2023-12-21 Thread Daniel Henrique Barboza
Hi, Rob reported a few days ago about vendor properties overrides that we're having with riscv_cpu_options [1]. At that time I was doing changes in the 'vlen' and 'elen' properties due to (yet to be sent) changes I'm making in Vector code. I decided to extend the work I was doing and it resulted

[PATCH v4 08/13] vdpa: move backend_cap to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 04/13] vdpa: move shadow_data to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 06/13] vdpa: move file descriptor to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 00/13] Consolidate common vdpa members in VhostVDPAShared

2023-12-21 Thread Eugenio Pérez
Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic can flow, nor the VM workload can continue

[PATCH v4 11/13] vdpa: use VhostVDPAShared in vdpa_dma_map and unmap

2023-12-21 Thread Eugenio Pérez
The callers only have the shared information by the end of this series. Start converting this functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 4 +-- hw/virtio/vhost-vdpa.c | 50 +- net/vhost-vdpa.c

[PATCH v4 05/13] vdpa: use vdpa shared for tracing

2023-12-21 Thread Eugenio Pérez
By the end of this series dma_map and dma_unmap functions don't have the vdpa device for tracing. Movinge trace function to shared member one. Print it also in the vdpa initialization so log reader can relate them. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c |

[PATCH v4 13/13] vdpa: move memory listener to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 12/13] vdpa: use dev_shared in vdpa_iommu

2023-12-21 Thread Eugenio Pérez
The memory listener functions can call these too. Make vdpa_iommu work with VhostVDPAShared. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 2 +- hw/virtio/vhost-vdpa.c | 16 2 files changed, 9 insertions(+), 9 deletions(-)

[PATCH v4 02/13] vdpa: move iova tree to the shared struct

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 10/13] vdpa: move iommu_list to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 09/13] vdpa: remove msg type of vhost_vdpa

2023-12-21 Thread Eugenio Pérez
It is always VHOST_IOTLB_MSG_V2. We can always make it back per vhost_dev if needed. This change makes easier for vhost_vdpa_map and unmap not to depend on vhost_vdpa but only in VhostVDPAShared. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 1 -

[PATCH v4 03/13] vdpa: move iova_range to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 07/13] vdpa: move iotlb_batch_begin_sent to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will

[PATCH v4 01/13] vdpa: add VhostVDPAShared

2023-12-21 Thread Eugenio Pérez
It will hold properties shared among all vhost_vdpa instances associated with of the same device. For example, we just need one iova_tree or one memory listener for the entire device. Next patches will register the vhost_vdpa memory listener at the beginning of the VM migration at the

[RFC PATCH] readthodocs: fully specify a build environment

2023-12-21 Thread Alex Bennée
This is now expected by rtd so I've expanded using their example as 22.04 is one of our supported platforms. I tried to work out if there was an easy way to re-generate a requirements.txt from our pythondeps.toml but in the end went for the easier solution. Signed-off-by: Alex Bennée Cc:

  1   2   3   >