Re: [PATCH v2 6/9] target/arm: Factor out code for setting MTE TCF0 field

2024-06-16 Thread Gustavo Romero
Hi Phil, On 6/14/24 6:02 AM, Philippe Mathieu-Daudé wrote: On 13/6/24 20:15, Gustavo Romero wrote: Hi Phil, On 6/13/24 2:35 PM, Philippe Mathieu-Daudé wrote: On 13/6/24 19:21, Gustavo Romero wrote: Factor out the code used for setting the MTE TCF0 field from the prctl code into a convenient

Re: [PATCH v2 5/9] target/arm: Make some MTE helpers widely available

2024-06-16 Thread Gustavo Romero
Hi Phil, On 6/14/24 9:34 AM, Philippe Mathieu-Daudé wrote: On 13/6/24 20:13, Gustavo Romero wrote: Hi Phil! On 6/13/24 2:32 PM, Philippe Mathieu-Daudé wrote: Hi Gustavo, On 13/6/24 19:20, Gustavo Romero wrote: Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 availabl

[PATCH v2 14/17] vfio/container: Remove VFIOContainerBase::ops

2024-06-16 Thread Cédric Le Goater
Instead, use VFIO_IOMMU_GET_CLASS() to get the class pointer. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- include/hw/vfio/vfio-container-base.h | 1 - hw/vfio/common.c | 2 +- hw/vfio/container-base.c | 37 +-- hw/v

[PATCH v2 10/17] vfio/container: Discover IOMMU type before creating the container

2024-06-16 Thread Cédric Le Goater
Since the QEMU struct type representing the VFIO container is deduced from the IOMMU type exposed by the host, this type should be well defined *before* creating the container struct. This will be necessary to instantiate a QOM object of the correct type in future changes. Rework vfio_set_iommu()

[PATCH v2 11/17] vfio/container: Change VFIOContainerBase to use QOM

2024-06-16 Thread Cédric Le Goater
VFIOContainerBase was made a QOM interface because we believed that a QOM object would expose all the IOMMU backends to the QEMU machine and human interface. This only applies to user creatable devices or objects. Change the VFIOContainerBase nature from interface to object and make the necessary

[PATCH v2 16/17] vfio/container: Introduce vfio_iommu_legacy_instance_init()

2024-06-16 Thread Cédric Le Goater
Just as we did for the VFIOContainerBase object, introduce an instance_init() handler for the legacy VFIOContainer object and do the specific initialization there. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- hw/vfio/container.c | 9 - 1 file changed, 8 insertions(+),

[PATCH v2 09/17] vfio/container: Introduce vfio_create_container()

2024-06-16 Thread Cédric Le Goater
This routine allocates the QEMU struct type representing the VFIO container. It is minimal currently and future changes will do more initialization. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- hw/vfio/container.c | 19 +++ 1 file changed, 15 insertions(+), 4

[PATCH v2 17/17] vfio/container: Move vfio_container_destroy() to an instance_finalize() handler

2024-06-16 Thread Cédric Le Goater
vfio_container_destroy() clears the resources allocated VFIOContainerBase object. Now that VFIOContainerBase is a QOM object, add an instance_finalize() handler to do the cleanup. It will be called through object_unref(). Suggested-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- include/

[PATCH v2 15/17] vfio/container: Remove vfio_container_init()

2024-06-16 Thread Cédric Le Goater
It's now empty. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- include/hw/vfio/vfio-container-base.h | 2 -- hw/vfio/container-base.c | 5 - hw/vfio/container.c | 3 --- hw/vfio/iommufd.c | 1 - 4 files changed, 11 deletion

[PATCH v2 12/17] vfio/container: Switch to QOM

2024-06-16 Thread Cédric Le Goater
Instead of allocating the container struct, create a QOM object of the appropriate type. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- hw/vfio/container.c | 6 +++--- hw/vfio/iommufd.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/container

[PATCH v2 01/17] vfio: Make vfio_devices_dma_logging_start() return bool

2024-06-16 Thread Cédric Le Goater
Since vfio_devices_dma_logging_start() takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. It will simplify potential changes coming after. vfio_container_set_dirty_page_tracking() could be modified in the same way but the errno value can be sa

[PATCH v2 13/17] vfio/container: Introduce an instance_init() handler

2024-06-16 Thread Cédric Le Goater
This allows us to move the initialization code from vfio_container_init(), which we will soon remove. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- hw/vfio/container-base.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/vfio/contain

[PATCH v2 06/17] vfio/container: Simplify vfio_container_init()

2024-06-16 Thread Cédric Le Goater
Assign the base container VFIOAddressSpace 'space' pointer in vfio_address_space_insert(). To be noted that vfio_connect_container() will assign the 'space' pointer later in the execution flow. This should not have any consequence. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan ---

[PATCH v2 07/17] vfio/container: Modify vfio_get_iommu_type() to use a container fd

2024-06-16 Thread Cédric Le Goater
The 'container' pointer has no other use than its 'fd' attribute. Simplify the prototype to ease future changes. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- hw/vfio/container.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/vfio/container.c b/hw

[PATCH v2 03/17] vfio/common: Move dirty tracking ranges update to helper

2024-06-16 Thread Cédric Le Goater
From: Joao Martins Separate the changes that updates the ranges from the listener, to make it reusable in preparation to expand its use to vIOMMU support. [ clg: - Rebased on upstream - Introduced vfio_dirty_tracking_update_range() ] Signed-off-by: Joao Martins Signed-off-by: Cédric Le

[PATCH v2 08/17] vfio/container: Introduce vfio_get_iommu_class_name()

2024-06-16 Thread Cédric Le Goater
Rework vfio_get_iommu_class() to return a literal class name instead of a class object. We will need this name to instantiate the object later on. Since the default case asserts, remove the error report as QEMU will simply abort before. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan

[PATCH v2 04/17] vfio/common: Extract vIOMMU code from vfio_sync_dirty_bitmap()

2024-06-16 Thread Cédric Le Goater
From: Avihai Horon Extract vIOMMU code from vfio_sync_dirty_bitmap() to a new function and restructure the code. This is done in preparation for optimizing vIOMMU deviice dirty page tracking. No functional changes intended. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins [ clg: - Reba

[PATCH v2 02/17] vfio: Remove unused declarations from vfio-common.h

2024-06-16 Thread Cédric Le Goater
These were forgotten in the recent cleanups. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 4 1 file changed, 4 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 776de8064f740784f95cab0311c5f15f

[PATCH v2 00/17] vfio: QOMify VFIOContainer

2024-06-16 Thread Cédric Le Goater
Hello, The series starts with simple changes (patch 1-4). Two of which were initially sent by Joao in a series adding VFIO migration support with vIOMMU [1]. The changes following prepare VFIOContainer for QOMification, switch the container models to QOM when ready and add some final cleanups. A

[PATCH v2 05/17] vfio/container: Introduce vfio_address_space_insert()

2024-06-16 Thread Cédric Le Goater
It will ease future changes. Signed-off-by: Cédric Le Goater Reviewed-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/common.c | 6 ++ hw/vfio/container.c | 2 +- hw/vfio/iommufd.c | 2 +- 4 files changed, 10 insertions(+), 2 deletions

Re: [PATCH v2 3/9] gdbstub: Add support for target-specific stubs

2024-06-16 Thread Gustavo Romero
Hi Alex, On 6/14/24 8:27 AM, Alex Bennée wrote: Gustavo Romero writes: Currently, it's not possible to have stubs specific to a given target, even though there are GDB features which are target-specific, like, for instance, memory tagging. This commit introduces gdb_extend_qsupported_feature

[PATCH v3 9/9] tests/tcg/aarch64: Add MTE gdbstub tests

2024-06-16 Thread Gustavo Romero
Add tests to exercise the MTE stubs. Signed-off-by: Gustavo Romero --- tests/tcg/aarch64/Makefile.target | 11 ++- tests/tcg/aarch64/gdbstub/test-mte.py | 86 +++ tests/tcg/aarch64/mte-8.c | 98 +++ 3 files changed, 193 insertions(+), 2

[PATCH v3 8/9] gdbstub: Add support for MTE in user mode

2024-06-16 Thread Gustavo Romero
This commit implements the stubs to handle the qIsAddressTagged, qMemTag, and QMemTag GDB packets, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 user mode. It also implements the get/set functions for the special GDB MTE register 'tag_ctl', used to control the MTE f

[PATCH v3 5/9] target/arm: Make some MTE helpers widely available

2024-06-16 Thread Gustavo Romero
Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems. Signed-off-by: Gustavo Romero --- target/arm/tcg/mte_helper.c | 45 +- target/arm/tcg/mte_helper.h | 63 + 2 files changed, 70 inser

[PATCH v3 3/9] gdbstub: Add support for target-specific stubs

2024-06-16 Thread Gustavo Romero
Currently, it's not possible to have stubs specific to a given target, even though there are GDB features which are target-specific, like, for instance, memory tagging. This commit introduces gdb_extend_qsupported_features, gdb_extend_query_table, and gdb_extend_set_table functions as interfaces t

[PATCH v3 6/9] target/arm: Factor out code for setting MTE TCF0 field

2024-06-16 Thread Gustavo Romero
Factor out the code used for setting the MTE TCF0 field from the prctl code into a convenient function. Other subsystems, like gdbstub, need to set this field as well, so keep it as a separate function to avoid duplication and ensure consistency in how this field is set across the board. Signed-of

[PATCH v3 4/9] target/arm: Fix exception case in allocation_tag_mem_probe

2024-06-16 Thread Gustavo Romero
If page in 'ptr_access' is inaccessible and probe is 'true' allocation_tag_mem_probe should not throw an exception, but currently it does, so fix it. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- target/arm/tcg/mte_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tar

[PATCH v3 2/9] gdbstub: Move GdbCmdParseEntry into a new header file

2024-06-16 Thread Gustavo Romero
Move GdbCmdParseEntry and its associated types into a separate header file to allow the use of GdbCmdParseEntry and other gdbstub command functions outside of gdbstub.c. Since GdbCmdParseEntry and get_param are now public, kdoc GdbCmdParseEntry and rename get_param to gdb_get_cmd_param. This comm

[PATCH v3 1/9] gdbstub: Clean up process_string_cmd

2024-06-16 Thread Gustavo Romero
Change 'process_string_cmd' to return true on success and false on failure, instead of 0 and -1. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gdbstub/gd

[PATCH v3 7/9] gdbstub: Make get cpu and hex conversion functions non-internal

2024-06-16 Thread Gustavo Romero
Make the gdb_first_attached_cpu and gdb_hextomem non-internal so they are not confined to use only in gdbstub.c. Signed-off-by: Gustavo Romero --- gdbstub/internals.h| 2 -- include/exec/gdbstub.h | 5 + include/gdbstub/commands.h | 6 ++ 3 files changed, 11 insertions(+), 2

[PATCH v3 0/9] Add MTE stubs for aarch64 user mode

2024-06-16 Thread Gustavo Romero
This patchset adds the stubs necessary to support GDB memory tagging commands on QEMU aarch64 user mode. These new stubs handle the qIsAddressTagged, qMemTag, and QMemTag packets, which allow GDB memory tagging subcommands 'check', 'print-allocation-tag', and 'set-allocation-tag' to work. The rema

Re: [PATCH v3 1/7] HostIOMMUDevice: Store the VFIO/VDPA agent

2024-06-16 Thread Cédric Le Goater
On 6/17/24 3:25 AM, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Sent: Friday, June 14, 2024 6:05 PM To: eric.au...@redhat.com; eric.auger@gmail.com; qemu- de...@nongnu.org; qemu-...@nongnu.org; m...@redhat.com; jean- phili...@linaro.org; peter.mayd..

[PATCH v2] Update event idx if guest has made extra buffers during double check

2024-06-16 Thread thomas
If guest has made some buffers available during double check, but the total buffer size available is lower than @bufsize, notify the guest with the latest available idx(event idx) seen by the host. Fixes: 06b12970174 ("virtio-net: fix network stall under load") Signed-off-by: wencheng Yang --- h

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-16 Thread Zhenyu Zhang
On Thu, Jun 13, 2024 at 1:48 AM Robin Murphy wrote: > > On 2024-06-12 1:50 pm, Philippe Mathieu-Daudé wrote: > > On 12/6/24 14:48, Peter Maydell wrote: > >> On Wed, 12 Jun 2024 at 13:33, Philippe Mathieu-Daudé > >> wrote: > >>> > >>> Hi Zhenyu, > >>> Hello Philippe, > >>> On 12/6/24 04:05, Zheny

Re: [PATCH v1 00/16] vfio: QOMify VFIOContainer

2024-06-16 Thread Cédric Le Goater
On 6/17/24 3:30 AM, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Subject: [PATCH v1 00/16] vfio: QOMify VFIOContainer Hello, The series starts with simple changes (patch 1-4). Two of which were initialy sent by Joao in a series adding VFIO migration sup

[PULL v2 00/19] aspeed queue

2024-06-16 Thread Cédric Le Goater
The following changes since commit 05ad1440b8428b0ade9b8e5c01469adb8fbf83e3: Merge tag 'virtio-grants-v8-tag' of https://gitlab.com/sstabellini/qemu into staging (2024-06-15 20:13:06 -0700) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-aspeed-20240617

Re: [PATCH] Update event idx if guest has made extra buffers during double check

2024-06-16 Thread Jason Wang
On Thu, Jun 13, 2024 at 10:22 AM thomas wrote: > > Fixes: 06b12970174 ("virtio-net: fix network stall under load") > > If guest has made some buffers available during double check, > but the total buffer size available is lower than @bufsize, > notify the guest with the latest available idx(event

RE: [PATCH v1 00/16] vfio: QOMify VFIOContainer

2024-06-16 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Subject: [PATCH v1 00/16] vfio: QOMify VFIOContainer > >Hello, > >The series starts with simple changes (patch 1-4). Two of which were >initialy sent by Joao in a series adding VFIO migration support with >vIOMMU [1]. > >The changes

RE: [PATCH v3 1/7] HostIOMMUDevice: Store the VFIO/VDPA agent

2024-06-16 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Friday, June 14, 2024 6:05 PM >To: eric.au...@redhat.com; eric.auger@gmail.com; qemu- >de...@nongnu.org; qemu-...@nongnu.org; m...@redhat.com; jean- >phili...@linaro.org; peter.mayd...@linaro.org; yangh...@redhat.com; Duan,

Re: [PATCH 5/5] s390x: Enable and document boot device fallback on panic

2024-06-16 Thread Jared Rossi
On 6/7/24 1:57 AM, Thomas Huth wrote: On 05/06/2024 16.48, Jared Rossi wrote: diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index c977a52b50..de3d1f0d5a 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -43,6 +43,7 @@ typedef unsigned lon

Re: [PATCH 1/1] i386/tcg: Allow IRET from user mode to user mode for dotnet runtime

2024-06-16 Thread Robert Henry
I do not think I will have the time or focus to work on improving this patch this summer, as I will retire in 2 weeks and need to make a clean break to focus on other things (health, for one) for a while. If anyone wants to put into place Richard's ideas, I will not be offended! I do not see any

Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-16 Thread Richard Henderson
On 6/13/24 02:33, Chinmay Rath wrote: +/* EA <- (ra == 0) ? 0 : GPR[ra] */ +static TCGv do_ea_calc_ra(DisasContext *ctx, int ra) +{ +TCGv EA; +if (!ra) { +EA = tcg_constant_tl(0); +return EA; +} +EA = tcg_temp_new(); +if (NARROW_MODE(ctx)) { +tcg_gen_ex

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-16 Thread Alex Bennée
Pierrick Bouvier writes: > On 6/13/24 01:54, Philippe Mathieu-Daudé wrote: >> On 12/6/24 17:35, Alex Bennée wrote: >>> From: Pierrick Bouvier >>> >>> This plugin uses the new time control interface to make decisions >>> about the state of time during the emulation. The algorithm is >>> currently

Re: [PATCH] target/sparc: use signed denominator in sdiv helper

2024-06-16 Thread Richard Henderson
On 6/6/24 07:43, Clément Chigot wrote: The result has to be done with the signed denominator (b32) instead of the unsigned value passed in argument (b). Fixes: 1326010322d6 ("target/sparc: Remove CC_OP_DIV") Signed-off-by: Clément Chigot --- target/sparc/helper.c | 2 +- 1 file changed, 1 in

Re: [PATCH v2] linux-user: Make TARGET_NR_setgroups affect only the current thread

2024-06-16 Thread Richard Henderson
On 6/14/24 08:46, Ilya Leoshkevich wrote: Like TARGET_NR_setuid, TARGET_NR_setgroups should affect only the calling thread, and not the entire process. Therefore, implement it using a syscall, and not a libc call. Cc:qemu-sta...@nongnu.org Fixes: 19b84f3c35d7 ("added setgroups and getgroups sysc

Re: [PATCH v3] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-16 Thread Richard Henderson
On 6/12/24 06:30, Anton Johansson wrote: For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Cc: qemu-sta...@nongnu.org Fixes: deba78709a ("accel/tcg: Always lock

Re: [PATCH] Make TARGET_PAGE_MASK typed as target_ulong

2024-06-16 Thread Richard Henderson
On 6/16/24 10:40, Roman Kiryanov wrote: Hi Richard, thank you for looking into this. No, this will cause failures, because we need this value to sign-extend to when the context includes {u}int64_t, and target_ulong is uint32_t. I did not expect this, good catch. I see QEMU uses size_t as th

Re: [PULL 0/5] virtio-grants-v8-tag

2024-06-16 Thread Richard Henderson
On 6/12/24 14:29, Stefano Stabellini wrote: The following changes since commit 80e8f0602168f451a93e71cbb1d59e93d745e62e: Merge tag 'virtio-grants-v8-tag' into staging (2024-06-09 11:21:55 -0700) are available in the Git repository at: https://gitlab.com/sstabellini/qemu.git for you t

Re: [PATCH] Make TARGET_PAGE_MASK typed as target_ulong

2024-06-16 Thread Roman Kiryanov
Hi Richard, thank you for looking into this. > No, this will cause failures, because we need this value to sign-extend to > when the > context includes {u}int64_t, and target_ulong is uint32_t. I did not expect this, good catch. I see QEMU uses size_t as the return type in qemu_target_page_size

Re: [PATCH v14 12/14] virtio-gpu: Handle resource blob commands

2024-06-16 Thread Akihiko Odaki
On 2024/06/16 10:03, Dmitry Osipenko wrote: From: Antonio Caggiano Support BLOB resources creation, mapping and unmapping by calling the new stable virglrenderer 0.10 interface. Only enabled when available and via the blob config. E.g. -device virtio-vga-gl,blob=true Signed-off-by: Antonio Cag

Re: [PATCH v14 10/14] virtio-gpu: Support blob scanout using dmabuf fd

2024-06-16 Thread Akihiko Odaki
On 2024/06/16 10:03, Dmitry Osipenko wrote: From: Robert Beckett Support displaying blob resources by handling SET_SCANOUT_BLOB command. Signed-by: Antonio Caggiano Signed-off-by: Robert Beckett Signed-off-by: Huang Rui Reviewed-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko --- hw