Re: [PATCH] hw/virtio/virtio-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-08 Thread Marc-André Lureau
On Fri, Oct 6, 2023 at 8:46 PM Thomas Huth wrote: > > Avoid using trivial variable names in macros, otherwise we get > the following compiler warning when compiling with -Wshadow=local: > > In file included from ../../qemu/hw/display/virtio-gpu-virgl.c:19: > ../../home/thuth/devel/qemu/hw/display/

[PULL 2/2] target/loongarch: Add preldx instruction

2023-10-08 Thread Song Gao
Resolve the issue of starting the Loongnix 20.5[1] system failure. Logs: Loading Linux 4.19.0-19-loongson-3 ... Loading initial ramdisk ... PROGRESS CODE: V02010004 I0 PROGRESS CODE: V03101019 I0 Error: unknown opcode. 903a3e6c: 0x382c6d82 [1] http://pkg.loongnix.cn/l

[PULL 0/2] loongarch-to-apply queue

2023-10-08 Thread Song Gao
-loongarch-20231008 for you to fetch changes up to e1fc0cf1fb65c5f049bef4661d0e3278e51e2560: target/loongarch: Add preldx instruction (2023-10-08 15:02:15 +0800) pull-loongarc

[PULL 1/2] target/loongarch: fix ASXE flag conflict

2023-10-08 Thread Song Gao
From: Jiajie Chen HW_FLAGS_EUEN_ASXE acccidentally conflicts with HW_FLAGS_CRMD_PG, enabling LASX instructions even when CSR_EUEN.ASXE=0. Closes: https://gitlab.com/qemu-project/qemu/-/issues/1907 Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Reviewed-by: Song Gao Message-Id: <202

Re: [PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
Sorry, the reply is late due to being on vacation for half a month. On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz wrote: > > One comment on the logging stuff in vhost-scsi. As far as I can tell the > logging in vhost-user-scsi looks good. > > Markus - does this look better to you? Otherwise do

Re: [PATCH v6 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Michael S. Tsirkin
On Fri, Sep 22, 2023 at 07:46:10PM +0800, Li Feng wrote: > Changes for v6: > - [PATCH] vhost-user: fix lost reconnect > - Fix missing assign event_cb. Pls don't make vN+1 a reply to vN - start a new thread with each version please. > Changes for v5: > - No logic has been changed, just move par

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Michael S. Tsirkin
On Sun, Oct 08, 2023 at 04:49:05PM +0800, Li Feng wrote: > On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz > wrote: > > > > > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > > > Currently the get_inflight_fd will be sent every time the device is > > > started, and > > > the backend w

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz wrote: > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > Currently the get_inflight_fd will be sent every time the device is > > started, and > > the backend will allocate shared memory to save the inflight state. If the > > backend fin

Re: [PATCH] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-08 Thread Michael S. Tsirkin
On Fri, Oct 06, 2023 at 07:35:18PM +0200, Thomas Huth wrote: > Rename some variables to avoid compiler warnings when compiling > with -Wshadow=local. > > Signed-off-by: Thomas Huth Reviewed-by: Michael S. Tsirkin > --- > contrib/vhost-user-gpu/vugpu.h | 8 > contrib/vhost-u

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
On Sun, Oct 8, 2023 at 4:51 PM Michael S. Tsirkin wrote: > > On Sun, Oct 08, 2023 at 04:49:05PM +0800, Li Feng wrote: > > On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz > > wrote: > > > > > > > > > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > > > > > Currently the get_inflight_fd

Re: [PATCH v6 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
On Sun, Oct 8, 2023 at 4:49 PM Michael S. Tsirkin wrote: > > On Fri, Sep 22, 2023 at 07:46:10PM +0800, Li Feng wrote: > > Changes for v6: > > - [PATCH] vhost-user: fix lost reconnect > > - Fix missing assign event_cb. > > > Pls don't make vN+1 a reply to vN - start a new thread > with each versi

Re: [PATCH] hw/virtio/virtio-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-08 Thread Michael S. Tsirkin
On Fri, Oct 06, 2023 at 06:45:08PM +0200, Thomas Huth wrote: > Avoid using trivial variable names in macros, otherwise we get > the following compiler warning when compiling with -Wshadow=local: > > In file included from ../../qemu/hw/display/virtio-gpu-virgl.c:19: > ../../home/thuth/devel/qemu/hw

Re: [PATCH] contrib/vhost-user-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-08 Thread Michael S. Tsirkin
On Fri, Oct 06, 2023 at 07:35:18PM +0200, Thomas Huth wrote: > Rename some variables to avoid compiler warnings when compiling > with -Wshadow=local. > > Signed-off-by: Thomas Huth > --- > contrib/vhost-user-gpu/vugpu.h | 8 > contrib/vhost-user-gpu/vhost-user-gpu.c | 6 +++---

[PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi/vh

[PATCH v7 2/5] vhost: move and rename the conn retry times

2023-10-08 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/

[PATCH v7 5/5] vhost-user: fix lost reconnect

2023-10-08 Thread Li Feng
When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fails at get_features, the vhost_dev_cleanup will be called immediately.

[PATCH v7 4/5] vhost-user-scsi: start vhost when guest kicks

2023-10-08 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions

[PATCH v7 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
Changes for v7: - [PATCH 3/5] vhost-user-scsi: support reconnect to backend - Add reporting the error in vhost-scsi; - Rebase to master and fix the conflict. - Add "Reviewed-by" tags. Changes for v6: - [PATCH] vhost-user: fix lost reconnect - Fix missing assign event_cb. Changes for v5: - N

[PATCH v7 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
Currently the get_inflight_fd will be sent every time the device is started, and the backend will allocate shared memory to save the inflight state. If the backend finds that it receives the second get_inflight_fd, it will release the previous shared memory, which breaks inflight working logic. Th

RE: [PATCH v4 10/15] vfio/ccw: Use vfio_[attach/detach]_device

2023-10-08 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Sent: Wednesday, October 4, 2023 11:44 PM >Subject: [PATCH v4 10/15] vfio/ccw: Use vfio_[attach/detach]_device > >Let the vfio-ccw device use vfio_attach_device() and >vfio_detach_device(), hence hiding the details of the used >IOMMU backend

Re: [PATCH 1/3] via-ide: Fix legacy mode emulation

2023-10-08 Thread BALATON Zoltan
On Sun, 8 Oct 2023, Mark Cave-Ayland wrote: On 05/10/2023 23:13, BALATON Zoltan wrote: The initial value for BARs were set in reset method for emulating legacy mode at start but this does not work because PCI code resets BARs after calling device reset method. This is certainly something I've

Re: [PATCH v3 03/10] migration: Refactor error handling in source return path

2023-10-08 Thread Philippe Mathieu-Daudé
On 5/10/23 18:05, Peter Xu wrote: On Thu, Oct 05, 2023 at 08:11:33AM +0200, Philippe Mathieu-Daudé wrote: Hi Peter, On 5/10/23 00:02, Peter Xu wrote: rp_state.error was a boolean used to show error happened in return path thread. That's not only duplicating error reporting (migrate_set_error)

[PATCH] migration: Use g_autofree to simplify ram_dirty_bitmap_reload()

2023-10-08 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- Based-on: --- migration/ram.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 982fbbeee1..4cb948cfd0 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -4164,11 +4164,11 @@ bo

Re: [PATCH] hw/virtio/virtio-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-08 Thread Philippe Mathieu-Daudé
On 8/10/23 10:57, Michael S. Tsirkin wrote: On Fri, Oct 06, 2023 at 06:45:08PM +0200, Thomas Huth wrote: Avoid using trivial variable names in macros, otherwise we get the following compiler warning when compiling with -Wshadow=local: In file included from ../../qemu/hw/display/virtio-gpu-virgl

Re: [PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Manos Pitsidianakis
Hello Li, I have some trivial style comments you could possibly address in a next version: On Sun, 08 Oct 2023 12:12, Li Feng wrote: diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index df6b66cc1a..5df24faff4 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-s

[PATCH QEMU] tulip: Fix LXT970 PHY registers

2023-10-08 Thread ~disean
From: Dmitry Borisov Fix incorrect MII status value (0xf02c). Use default values from a 21143-based board: https://www.beowulf.org/pipermail/tulip-bug/2000-February/000485.html Signed-off-by: Dmitry Borisov --- hw/net/tulip.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) mode

[PATCH QEMU] tulip: Fix LXT970 PHY registers

2023-10-08 Thread ~disean
From: Dmitry Borisov Fix incorrect MII status value (0xf02c). Use default values from a 21143-based board: https://www.beowulf.org/pipermail/tulip-bug/2000-February/000485.html Signed-off-by: Dmitry Borisov --- hw/net/tulip.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) mode

RE: [PATCH v2 3/3] target/hexagon: avoid shadowing globals

2023-10-08 Thread Brian Cain
> -Original Message- > From: ltaylorsimp...@gmail.com > Sent: Friday, October 6, 2023 11:01 AM > To: Brian Cain ; qemu-devel@nongnu.org > Cc: arm...@redhat.com; richard.hender...@linaro.org; phi...@linaro.org; > peter.mayd...@linaro.org; Matheus Bernardino (QUIC) > ; stefa...@redhat.com;

Re: [PATCH 15/19] parallels: Remove unnecessary data_end field

2023-10-08 Thread Alexander Ivanov
On 10/7/23 19:54, Mike Maslenkin wrote: On Sat, Oct 7, 2023 at 5:30 PM Alexander Ivanov wrote: On 10/7/23 13:21, Mike Maslenkin wrote: On Sat, Oct 7, 2023 at 1:18 PM Alexander Ivanov wrote: On 10/6/23 21:43, Mike Maslenkin wrote: On Mon, Oct 2, 2023 at 12:01 PM Alexander Ivanov wrot

Re: [PATCH v4 10/15] vfio/ccw: Use vfio_[attach/detach]_device

2023-10-08 Thread Eric Auger
Hi Zhenzhong, On 10/8/23 12:21, Duan, Zhenzhong wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger >> Sent: Wednesday, October 4, 2023 11:44 PM >> Subject: [PATCH v4 10/15] vfio/ccw: Use vfio_[attach/detach]_device >> >> Let the vfio-ccw device use vfio_attach_device() and >> vf

Re: [PATCH v8 00/29] Consolidate PIIX south bridges

2023-10-08 Thread Chuck Zmudzinski
On 10/7/23 8:38 AM, Bernhard Beschow wrote: > This series consolidates the implementations of the PIIX3 and PIIX4 south > bridges and makes PIIX4 usable in the PC machine via an experimental command > line parameter. The motivation is to resolve duplicate code between the device > models as well as

Re: [PATCH 2/3] hw/pci-host: Add emulation of Mai Logic Articia S

2023-10-08 Thread BALATON Zoltan
On Sun, 8 Oct 2023, Mark Cave-Ayland wrote: On 05/10/2023 23:13, BALATON Zoltan wrote: The Articia S is a generic chipset supporting several different CPUs that were used on some PPC boards. This is a minimal emulation of the parts needed for emulating the AmigaOne board. Signed-off-by: BALATO

[PATCH v2] target/riscv: Use a direct cast for better performance

2023-10-08 Thread Richard W.M. Jones
v1 was here: https://lists.nongnu.org/archive/html/qemu-devel/2023-10/msg02021.html v2 is functionally exactly the same, except I changed s/qemu cast/QOM cast/ in the comment, and added the Reviewed-by tag received for the first version. Rich.

[PATCH v2] target/riscv: Use a direct cast for better performance

2023-10-08 Thread Richard W.M. Jones
RISCV_CPU(cs) uses a checked cast. When QOM cast debugging is enabled this adds about 5% total overhead when emulating RV64 on x86-64 host. Using a RISC-V guest with 16 vCPUs, 16 GB of guest RAM, virtio-blk disk. The guest has a copy of the qemu source tree. The test involves compiling the qemu

[PATCH v3 1/3] target/hexagon: move GETPC() calls to top level helpers

2023-10-08 Thread Brian Cain
From: Matheus Tavares Bernardino As docs/devel/loads-stores.rst states: ``GETPC()`` should be used with great care: calling it in other functions that are *not* the top level ``HELPER(foo)`` will cause unexpected behavior. Instead, the value of ``GETPC()`` should be read from the helper

[PATCH v3 0/3] hexagon: GETPC() fixes, shadowing fixes

2023-10-08 Thread Brian Cain
Changes since v2: - rebased, suggested by Markus - s/cpu_env/tcg_env/ - For local shadows: s/tcg_env/tcg_env_/ Brian Cain (2): target/hexagon: fix some occurrences of -Wshadow=local target/hexagon: avoid shadowing globals Matheus Tavares Bernardino (1): target/hexagon: m

[PATCH v3 2/3] target/hexagon: fix some occurrences of -Wshadow=local

2023-10-08 Thread Brian Cain
Of the changes in this commit, the changes in `HELPER(commit_hvx_stores)()` are less obvious. They are required because of some macro invocations like SCATTER_OP_WRITE_TO_MEM(). e.g.: In file included from ../target/hexagon/op_helper.c:31: ../target/hexagon/mmvec/macros.h:205:18: error:

[PATCH v3 3/3] target/hexagon: avoid shadowing globals

2023-10-08 Thread Brian Cain
The typedef `vaddr` is shadowed by `vaddr` identifiers, so we rename the identifiers to avoid shadowing the type name. The global `tcg_env` is shadowed by local `tcg_env` arguments, so we rename the function arguments to avoid shadowing the global. Signed-off-by: Brian Cain --- target/hexagon/g

Re: [PATCH 1/3] target/riscv: Propagate error from PMU setup

2023-10-08 Thread Alistair Francis
On Tue, Oct 3, 2023 at 10:53 PM Rob Bradford wrote: > > More closely follow the QEMU style by returning an Error and propagating > it there is an error relating to the PMU setup. > > Further simplify the function by removing the num_counters parameter as > this is available from the passed in cpu

Re: [PATCH 2/3] target/riscv: Support discontinuous PMU counters

2023-10-08 Thread Alistair Francis
On Wed, Oct 4, 2023 at 7:36 PM Rob Bradford wrote: > > Hi Atish, > > On Tue, 2023-10-03 at 13:25 -0700, Atish Kumar Patra wrote: > > On Tue, Oct 3, 2023 at 5:51 AM Rob Bradford > > wrote: > > > > > > There is no requirement that the enabled counters in the platform > > > are > > > continuously nu

Re: [PATCH v2 1/2] target/riscv/kvm: improve 'init_multiext_cfg' error msg

2023-10-08 Thread Alistair Francis
On Wed, Oct 4, 2023 at 12:46 AM Daniel Henrique Barboza wrote: > > Our error message is returning the value of 'ret', which will be always > -1 in case of error, and will not be that useful: > > qemu-system-riscv64: Unable to read ISA_EXT KVM register ssaia, error -1 > > Improve the error message

Re: [PATCH v2 2/2] target/riscv/kvm: support KVM_GET_REG_LIST

2023-10-08 Thread Alistair Francis
On Wed, Oct 4, 2023 at 12:48 AM Daniel Henrique Barboza wrote: > > KVM for RISC-V started supporting KVM_GET_REG_LIST in Linux 6.6. It > consists of a KVM ioctl() that retrieves a list of all available regs > for get_one_reg/set_one_reg. Regs that aren't present in the list aren't > supported in t

Re: [PATCH 0/2] riscv, kvm: support KVM_GET_REG_LIST

2023-10-08 Thread Alistair Francis
On Tue, Oct 3, 2023 at 9:34 PM Daniel Henrique Barboza wrote: > > Hi, > > Starting on Linux 6.6 the QEMU RISC-V KVM driver now supports > KMV_GET_REG_LIST. This API will make it simpler for the QEMU KVM driver > to determine whether a KVM reg is present or not. > > We'll use this API to fetch ISA_

Re: [PATCH] target/riscv/tcg: remove RVG warning

2023-10-08 Thread Alistair Francis
On Tue, Oct 3, 2023 at 10:26 PM Daniel Henrique Barboza wrote: > > Vendor CPUs that set RVG are displaying user warnings about other > extensions that RVG must enable, one warning per CPU. E.g.: > > $ ./build/qemu-system-riscv64 -smp 8 -M virt -cpu veyron-v1 -nographic > qemu-system-riscv64: warni

Re: [PATCH] target/riscv/tcg: remove RVG warning

2023-10-08 Thread Alistair Francis
On Tue, Oct 3, 2023 at 10:26 PM Daniel Henrique Barboza wrote: > > Vendor CPUs that set RVG are displaying user warnings about other > extensions that RVG must enable, one warning per CPU. E.g.: > > $ ./build/qemu-system-riscv64 -smp 8 -M virt -cpu veyron-v1 -nographic > qemu-system-riscv64: warni

Re: [PATCH v3 4/5] hw/char: riscv_htif: replace exit calls with proper shutdown

2023-10-08 Thread Alistair Francis
On Mon, Oct 2, 2023 at 7:32 PM Clément Chigot wrote: > > On Fri, Sep 22, 2023 at 7:20 AM Alistair Francis wrote: > > > > On Thu, Sep 7, 2023 at 9:26 PM Clément Chigot wrote: > > > > > > This replaces the exit calls by shutdown requests, ensuring a proper > > > cleanup of Qemu. Otherwise, some co

Re: [PATCH v2] target/riscv: pmp: Ignore writes when RW=01

2023-10-08 Thread Alistair Francis
On Mon, Sep 25, 2023 at 9:11 PM Mayuresh Chitale wrote: > > As per the Priv spec: "The R, W, and X fields form a collective WARL > field for which the combinations with R=0 and W=1 are reserved." > However currently such writes are not ignored as ought to be. The > combinations with RW=01 are allo

RE: [PATCH v4 10/15] vfio/ccw: Use vfio_[attach/detach]_device

2023-10-08 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Sent: Monday, October 9, 2023 1:46 AM >Subject: Re: [PATCH v4 10/15] vfio/ccw: Use vfio_[attach/detach]_device > >Hi Zhenzhong, >On 10/8/23 12:21, Duan, Zhenzhong wrote: >> Hi Eric, >> >>> -Original Message- >>> From: Eric Auger >>> Sent: W

Re: [PATCH v2] target/riscv: pmp: Ignore writes when RW=01

2023-10-08 Thread Alistair Francis
On Mon, Sep 25, 2023 at 9:11 PM Mayuresh Chitale wrote: > > As per the Priv spec: "The R, W, and X fields form a collective WARL > field for which the combinations with R=0 and W=1 are reserved." > However currently such writes are not ignored as ought to be. The > combinations with RW=01 are allo

Re: [PATCH] target/riscv: deprecate capital 'Z' CPU properties

2023-10-08 Thread Alistair Francis
On Sun, Oct 8, 2023 at 3:15 AM Daniel Henrique Barboza wrote: > > At this moment there are eleven CPU extension properties that starts > with capital 'Z': Zifencei, Zicsr, Zihintntl, Zihintpause, Zawrs, Zfa, > Zfh, Zfhmin, Zve32f, Zve64f and Zve64d. All other extensions are named > with lower-case

Re: [PATCH] target/riscv: deprecate capital 'Z' CPU properties

2023-10-08 Thread Alistair Francis
On Sun, Oct 8, 2023 at 3:15 AM Daniel Henrique Barboza wrote: > > At this moment there are eleven CPU extension properties that starts > with capital 'Z': Zifencei, Zicsr, Zihintntl, Zihintpause, Zawrs, Zfa, > Zfh, Zfhmin, Zve32f, Zve64f and Zve64d. All other extensions are named > with lower-case

[PATCH 3/3] vfio/ccw: Remove redundant definition of TYPE_VFIO_CCW

2023-10-08 Thread Zhenzhong Duan
No functional changes. Signed-off-by: Zhenzhong Duan --- include/hw/s390x/vfio-ccw.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hw/s390x/vfio-ccw.h b/include/hw/s390x/vfio-ccw.h index 63a909eb7e..4209d27657 100644 --- a/include/hw/s390x/vfio-ccw.h +++ b/include/hw/s390x/vfio-cc

[PATCH 0/3] vfio: memory leak fix and code cleanup

2023-10-08 Thread Zhenzhong Duan
Hi, This trivial patchset fixes a incremental memory leak in rare case, and some cleanup on ap/ccw. This patchset is based on vfio-next. Thanks Zhenzhong Zhenzhong Duan (3): vfio/pci: Fix a potential memory leak in vfio_listener_region_add vfio/ap: Remove pointless apdev variable vfio/ccw

[PATCH 2/3] vfio/ap: Remove pointless apdev variable

2023-10-08 Thread Zhenzhong Duan
No need to double-cast, call VFIO_AP_DEVICE() on DeviceState. No functional changes. Signed-off-by: Zhenzhong Duan --- hw/vfio/ap.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 22e564f4f7..e083a19eac 100644 --- a/hw/vfio/ap.c +++

[PATCH 1/3] vfio/pci: Fix a potential memory leak in vfio_listener_region_add

2023-10-08 Thread Zhenzhong Duan
When there is an failure in vfio_listener_region_add() and the section belongs to a ram device, there is an inaccurate error report which should never be related to vfio_dma_map failure. The memory holding err is also incrementally leaked in each failure. Fix it by reporting the real error and fre

Re: [PATCH 0/6] riscv: RVA22U64 profile support

2023-10-08 Thread Alistair Francis
On Fri, Sep 29, 2023 at 10:54 PM Daniel P. Berrangé wrote: > > On Fri, Sep 29, 2023 at 09:49:47AM -0300, Daniel Henrique Barboza wrote: > > > > > > On 9/29/23 08:55, Daniel P. Berrangé wrote: > > > On Fri, Sep 29, 2023 at 08:29:08AM -0300, Daniel Henrique Barboza wrote: > > > > > > > > > > > > On

Re: [PATCH 2/2] target/riscv/tcg-cpu.c: add extension properties for all cpus

2023-10-08 Thread Alistair Francis
On Fri, Sep 29, 2023 at 8:39 PM Daniel P. Berrangé wrote: > > On Tue, Sep 26, 2023 at 03:31:09PM -0300, Daniel Henrique Barboza wrote: > > At this moment we do not expose extension properties for vendor CPUs > > because that would allow users to change them via command line. The > > drawback is th

Re: [PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
Thanks for your comments, I will submit the v8. > On 8 Oct 2023, at 6:46 PM, Manos Pitsidianakis > wrote: > > Hello Li, I have some trivial style comments you could possibly address in a > next version: > > On Sun, 08 Oct 2023 12:12, Li Feng wrote: >> diff --git a/hw/scsi/vhost-user-scsi.c b

[PATCH v8 2/5] vhost: move and rename the conn retry times

2023-10-08 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/

[PATCH v8 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
Changes for v8: - [PATCH 3/5] vhost-user-scsi: support reconnect to backend - Fix code style suggested by Manos Pitsidianakis - [PATCH 4/5] vhost-user-scsi: start vhost when guest kicks - Use 'DEVICE()' macro in vhost_user_scsi_handle_output to replace the 'parent_obj.parent_obj.parent_obj.

[PATCH v8 4/5] vhost-user-scsi: start vhost when guest kicks

2023-10-08 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions

[PATCH v8 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
Currently the get_inflight_fd will be sent every time the device is started, and the backend will allocate shared memory to save the inflight state. If the backend finds that it receives the second get_inflight_fd, it will release the previous shared memory, which breaks inflight working logic. Th

[PATCH v8 5/5] vhost-user: fix lost reconnect

2023-10-08 Thread Li Feng
When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fails at get_features, the vhost_dev_cleanup will be called immediately.

[PATCH v8 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi/vh

Re: [PATCH] hw/virtio/vhost: Silence compiler warnings in vhost code when using -Wshadow

2023-10-08 Thread Markus Armbruster
Michael Tokarev writes: > 06.10.2023 14:24, Michael S. Tsirkin: >> On Fri, Oct 06, 2023 at 01:45:51PM +0300, Michael Tokarev wrote: >>> 06.10.2023 11:55, Markus Armbruster пишет: Michael Tokarev writes: > Applied to my trivial-patches tree, thanks! > > Marcus, you picked up

Re: [PATCH v2 3/3] target/hexagon: avoid shadowing globals

2023-10-08 Thread Philippe Mathieu-Daudé
Hi Brian, On 6/10/23 00:22, Brian Cain wrote: The typedef `vaddr` is shadowed by `vaddr` identifiers, so we rename the identifiers to avoid shadowing the type name. This one surprises me, since we have other occurences: include/exec/memory.h:751:bool memory_get_xlat_addr(IOMMUTLBEntry *iotlb

Re: [PATCH v3 1/3] target/hexagon: move GETPC() calls to top level helpers

2023-10-08 Thread Philippe Mathieu-Daudé
On 9/10/23 00:09, Brian Cain wrote: From: Matheus Tavares Bernardino As docs/devel/loads-stores.rst states: ``GETPC()`` should be used with great care: calling it in other functions that are *not* the top level ``HELPER(foo)`` will cause unexpected behavior. Instead, the value of `

Re: [PATCH v3 2/3] target/hexagon: fix some occurrences of -Wshadow=local

2023-10-08 Thread Philippe Mathieu-Daudé
On 9/10/23 00:09, Brian Cain wrote: Of the changes in this commit, the changes in `HELPER(commit_hvx_stores)()` are less obvious. They are required because of some macro invocations like SCATTER_OP_WRITE_TO_MEM(). e.g.: In file included from ../target/hexagon/op_helper.c:31: ../targe

Re: [PATCH v3 0/3] hexagon: GETPC() fixes, shadowing fixes

2023-10-08 Thread Markus Armbruster
I applied this series to my shadow-next in my public Git repository at https://repo.or.cz/qemu/armbru.git. I don't intend to include it in pull requests, because it does more than just fix -Wshadow issues. Don't think that'll be a problem. Thanks!

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-08 Thread Markus Armbruster
Warner Losh writes: > On Fri, Oct 6, 2023, 11:55 AM Thomas Huth wrote: > >> On 06/10/2023 18.18, Thomas Huth wrote: >> > On 06/10/2023 16.45, Markus Armbruster wrote: >> >> Local variables shadowing other local variables or parameters make the >> >> code needlessly hard to understand. Bugs love

Re: [PATCH 3/3] hw/ppc: Add emulation of AmigaOne XE board

2023-10-08 Thread Philippe Mathieu-Daudé
Hi Zoltan, On 6/10/23 00:13, BALATON Zoltan wrote: The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware with patches to support AmigaOS and is very similar to pegasos2 so can be easily emulated sharing most code with pegasos2. The reason to emulate it is that AmigaOS comes in di

Re: [PATCH 2/3] vfio/ap: Remove pointless apdev variable

2023-10-08 Thread Philippe Mathieu-Daudé
On 9/10/23 04:20, Zhenzhong Duan wrote: No need to double-cast, call VFIO_AP_DEVICE() on DeviceState. No functional changes. Signed-off-by: Zhenzhong Duan --- hw/vfio/ap.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 3/3] vfio/ccw: Remove redundant definition of TYPE_VFIO_CCW

2023-10-08 Thread Philippe Mathieu-Daudé
On 9/10/23 04:20, Zhenzhong Duan wrote: No functional changes. Signed-off-by: Zhenzhong Duan --- include/hw/s390x/vfio-ccw.h | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 0/3] vfio: memory leak fix and code cleanup

2023-10-08 Thread Cédric Le Goater
On 10/9/23 04:20, Zhenzhong Duan wrote: Hi, This trivial patchset fixes a incremental memory leak in rare case, and some cleanup on ap/ccw. This patchset is based on vfio-next. Will this apply on the future v5 of Eric ? Thanks, C. Thanks Zhenzhong Zhenzhong Duan (3): vfio/pci: Fix a

[PATCH v5 0/3] ramfb: migration support

2023-10-08 Thread marcandre . lureau
From: Marc-André Lureau Hi, Implement RAMFB migration, and add properties to enable it only on >= 8.2 machines, + a few related cleanups. thanks v5: - add missing VMSTATE_END_OF_LIST - changed ramfb=off & x-mig=on user config error to a warning - add r-b tags v4: (Laszlo review and suggestion

[PATCH v5 2/3] ramfb-standalone: add migration support

2023-10-08 Thread marcandre . lureau
From: Marc-André Lureau Add a "ramfb-dev" section whenever "x-migrate" is turned on. Turn it off by default on machines <= 8.1 for compatibility reasons. Signed-off-by: Marc-André Lureau Reviewed-by: Laszlo Ersek --- hw/core/machine.c | 1 + hw/display/ramfb-standalone.c | 27 +++

[PATCH v5 1/3] ramfb: add migration support

2023-10-08 Thread marcandre . lureau
From: Marc-André Lureau Implementing RAMFB migration is quite straightforward. One caveat is to treat the whole RAMFBCfg as a blob, since that's what is exposed to the guest directly. This avoid having to fiddle with endianness issues if we were to migrate fields individually as integers. The de

[PATCH v5 3/3] hw/vfio: add ramfb migration support

2023-10-08 Thread marcandre . lureau
From: Marc-André Lureau Add a "VFIODisplay" subsection whenever "x-ramfb-migrate" is turned on. Turn it off by default on machines <= 8.1 for compatibility reasons. Signed-off-by: Marc-André Lureau Reviewed-by: Laszlo Ersek --- hw/vfio/pci.h | 3 +++ hw/core/machine.c | 1 + hw/vfio/di

[PULL 09/25] tcg: Correct invalid mentions of 'softmmu' by 'system-mode'

2023-10-08 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004090629.37473-6-phi...@linaro.org> Signed-off-by: Paolo Bonzini --- accel/tcg/user-exec.c | 2 +- docs/devel/testing.rst | 2 +- include/qemu/atomic128.h

[PULL 16/25] system: Rename softmmu/ directory as system/

2023-10-08 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé The softmmu/ directory contains files specific to system emulation. Rename it as system/. Update meson rules, the MAINTAINERS file and all the documentation and comments. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004090629.37473-14-phi...@linaro.org> S

[PULL v2 00/25] Audio, source reorg, HVF changes for 2023-10-06

2023-10-08 Thread Paolo Bonzini
The following changes since commit 2f3913f4b2ad74baeb5a6f1d36efbd9ecdf1057d: Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-10-05 09:01:01 -0400) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream f

Re: [PATCH v2 3/3] target/hexagon: avoid shadowing globals

2023-10-08 Thread Philippe Mathieu-Daudé
On 9/10/23 08:09, Philippe Mathieu-Daudé wrote: Hi Brian, On 6/10/23 00:22, Brian Cain wrote: The typedef `vaddr` is shadowed by `vaddr` identifiers, so we rename the identifiers to avoid shadowing the type name. This one surprises me, since we have other occurences: include/exec/memory.h:75

Re: [PULL 00/21] vfio queue

2023-10-08 Thread Cédric Le Goater
On 10/6/23 12:33, Cédric Le Goater wrote: On 10/6/23 08:19, Cédric Le Goater wrote: The following changes since commit 2f3913f4b2ad74baeb5a6f1d36efbd9ecdf1057d:    Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-10-05 09:01:01 -0400) are availab

[PULL v2 0/6] vfio queue

2023-10-08 Thread Cédric Le Goater
The following changes since commit 2f3913f4b2ad74baeb5a6f1d36efbd9ecdf1057d: Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-10-05 09:01:01 -0400) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-vfio-2023100

[PULL 1/6] vfio/display: Fix missing update to set backing fields

2023-10-08 Thread Cédric Le Goater
From: Alex Williamson The below referenced commit renames scanout_width/height to backing_width/height, but also promotes these fields in various portions of the egl interface. Meanwhile vfio dmabuf support has never used the previous scanout fields and is therefore missed in the update. This r

[PULL 6/6] vfio/pci: enable MSI-X in interrupt restoring on dynamic allocation

2023-10-08 Thread Cédric Le Goater
From: Jing Liu During migration restoring, vfio_enable_vectors() is called to restore enabling MSI-X interrupts for assigned devices. It sets the range from 0 to nr_vectors to kernel to enable MSI-X and the vectors unmasked in guest. During the MSI-X enabling, all the vectors within the range are

[PULL 5/6] vfio/pci: use an invalid fd to enable MSI-X

2023-10-08 Thread Cédric Le Goater
From: Jing Liu Guests typically enable MSI-X with all of the vectors masked in the MSI-X vector table. To match the guest state of device, QEMU enables MSI-X by enabling vector 0 with userspace triggering and immediately release. However the release function actually does not release it due to al

[PULL 4/6] vfio/pci: enable vector on dynamic MSI-X allocation

2023-10-08 Thread Cédric Le Goater
From: Jing Liu The vector_use callback is used to enable vector that is unmasked in guest. The kernel used to only support static MSI-X allocation. When allocating a new interrupt using "static MSI-X allocation" kernels, QEMU first disables all previously allocated vectors and then re-allocates a

[PULL 3/6] vfio/pci: detect the support of dynamic MSI-X allocation

2023-10-08 Thread Cédric Le Goater
From: Jing Liu Kernel provides the guidance of dynamic MSI-X allocation support of passthrough device, by clearing the VFIO_IRQ_INFO_NORESIZE flag to guide user space. Fetch the flags from host to determine if dynamic MSI-X allocation is supported. Originally-by: Reinette Chatre Signed-off-by:

[PULL 2/6] vfio/pci: rename vfio_put_device to vfio_pci_put_device

2023-10-08 Thread Cédric Le Goater
From: Zhenzhong Duan vfio_put_device() is a VFIO PCI specific function, rename it with 'vfio_pci' prefix to avoid confusing. No functional change. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- hw/vfio/pci.c | 4 ++-- 1 file changed, 2 inser

RE: [PATCH 0/3] vfio: memory leak fix and code cleanup

2023-10-08 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Monday, October 9, 2023 2:32 PM >Subject: Re: [PATCH 0/3] vfio: memory leak fix and code cleanup > >On 10/9/23 04:20, Zhenzhong Duan wrote: >> Hi, >> >> This trivial patchset fixes a incremental memory leak in rare case, >> and some clea