[PATCH v2 1/7] chardev/char-fe: Document returned value on error

2024-07-22 Thread Philippe Mathieu-Daudé
qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]() return -1 on error. Mention it in the documentation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- include/chardev/char-fe.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/chardev/char-fe.h b/include

[PATCH 0/4] gdbstub: Add support for MTE in system mode

2024-07-22 Thread Gustavo Romero
This patchset makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. It also extends the MTE gdbstub tests to run in system mode, sharing the tests between user mo

[PATCH 3/4] tests/guest-debug: Support passing arguments to the GDB test script

2024-07-22 Thread Gustavo Romero
This commit adds a new option to run-test.py, --test-args, which can be used to pass arguments to the GDB test script specified by the --test option. The arguments passed are in the key=value form, and multiple pairs can be passed, separated by a space. For example: run-test.py [...] --test --tes

[PATCH v2 5/7] util/fifo8: Rename fifo8_pop_buf() -> fifo8_pop_constbuf()

2024-07-22 Thread Philippe Mathieu-Daudé
Since fifo8_pop_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h| 4 ++-- chardev/msmouse.c

[PATCH v2 7/7] util/fifo8: Introduce fifo8_discard()

2024-07-22 Thread Philippe Mathieu-Daudé
Add the fifo8_discard() helper for clarity. It is a simple wrapper over fifo8_pop_buf(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 8 hw/scsi/esp.c| 2 +- util/fifo8.c | 6 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/inclu

[PATCH v2 2/7] util/fifo8: Fix style

2024-07-22 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index c6295c6ff0..2692d6bfda 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -15,1

[PATCH v2 4/7] util/fifo8: Rename fifo8_peek_buf() -> fifo8_peek_constbuf()

2024-07-22 Thread Philippe Mathieu-Daudé
Since fifo8_peek_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 4 ++-- hw/scsi/esp.c

Re: [PATCH v2 7/7] util/fifo8: Introduce fifo8_discard()

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 18:07, Philippe Mathieu-Daudé wrote: Add the fifo8_discard() helper for clarity. It is a simple wrapper over fifo8_pop_buf(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 8 hw/scsi/esp.c| 2 +- util/fifo8.c | 6 ++ 3 files change

[PATCH] MAINTAINERS: Add myself as a reviewer of machine core

2024-07-22 Thread Zhao Liu
While working on a series of CPU/cache topology work, I became interested in the machine core component and would like to help to review more related patches. Signed-off-by: Zhao Liu --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7d9811458cb0.

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-22 Thread Joao Martins
On 22/07/2024 16:58, Cédric Le Goater wrote: > On 7/22/24 17:42, Joao Martins wrote: >> On 22/07/2024 16:13, Cédric Le Goater wrote: >>> On 7/22/24 17:01, Joao Martins wrote: On 22/07/2024 15:53, Cédric Le Goater wrote: > On 7/19/24 19:26, Joao Martins wrote: >> On 19/07/2024 15:24, Jo

[PULL 2/4] hw/nvme: add cross namespace copy support

2024-07-22 Thread Klaus Jensen
From: Arun Kumar Extend copy command to copy user data across different namespaces via support for specifying a namespace for each source range Signed-off-by: Arun Kumar Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 369 +++--

[PULL 4/4] hw/nvme: remove useless type cast

2024-07-22 Thread Klaus Jensen
From: Yao Xingtao The type of req->cmd is NvmeCmd, cast the pointer of this type to NvmeCmd* is useless. Signed-off-by: Yao Xingtao Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw

[PULL 3/4] hw/nvme: actually implement abort

2024-07-22 Thread Klaus Jensen
From: Ayush Mishra Abort was not implemented previously, but we can implement it for AERs and asynchrnously for I/O. Signed-off-by: Ayush Mishra Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 32 1 file changed, 32 insertions(+) d

[PULL 1/4] hw/nvme: fix memory leak in nvme_dsm

2024-07-22 Thread Klaus Jensen
From: Zheyu Ma The allocated memory to hold LBA ranges leaks in the nvme_dsm function. This happens because the allocated memory for iocb->range is not freed in all error handling paths. Fix this by adding a free to ensure that the allocated memory is properly freed. ASAN log: ==3075137==ERROR:

[PULL 0/4] hw/nvme patches

2024-07-22 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit a7ddb48bd1363c8bcdf42776d320289c42191f01: Merge tag 'pull-aspeed-20240721' of https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000) are available in the Git repository at: https://gitlab.com/birkelund/qemu.git

Re: [PATCH] MAINTAINERS: Add myself as a reviewer of machine core

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 18:44, Zhao Liu wrote: While working on a series of CPU/cache topology work, I became interested in the machine core component and would like to help to review more related patches. Thanks! Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Zhao Liu --- MAINTAINERS | 1 + 1 f

Re: [PATCH v3 12/12] target/riscv: Simplify probing in vext_ldff

2024-07-22 Thread Max Chou
Reviewed-by: Max Chou On 2024/7/19 9:07 AM, Richard Henderson wrote: The current pairing of tlb_vaddr_to_host with extra is either inefficient (user-only, with page_check_range) or incorrect (system, with probe_pages). For proper non-fault behaviour, use probe_access_flags with its nonfault pa

Re: [PATCH] [PATCH] system/memory: Fix max access size

2024-07-22 Thread Paolo Bonzini
On Mon, Jul 22, 2024 at 4:29 PM Philippe Mathieu-Daudé wrote: > It seems this model could be simplified using .min_access_size = 8, > letting the core memory layer handle the % 4 byte accesses (the > read path is obvious, the write one a bit less). Nothing urgent, > possibly a BitSizedTask. The m

Re: [PATCH] [PATCH] system/memory: Fix max access size

2024-07-22 Thread Peter Maydell
On Mon, 22 Jul 2024 at 17:51, Paolo Bonzini wrote: > > On Mon, Jul 22, 2024 at 4:29 PM Philippe Mathieu-Daudé > wrote: > > It seems this model could be simplified using .min_access_size = 8, > > letting the core memory layer handle the % 4 byte accesses (the > > read path is obvious, the write on

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-22 Thread Cédric Le Goater
On 7/22/24 18:29, Joao Martins wrote: On 22/07/2024 16:58, Cédric Le Goater wrote: On 7/22/24 17:42, Joao Martins wrote: On 22/07/2024 16:13, Cédric Le Goater wrote: On 7/22/24 17:01, Joao Martins wrote: On 22/07/2024 15:53, Cédric Le Goater wrote: On 7/19/24 19:26, Joao Martins wrote: On 1

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-22 Thread Cédric Le Goater
On 7/22/24 19:04, Cédric Le Goater wrote: On 7/22/24 18:29, Joao Martins wrote: On 22/07/2024 16:58, Cédric Le Goater wrote: On 7/22/24 17:42, Joao Martins wrote: On 22/07/2024 16:13, Cédric Le Goater wrote: On 7/22/24 17:01, Joao Martins wrote: On 22/07/2024 15:53, Cédric Le Goater wrote:

[PATCH 4/4] target/arm: Ignore SMCR_EL2.LEN and SVCR_EL2.LEN if EL2 is not enabled

2024-07-22 Thread Peter Maydell
When determining the current vector length, the SMCR_EL2.LEN and SVCR_EL2.LEN settings should only be considered if EL2 is enabled (compare the pseudocode CurrentSVL and CurrentNSVL which call EL2Enabled()). We were checking against ARM_FEATURE_EL2 rather than calling arm_is_el2_enabled(), which m

[PATCH 1/4] target/arm: Don't assert for 128-bit tile accesses when SVL is 128

2024-07-22 Thread Peter Maydell
For an instruction which accesses a 128-bit element tile when the SVL is also 128 (for example MOV z0.Q, p0/M, ZA0H.Q[w0,0]), we will assert in get_tile_rowcol(): qemu-system-aarch64: ../../tcg/tcg-op.c:926: tcg_gen_deposit_z_i32: Assertion `len > 0' failed. This happens because we calculate

[PATCH 3/4] target/arm: Avoid shifts by -1 in tszimm_shr() and tszimm_shl()

2024-07-22 Thread Peter Maydell
The function tszimm_esz() returns a shift amount, or possibly -1 in certain cases that correspond to unallocated encodings in the instruction set. We catch these later in the trans_ functions (generally with an "a-esz < 0" check), but before we do the decodetree-generated code will also call tszim

[PATCH 0/4] target/arm: Various minor SME bugfixes

2024-07-22 Thread Peter Maydell
This patchset fixes a handful of minor bugs in our SME implementation: one spotted by Coverity, one raised as a Gitlab issue, and a couple that I just noticed in passing while I was working with the code. thanks -- PMM Peter Maydell (4): target/arm: Don't assert for 128-bit tile accesses when S

[PATCH 2/4] target/arm: Fix UMOPA/UMOPS of 16-bit values

2024-07-22 Thread Peter Maydell
The UMOPA/UMOPS instructions are supposed to multiply unsigned 8 or 16 bit elements and accumulate the products into a 64-bit element. In the Arm ARM pseudocode, this is done with the usual infinite-precision signed arithmetic. However our implementation doesn't quite get it right, because in the

Re: [PATCH 2/2] vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev

2024-07-22 Thread Eric Farman
On Mon, 2024-07-22 at 17:36 +0200, Cédric Le Goater wrote: > On 7/22/24 17:09, Joao Martins wrote: > > On 22/07/2024 15:57, Eric Farman wrote: > > > On Mon, 2024-07-22 at 15:07 +0800, Zhenzhong Duan wrote: > > > > mdevs aren't "physical" devices and when asking for backing IOMMU info, > > > > it fa

[PATCH] target/riscv: Add a property to set vl to ceil(AVL/2)

2024-07-22 Thread Jason Chien
RVV spec allows implementations to set vl with values within [ceil(AVL/2),VLMAX] when VLMAX < AVL < 2*VLMAX. This commit adds a property "rvv_vl_half_avl" to enable setting vl = ceil(AVL/2). This behavior helps identify compiler issues and bugs. Signed-off-by: Jason Chien --- target/riscv/cpu.c

[RFC PATCH v2 5/9] migration/multifd: Replace p->pages with an union pointer

2024-07-22 Thread Fabiano Rosas
We want multifd to be able to handle more types of data than just ram pages. To start decoupling multifd from pages, replace p->pages (MultiFDPages_t) with the new type MultiFDSendData that hides the client payload inside an union. The general idea here is to isolate functions that *need* to handl

[RFC PATCH v2 3/9] migration/multifd: Introduce MultiFDSendData

2024-07-22 Thread Fabiano Rosas
Add a new data structure to replace p->pages in the multifd channel. This new structure will hide the multifd payload type behind an union, so we don't need to add a new field to the channel each time we want to handle a different data type. This also allow us to keep multifd_send_pages() as is, w

[RFC PATCH v2 1/9] migration/multifd: Reduce access to p->pages

2024-07-22 Thread Fabiano Rosas
I'm about to replace the p->pages pointer with an opaque pointer, so do a cleanup now to reduce direct accesses to p->page, which makes the next diffs cleaner. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu --- migration/multifd-qpl.c | 8 +--- migration/multifd-uadk.c | 9 +

[RFC PATCH v2 9/9] migration/multifd: Replace multifd_send_state->pages with client data

2024-07-22 Thread Fabiano Rosas
Multifd currently has a simple scheduling mechanism that distributes work to the various channels by keeping storage space within each channel and an extra space that is given to the client. Each time the client fills the space with data and calls into multifd, that space is given to the next idle

[RFC PATCH v2 7/9] migration/multifd: Isolate ram pages packet data

2024-07-22 Thread Fabiano Rosas
While we cannot yet disentangle the multifd packet from page data, we can make the code a bit cleaner by setting the page-related fields in a separate function. Signed-off-by: Fabiano Rosas --- migration/multifd.c | 97 - 1 file changed, 61 insertions(

[RFC PATCH v2 0/9] migration/multifd: Remove multifd_send_state->pages

2024-07-22 Thread Fabiano Rosas
Hi, In this v2 I took Peter's suggestion of keeping the channels' pointers and moving only the extra slot. The major changes are in patches 5 and 9. Patch 3 introduces the structure: typedef enum { MULTIFD_PAYLOAD_NONE, MULTIFD_PAYLOAD_RAM, } MultiFDPayloadType; struct MultiFDSendData {

[RFC PATCH v2 8/9] migration/multifd: Don't send ram data during SYNC

2024-07-22 Thread Fabiano Rosas
Skip saving and loading any ram data in the packet in the case of a SYNC. This fixes a shortcoming of the current code which requires a reset of the MultiFDPages_t fields right after the previous pending_job finishes, otherwise the very next job might be a SYNC and multifd_send_fill_packet() will p

[RFC PATCH v2 4/9] migration/multifd: Make MultiFDPages_t:offset a flexible array member

2024-07-22 Thread Fabiano Rosas
We're about to use MultiFDPages_t from inside the MultiFDSendData payload union, which means we cannot have pointers to allocated data inside the pages structure, otherwise we'd lose the reference to that memory once another payload type touches the union. Move the offset array into the end of the

[RFC PATCH v2 2/9] migration/multifd: Pass in MultiFDPages_t to file_write_ramblock_iov

2024-07-22 Thread Fabiano Rosas
We want to stop dereferencing 'pages' so it can be replaced by an opaque pointer in the next patches. Signed-off-by: Fabiano Rosas --- migration/file.c| 3 ++- migration/file.h| 2 +- migration/multifd.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/fil

[RFC PATCH v2 6/9] migration/multifd: Move pages accounting into multifd_send_zero_page_detect()

2024-07-22 Thread Fabiano Rosas
All references to pages are being removed from the multifd worker threads in order to allow multifd to deal with different payload types. multifd_send_zero_page_detect() is called by all multifd migration paths that deal with pages and is the last spot where zero pages and normal page amounts are

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-22 Thread Joao Martins
On 22/07/2024 18:04, Cédric Le Goater wrote: > On 7/22/24 18:29, Joao Martins wrote: >> On 22/07/2024 16:58, Cédric Le Goater wrote: >>> On 7/22/24 17:42, Joao Martins wrote: On 22/07/2024 16:13, Cédric Le Goater wrote: > On 7/22/24 17:01, Joao Martins wrote: >> On 22/07/2024 15:53, Cé

Re: [PATCH v5 12/13] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-22 Thread Joao Martins
On 22/07/2024 18:15, Cédric Le Goater wrote: > On 7/22/24 19:04, Cédric Le Goater wrote: >> On 7/22/24 18:29, Joao Martins wrote: >>> On 22/07/2024 16:58, Cédric Le Goater wrote: On 7/22/24 17:42, Joao Martins wrote: > On 22/07/2024 16:13, Cédric Le Goater wrote: >> On 7/22/24 17:01, J

Re: [RFC PATCH v2 4/9] migration/multifd: Make MultiFDPages_t:offset a flexible array member

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:09PM -0300, Fabiano Rosas wrote: > We're about to use MultiFDPages_t from inside the MultiFDSendData > payload union, which means we cannot have pointers to allocated data > inside the pages structure, otherwise we'd lose the reference to that > memory once another pay

Re: [RFC PATCH v2 2/9] migration/multifd: Pass in MultiFDPages_t to file_write_ramblock_iov

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:07PM -0300, Fabiano Rosas wrote: > We want to stop dereferencing 'pages' so it can be replaced by an > opaque pointer in the next patches. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

Re: [RFC PATCH v2 3/9] migration/multifd: Introduce MultiFDSendData

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:08PM -0300, Fabiano Rosas wrote: > Add a new data structure to replace p->pages in the multifd > channel. This new structure will hide the multifd payload type behind > an union, so we don't need to add a new field to the channel each time > we want to handle a differe

Re: [RFC PATCH v2 6/9] migration/multifd: Move pages accounting into multifd_send_zero_page_detect()

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:11PM -0300, Fabiano Rosas wrote: > All references to pages are being removed from the multifd worker > threads in order to allow multifd to deal with different payload > types. > > multifd_send_zero_page_detect() is called by all multifd migration > paths that deal wi

Re: [RFC PATCH v2 7/9] migration/multifd: Isolate ram pages packet data

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:12PM -0300, Fabiano Rosas wrote: > While we cannot yet disentangle the multifd packet from page data, we > can make the code a bit cleaner by setting the page-related fields in > a separate function. > > Signed-off-by: Fabiano Rosas > --- > migration/multifd.c | 97

Re: [RFC PATCH v2 9/9] migration/multifd: Replace multifd_send_state->pages with client data

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:14PM -0300, Fabiano Rosas wrote: > Multifd currently has a simple scheduling mechanism that distributes > work to the various channels by keeping storage space within each > channel and an extra space that is given to the client. Each time the > client fills the space

Re: [RFC PATCH v2 0/9] migration/multifd: Remove multifd_send_state->pages

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:05PM -0300, Fabiano Rosas wrote: > Hi, > > In this v2 I took Peter's suggestion of keeping the channels' pointers > and moving only the extra slot. The major changes are in patches 5 and > 9. Patch 3 introduces the structure: > > typedef enum { > MULTIFD_PAYLOAD_

Re: [PATCH 4/4] target/arm: Ignore SMCR_EL2.LEN and SVCR_EL2.LEN if EL2 is not enabled

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 19:29, Peter Maydell wrote: When determining the current vector length, the SMCR_EL2.LEN and SVCR_EL2.LEN settings should only be considered if EL2 is enabled (compare the pseudocode CurrentSVL and CurrentNSVL which call EL2Enabled()). We were checking against ARM_FEATURE_EL2 rather t

[PULL 1/8] vnc: increase max display size

2024-07-22 Thread marcandre . lureau
From: Gerd Hoffmann It's 2024. 4k display resolutions are a thing these days. Raise width and height limits of the qemu vnc server. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1596 Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Message-ID: <20240530111029.1726329-1-k

[PULL 2/8] virtio-gpu-gl: declare dependency on ui-opengl

2024-07-22 Thread marcandre . lureau
From: Marc-André Lureau Since commit e8a2db94 "virtio-gpu-virgl: teach it to get the QEMU EGL display", virtio-gl depends on ui-opengl symbol "qemu_egl_display". Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2391 Fixes: e8a2db94 ("virtio-gpu-virgl: teach it to get the QEMU EGL display"

[PULL 5/8] ui/vdagent: improve vdagent_fe_open() trace

2024-07-22 Thread marcandre . lureau
From: Marc-André Lureau Place the trace when the function enters, with arg value. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240717171541.201525-3-marcandre.lur...@redhat.com> --- ui/vdagent.c| 3 ++- ui/trace-events | 2 +- 2 files changed, 3 inse

[PULL 6/8] ui/vdagent: notify clipboard peers of serial reset

2024-07-22 Thread marcandre . lureau
From: Marc-André Lureau Since we reset the serial counters, peers should also be reset to be sync. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240717171541.201525-4-marcandre.lur...@redhat.com> --- ui/clipboard.c | 2 ++ ui/vdagent.c| 2 ++ ui/trac

[PULL 3/8] Cursor: 8 -> 1 bit alpha downsampling improvement

2024-07-22 Thread marcandre . lureau
From: Phil Dennis-Jordan Mouse cursors with 8 bit alpha were downsampled to 1-bit opacity maps by turning alpha values of 255 into 1 and everything else into 0. This means that mostly-opaque pixels ended up completely invisible. This patch changes the behaviour so that only pixels with less than

[PULL 7/8] ui/vdagent: send caps on fe_open

2024-07-22 Thread marcandre . lureau
From: Marc-André Lureau The spice-vdagentd doesn't send capabilities again on host/client disconnect (but when the session agent connects and sends a GUEST_XORG_RESOLUTION message) When the dbus client disconnects, vdagent_disconnect() is called to reset the agent state. Capabilities must be neg

[PULL 8/8] chardev/char-win-stdio.c: restore old console mode

2024-07-22 Thread marcandre . lureau
From: songziming If I use `-serial stdio` on Windows, after QEMU exits, the terminal could not handle arrow keys and tab any more. Because stdio backend on Windows sets console mode to virtual terminal input when starts, but does not restore the old mode when finalize. This small patch saves the

[PULL 4/8] ui: add more tracing for dbus

2024-07-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240717171541.201525-2-marcandre.lur...@redhat.com> --- audio/dbusaudio.c | 2 +- ui/dbus-clipboard.c | 4 audio/trace-events | 2 +- ui/trace-events | 2 ++ 4 files changed,

[PULL 0/8] Ui patches

2024-07-22 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit a7ddb48bd1363c8bcdf42776d320289c42191f01: Merge tag 'pull-aspeed-20240721' of https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000) are available in the Git repository at: https://gitlab.com/marcandre.lureau/qe

Re: [RFC PATCH v2 6/9] migration/multifd: Move pages accounting into multifd_send_zero_page_detect()

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 02:59:11PM -0300, Fabiano Rosas wrote: >> All references to pages are being removed from the multifd worker >> threads in order to allow multifd to deal with different payload >> types. >> >> multifd_send_zero_page_detect() is called by all multifd migr

Re: [RFC PATCH v2 0/9] migration/multifd: Remove multifd_send_state->pages

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 02:59:05PM -0300, Fabiano Rosas wrote: >> Hi, >> >> In this v2 I took Peter's suggestion of keeping the channels' pointers >> and moving only the extra slot. The major changes are in patches 5 and >> 9. Patch 3 introduces the structure: >> >> typedef e

Re: [RFC PATCH v2 9/9] migration/multifd: Replace multifd_send_state->pages with client data

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 02:59:14PM -0300, Fabiano Rosas wrote: >> Multifd currently has a simple scheduling mechanism that distributes >> work to the various channels by keeping storage space within each >> channel and an extra space that is given to the client. Each time the >

Re: [RFC PATCH v2 7/9] migration/multifd: Isolate ram pages packet data

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 02:59:12PM -0300, Fabiano Rosas wrote: >> While we cannot yet disentangle the multifd packet from page data, we >> can make the code a bit cleaner by setting the page-related fields in >> a separate function. >> >> Signed-off-by: Fabiano Rosas >> --- >

Re: [RFC PATCH v2 4/9] migration/multifd: Make MultiFDPages_t:offset a flexible array member

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 02:59:09PM -0300, Fabiano Rosas wrote: >> We're about to use MultiFDPages_t from inside the MultiFDSendData >> payload union, which means we cannot have pointers to allocated data >> inside the pages structure, otherwise we'd lose the reference to that >

Re: [RFC PATCH v2 6/9] migration/multifd: Move pages accounting into multifd_send_zero_page_detect()

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 05:07:57PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Mon, Jul 22, 2024 at 02:59:11PM -0300, Fabiano Rosas wrote: > >> All references to pages are being removed from the multifd worker > >> threads in order to allow multifd to deal with different payload > >>

Re: [RFC PATCH v2 9/9] migration/multifd: Replace multifd_send_state->pages with client data

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 05:26:49PM -0300, Fabiano Rosas wrote: > >> +void multifd_ram_save_setup(void) > >> +{ > >> +uint32_t n = MULTIFD_PACKET_SIZE / qemu_target_page_size(); > >> + > >> +multifd_ram_send = multifd_send_data_alloc(); > >> +multifd_ram_send->u.ram.allocated = n; > > >

Re: [RFC PATCH v2 0/9] migration/multifd: Remove multifd_send_state->pages

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 05:21:48PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Mon, Jul 22, 2024 at 02:59:05PM -0300, Fabiano Rosas wrote: > >> Hi, > >> > >> In this v2 I took Peter's suggestion of keeping the channels' pointers > >> and moving only the extra slot. The major changes

Re: [RFC PATCH v2 8/9] migration/multifd: Don't send ram data during SYNC

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 02:59:13PM -0300, Fabiano Rosas wrote: > Skip saving and loading any ram data in the packet in the case of a > SYNC. This fixes a shortcoming of the current code which requires a > reset of the MultiFDPages_t fields right after the previous > pending_job finishes, otherwise

Re: [PATCH v2 2/7] util/fifo8: Fix style

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:07, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index c6295c6ff0..2692d6bfda 100644 --- a/incl

Re: [PATCH v2 4/7] util/fifo8: Rename fifo8_peek_buf() -> fifo8_peek_constbuf()

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:07, Philippe Mathieu-Daudé wrote: Since fifo8_peek_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH v2 5/7] util/fifo8: Rename fifo8_pop_buf() -> fifo8_pop_constbuf()

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:07, Philippe Mathieu-Daudé wrote: Since fifo8_pop_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH v2 6/7] util/fifo8: Expose fifo8_pop_buf()

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:07, Philippe Mathieu-Daudé wrote: Extract fifo8_pop_buf() from hw/scsi/esp.c and expose it as part of the API. This function takes care of non-contiguous (wrapped) FIFO buffer (which is an implementation detail). Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daud

Re: [PATCH v2 3/7] util/fifo8: Use fifo8_reset() in fifo8_create()

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:07, Philippe Mathieu-Daudé wrote: Avoid open-coding fifo8_reset() in fifo8_create(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- util/fifo8.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/util/fifo8.c b/util/fif

Re: [RFC PATCH v2 7/9] migration/multifd: Isolate ram pages packet data

2024-07-22 Thread Peter Xu
On Mon, Jul 22, 2024 at 05:34:44PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Mon, Jul 22, 2024 at 02:59:12PM -0300, Fabiano Rosas wrote: > >> While we cannot yet disentangle the multifd packet from page data, we > >> can make the code a bit cleaner by setting the page-related fields

Re: [PATCH v2 1/7] chardev/char-fe: Document returned value on error

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:07, Philippe Mathieu-Daudé wrote: qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]() return -1 on error. Mention it in the documentation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- include/chardev/char-fe.h | 3 +++ 1 file changed, 3 insertions(

Re: [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting)

2024-07-22 Thread Philippe Mathieu-Daudé
Hi Alex, On 22/7/24 13:03, Alex Bennée wrote: warn: No match for commit c135d5eaafe7aa2533da663d8e5a34a424b71eb9 found at https://gitlab.com/stsquad/qemu.git warn: Are you sure you pushed 'pull-target-arm-20240711-209-gc135d5eaaf' there? Is this warning expected? The following changes since

Re: [PATCH v2 7/7] util/fifo8: Introduce fifo8_discard()

2024-07-22 Thread Pierrick Bouvier
On 7/22/24 09:12, Philippe Mathieu-Daudé wrote: On 22/7/24 18:07, Philippe Mathieu-Daudé wrote: Add the fifo8_discard() helper for clarity. It is a simple wrapper over fifo8_pop_buf(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 8 hw/scsi/esp.c| 2 +-

Re: [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting)

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 23:07, Philippe Mathieu-Daudé wrote: Hi Alex, On 22/7/24 13:03, Alex Bennée wrote: warn: No match for commit c135d5eaafe7aa2533da663d8e5a34a424b71eb9 found at https://gitlab.com/stsquad/qemu.git warn: Are you sure you pushed 'pull-target-arm-20240711-209-gc135d5eaaf' there? Is thi

Re: [PATCH] hw/i2c/mpc_i2c.c: Fix mmio region size

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 12:16, BALATON Zoltan wrote: On Mon, 22 Jul 2024, Philippe Mathieu-Daudé wrote: +Amit & Andrew On 22/7/24 00:55, BALATON Zoltan wrote: The last register of this device is at offset 0x14 occupying 8 bits so to cover it the mmio region needs to be 0x15 bytes long. Also correct the nam

[PATCH v6 1/9] vfio/iommufd: Introduce auto domain creation

2024-07-22 Thread Joao Martins
There's generally two modes of operation for IOMMUFD: 1) The simple user API which intends to perform relatively simple things with IOMMUs e.g. DPDK. The process generally creates an IOAS and attaches to VFIO and mainly performs IOAS_MAP and UNMAP. 2) The native IOMMUFD API where you have fine gr

[PATCH v6 8/9] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-22 Thread Joao Martins
By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=on, but that option is generally left for testing p

[PATCH v6 3/9] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps

2024-07-22 Thread Joao Martins
Store the value of @caps returned by iommufd_backend_get_device_info() in a new field HostIOMMUDeviceCaps::hw_caps. Right now the only value is whether device IOMMU supports dirty tracking (IOMMU_HW_CAP_DIRTY_TRACKING). This is in preparation for HostIOMMUDevice::realize() being called early durin

[PATCH v6 9/9] vfio/common: Allow disabling device dirty page tracking

2024-07-22 Thread Joao Martins
The property 'x-pre-copy-dirty-page-tracking' allows disabling the whole tracking of VF pre-copy phase of dirty page tracking, though it means that it will only be used at the start of the switchover phase. Add an option that disables the VF dirty page tracking, and fall back into container-based

[PATCH v6 2/9] vfio/{iommufd,container}: Remove caps::aw_bits

2024-07-22 Thread Joao Martins
Remove caps::aw_bits which requires the bcontainer::iova_ranges being initialized after device is actually attached. Instead defer that to .get_cap() and call vfio_device_get_aw_bits() directly. This is in preparation for HostIOMMUDevice::realize() being called early during attach_device(). Sugge

[PATCH v6 4/9] vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-22 Thread Joao Martins via
Move the HostIOMMUDevice::realize() to be invoked during the attach of the device before we allocate IOMMUFD hardware pagetable objects (HWPT). This allows the use of the hw_caps obtained by IOMMU_GET_HW_INFO that essentially tell if the IOMMU behind the device supports dirty tracking. Note: The

[PATCH v6 6/9] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support

2024-07-22 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that enables or disables dirty page tracking. The ioctl is used if the hwpt has been created with dirty tracking supported domain (stored in hwpt::flags) and it is called on the whole list of iommu domains. Signed-off-by: Joao Martins

[PATCH v6 0/9] hw/iommufd: IOMMUFD Dirty Tracking

2024-07-22 Thread Joao Martins
This small series adds support for IOMMU dirty tracking support via the IOMMUFD backend. The hardware capability is available on most recent x86 hardware (and these SMMUv3 in upcoming v6.11). The series is divided organized as follows: * Patches 1 - 7: IOMMUFD backend support for dirty tracking;

[PATCH v6 7/9] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support

2024-07-22 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI that fetches the bitmap that tells what was dirty in an IOVA range. A single bitmap is allocated and used across all the hwpts sharing an IOAS which is then used in log_sync() to set Qemu global bitmaps. Signed-off-by: Joao Martins Rev

[PATCH v6 5/9] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-07-22 Thread Joao Martins
In preparation to using the dirty tracking UAPI, probe whether the IOMMU supports dirty tracking. This is done via the data stored in hiod::caps::hw_caps initialized from GET_HW_INFO. Qemu doesn't know if VF dirty tracking is supported when allocating hardware pagetable in iommufd_cdev_autodomains

Re: [PATCH 1/2] mips/loongson3_virt: remove useless type cast

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 11:17, Yao Xingtao wrote: The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast the pointer of this type to uint64_t* is useless. Signed-off-by: Yao Xingtao --- hw/mips/loongson3_virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Patch queued, than

Re: [PATCH] MAINTAINERS: Cover guest-agent in QAPI schema

2024-07-22 Thread Philippe Mathieu-Daudé
On 17/7/24 16:00, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) Patch queued.

Re: [PATCH v2 2/7] util/fifo8: Fix style

2024-07-22 Thread Mark Cave-Ayland
On 22/07/2024 17:07, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/fifo8.h | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index c6295c6ff0..2692d6bfda 100644 --- a/

Re: [RFC PATCH v2 0/9] migration/multifd: Remove multifd_send_state->pages

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 05:21:48PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Mon, Jul 22, 2024 at 02:59:05PM -0300, Fabiano Rosas wrote: >> >> Hi, >> >> >> >> In this v2 I took Peter's suggestion of keeping the channels' pointers >> >> and moving only the ex

Re: [PATCH] hw/nubus/nubus-virtio-mmio: Fix missing ERRP_GUARD() in nubus_virtio_mmio_realize()

2024-07-22 Thread Philippe Mathieu-Daudé
+Markus/Eric for review On 17/7/24 13:27, Zhao Liu wrote: Hi Philippe, If possible, can this one catch a ride with your PULL too? Many thanks! Zhao On Mon, Jul 15, 2024 at 05:59:37PM +0800, Zhao Liu wrote: Date: Mon, 15 Jul 2024 17:59:37 +0800 From: Zhao Liu Subject: [PATCH] hw/nubus/nubus-

[PATCH 2/2] hw/misc/aspeed_hace: Fix SG Accumulative hashing

2024-07-22 Thread Alejandro Zeise
Make the Aspeed HACE module use the new qcrypto accumulative hashing functions when in scatter-gather accumulative mode. A hash context will maintain a "running-hash" as each scatter-gather chunk is received. Previously each scatter-gather "chunk" was cached so the hash could be computed once the

[PATCH 0/2] hw/misc/aspeed_hace: Fix SG Accumulative Hash Calculations

2024-07-22 Thread Alejandro Zeise
The goal of this patch series is to fix accumulative hashing support in the Aspeed HACE module. The issue that stemmed this patch was a failure to boot an OpenBMC image using the "ast2600-evb" machine. The U-boot 2019.04 loader failed to verify image hashes. These incorrect image hashes given by

[PATCH 1/2] crypto: add support for accumulative hashing

2024-07-22 Thread Alejandro Zeise
This change adds an accumulative hashing function (qcrypto_hash_accumulate_bytesv) and implementation for each of the crypto library backends that QEMU supports. The QCrypto API did not support hashing in an accumulative mode. As such, hardware hash modules (like the HACE from Aspeed's SoCs) are u

Re: [PATCH v2 4/7] util/fifo8: Rename fifo8_peek_buf() -> fifo8_peek_constbuf()

2024-07-22 Thread Mark Cave-Ayland
On 22/07/2024 17:07, Philippe Mathieu-Daudé wrote: Since fifo8_peek_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Perhaps fifo8_peek_bufptr() is a better

Re: [RFC PATCH v2 8/9] migration/multifd: Don't send ram data during SYNC

2024-07-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Jul 22, 2024 at 02:59:13PM -0300, Fabiano Rosas wrote: >> Skip saving and loading any ram data in the packet in the case of a >> SYNC. This fixes a shortcoming of the current code which requires a >> reset of the MultiFDPages_t fields right after the previous >> pending

Re: [PULL 0/8] Ui patches

2024-07-22 Thread Philippe Mathieu-Daudé
On 22/7/24 22:06, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The following changes since commit a7ddb48bd1363c8bcdf42776d320289c42191f01: Merge tag 'pull-aspeed-20240721' of https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000) are available in the Git

Re: [PATCH v2 5/7] util/fifo8: Rename fifo8_pop_buf() -> fifo8_pop_constbuf()

2024-07-22 Thread Mark Cave-Ayland
On 22/07/2024 17:07, Philippe Mathieu-Daudé wrote: Since fifo8_pop_buf() return a const buffer (which points directly into the FIFO backing store), rename it using the 'constbuf' suffix. This will help differentiate with methods *copying* the FIFO data. Similar comment re: fifo8_pop_bufptr() a

Re: [PATCH v2 6/7] util/fifo8: Expose fifo8_pop_buf()

2024-07-22 Thread Mark Cave-Ayland
On 22/07/2024 17:07, Philippe Mathieu-Daudé wrote: Extract fifo8_pop_buf() from hw/scsi/esp.c and expose it as part of the API. This function takes care of non-contiguous (wrapped) FIFO buffer (which is an implementation detail). I wonder if it is also worth updating the comment for fifo8_pop

<    1   2   3   4   5   >