[PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Cédric Le Goater
Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow because the expression is evaluated using 32-bit arithmetic and then used in a context expecting a uint64_t. Fixes: Coverity CID 1523918 Cc: Glenn Miles Signed-off-by: Cédric Le Goater --- hw/ppc/pnv_i2c.c | 2 +- 1 file cha

Re: [PATCH] ppc/pnv: Fix potential overflow in I2C model

2023-11-09 Thread Philippe Mathieu-Daudé
On 9/11/23 09:05, Cédric Le Goater wrote: Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow because the expression is evaluated using 32-bit arithmetic and then used in a context expecting a uint64_t. Fixes: Coverity CID 1523918 Cc: Glenn Miles Signed-off-by: Cédric Le Goat

Re: QEMU Virtio GPU features status & roadmap?

2023-11-09 Thread Huang Rui
On Wed, Nov 08, 2023 at 07:07:43PM +0800, Marc-André Lureau wrote: > Hi > > On Wed, Nov 8, 2023 at 1:04 PM Antonio Caggiano > wrote: > > > > Hi Hans, > > > > +cc Gert and Dmitry > > > > On 17/10/2023 02:48, Hans de Ruiter wrote: > > > Hi, > > > > > > I'm working on Virtio GPU drivers for AmigaOS,

Re: [PATCH v6] tests/avocado: add test to exercize processor address space memory bound checks

2023-11-09 Thread Philippe Mathieu-Daudé
On 9/11/23 05:56, Ani Sinha wrote: QEMU has validations to make sure that a VM is not started with more memory (static and hotpluggable memory) than what the guest processor can address directly with its addressing bits. This change adds a test to make sure QEMU fails to start with a specific err

Re: [PATCH v2 20/35] tcg/sparc64: Hoist read of tcg_cond_to_rcond

2023-11-09 Thread Philippe Mathieu-Daudé
On 8/11/23 21:57, Richard Henderson wrote: On 11/6/23 13:02, Philippe Mathieu-Daudé wrote: On 28/10/23 21:45, Richard Henderson wrote: Use a non-zero value here (an illegal encoding) as a better condition than is_unsigned_cond for when MOVR/BPR is usable. Signed-off-by: Richard Henderson ---

Re: [PATCH v2 27/35] tcg/ppc: Support TCG_COND_TST{EQ,NE}

2023-11-09 Thread Philippe Mathieu-Daudé
Hi Richard, On 28/10/23 21:45, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 105 --- 1 file changed, 98 insertions(+), 7 deletions(-) +/* + * Set dest non-zero if and only if (arg1 & arg2) is non-zero. + * If

Re: [PATCH v6] tests/avocado: add test to exercize processor address space memory bound checks

2023-11-09 Thread Ani Sinha
> On 09-Nov-2023, at 1:49 PM, Philippe Mathieu-Daudé wrote: > > On 9/11/23 05:56, Ani Sinha wrote: >> QEMU has validations to make sure that a VM is not started with more memory >> (static and hotpluggable memory) than what the guest processor can address >> directly with its addressing bits.

Re: [PATCH v4 26/41] backends/iommufd: Introduce the iommufd object

2023-11-09 Thread Markus Armbruster
Cédric Le Goater writes: > On 11/8/23 11:30, Markus Armbruster wrote: >> Cédric Le Goater writes: >> >>> Hello Markus, >>> >>> On 11/8/23 06:50, Markus Armbruster wrote: Cédric Le Goater writes: > On 11/2/23 08:12, Zhenzhong Duan wrote: >> From: Eric Auger >> Introduce a

Re: [PATCH] block-backend: per-device throttling of BLOCK_IO_ERROR reports

2023-11-09 Thread Vladimir Sementsov-Ogievskiy
On 09.11.23 00:22, Eric Blake wrote: On Tue, Nov 07, 2023 at 11:58:42AM +0300, Vladimir Sementsov-Ogievskiy wrote: From: Leonid Kaplan BLOCK_IO_ERROR events comes from guest, so we must throttle them. We still want per-device throttling, so let's use device id as a key. Signed-off-by: Leonid

[PATCH] plugins: Move the windows linking function to qemu

2023-11-09 Thread Greg Manning
Previously, a plugin author needed an implementation of the __pfnDliFailureHook2 or __pfnDliNotifyHook2 hook in the plugin. Now all they need is a null exported pointer with the right name (win32_common.c). If QEMU finds this, it will set it to the hook function, which has now moved into qemu (os-w

[PATCH] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Greg Manning
fixes #1927. Cross compile gcc is more picky about argument order than msys. Changed the meson command to take the (now renamed) libqemu_plugin_api.a as a lib, rather than an object. This puts it in the right place on both native and cross compile gcc commands Reenable plugins on crossbuilds ---

[PATCH v2 0/1] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Greg Manning
v1-v2: Added the signed-off-by line. Greg Manning (1): plugins: fix win plugin tests on cross compile .gitlab-ci.d/crossbuilds.yml | 2 +- contrib/plugins/Makefile | 2 +- plugins/meson.build | 2 +- tests/plugin/meson.build | 3 ++- 4 files changed, 5 insertions(+), 4 deletio

[PATCH v2 1/1] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Greg Manning
fixes #1927. Cross compile gcc is more picky about argument order than msys. Changed the meson command to take the (now renamed) libqemu_plugin_api.a as a lib, rather than an object. This puts it in the right place on both native and cross compile gcc commands Reenable plugins on crossbuilds Sig

[PATCH v2 1/1] plugins: Move the windows linking function to qemu

2023-11-09 Thread Greg Manning
Previously, a plugin author needed an implementation of the __pfnDliFailureHook2 or __pfnDliNotifyHook2 hook in the plugin. Now all they need is a null exported pointer with the right name (as in win32_linker.c). If QEMU finds this, it will set it to the hook function, which has now moved into qemu

[PATCH v2 0/1] plugins: Move the windows linking function to qemu

2023-11-09 Thread Greg Manning
v1-v2: Added signed-off-by line. Greg Manning (1): plugins: Move the windows linking function to qemu contrib/plugins/win32_linker.c | 23 +++ include/sysemu/os-win32.h | 25 + os-win32.c | 33

Re: [PATCH v2 1/1] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Paolo Bonzini
On 11/9/23 10:24, Greg Manning wrote: t += shared_module(i, files(i + '.c') + '../../contrib/plugins/win32_linker.c', include_directories: '../../include/qemu', -objects: [win32_qemu_plugin_api_lib], +link_depends: [

Re: [PATCH v2 1/1] plugins: Move the windows linking function to qemu

2023-11-09 Thread Paolo Bonzini
On 11/9/23 10:25, Greg Manning wrote: Previously, a plugin author needed an implementation of the __pfnDliFailureHook2 or __pfnDliNotifyHook2 hook in the plugin. Now all they need is a null exported pointer with the right name (as in win32_linker.c). If QEMU finds this, it will set it to the hook

Re: [PATCH] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Philippe Mathieu-Daudé
Hi Greg, On 9/11/23 10:13, Greg Manning wrote: fixes #1927. Does this match GitLab pattern? See https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#default-closing-pattern We usually write: "Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1927"; So there is no confusi

Re: [PATCH] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Philippe Mathieu-Daudé
Hi Greg, On 9/11/23 10:13, Greg Manning wrote: > fixes #1927. Does this match the GitLab pattern? See https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#default-closing-pattern We usually write: "Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1927"; So there is no conf

[PATCH] doc/sphinx/hxtool.py: add optional label argument to SRST directive

2023-11-09 Thread Woodhouse, David
We can't just embed labels directly into files like qemu-options.hx which are included from multiple top-level RST files, because Sphinx sees the labels as duplicate: https://github.com/sphinx-doc/sphinx/issues/9707 So add an 'emitrefs' option to the Sphinx hxtool-doc directive, which is set only

Re: [PULL v3 09/25] ui/console: allow to override the default VC

2023-11-09 Thread David Woodhouse
On Tue, 2023-11-07 at 14:15 +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > If a display is backed by a specialized VC, allow to override the > default "vc:80Cx24C". > > As suggested by Paolo, if the display doesn't implement a VC (get_vc() > returns NULL), use a fallback

Re: [PATCH v2 21/35] tcg/sparc64: Pass TCGCond to tcg_out_cmp

2023-11-09 Thread Philippe Mathieu-Daudé
On 28/10/23 21:45, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH 8.2 bugfix] net: do not delete nics in net_cleanup()

2023-11-09 Thread David Woodhouse
From: David Woodhouse In net_cleanup() we only need to delete the netdevs, as those may have state which outlives QEMU when it exits, and thus may actually need to be cleaned up on exit. The nics, on the other hand, are owned by the device which created them. Most devices don't bother to clean u

Re: [PULL v3 09/25] ui/console: allow to override the default VC

2023-11-09 Thread Stefan Hajnoczi
On Thu, 9 Nov 2023 at 19:10, David Woodhouse wrote: > > On Tue, 2023-11-07 at 14:15 +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > If a display is backed by a specialized VC, allow to override the > > default "vc:80Cx24C". > > > > As suggested by Paolo, if the displ

[PATCH 8.2 bugfix] vl: disable default serial when xen-console is enabled

2023-11-09 Thread David Woodhouse
From: David Woodhouse If a Xen console is configured on the command line, do not add a default serial port. Fixes: 1bec1cc0da4 ("ui/console: allow to override the default VC") Signed-off-by: David Woodhouse --- (Bonus points for adding a Xen console by default for Xen guests instead of a serial

Re: [PULL v3 09/25] ui/console: allow to override the default VC

2023-11-09 Thread David Woodhouse
On Thu, 2023-11-09 at 19:34 +0800, Stefan Hajnoczi wrote: > On Thu, 9 Nov 2023 at 19:10, David Woodhouse wrote: > > > > On Tue, 2023-11-07 at 14:15 +0400, marcandre.lur...@redhat.com wrote: > > > From: Marc-André Lureau > > > > > > If a display is backed by a specialized VC, allow to override t

[PATCH v5 00/20] vfio: Adopt iommufd

2023-11-09 Thread Zhenzhong Duan
Hi, Thanks all for giving guides and comments on previous series, this is the remaining part of the iommufd support. Based on Cédric's suggestion, replace old config method for IOMMUFD with Kconfig. This series is added some extra changes based on Cédric's changes at https://github.com/legoater/

[PATCH v5 04/20] vfio/iommufd: Relax assert check for iommufd backend

2023-11-09 Thread Zhenzhong Duan
Currently iommufd doesn't support dirty page sync yet, but it will not block us doing live migration if VFIO migration is force enabled. So in this case we allow set_dirty_page_tracking to be NULL. Note we don't need same change for query_dirty_bitmap because when dirty page sync isn't supported,

[PATCH v5 06/20] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info

2023-11-09 Thread Zhenzhong Duan
This helper will be used by both legacy and iommufd backends. No functional changes intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- hw/vfio/pci.h | 3 +++ hw/vfio/pci.c | 54 +++ 2 files

[PATCH v5 07/20] vfio/pci: Introduce a vfio pci hot reset interface

2023-11-09 Thread Zhenzhong Duan
Legacy vfio pci and iommufd cdev have different process to hot reset vfio device, expand current code to abstract out pci_hot_reset callback for legacy vfio, this same interface will also be used by iommufd cdev vfio device. Rename vfio_pci_hot_reset to vfio_legacy_pci_hot_reset and move it into c

[PATCH v5 14/20] vfio/ap: Make vfio cdev pre-openable by passing a file handle

2023-11-09 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan --- hw/vfio/ap.c | 32 +++- 1 file changed, 31 inse

[PATCH v5 01/20] backends/iommufd: Introduce the iommufd object

2023-11-09 Thread Zhenzhong Duan
From: Eric Auger Introduce an iommufd object which allows the interaction with the host /dev/iommu device. The /dev/iommu can have been already pre-opened outside of qemu, in which case the fd can be passed directly along with the iommufd object: This allows the iommufd object to be shared accr

[PATCH v5 18/20] hw/arm: Activate IOMMUFD for virt machines

2023-11-09 Thread Zhenzhong Duan
From: Cédric Le Goater Signed-off-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 3ada335a24..660f49db49 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -8,6 +8,7 @@ config ARM_V

[PATCH v5 08/20] vfio/iommufd: Enable pci hot reset through iommufd cdev interface

2023-11-09 Thread Zhenzhong Duan
Add a new callback iommufd_pci_hot_reset to do iommufd specific check and reset operation. Signed-off-by: Zhenzhong Duan --- hw/vfio/iommufd.c| 142 +++ hw/vfio/trace-events | 1 + 2 files changed, 143 insertions(+) diff --git a/hw/vfio/iommufd.c b/

[PATCH v5 02/20] util/char_dev: Add open_cdev()

2023-11-09 Thread Zhenzhong Duan
From: Yi Liu /dev/vfio/devices/vfioX may not exist. In that case it is still possible to open /dev/char/$major:$minor instead. Add helper function to abstract the cdev open. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- v5: move chardev_open.[h|c] under

[PATCH v5 16/20] vfio/ccw: Make vfio cdev pre-openable by passing a file handle

2023-11-09 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan --- hw/vfio/ccw.c | 34 +++--- 1 file changed, 31 i

[PATCH v5 13/20] vfio/ap: Allow the selection of a given iommu backend

2023-11-09 Thread Zhenzhong Duan
Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-ap device: if the user wants to use the legacy backend, it shall not link the vfio-ap device with any iommufd object: -device vfio-a

[PATCH v5 11/20] vfio/platform: Allow the selection of a given iommu backend

2023-11-09 Thread Zhenzhong Duan
Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-platform device: If the user wants to use the legacy backend, it shall not link the vfio-platform device with any iommufd object: -d

[PATCH v5 19/20] kconfig: Activate IOMMUFD for s390x machines

2023-11-09 Thread Zhenzhong Duan
From: Cédric Le Goater Signed-off-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/s390x/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/Kconfig b/hw/s390x/Kconfig index 4c068d7960..26ad104485 100644 --- a/hw/s390x/Kconfig +++ b/hw/s390x/Kconfig @@ -6,6 +6,7 @@ co

[PATCH v5 15/20] vfio/ccw: Allow the selection of a given iommu backend

2023-11-09 Thread Zhenzhong Duan
Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-ccw device: If the user wants to use the legacy backend, it shall not link the vfio-ccw device with any iommufd object: -device vfio

[PATCH v5 12/20] vfio/platform: Make vfio cdev pre-openable by passing a file handle

2023-11-09 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan --- hw/vfio/platform.c | 41 + 1 file c

[PATCH v5 03/20] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Zhenzhong Duan
From: Yi Liu Add the iommufd backend. The IOMMUFD container class is implemented based on the new /dev/iommu user API. This backend obviously depends on CONFIG_IOMMUFD. So far, the iommufd backend doesn't support dirty page sync yet due to missing support in the host kernel. Co-authored-by: Eri

[PATCH v5 10/20] vfio/pci: Make vfio cdev pre-openable by passing a file handle

2023-11-09 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Together with the earlier support of pre-opening /dev/iommu device, now we have full support of passing a vfio

[PATCH v5 20/20] hw/i386: Activate IOMMUFD for q35 machines

2023-11-09 Thread Zhenzhong Duan
From: Cédric Le Goater Signed-off-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/i386/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 55850791df..a1846be6f7 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -95,6 +95,7 @@ confi

[PATCH v5 09/20] vfio/pci: Allow the selection of a given iommu backend

2023-11-09 Thread Zhenzhong Duan
From: Eric Auger Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-pci device: If the user wants to use the legacy backend, it shall not link the vfio-pci device with any iommufd obj

[PATCH v5 05/20] vfio/iommufd: Add support for iova_ranges and pgsizes

2023-11-09 Thread Zhenzhong Duan
Some vIOMMU such as virtio-iommu use iova ranges from host side to setup reserved ranges for passthrough device, so that guest will not use an iova range beyond host support. Use an uAPI of IOMMUFD to get iova ranges of host side and pass to vIOMMU just like the legacy backend. Also use out_iova_

[PATCH v5 17/20] vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks

2023-11-09 Thread Zhenzhong Duan
Some of the callbacks in VFIOIOMMUOps pass VFIOContainerBase poiner, those callbacks only need read access to the sub object of VFIOContainerBase. So make VFIOContainerBase, VFIOContainer and VFIOIOMMUFDContainer as const in these callbacks. Local functions called by those callbacks also need same

[PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init

2023-11-09 Thread Janosch Frank
dump_state_prepare() now sets the function pointers to NULL so we only need to touch them if we're going to use them. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- target/s390x/arch_dump.c | 4 1 file changed, 4 deletions(-) diff --git a/target/s390x/arch_dump.c b/target

[PATCH v2 3/3] target/s390x/arch_dump: Add arch cleanup function for PV dumps

2023-11-09 Thread Janosch Frank
PV dumps block vcpu runs until dump end is reached. If there's an error between PV dump init and PV dump end the vm will never be able to run again. One example of such an error is insufficient disk space for the dump file. Let's add a cleanup function that tries to do a dump end. The dump complet

[PATCH v2 0/3] dump: Arch info function pointer addition and cleanup

2023-11-09 Thread Janosch Frank
Small cleanups/fixes to the dump info function pointer assignments as well as a new function pointer for cleanup of residual state. This has come up because test managed to dump a s390 PV vm onto a disk that was too small for the dump. After the dump failed, the vm wasn't able to resume running si

[PATCH v2 2/3] dump: Add arch cleanup function

2023-11-09 Thread Janosch Frank
Some architectures (s390x) need to cleanup after a failed dump to be able to continue to run the vm. Add a cleanup function pointer and call it if it's set. Signed-off-by: Janosch Frank --- dump/dump.c| 4 include/sysemu/dump-arch.h | 1 + 2 files changed, 5 insertions(+) d

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Joao Martins
On 08/11/2023 12:48, Jason Gunthorpe wrote: > On Wed, Nov 08, 2023 at 07:16:52AM +, Duan, Zhenzhong wrote: > +ret = iommufd_backend_alloc_hwpt(iommufd, vbasedev->devid, + container->ioas_id, &hwpt_id); + +if (ret) { +

Re: [PATCH v2] target/arm: Fix SVE STR increment

2023-11-09 Thread Alex Bennée
Richard Henderson writes: > The previous change missed updating one of the increments and > one of the MemOps. Add a test case for all vector lengths. > > Cc: qemu-sta...@nongnu.org > Fixes: e6dd5e782be ("target/arm: Use tcg_gen_qemu_{ld, st}_i128 in > gen_sve_{ld, st}r") > Signed-off-by: Richa

Re: [PATCH v2 3/3] target/s390x/arch_dump: Add arch cleanup function for PV dumps

2023-11-09 Thread Claudio Imbrenda
On Thu, 9 Nov 2023 12:04:43 + Janosch Frank wrote: > PV dumps block vcpu runs until dump end is reached. If there's an > error between PV dump init and PV dump end the vm will never be able > to run again. One example of such an error is insufficient disk space > for the dump file. > > Let'

Re: [PATCH v2 1/1] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Greg Manning
> On 11/9/23 10:24, Greg Manning wrote: > >t += shared_module(i, files(i + '.c') + > > '../../contrib/plugins/win32_linker.c', > > include_directories: '../../include/qemu', > > -objects: [win32_qemu_plugin_api_lib], > > +

Re: [PATCH 2/7] qcow2: add get_sc_range_info() helper for working with subcluster ranges

2023-11-09 Thread Andrey Drobyshev
Hello Hanna, Sorry for the delay and thanks for your thorough and detailed review. On 10/31/23 17:53, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> This helper simply obtains the l2 table parameters of the cluster which >> contains the given subclusters range.  Right now t

Re: [PATCH 6/7] iotests/common.rc: add disk_usage function

2023-11-09 Thread Andrey Drobyshev
On 11/3/23 17:20, Hanna Czenczek wrote: > On 20.10.23 23:56, Andrey Drobyshev wrote: >> Move the definition from iotests/250 to common.rc.  This is used to >> detect real disk usage of sparse files.  In particular, we want to use >> it for checking subclusters-based discards. >> >> Signed-off-by: A

[PATCH v3 1/1] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Greg Manning
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1972 Cross compile gcc is more picky about argument order than msys. Changed the meson command to take the (now renamed) libqemu_plugin_api.a as a lib, rather than an object. This puts it in the right place on both native and cross compile gc

[PATCH v3 0/1] plugins: fix win plugin tests on cross compile

2023-11-09 Thread Greg Manning
v1-v2: Added the signed-off-by line. v2-v3: Fixed the issue reference. Greg Manning (1): plugins: fix win plugin tests on cross compile .gitlab-ci.d/crossbuilds.yml | 2 +- contrib/plugins/Makefile | 2 +- plugins/meson.build | 2 +- tests/plugin/meson.build | 3 ++- 4 files c

Re: [PATCH v2] Optimize buffer_is_zero

2023-11-09 Thread Alexander Monakov
I'd like to ping this patch on behalf of Mikhail. https://patchew.org/QEMU/20231027143704.7060-1-mmroma...@ispras.ru/ If this needs to be split up a bit to ease review, please let us know. On Fri, 27 Oct 2023, Mikhail Romanov wrote: > Improve buffer_is_zero function which is often used in qem

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Joao Martins
On 09/11/2023 12:57, Jason Gunthorpe wrote: > On Thu, Nov 09, 2023 at 12:17:35PM +, Joao Martins wrote: >> On 08/11/2023 12:48, Jason Gunthorpe wrote: >>> On Wed, Nov 08, 2023 at 07:16:52AM +, Duan, Zhenzhong wrote: >>> >> +ret = iommufd_backend_alloc_hwpt(iommufd, vbasedev->devid,

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Jason Gunthorpe
On Thu, Nov 09, 2023 at 12:17:35PM +, Joao Martins wrote: > > > On 08/11/2023 12:48, Jason Gunthorpe wrote: > > On Wed, Nov 08, 2023 at 07:16:52AM +, Duan, Zhenzhong wrote: > > > +ret = iommufd_backend_alloc_hwpt(iommufd, vbasedev->devid, > +

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Joao Martins
On 09/11/2023 12:59, Joao Martins wrote: > On 09/11/2023 12:57, Jason Gunthorpe wrote: >> On Thu, Nov 09, 2023 at 12:17:35PM +, Joao Martins wrote: >>> On 08/11/2023 12:48, Jason Gunthorpe wrote: On Wed, Nov 08, 2023 at 07:16:52AM +, Duan, Zhenzhong wrote: >>> +ret = iommu

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Jason Gunthorpe
On Thu, Nov 09, 2023 at 01:03:02PM +, Joao Martins wrote: > > I am not talking about mdevs; but rather the regular (non mdev) case not > > being > > able to use dirty tracking with autodomains hwpt allocation. > > ... without any vIOMMU. Ah, well, that is troublesome isn't it.. So do we te

Re: [PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init

2023-11-09 Thread Thomas Huth
On 09/11/2023 13.04, Janosch Frank wrote: dump_state_prepare() now sets the function pointers to NULL so we only need to touch them if we're going to use them. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- target/s390x/arch_dump.c | 4 1 file changed, 4 deletions(-)

Re: [PATCH v2 2/3] dump: Add arch cleanup function

2023-11-09 Thread Thomas Huth
On 09/11/2023 13.04, Janosch Frank wrote: Some architectures (s390x) need to cleanup after a failed dump to be able to continue to run the vm. Add a cleanup function pointer and call it if it's set. Signed-off-by: Janosch Frank --- dump/dump.c| 4 include/sysemu/dump-arc

Re: QEMU Virtio GPU features status & roadmap?

2023-11-09 Thread Hans de Ruiter
Hi everyone, Thanks for the info. It's great to hear that things are progressing. In the meantime, I've started working with Virtio GPU in its current state on QEMU's master branch. I think I've managed to find a workaround for the direct VRAM access. BTW, is there any official documentation

Re: [PATCH v2 3/3] target/s390x/arch_dump: Add arch cleanup function for PV dumps

2023-11-09 Thread Thomas Huth
On 09/11/2023 13.04, Janosch Frank wrote: PV dumps block vcpu runs until dump end is reached. If there's an error between PV dump init and PV dump end the vm will never be able to run again. One example of such an error is insufficient disk space for the dump file. Let's add a cleanup function t

Re: [PATCH v2] target/arm: Fix SVE STR increment

2023-11-09 Thread Michael Tokarev
09.11.2023 15:23, Alex Bennée: Richard Henderson writes: The previous change missed updating one of the increments and one of the MemOps. Add a test case for all vector lengths. Cc: qemu-sta...@nongnu.org Fixes: e6dd5e782be ("target/arm: Use tcg_gen_qemu_{ld, st}_i128 in gen_sve_{ld, st}r")

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-09 Thread Joao Martins
On 09/11/2023 13:09, Jason Gunthorpe wrote: > On Thu, Nov 09, 2023 at 01:03:02PM +, Joao Martins wrote: > >>> I am not talking about mdevs; but rather the regular (non mdev) case not >>> being >>> able to use dirty tracking with autodomains hwpt allocation. >> >> ... without any vIOMMU. > >

Re: [PATCH v2] target/arm: Fix SVE STR increment

2023-11-09 Thread Alex Bennée
Michael Tokarev writes: > 09.11.2023 15:23, Alex Bennée: >> Richard Henderson writes: >> >>> The previous change missed updating one of the increments and >>> one of the MemOps. Add a test case for all vector lengths. >>> >>> Cc: qemu-sta...@nongnu.org >>> Fixes: e6dd5e782be ("target/arm: Use

[Stable-8.1.3 04/55] python/qmp: remove Server.wait_closed() call for Python 3.12

2023-11-09 Thread Michael Tokarev
From: John Snow This patch is a backport from https://gitlab.com/qemu-project/python-qemu-qmp/-/commit/e03a3334b6a477beb09b293708632f2c06fe9f61 According to Guido in https://github.com/python/cpython/issues/104344 , this call was never meant to wait for the server to shut down - that is handled

[Stable-8.1.3 00/55] Patch Round-up for stable 8.1.3, freeze on 2023-11-19

2023-11-09 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.1.3: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.1 Patch freeze is 2023-11-19, and the release is planned for 2023-11-21: https://wiki.qemu.org/Planning/8.1 Please respond here or CC qemu-sta...@nongnu.org on any additional pa

[Stable-8.1.3 01/55] hw/pvrdma: Protect against buggy or malicious guest driver

2023-11-09 Thread Michael Tokarev
From: Yuval Shaia Guest driver allocates and initialize page tables to be used as a ring of descriptors for CQ and async events. The page table that represents the ring, along with the number of pages in the page table is passed to the device. Currently our device supports only one page table for

[Stable-8.1.3 14/55] lasips2: LASI PS/2 devices are not user-createable

2023-11-09 Thread Michael Tokarev
From: Helge Deller Those PS/2 ports are created with the LASI controller when a 32-bit PA-RISC machine is created. Mark them not user-createable to avoid showing them in the qemu device list. Signed-off-by: Helge Deller Cc: qemu-sta...@nongnu.org (cherry picked from commit a1e6a5c46219bada2c7b

[Stable-8.1.3 03/55] migration: Non multifd migration don't care about multifd flushes

2023-11-09 Thread Michael Tokarev
From: Juan Quintela RDMA was having trouble because migrate_multifd_flush_after_each_section() can only be true or false, but we don't want to send any flush when we are not in multifd migration. CC: Fabiano Rosas Reviewed-by: Li Zhijian Reviewed-by: Peter Xu Signed-off-by: Juan Quintela Mes

[Stable-8.1.3 15/55] target/arm: Fix CNTPCT_EL0 trapping from EL0 when HCR_EL2.E2H is 0

2023-11-09 Thread Michael Tokarev
From: Michal Orzel On an attempt to access CNTPCT_EL0 from EL0 using a guest running on top of Xen, a trap from EL2 was observed which is something not reproducible on HW (also, Xen does not trap accesses to physical counter). This is because gt_counter_access() checks for an incorrect bit (1 in

[Stable-8.1.3 09/55] tests/vm: avoid invalid escape in Python string

2023-11-09 Thread Michael Tokarev
From: Paolo Bonzini This is an error in Python 3.12; fix it by using a raw string literal or by double-escaping the backslash. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 86a8989d4557a09b68f8b78b6c3fb6ad3f23ca6f) Signed-off-by: Michael Tokarev diff --git

[Stable-8.1.3 17/55] hw/rdma/vmw/pvrdma_cmd: Use correct struct in query_port()

2023-11-09 Thread Michael Tokarev
From: Peter Maydell In query_port() we pass the address of a local pvrdma_port_attr struct to the rdma_query_backend_port() function. Unfortunately, rdma_backend_query_port() wants a pointer to a struct ibv_port_attr, and the two are not the same length. Coverity spotted this (CID 1507146): pvr

[Stable-8.1.3 08/55] tests/avocado: avoid invalid escape in Python string

2023-11-09 Thread Michael Tokarev
From: Paolo Bonzini This is an error in Python 3.12; fix it by using a raw string literal. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 1b5f3f65cc71341a4f9fc9e89bb6985fde703758) Signed-off-by: Michael Tokarev diff --git a/tests/avocado/virtio_check_params

[Stable-8.1.3 05/55] tests/docker: avoid invalid escape in Python string

2023-11-09 Thread Michael Tokarev
From: Paolo Bonzini This is an error in Python 3.12; fix it by using a raw string literal. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit a5e3cb3b90a62a42cd19ad9a20ca25c7df1dc3da) Signed-off-by: Michael Tokarev diff --git a/tests/docker/docker.py b/tests/do

[Stable-8.1.3 28/55] vfio/pci: Fix buffer overrun when writing the VF token

2023-11-09 Thread Michael Tokarev
From: Cédric Le Goater qemu_uuid_unparse() includes a trailing NUL when writing the uuid string and the buffer size should be UUID_FMT_LEN + 1 bytes. Use the recently added UUID_STR_LEN which defines the correct size. Fixes: CID 1522913 Fixes: 2dca1b37a760 ("vfio/pci: add support for VF token")

[Stable-8.1.3 02/55] migration: Fix analyze-migration read operation signedness

2023-11-09 Thread Michael Tokarev
From: Fabiano Rosas The migration code uses unsigned values for 16, 32 and 64-bit operations. Fix the script to do the same. This was causing an issue when parsing the migration stream generated on the ppc64 target because one of instance_ids was larger than the 32bit signed maximum: Traceback

[Stable-8.1.3 26/55] target/arm: Correctly propagate stage 1 BTI guarded bit in a two-stage walk

2023-11-09 Thread Michael Tokarev
From: Peter Maydell In a two-stage translation, the result of the BTI guarded bit should be the guarded bit from the first stage of translation, as there is no BTI guard information in stage two. Our code tried to do this, but got it wrong, because we currently have two fields where the GP bit i

[Stable-8.1.3 12/55] linux-user/mips: fix abort on integer overflow

2023-11-09 Thread Michael Tokarev
From: Mikulas Patocka QEMU mips userspace emulation crashes with "qemu: unhandled CPU exception 0x15 - aborting" when one of the integer arithmetic instructions detects an overflow. This patch fixes it so that it delivers SIGFPE with FPE_INTOVF instead. Cc: qemu-sta...@nongnu.org Signed-off-by:

[Stable-8.1.3 40/55] qcow2: keep reference on zeroize with discard-no-unref enabled

2023-11-09 Thread Michael Tokarev
From: Jean-Louis Dupond When the discard-no-unref flag is enabled, we keep the reference for normal discard requests. But when a discard is executed on a snapshot/qcow2 image with backing, the discards are saved as zero clusters in the snapshot image. When committing the snapshot to the backing

[Stable-8.1.3 16/55] hw/sd/sdhci: Block Size Register bits [14:12] is lost

2023-11-09 Thread Michael Tokarev
From: Lu Gao Block Size Register bits [14:12] is SDMA Buffer Boundary, it is missed in register write, but it is needed in SDMA transfer. e.g. it will be used in sdhci_sdma_transfer_multi_blocks to calculate boundary_ variables. Missing this field will cause wrong operation for different SDMA Bu

[Stable-8.1.3 34/55] hw/xen: fix XenStore watch delivery to guest

2023-11-09 Thread Michael Tokarev
From: David Woodhouse When fire_watch_cb() found the response buffer empty, it would call deliver_watch() to generate the XS_WATCH_EVENT message in the response buffer and send an event channel notification to the guest… without actually *copying* the response buffer into the ring. So there was n

[Stable-8.1.3 11/55] linux-user: Fixes for zero_bss

2023-11-09 Thread Michael Tokarev
From: Richard Henderson The previous change, 2d385be6152, assumed !PAGE_VALID meant that the page would be unmapped by the elf image. However, since we reserved the entire image space via mmap, PAGE_VALID will always be set. Instead, assume PROT_NONE for the same condition. Furthermore, assume

[Stable-8.1.3 10/55] tracetool: avoid invalid escape in Python string

2023-11-09 Thread Michael Tokarev
From: Paolo Bonzini This is an error in Python 3.12; fix it by using a raw string literal. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit e6d8e5e6e366ab4c9ed7d8ed1572f98c6ad6a38e) Signed-off-by: Michael Tokarev diff --git a/scripts/tracetool/__init__.py b/s

[Stable-8.1.3 13/55] linux-user/sh4: Fix crashes on signal delivery

2023-11-09 Thread Michael Tokarev
From: Mikulas Patocka sh4 uses gUSA (general UserSpace Atomicity) to provide atomicity on CPUs that don't have atomic instructions. A gUSA region that adds 1 to an atomic variable stored in @R2 looks like this: 4004b6: 03 c7 mova4004c4 ,r0 4004b8: f3 61 mo

[Stable-8.1.3 07/55] target/hexagon: avoid invalid escape in Python string

2023-11-09 Thread Michael Tokarev
From: Paolo Bonzini This is an error in Python 3.12; fix it by using a raw string literal. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit e41c40d101fce79af4d679955eb6e0d31e02c47c) Signed-off-by: Michael Tokarev diff --git a/target/hexagon/hex_common.py b/ta

[Stable-8.1.3 32/55] hw/xen: select kernel mode for per-vCPU event channel upcall vector

2023-11-09 Thread Michael Tokarev
From: David Woodhouse A guest which has configured the per-vCPU upcall vector may set the HVM_PARAM_CALLBACK_IRQ param to fairly much anything other than zero. For example, Linux v6.0+ after commit b1c3497e604 ("x86/xen: Add support for HVMOP_set_evtchn_upcall_vector") will just do this after se

[Stable-8.1.3 49/55] hw/ide: reset: cancel async DMA operation before resetting state

2023-11-09 Thread Michael Tokarev
From: Fiona Ebner If there is a pending DMA operation during ide_bus_reset(), the fact that the IDEState is already reset before the operation is canceled can be problematic. In particular, ide_dma_cb() might be called and then use the reset IDEState which contains the signature after the reset.

[Stable-8.1.3 20/55] misc/led: LED state is set opposite of what is expected

2023-11-09 Thread Michael Tokarev
From: Glenn Miles Testing of the LED state showed that when the LED polarity was set to GPIO_POLARITY_ACTIVE_LOW and a low logic value was set on the input GPIO of the LED, the LED was being turn off when it was expected to be turned on. Fixes: ddb67f6402 ("hw/misc/led: Allow connecting from GPI

[Stable-7.2.7 42/62] tests/tcg: Add -fno-stack-protector

2023-11-09 Thread Michael Tokarev
From: Akihiko Odaki A build of GCC 13.2 will have stack protector enabled by default if it was configured with --enable-default-ssp option. For such a compiler, it is necessary to explicitly disable stack protector when linking without standard libraries. Signed-off-by: Akihiko Odaki Message-Id

[Stable-7.2.7 58/62] hw/ide: reset: cancel async DMA operation before resetting state

2023-11-09 Thread Michael Tokarev
From: Fiona Ebner If there is a pending DMA operation during ide_bus_reset(), the fact that the IDEState is already reset before the operation is canceled can be problematic. In particular, ide_dma_cb() might be called and then use the reset IDEState which contains the signature after the reset.

[Stable-7.2.7 49/62] target/arm: Fix handling of SW and NSW bits for stage 2 walks

2023-11-09 Thread Michael Tokarev
From: Peter Maydell We currently don't correctly handle the VSTCR_EL2.SW and VTCR_EL2.NSW configuration bits. These allow configuration of whether the stage 2 page table walks for Secure IPA and NonSecure IPA should do their descriptor reads from Secure or NonSecure physical addresses. (This is

[Stable-7.2.7 51/62] block/nvme: nvme_process_completion() fix bound for cid

2023-11-09 Thread Michael Tokarev
From: Vladimir Sementsov-Ogievskiy NVMeQueuePair::reqs has length NVME_NUM_REQS, which less than NVME_QUEUE_SIZE by 1. Fixes: 1086e95da17050 ("block/nvme: switch to a NVMeRequest freelist") Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Reviewed-by: Maksim Davydov Me

[Stable-7.2.7 34/62] hw/pvrdma: Protect against buggy or malicious guest driver

2023-11-09 Thread Michael Tokarev
From: Yuval Shaia Guest driver allocates and initialize page tables to be used as a ring of descriptors for CQ and async events. The page table that represents the ring, along with the number of pages in the page table is passed to the device. Currently our device supports only one page table for

  1   2   3   4   >