Re: [PATCH v4 05/24] Revert "replay: stop us hanging in rr_wait_io_event"

2024-03-13 Thread Nicholas Piggin
On Wed Mar 13, 2024 at 7:03 AM AEST, Alex Bennée wrote: > "Nicholas Piggin" writes: > > > On Tue Mar 12, 2024 at 11:33 PM AEST, Alex Bennée wrote: > >> Nicholas Piggin writes: > >> > >> > This reverts commit 1f881ea4a444ef36a8b6907b0b82be4b3af253a2. > >> > > >> > That commit causes

Re: [PATCH v2 03/10] ppc/spapr|pnv: Remove SAO from pa-features

2024-03-13 Thread Nicholas Piggin
On Thu Mar 14, 2024 at 12:34 PM AEST, David Gibson wrote: > On Tue, Mar 12, 2024 at 11:14:12PM +1000, Nicholas Piggin wrote: > > SAO is a page table attribute that strengthens the memory ordering of > > accesses. QEMU with MTTCG does not implement this, so clear it in > > ibm,pa-features. This is

Re: [PATCH-for-9.0? 05/12] target/ppc: Rename init_excp_4xx_softmmu() -> init_excp_4xx()

2024-03-13 Thread Nicholas Piggin
On Thu Mar 14, 2024 at 7:33 AM AEST, Philippe Mathieu-Daudé wrote: > Unify with other init_excp_FOO() in the same file. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin > --- > target/ppc/cpu_init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

RE: [PATCH v1 3/6] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap

2024-03-13 Thread Duan, Zhenzhong
>-Original Message- >From: Michael S. Tsirkin >Subject: Re: [PATCH v1 3/6] intel_iommu: Add a framework to check and >sync host IOMMU cap/ecap > >On Wed, Mar 13, 2024 at 07:54:11AM +, Duan, Zhenzhong wrote: >> >> >> >-Original Message- >> >From: Michael S. Tsirkin >>

Re: [PATCH for-9.0 v14 4/8] target/riscv/vector_helpers: do early exit when vstart >= vl

2024-03-13 Thread Max Chou
Hi Daniel, According the v spec section 15.2 & 15.3. "The vcpop.m instruction writes x[rd] even if vl=0 (with the value 0, since no mask elements are active).   Traps on vcpop.m are always reported with a vstart of 0. The vcpop.m instruction will raise an illegal instruction exception if

RE: [PATCH] vfio/iommufd: Fix memory leak

2024-03-13 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Thursday, March 14, 2024 5:06 AM >To: qemu-devel@nongnu.org >Cc: Alex Williamson ; Cédric Le Goater >; Eric Auger ; Liu, Yi L >; Duan, Zhenzhong >Subject: [PATCH] vfio/iommufd: Fix memory leak > >Make sure variable contents is freed if

Re: [PATCH] hw/virtio: Add support for VDPA network simulation devices

2024-03-13 Thread Jason Wang
On Thu, Mar 14, 2024 at 3:52 AM Michael S. Tsirkin wrote: > > On Wed, Mar 13, 2024 at 07:51:08PM +0100, Thomas Weißschuh wrote: > > On 2024-02-21 15:38:02+0800, Hao Chen wrote: > > > This patch adds support for VDPA network simulation devices. > > > The device is developed based on virtio-net and

Re: [PATCH] vfio/iommufd: Fix memory leak

2024-03-13 Thread Yi Liu
On 2024/3/14 05:06, Cédric Le Goater wrote: Make sure variable contents is freed if scanf fails. Cc: Eric Auger Cc: Yi Liu Cc: Zhenzhong Duan Fixes: CID 1540007 Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend") Signed-off-by: Cédric Le Goater --- hw/vfio/iommufd.c | 5

Re: [PATCH] vhost-vdpa: check vhost_vdpa_set_vring_ready() return value

2024-03-13 Thread Jason Wang
On Wed, Feb 7, 2024 at 5:27 PM Stefano Garzarella wrote: > > vhost_vdpa_set_vring_ready() could already fail, but if Linux's > patch [1] will be merged, it may fail with more chance if > userspace does not activate virtqueues before DRIVER_OK when > VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK is not

Re: [PATCH v2 1/6] virtio/virtio-pci: Handle extra notification data

2024-03-13 Thread Jason Wang
On Wed, Mar 13, 2024 at 7:55 PM Jonah Palmer wrote: > > Add support to virtio-pci devices for handling the extra data sent > from the driver to the device when the VIRTIO_F_NOTIFICATION_DATA > transport feature has been negotiated. > > The extra data that's passed to the virtio-pci device when

Re: [PATCH v2 04/10] ppc/spapr: Remove copy-paste from pa-features

2024-03-13 Thread David Gibson
On Tue, Mar 12, 2024 at 11:14:13PM +1000, Nicholas Piggin wrote: > TCG does not support copy/paste instructions. Remove it from > ibm,pa-features. This has never been implemented under TCG or > practically usable under KVM, so it won't be missed. As with the previous patch, the specific

Re: [PATCH v2 03/10] ppc/spapr|pnv: Remove SAO from pa-features

2024-03-13 Thread David Gibson
On Tue, Mar 12, 2024 at 11:14:12PM +1000, Nicholas Piggin wrote: > SAO is a page table attribute that strengthens the memory ordering of > accesses. QEMU with MTTCG does not implement this, so clear it in > ibm,pa-features. This is an obscure feature that has been removed from > POWER10 ISA v3.1,

Re: [PATCH v6 03/17] hw/loongarch: Add slave cpu boot_code

2024-03-13 Thread chen huacai
Song, On Fri, Mar 8, 2024 at 12:51 AM Song Gao wrote: > > Signed-off-by: Song Gao > Message-Id: <20240301093839.663947-4-gaos...@loongson.cn> > --- > hw/loongarch/boot.c | 70 - > 1 file changed, 69 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH V4 1/1] target/loongarch: Fixed tlb huge page loading issue

2024-03-13 Thread chen huacai
Hi, Xianglai, Generally, the subject should be "Fix tlb huge page loading issue" rather than "Fixed tlb huge page loading issue". On Thu, Mar 14, 2024 at 9:34 AM Xianglai Li wrote: > > When we use qemu tcg simulation, the page size of bios is 4KB. > When using the level 2 super large page (page

[PATCH V4] target/loongarch: Fixed tlb huge page loading issue

2024-03-13 Thread Xianglai Li
When we use qemu tcg simulation, the page size of bios is 4KB. When using the level 2 super large page (page size is 1G) to create the page table, it is found that the content of the corresponding address space is abnormal, resulting in the bios can not start the operating system and graphical

RE: [PULL 2/3] xen: Drop out of coroutine context xen_invalidate_map_cache_entry

2024-03-13 Thread Peng Fan
> Subject: Re: [PULL 2/3] xen: Drop out of coroutine context > xen_invalidate_map_cache_entry > > 13.03.2024 20:21, Michael Tokarev: > > 12.03.2024 17:27, Anthony PERARD wrote: > >> From: Peng Fan > >> > >> xen_invalidate_map_cache_entry is not expected to run in a coroutine. > >> Without this,

[PATCH V4 1/1] target/loongarch: Fixed tlb huge page loading issue

2024-03-13 Thread Xianglai Li
When we use qemu tcg simulation, the page size of bios is 4KB. When using the level 2 super large page (page size is 1G) to create the page table, it is found that the content of the corresponding address space is abnormal, resulting in the bios can not start the operating system and graphical

Re: [PATCH v6 03/17] hw/loongarch: Add slave cpu boot_code

2024-03-13 Thread maobibo
On 2024/3/11 下午2:50, maobibo wrote: On 2024/3/8 下午5:36, gaosong wrote: 在 2024/3/8 16:27, maobibo 写道: On 2024/3/8 上午12:48, Song Gao wrote: Signed-off-by: Song Gao Message-Id: <20240301093839.663947-4-gaos...@loongson.cn> ---   hw/loongarch/boot.c | 70

Re: [PATCH for-9.0] mirror: Don't call job_pause_point() under graph lock

2024-03-13 Thread Eric Blake
On Wed, Mar 13, 2024 at 04:30:00PM +0100, Kevin Wolf wrote: > Calling job_pause_point() while holding the graph reader lock > potentially results in a deadlock: bdrv_graph_wrlock() first drains > everything, including the mirror job, which pauses it. The job is only > unpaused at the end of the

[PATCH for-9.0 v2 0/3] target/hppa: Fix some wide mode displacements

2024-03-13 Thread Richard Henderson
As reported by Sven Schnelle, fixed via decodetree functions. Changes for v2: - Fix extract_16 implementation (deller) - Adjust some local variables to match arch doc field names. r~ Richard Henderson (3): target/hppa: Fix assemble_16 insns for wide mode target/hppa: Fix assemble_11a

[PATCH v2 3/3] target/hppa: Fix assemble_12a insns for wide mode

2024-03-13 Thread Richard Henderson
Tested-by: Helge Deller Reported-by: Sven Schnelle Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 27 --- target/hppa/translate.c | 17 + 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/target/hppa/insns.decode

Re: [PATCH v3 00/20] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS

2024-03-13 Thread Michael S. Tsirkin
On Wed, Mar 13, 2024 at 09:49:39AM +0100, Igor Mammedov wrote: > On Tue, 12 Mar 2024 13:31:39 -0400 > "Michael S. Tsirkin" wrote: > > > On Tue, Mar 12, 2024 at 05:10:30PM +0100, Igor Mammedov wrote: > > > Changelog: > > > v3: > > >* whitespace missed by checkpatch > > >* fix idndent in

[PATCH v2 2/3] target/hppa: Fix assemble_11a insns for wide mode

2024-03-13 Thread Richard Henderson
Tested-by: Helge Deller Reviewed-by: Helge Deller Reported-by: Sven Schnelle Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 7 --- target/hppa/translate.c | 23 +-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git

[PATCH v2 1/3] target/hppa: Fix assemble_16 insns for wide mode

2024-03-13 Thread Richard Henderson
Reported-by: Sven Schnelle Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 15 +-- target/hppa/translate.c | 22 ++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index

Re: [PATCH for-9.0 v14 3/8] target/riscv: always clear vstart in whole vec move insns

2024-03-13 Thread Richard Henderson
On 3/13/24 12:01, Daniel Henrique Barboza wrote: These insns have 2 paths: we'll either have vstart already cleared if vstart_eq_zero or we'll do a brcond to check if vstart >= maxsz to call the 'vmvr_v' helper. The helper will clear vstart if it executes until the end, or if vstart >= vl.

[PATCH for-9.0 v14 4/8] target/riscv/vector_helpers: do early exit when vstart >= vl

2024-03-13 Thread Daniel Henrique Barboza
We're going to make changes that will required each helper to be responsible for the 'vstart' management, i.e. we will relieve the 'vstart < vl' assumption that helpers have today. Helpers are usually able to deal with vstart >= vl, i.e. doing nothing aside from setting vstart = 0 at the end, but

[PATCH for-9.0 v14 5/8] target/riscv: remove 'over' brconds from vector trans

2024-03-13 Thread Daniel Henrique Barboza
The previous patch added an early vstart >= vl exit in all vector helpers, most of them using the VSTART_CHECK_EARLY_EXIT() macro, and now we're left with a lot of 'brcond' that has not use. The pattern goes like this: VSTART_CHECK_EARLY_EXIT(env); (...)

[PATCH for-9.0 v14 8/8] target/riscv/vector_helper.c: optimize loops in ldst helpers

2024-03-13 Thread Daniel Henrique Barboza
Change the for loops in ldst helpers to do a single increment in the counter, and assign it env->vstart, to avoid re-reading from vstart every time. Suggested-by: Richard Henderson Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson ---

[PATCH for-9.0 v14 2/8] trans_rvv.c.inc: set vstart = 0 in int scalar move insns

2024-03-13 Thread Daniel Henrique Barboza
trans_vmv_x_s, trans_vmv_s_x, trans_vfmv_f_s and trans_vfmv_s_f aren't setting vstart = 0 after execution. This is usually done by a helper in vector_helper.c but these functions don't use helpers. We'll set vstart after any potential 'over' brconds, and that will also mandate a mark_vs_dirty()

[PATCH for-9.0 v14 0/8] riscv: set vstart_eq_zero on vector insns

2024-03-13 Thread Daniel Henrique Barboza
Hi, In this version we're fixing a redundant check in the vmvr_v helper that was pointed out by in v13. To make this change easier patches 3 and 4 switched places. A trivial change was made in patch 4 that don't warrant another review. We're missing acks in patch 3 only. Series based on

[PATCH for-9.0 v14 7/8] target/riscv: enable 'vstart_eq_zero' in the end of insns

2024-03-13 Thread Daniel Henrique Barboza
From: Ivan Klokov The vstart_eq_zero flag is updated at the beginning of the translation phase from the env->vstart variable. During the execution phase all functions will set env->vstart = 0 after a successful execution, but the vstart_eq_zero flag remains the same as at the start of the block.

[PATCH for-9.0 v14 6/8] trans_rvv.c.inc: remove redundant mark_vs_dirty() calls

2024-03-13 Thread Daniel Henrique Barboza
trans_vmv_v_i , trans_vfmv_v_f and the trans_##NAME macro from GEN_VMV_WHOLE_TRANS() are calling mark_vs_dirty() in both branches of their 'ifs'. conditionals. Call it just once in the end like other functions are doing. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson

[PATCH for-9.0 v14 3/8] target/riscv: always clear vstart in whole vec move insns

2024-03-13 Thread Daniel Henrique Barboza
These insns have 2 paths: we'll either have vstart already cleared if vstart_eq_zero or we'll do a brcond to check if vstart >= maxsz to call the 'vmvr_v' helper. The helper will clear vstart if it executes until the end, or if vstart >= vl. However, if vstart >= maxsz, the helper will be

[PATCH for-9.0 v14 1/8] target/riscv/vector_helper.c: set vstart = 0 in GEN_VEXT_VSLIDEUP_VX()

2024-03-13 Thread Daniel Henrique Barboza
The helper isn't setting env->vstart = 0 after its execution, as it is expected from every vector instruction that completes successfully. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/vector_helper.c | 1 + 1 file

Re: [PATCH v2 02/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase()

2024-03-13 Thread Philippe Mathieu-Daudé
On 13/3/24 12:03, Philippe Mathieu-Daudé wrote: On 13/3/24 09:57, Mark Cave-Ayland wrote: The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_message_phase() use the underlying Fifo8 functions directly.

Re: [PATCH v2 01/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase()

2024-03-13 Thread Philippe Mathieu-Daudé
On 13/3/24 22:08, Mark Cave-Ayland wrote: On 13/03/2024 11:03, Philippe Mathieu-Daudé wrote: On 13/3/24 09:57, Mark Cave-Ayland wrote: The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the

Re: [PATCH for-9.0 v13 4/8] target/riscv: always clear vstart in whole vec move insns

2024-03-13 Thread Daniel Henrique Barboza
On 3/13/24 18:16, Richard Henderson wrote: On 3/13/24 09:30, Daniel Henrique Barboza wrote: These insns have 2 paths: we'll either have vstart already cleared if vstart_eq_zero or we'll do a brcond to check if vstart >= maxsz to call the 'vmvr_v' helper. The helper will clear vstart if it

[PATCH-for-9.1 06/12] tcg/sparc64: Check for USER_ONLY definition instead of SOFTMMU one

2024-03-13 Thread Philippe Mathieu-Daudé
Since we *might* have user emulation with softmmu, replace the system emulation check by !user emulation one. Signed-off-by: Philippe Mathieu-Daudé --- tcg/sparc64/tcg-target.c.inc | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc

[PATCH-for-9.1 10/12] exec/cpu-defs: Restrict SOFTMMU specific definitions to accel/tcg/

2024-03-13 Thread Philippe Mathieu-Daudé
CPU_TLB_foo definitions are specific to SoftMMU and only used in accel/tcg/. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-target.h | 26 ++ include/exec/cpu-defs.h | 26 -- 2 files changed, 26 insertions(+), 26 deletions(-)

[PATCH-for-9.1 07/12] plugins/api: Check for USER_ONLY definition instead of SOFTMMU one

2024-03-13 Thread Philippe Mathieu-Daudé
Since we *might* have user emulation with softmmu, replace the system emulation check by !user emulation one. Signed-off-by: Philippe Mathieu-Daudé --- plugins/api.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/api.c b/plugins/api.c index

[PATCH-for-9.1 09/12] accel/tcg/internal: Check for USER_ONLY definition instead of SOFTMMU

2024-03-13 Thread Philippe Mathieu-Daudé
Since we *might* have user emulation with softmmu, replace the system emulation check by !user emulation one. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-target.h | 6 +++--- accel/tcg/tb-hash.h | 4 ++-- accel/tcg/tcg-all.c | 2 +- 3 files changed, 6

[PATCH-for-9.0? 08/12] accel/tcg/tb-maint: Add comments around system emulation

2024-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tb-maint.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index da39a43bd8..2fef7db9e1 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -147,7 +147,8 @@

[PATCH-for-9.1 12/12] exec/poison: Poison CONFIG_SOFTMMU again

2024-03-13 Thread Philippe Mathieu-Daudé
Now that the confusion around SOFTMMU vs SYSTEM emulation was clarified, we can restore the CONFIG_SOFTMMU poison pragma. This reverts commit d31b84041d4353ef310ffde23c87b78c2aa32ead ("exec/poison: Do not poison CONFIG_SOFTMMU"). Signed-off-by: Philippe Mathieu-Daudé --- include/exec/poison.h

Re: [PATCH-for-9.0 3/4] qtest/libqos: Un-inline size_to_prdtl()

2024-03-13 Thread Philippe Mathieu-Daudé
On 13/3/24 20:39, Peter Maydell wrote: On Wed, 13 Mar 2024 at 18:50, Philippe Mathieu-Daudé wrote: See previous commit and commit 9de9fa5cf2 ("Avoid using inlined functions with external linkage") for rationale. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqos/ahci.c | 2 +-

[PATCH-for-9.0? 04/12] gdbstub/system: Rename 'user_ctx' argument as 'ctx'

2024-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- gdbstub/internals.h | 8 gdbstub/system.c| 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 7055138dee..e39c4b113c 100644 --- a/gdbstub/internals.h +++

[PATCH-for-9.0? 03/12] gdbstub: Correct invalid mentions of 'softmmu' by 'system'

2024-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- gdbstub/internals.h | 20 ++-- gdbstub/system.c| 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index b472459838..7055138dee 100644 --- a/gdbstub/internals.h +++

[PATCH-for-9.1 11/12] tcg: Remove unused CONFIG_SOFTMMU definition from libtcg_system.fa

2024-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- tcg/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/tcg/meson.build b/tcg/meson.build index 8251589fd4..b5246676c6 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -42,7 +42,6 @@ user_ss.add(tcg_user) libtcg_system =

[PATCH-for-9.0? 05/12] target/ppc: Rename init_excp_4xx_softmmu() -> init_excp_4xx()

2024-03-13 Thread Philippe Mathieu-Daudé
Unify with other init_excp_FOO() in the same file. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 7e65f08147..b208bd91a0 100644 ---

[PATCH-for-9.0? 02/12] travis-ci: Rename SOFTMMU -> SYSTEM

2024-03-13 Thread Philippe Mathieu-Daudé
Since we *might* have user emulation with softmmu, rename MAIN_SOFTMMU_TARGETS as MAIN_SYSTEM_TARGETS to express 'system emulation targets'. Signed-off-by: Philippe Mathieu-Daudé --- .travis.yml | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml

[PATCH-for-9.0? 01/12] accel/tcg/plugin: Remove CONFIG_SOFTMMU_GATE definition

2024-03-13 Thread Philippe Mathieu-Daudé
The CONFIG_SOFTMMU_GATE definition was never used, remove it. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/plugin-gen.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 8028786c7b..cd78ef94a1 100644 ---

[PATCH-for-9.1 00/12] accel/tcg: Finish replacing SOFTMMU -> SYSTEM

2024-03-13 Thread Philippe Mathieu-Daudé
Finish the softmmu/system clarification. Poison CONFIG_SOFTMMU at the end, we can still check for system mode with !CONFIG_USER_ONLY. Philippe Mathieu-Daudé (12): accel/tcg/plugin: Remove CONFIG_SOFTMMU_GATE definition travis-ci: Rename SOFTMMU -> SYSTEM gdbstub: Correct invalid mentions

[PATCH v2 0/2] migration mapped-ram fixes

2024-03-13 Thread Fabiano Rosas
Hi, In this v2: patch 1 - The fix for the ioc leaks, now including the main channel patch 2 - A fix for an fd: migration case I thought I had written code for, but obviously didn't. Thank you for your patience. based-on: https://gitlab.com/peterx/qemu/-/commits/migration-stable CI

[PATCH v2 2/2] migration/multifd: Ensure we're not given a socket for file migration

2024-03-13 Thread Fabiano Rosas
When doing migration using the fd: URI, the incoming migration starts before the user has passed the file descriptor to QEMU. This means that the checks at migration_channels_and_transport_compatible() happen too soon and we need to allow a migration channel of type SOCKET_ADDRESS_TYPE_FD even

[PATCH v2 1/2] migration: Fix iocs leaks during file and fd migration

2024-03-13 Thread Fabiano Rosas
The memory for the io channels is being leaked in three different ways during file migration: 1) if the offset check fails we never drop the ioc reference; 2) we allocate an extra channel for no reason; 3) if multifd is enabled but channel creation fails when calling dup(), we leave the

Re: [PATCH V4 10/14] migration: stop vm for cpr

2024-03-13 Thread Cédric Le Goater
On 3/13/24 15:18, Steven Sistare wrote: On 2/29/2024 8:28 PM, Peter Xu wrote: On Thu, Feb 29, 2024 at 10:21:14AM -0500, Steven Sistare wrote: On 2/25/2024 9:08 PM, Peter Xu wrote: On Thu, Feb 22, 2024 at 09:28:36AM -0800, Steve Sistare wrote: When migration for cpr is initiated, stop the vm

Re: [PATCH for-9.0 v13 4/8] target/riscv: always clear vstart in whole vec move insns

2024-03-13 Thread Richard Henderson
On 3/13/24 09:30, Daniel Henrique Barboza wrote: These insns have 2 paths: we'll either have vstart already cleared if vstart_eq_zero or we'll do a brcond to check if vstart >= maxsz to call the 'vmvr_v' helper. The helper will clear vstart if it executes until the end, or if vstart >= vl.

Re: [PATCH] vfio/iommufd: Fix memory leak

2024-03-13 Thread Eric Auger
On 3/13/24 22:06, Cédric Le Goater wrote: > Make sure variable contents is freed if scanf fails. > > Cc: Eric Auger > Cc: Yi Liu > Cc: Zhenzhong Duan > Fixes: CID 1540007 > Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend") > Signed-off-by: Cédric Le Goater Reviewed-by:

Re: [PATCH-for-9.0 2/4] accel/hvf: Un-inline hvf_arch_supports_guest_debug()

2024-03-13 Thread Richard Henderson
On 3/13/24 08:49, Philippe Mathieu-Daudé wrote: See previous commit and commit 9de9fa5cf2 ("Avoid using inlined functions with external linkage") for rationale. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/hvf/hvf.c | 2 +- target/i386/hvf/hvf.c | 2 +- 2 files changed, 2

Re: [PATCH-for-9.0 4/4] meson: Enable -Wstatic-in-inline

2024-03-13 Thread Richard Henderson
On 3/13/24 08:49, Philippe Mathieu-Daudé wrote: Compilers are clever enough to inline code when necessary. The only case we accept an inline function is static in header (we use C, not C++). Add the -Wstatic-in-inline CPPFLAG to prevent public and inline function to be added in the code base.

Re: [PATCH v2 01/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase()

2024-03-13 Thread Mark Cave-Ayland
On 13/03/2024 11:03, Philippe Mathieu-Daudé wrote: On 13/3/24 09:57, Mark Cave-Ayland wrote: The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the underlying Fifo8 functions directly.

Re: [PATCH-for-9.0 1/4] hw/arm/smmu: Avoid using inlined functions with external linkage again

2024-03-13 Thread Richard Henderson
On 3/13/24 08:49, Philippe Mathieu-Daudé wrote: Similarly to commit 9de9fa5cf2 ("hw/arm/smmu-common: Avoid using inlined functions with external linkage"): None of our code base require / use inlined functions with external linkage. Some places use internal inlining in the hot path. These

[PATCH] vfio/iommufd: Fix memory leak

2024-03-13 Thread Cédric Le Goater
Make sure variable contents is freed if scanf fails. Cc: Eric Auger Cc: Yi Liu Cc: Zhenzhong Duan Fixes: CID 1540007 Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend") Signed-off-by: Cédric Le Goater --- hw/vfio/iommufd.c | 5 +++-- 1 file changed, 3 insertions(+), 2

Re: [PATCH 12/12] vdpa: fix network breakage after cancelling migration

2024-03-13 Thread Michael Tokarev
13.03.2024 22:10, Si-Wei Liu wrote: On 3/13/2024 11:12 AM, Michael Tokarev wrote: .. Is this a -stable material? Probably yes, the pre-requisites of this patch are PATCH #10 and #11 from this series (where SVQ_TSTATE_DISABLING gets defined and set). If yes, is it also applicable for

Re: [PATCH v3] target/riscv: Implement dynamic establishment of custom decoder

2024-03-13 Thread Richard Henderson
On 3/12/24 23:57, Huang Tao wrote: In this patch, we modify the decoder to be a freely composable data structure instead of a hardcoded one. It can be dynamically builded up according to the extensions. This approach has several benefits: 1. Provides support for heterogeneous cpu architectures.

Re: udp guestfwd

2024-03-13 Thread Felix Wu
Hi Louai, Are you using IPv6 or IPv4? The IPv4 is actually broken (if you want to send multiple requests to slirp and get them forwarded). You can check the latest comments in following tickets: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/67

Re: [PATCH for-9.0] target/riscv: do not enable all named features by default

2024-03-13 Thread Andrew Jones
On Tue, Mar 12, 2024 at 05:32:14PM -0300, Daniel Henrique Barboza wrote: > Commit 3b8022269c added the capability of named features/profile > extensions to be added in riscv,isa. To do that we had to assign priv > versions for each one of them in isa_edata_arr[]. But this resulted in a >

Re: [PATCH] hw/virtio: Add support for VDPA network simulation devices

2024-03-13 Thread Michael S. Tsirkin
On Wed, Mar 13, 2024 at 07:51:08PM +0100, Thomas Weißschuh wrote: > On 2024-02-21 15:38:02+0800, Hao Chen wrote: > > This patch adds support for VDPA network simulation devices. > > The device is developed based on virtio-net and tap backend, > > and supports hardware live migration function. > >

Re: [PATCH-for-9.0 2/4] accel/hvf: Un-inline hvf_arch_supports_guest_debug()

2024-03-13 Thread Peter Maydell
On Wed, 13 Mar 2024 at 18:50, Philippe Mathieu-Daudé wrote: > > See previous commit and commit 9de9fa5cf2 ("Avoid using inlined > functions with external linkage") for rationale. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH-for-9.0 3/4] qtest/libqos: Un-inline size_to_prdtl()

2024-03-13 Thread Peter Maydell
On Wed, 13 Mar 2024 at 18:50, Philippe Mathieu-Daudé wrote: > > See previous commit and commit 9de9fa5cf2 ("Avoid using inlined > functions with external linkage") for rationale. > > Signed-off-by: Philippe Mathieu-Daudé > --- > tests/qtest/libqos/ahci.c | 2 +- > 1 file changed, 1

[PATCH for-9.0 v13 3/8] target/riscv/vector_helpers: do early exit when vstart >= vl

2024-03-13 Thread Daniel Henrique Barboza
We're going to make changes that will required each helper to be responsible for the 'vstart' management, i.e. we will relieve the 'vstart < vl' assumption that helpers have today. Helpers are usually able to deal with vstart >= vl, i.e. doing nothing aside from setting vstart = 0 at the end, but

[PATCH for-9.0 v13 7/8] target/riscv: enable 'vstart_eq_zero' in the end of insns

2024-03-13 Thread Daniel Henrique Barboza
From: Ivan Klokov The vstart_eq_zero flag is updated at the beginning of the translation phase from the env->vstart variable. During the execution phase all functions will set env->vstart = 0 after a successful execution, but the vstart_eq_zero flag remains the same as at the start of the block.

[PATCH for-9.0 v13 6/8] trans_rvv.c.inc: remove redundant mark_vs_dirty() calls

2024-03-13 Thread Daniel Henrique Barboza
trans_vmv_v_i , trans_vfmv_v_f and the trans_##NAME macro from GEN_VMV_WHOLE_TRANS() are calling mark_vs_dirty() in both branches of their 'ifs'. conditionals. Call it just once in the end like other functions are doing. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson

[PATCH for-9.0 v13 8/8] target/riscv/vector_helper.c: optimize loops in ldst helpers

2024-03-13 Thread Daniel Henrique Barboza
Change the for loops in ldst helpers to do a single increment in the counter, and assign it env->vstart, to avoid re-reading from vstart every time. Suggested-by: Richard Henderson Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson ---

[PATCH for-9.0 v13 4/8] target/riscv: always clear vstart in whole vec move insns

2024-03-13 Thread Daniel Henrique Barboza
These insns have 2 paths: we'll either have vstart already cleared if vstart_eq_zero or we'll do a brcond to check if vstart >= maxsz to call the 'vmvr_v' helper. The helper will clear vstart if it executes until the end, or if vstart >= vl. However, if vstart >= maxsz, the helper will be

[PATCH for-9.0 v13 5/8] target/riscv: remove 'over' brconds from vector trans

2024-03-13 Thread Daniel Henrique Barboza
The previous patch added an early vstart >= vl exit in all vector helpers, most of them using the VSTART_CHECK_EARLY_EXIT() macro, and now we're left with a lot of 'brcond' that has not use. The pattern goes like this: VSTART_CHECK_EARLY_EXIT(env); (...)

[PATCH for-9.0 v13 2/8] trans_rvv.c.inc: set vstart = 0 in int scalar move insns

2024-03-13 Thread Daniel Henrique Barboza
trans_vmv_x_s, trans_vmv_s_x, trans_vfmv_f_s and trans_vfmv_s_f aren't setting vstart = 0 after execution. This is usually done by a helper in vector_helper.c but these functions don't use helpers. We'll set vstart after any potential 'over' brconds, and that will also mandate a mark_vs_dirty()

[PATCH for-9.0 v13 1/8] target/riscv/vector_helper.c: set vstart = 0 in GEN_VEXT_VSLIDEUP_VX()

2024-03-13 Thread Daniel Henrique Barboza
The helper isn't setting env->vstart = 0 after its execution, as it is expected from every vector instruction that completes successfully. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/vector_helper.c | 1 + 1 file

[PATCH for-9.0 v13 0/8] riscv: set vstart_eq_zero on vector insns

2024-03-13 Thread Daniel Henrique Barboza
Hi, In this new version I added a new patch (patch 4) to handle the case pointed out by LIU Zhiwei in v12. I decided to do it in separate since it's a distinct case from what we're dealing with in patch 5. No other changes made. Series based on master. Patches missing acks: patch 4. Changes

Re: [PATCH v3 1/1] target/i386: Enable page walking from MMIO memory

2024-03-13 Thread Richard Henderson
On 3/7/24 05:53, Jonathan Cameron wrote: From: Gregory Price CXL emulation of interleave requires read and write hooks due to requirement for subpage granularity. The Linux kernel stack now enables using this memory as conventional memory in a separate NUMA node. If a process is deliberately

Re: [PATCH v2] target/arm: Fix 32-bit SMOPA

2024-03-13 Thread Richard Henderson
On 3/13/24 09:12, Michael Tokarev wrote: warning: TCG temporary leaks before 00400730 qemu-aarch64: ../tcg/tcg.c:1052: tcg_temp_free_internal: Assertion `ts->temp_allocated != 0' failed. timeout: the monitored command dumped core Trace/breakpoint trap Does it make sense to pick this

Re: [PATCH v5 3/3] target/riscv: Enable sdtrig for Ventana's Veyron CPUs

2024-03-13 Thread Andrew Jones
On Wed, Mar 13, 2024 at 11:50:09PM +0530, Himanshu Chauhan wrote: > Ventana's Veyron CPUs support sdtrig ISA extension. By default, enable > the sdtrig extension and disable the debug property for these CPUs. > > Signed-off-by: Himanshu Chauhan > --- > target/riscv/cpu.c | 2 ++ > 1 file

Re: [PATCH v5 2/3] target/riscv: Expose sdtrig ISA extension

2024-03-13 Thread Andrew Jones
On Wed, Mar 13, 2024 at 11:50:08PM +0530, Himanshu Chauhan wrote: > This patch adds "sdtrig" in the ISA string when sdtrig extension is enabled. > The sdtrig extension may or may not be implemented in a system. Therefore, the >-cpu rv64,sdtrig= > option can be used to dynamically turn

Re: [PATCH v2 1/2] vhost: dirty log should be per backend type

2024-03-13 Thread Si-Wei Liu
On 3/12/2024 8:07 AM, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 10:42:29AM -0800, Si-Wei Liu wrote: Hi Michael, I'm taking off for 2+ weeks, but please feel free to provide comment and feedback while I'm off. I'll be checking emails still, and am about to address any opens as soon

Re: [PATCH v2] target/arm: Fix 32-bit SMOPA

2024-03-13 Thread Michael Tokarev
10.03.2024 21:13, Richard Henderson wrote: On 3/9/24 08:40, Michael Tokarev wrote: ... I tried to pick this one up for stable-7.2 (since the fix is for older commit), and faced a fun issue in this change to tests/tcg/aarch64/Makefile.target, since 7.2. doesn't have CROSS_AS_HAS_ARMV9_SME yet. 

Re: [PATCH 12/12] vdpa: fix network breakage after cancelling migration

2024-03-13 Thread Si-Wei Liu
On 3/13/2024 11:12 AM, Michael Tokarev wrote: 14.02.2024 14:28, Si-Wei Liu wrote: Fix an issue where cancellation of ongoing migration ends up with no network connectivity. When canceling migration, SVQ will be switched back to the passthrough mode, but the right call fd is not programed to

Re: [PATCH v5 1/3] target/riscv: Enable mcontrol6 triggers only when sdtrig is selected

2024-03-13 Thread Andrew Jones
On Wed, Mar 13, 2024 at 11:50:07PM +0530, Himanshu Chauhan wrote: > The mcontrol6 triggers are not defined in debug specification v0.13 > These triggers are defined in sdtrig ISA extension. > > This patch: >* Adds ext_sdtrig capability which is used to select mcontrol6 triggers >* Keeps

Re: [PATCH 12/12] vdpa: fix network breakage after cancelling migration

2024-03-13 Thread Michael Tokarev
13.03.2024 21:12, Michael Tokarev пишет: 14.02.2024 14:28, Si-Wei Liu wrote: Fix an issue where cancellation of ongoing migration ends up with no network connectivity. When canceling migration, SVQ will be switched back to the passthrough mode, but the right call fd is not programed to the

Re: [PATCH] hw/virtio: Add support for VDPA network simulation devices

2024-03-13 Thread Thomas Weißschuh
On 2024-02-21 15:38:02+0800, Hao Chen wrote: > This patch adds support for VDPA network simulation devices. > The device is developed based on virtio-net and tap backend, > and supports hardware live migration function. > > For more details, please refer to "docs/system/devices/vdpa-net.rst" > >

[PATCH-for-9.0 4/4] meson: Enable -Wstatic-in-inline

2024-03-13 Thread Philippe Mathieu-Daudé
Compilers are clever enough to inline code when necessary. The only case we accept an inline function is static in header (we use C, not C++). Add the -Wstatic-in-inline CPPFLAG to prevent public and inline function to be added in the code base. Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH-for-9.0 1/4] hw/arm/smmu: Avoid using inlined functions with external linkage again

2024-03-13 Thread Philippe Mathieu-Daudé
Similarly to commit 9de9fa5cf2 ("hw/arm/smmu-common: Avoid using inlined functions with external linkage"): None of our code base require / use inlined functions with external linkage. Some places use internal inlining in the hot path. These two functions are certainly not in any hot path

[PATCH-for-9.0 2/4] accel/hvf: Un-inline hvf_arch_supports_guest_debug()

2024-03-13 Thread Philippe Mathieu-Daudé
See previous commit and commit 9de9fa5cf2 ("Avoid using inlined functions with external linkage") for rationale. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/hvf/hvf.c | 2 +- target/i386/hvf/hvf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH-for-9.0 3/4] qtest/libqos: Un-inline size_to_prdtl()

2024-03-13 Thread Philippe Mathieu-Daudé
See previous commit and commit 9de9fa5cf2 ("Avoid using inlined functions with external linkage") for rationale. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqos/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/libqos/ahci.c

[PATCH-for-9.0 0/4] overall: Avoid using inlined functions with external linkage again

2024-03-13 Thread Philippe Mathieu-Daudé
Mostly as a C style cleanup, use -Wstatic-in-inline to avoid using inlined function with external linkage. Philippe Mathieu-Daudé (4): hw/arm/smmu: Avoid using inlined functions with external linkage again accel/hvf: Un-inline hvf_arch_supports_guest_debug() qtest/libqos: Un-inline

[PATCH] docs/specs/pvpanic: mark shutdown event as not implemented

2024-03-13 Thread Thomas Weißschuh
) a regular guest shutdown has happened and should be processed by the host PCI Interface --- base-commit: ba49d760eb04630e7b15f423ebecf6c871b8f77b change-id: 20240313-pvpanic-note-fa3ce8d2165a Best regards, -- Thomas Weißschuh

Re: [PATCH v2 2/2] hmat acpi: Fix out of bounds access due to missing use of indirection

2024-03-13 Thread Michael Tokarev
07.03.2024 19:03, Jonathan Cameron via wrote: With a numa set up such as -numa nodeid=0,cpus=0 \ -numa nodeid=1,memdev=mem \ -numa nodeid=2,cpus=1 and appropriate hmat_lb entries the initiator list is correctly computed and writen to HMAT as 0,2 but then the LB data is accessed using the node

[PATCH v5 1/3] target/riscv: Enable mcontrol6 triggers only when sdtrig is selected

2024-03-13 Thread Himanshu Chauhan
The mcontrol6 triggers are not defined in debug specification v0.13 These triggers are defined in sdtrig ISA extension. This patch: * Adds ext_sdtrig capability which is used to select mcontrol6 triggers * Keeps the debug property. All triggers that are defined in v0.13 are exposed.

[PATCH v5 3/3] target/riscv: Enable sdtrig for Ventana's Veyron CPUs

2024-03-13 Thread Himanshu Chauhan
Ventana's Veyron CPUs support sdtrig ISA extension. By default, enable the sdtrig extension and disable the debug property for these CPUs. Signed-off-by: Himanshu Chauhan --- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index

[PATCH v5 2/3] target/riscv: Expose sdtrig ISA extension

2024-03-13 Thread Himanshu Chauhan
This patch adds "sdtrig" in the ISA string when sdtrig extension is enabled. The sdtrig extension may or may not be implemented in a system. Therefore, the -cpu rv64,sdtrig= option can be used to dynamically turn sdtrig extension on or off. Since, the sdtrig ISA extension is a superset

[PATCH v5 0/3] Introduce sdtrig ISA extension

2024-03-13 Thread Himanshu Chauhan
All the CPUs may or may not implement the debug triggers. Some CPUs may implement only debug specification v0.13 and not sdtrig ISA extension. This patchset, adds sdtrig ISA as an extension which can be turned on or off by sdtrig= option. It is turned off by default. When debug is true and

Re: [PATCH 12/12] vdpa: fix network breakage after cancelling migration

2024-03-13 Thread Michael Tokarev
14.02.2024 14:28, Si-Wei Liu wrote: Fix an issue where cancellation of ongoing migration ends up with no network connectivity. When canceling migration, SVQ will be switched back to the passthrough mode, but the right call fd is not programed to the device and the svq's own call fd is still

  1   2   3   >