Re: [PATCH] gitlab: Update msys2-64bit runner tags

2024-05-08 Thread Thomas Huth
On 07/05/2024 19.53, Richard Henderson wrote: Gitlab has deprecated and removed support for windows-1809 and shared-windows. Update to saas-windows-medium-amd64 per https://about.gitlab.com/blog/2024/01/22/windows-2022-support-for-gitlab-saas-runners/ Signed-off-by: Richard Henderson --- .g

Re: [PATCH 1/9] monitor: Honor QMP request for fd removal immediately

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:34AM -0300, Fabiano Rosas wrote: > We're enabling using the fdset interface to pass file descriptors for > use in the migration code. Since migrations can happen more than once > during the VMs lifetime, we need a way to remove an fd from the fdset > at the end of migr

Re: [PATCH v13 5/6] ui/console: Use qemu_dmabuf_new() and free() helpers instead

2024-05-08 Thread Marc-André Lureau
Hi On Tue, May 7, 2024 at 10:44 PM wrote: > > From: Dongwon Kim > > This commit introduces utility functions for the creation and deallocation > of QemuDmaBuf instances. Additionally, it updates all relevant sections > of the codebase to utilize these new utility functions. > > v7: remove prefix

Re: [PATCH v2 08/15] hw/riscv/riscv-iommu: add Address Translation Cache (IOATC)

2024-05-08 Thread Frank Chang
Hi Daniel, Daniel Henrique Barboza 於 2024年3月8日 週五 上午12:05寫道: > > From: Tomasz Jeznach > > The RISC-V IOMMU spec predicts that the IOMMU can use translation caches > to hold entries from the DDT. This includes implementation for all cache > commands that are marked as 'not implemented'. > > There

[PATCH v4 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-05-08 Thread Stefano Garzarella
v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/ v2: https://patchew.org/QEMU/20240326133936.125332-1-sgarz...@redhat.com/ v3: https://patchew.org/QEMU/20240404122330.92710-1-sgarz...@redhat.com/ v4: - rebased on master (commit e116b92d01c2cd75957a9f8ad1d4932292867b81) -

[PATCH v4 02/12] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-05-08 Thread Stefano Garzarella
In vu_message_write() we use sendmsg() to send the message header, then a write() to send the payload. If sendmsg() fails we should avoid sending the payload, since we were unable to send the header. Discovered before fixing the issue with the previous patch, where sendmsg() failed on macOS due t

[PATCH v4 08/12] libvhost-user: enable it on any POSIX system

2024-05-08 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system. Compiling it on macOS and FreeBSD some problems came up: - avoid to include linux/vhost.h which is avaibale only on Linux (vhost_types.h contains many of the things we need) - macOS doesn't p

[PATCH v4 09/12] contrib/vhost-user-blk: enable it on any POSIX system

2024-05-08 Thread Stefano Garzarella
Let's make the code more portable by adding defines from block/file-posix.c to support O_DIRECT in other systems (e.g. macOS). vhost-user-server.c is a dependency, let's enable it for any POSIX system. Signed-off-by: Stefano Garzarella --- v4: - moved using of "qemu/bswap.h" API in a separate pa

[PATCH v4 10/12] hostmem: add a new memory backend based on POSIX shm_open()

2024-05-08 Thread Stefano Garzarella
shm_open() creates and opens a new POSIX shared memory object. A POSIX shared memory object allows creating memory backend with an associated file descriptor that can be shared with external processes (e.g. vhost-user). The new `memory-backend-shm` can be used as an alternative when `memory-backen

[PATCH v4 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-05-08 Thread Stefano Garzarella
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- contrib/vhost-user-blk/vhost-user-blk.c | 9 + contrib/vhost-user-input/main.c | 16

[PATCH v4 07/12] vhost-user: enable frontends on any POSIX system

2024-05-08 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system. In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well. Signed-off-by: Stefano Garzarella --- meson.build

[PATCH v4 12/12] tests/qtest/vhost-user-test: add a test case for memory-backend-shm

2024-05-08 Thread Stefano Garzarella
`memory-backend-shm` can be used with vhost-user devices, so let's add a new test case for it. Signed-off-by: Stefano Garzarella --- tests/qtest/vhost-user-test.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-t

[PATCH v4 03/12] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-05-08 Thread Stefano Garzarella
libvhost-user will panic when receiving VHOST_USER_GET_INFLIGHT_FD message if MFD_ALLOW_SEALING is not defined, since it's not able to create a memfd. VHOST_USER_GET_INFLIGHT_FD is used only if VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is negotiated. So, let's mask that feature if the backend is not ab

[PATCH v4 01/12] libvhost-user: set msg.msg_control to NULL when it is empty

2024-05-08 Thread Stefano Garzarella
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Reviewed-by: Eric Blake Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- subprojec

[PATCH v4 04/12] vhost-user-server: do not set memory fd non-blocking

2024-05-08 Thread Stefano Garzarella
In vhost-user-server we set all fd received from the other peer in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.) it's not really needed, because we don't use these fd with blocking operations, but only to map memory. In addition, in some systems this operation can fail (e.g. in

[PATCH v4 11/12] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-05-08 Thread Stefano Garzarella
`memory-backend-memfd` is available only on Linux while the new `memory-backend-shm` can be used on any POSIX-compliant operating system. Let's use it so we can run the test in multiple environments. Signed-off-by: Stefano Garzarella --- tests/qtest/vhost-user-blk-test.c | 2 +- 1 file changed,

[PATCH v4 05/12] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-05-08 Thread Stefano Garzarella
On macOS passing `-s /tmp/vhost.socket` parameter to the vhost-user-blk application, the bind was done on `/tmp/vhost.socke` pathname, missing the last character. This sounds like one of the portability problems described in the unix(7) manpage: Pathname sockets When binding a socket

Re: Hermetic virtio-vsock in QEMU

2024-05-08 Thread Stefano Garzarella
Hi Roman, On Tue, May 07, 2024 at 11:20:50PM GMT, Roman Kiryanov wrote: Hi Stefano, On Tue, May 7, 2024 at 1:10 AM Stefano Garzarella wrote: I have no experience with Windows, but what we need for vhost-user is: - AF_UNIX and be able to send file descriptors using ancillary data (i.e. SCM

[PATCH v2 0/6] kconfig: express dependency of individual boards on libfdt

2024-05-08 Thread Paolo Bonzini
This is a follow up to the "default y" patch series at https://lore.kernel.org/qemu-devel/20240423131612.28362-1-pbonz...@redhat.com/ and shows an example of what that series enables. With this change, individual boards will be enabled/disabled depending on whether libfdt is present or not. In pa

[PATCH 1/6] meson: pick libfdt from common_ss when building target-specific files

2024-05-08 Thread Paolo Bonzini
Avoid having to list dependencies such as libfdt twice, both on common_ss and specific_ss. Instead, just take all the dependencies in common_ss and allow the target-specific libqemu-*.fa library to use them. Signed-off-by: Paolo Bonzini --- meson.build | 14 +++--- hw/arm/m

[PATCH 4/6] kconfig: express dependency of individual boards on libfdt

2024-05-08 Thread Paolo Bonzini
Now that boards are enabled by default and the "CONFIG_FOO=y" entries are gone from configs/devices/, there cannot be any more a conflicts between the default contents of configs/devices/ and a failed "depends on" clause. With this change, each individual board or target can express whether it nee

[PATCH 2/6] meson: move libfdt together with other dependencies

2024-05-08 Thread Paolo Bonzini
Move the libfdt detection code together with other dependencies instead of keeping it with subprojects. This has the disadvantage of performing the detection even if no target requires libfdt; but it has the advantage that Kconfig will be able to observe the availability of the library. Signed-of

[PATCH 3/6] kconfig: allow compiling out QEMU device tree code per target

2024-05-08 Thread Paolo Bonzini
Introduce a new Kconfig symbol, CONFIG_DEVICE_TREE, that specifies whether to include the common device tree code in system/device_tree.c and to link to libfdt. For now, include it unconditionally if libfdt is available. Signed-off-by: Paolo Bonzini --- meson.build | 1 + incl

[PATCH 6/6] configs: disable emulators that require it if libfdt is not found

2024-05-08 Thread Paolo Bonzini
Since boards can express their dependency on libfdt and system/device_tree.c, only leave TARGET_NEED_FDT if the target has a hard dependency. Those emulators will be skipped if libfdt is disabled, or if it is "auto" and not found and --disable-download is passed; unless the target is mentioned exp

[PATCH 5/6] hw/xtensa: require libfdt

2024-05-08 Thread Paolo Bonzini
All other boards require libfdt if it can be used (including for example i386/x86_64), so change the "imply" to "select" and always allow -dtb in qemu-system-xtensa. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/xtensa/xtfpga.c | 9 - hw/xtensa/Kconfig | 4 ++-

Re: [PATCH 2/9] migration: Fix file migration with fdset

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:35AM -0300, Fabiano Rosas wrote: > When the migration using the "file:" URI was implemented, I don't > think any of us noticed that if you pass in a file name with the > format "/dev/fdset/N", this allows a file descriptor to be passed in > to QEMU and that behaves jus

CXL numa error on arm64 qemu virt machine

2024-05-08 Thread Yuquan Wang
Hello, Jonathan Recently I run some cxl tests on qemu virt(branch:cxl-2024-04-22-draft) but met some problems. Problems: 1) the virt machine could not set the right numa topology from user input; My Qemu numa set: -object memory-backend-ram,size=2G,id=mem0 \ -numa node,nodeid=0,cpus=0-1,memdev

Re: [PATCH 2/9] migration: Fix file migration with fdset

2024-05-08 Thread Daniel P . Berrangé
On Fri, May 03, 2024 at 12:23:51PM -0400, Peter Xu wrote: > On Fri, Apr 26, 2024 at 11:20:35AM -0300, Fabiano Rosas wrote: > > When the migration using the "file:" URI was implemented, I don't > > think any of us noticed that if you pass in a file name with the > > format "/dev/fdset/N", this allow

Re: [PATCH 3/9] tests/qtest/migration: Fix file migration offset check

2024-05-08 Thread Daniel P . Berrangé
On Fri, May 03, 2024 at 05:36:59PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Fri, Apr 26, 2024 at 11:20:36AM -0300, Fabiano Rosas wrote: > >> When doing file migration, QEMU accepts an offset that should be > >> skipped when writing the migration stream to the file. The purpose of >

[PATCH] Fixes: Indentation using spaces instead of TABS and improve formatting

2024-05-08 Thread Tanmay Patil
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/373 Files changed: - hw/arm/boot.c - hw/char/omap_uart.c - hw/gpio/zaurus.c - hw/input/tsc2005.c Signed-off-by: Tanmay Patil --- hw/arm/boot.c | 8 +-- hw/char/omap_uart.c | 49 + hw

Re: [PATCH v2 04/33] accel/tcg: Reorg translator_ld*

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 18:49, Richard Henderson wrote: On 5/6/24 15:47, Philippe Mathieu-Daudé wrote: On 25/4/24 01:31, Richard Henderson wrote: Reorg translator_access into translator_ld, with a more memcpy-ish interface.  If both pages are in ram, do not go through the caller's slow path. Assert that the

Re: [PATCH] Fixes: Indentation using TABs and improve formatting

2024-05-08 Thread Tanmay
Hi, I just sent a patch with fewer files to address using git-send-email. Thanks, Tanmay On Tue, 7 May 2024 at 15:56, Peter Maydell wrote: > On Mon, 6 May 2024 at 07:20, Tanmay wrote: > > > > Hi, > > > > I have added a patch inline that fixes indentation and formatting for > some files as lis

Re: [PATCH 2/6] meson: move libfdt together with other dependencies

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:51, Paolo Bonzini wrote: Move the libfdt detection code together with other dependencies instead of keeping it with subprojects. This has the disadvantage of performing the detection even if no target requires libfdt; but it has the advantage that Kconfig will be able to observe the

Re: [PATCH 1/6] meson: pick libfdt from common_ss when building target-specific files

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:51, Paolo Bonzini wrote: Avoid having to list dependencies such as libfdt twice, both on common_ss and specific_ss. Instead, just take all the dependencies in common_ss and allow the target-specific libqemu-*.fa library to use them. Signed-off-by: Paolo Bonzini --- meson.build

Re: [PATCH 4/9] migration: Add direct-io parameter

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:37AM -0300, Fabiano Rosas wrote: > Add the direct-io migration parameter that tells the migration code to > use O_DIRECT when opening the migration stream file whenever possible. > > This is currently only used with the mapped-ram migration that has a > clear window g

Re: [PATCH 2/4] hw/gpio: Handle clock migration in STM32L4x5 gpios

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 20:55, Inès Varhol wrote: STM32L4x5 GPIO wasn't migrating its clock. Signed-off-by: Inès Varhol --- hw/gpio/stm32l4x5_gpio.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 5/9] migration/multifd: Add direct-io support

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:38AM -0300, Fabiano Rosas wrote: > When multifd is used along with mapped-ram, we can take benefit of a > filesystem that supports the O_DIRECT flag and perform direct I/O in > the multifd threads. This brings a significant performance improvement > because direct-io w

Re: [PATCH] gitlab: Update msys2-64bit runner tags

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 19:53, Richard Henderson wrote: Gitlab has deprecated and removed support for windows-1809 and shared-windows. Update to saas-windows-medium-amd64 per https://about.gitlab.com/blog/2024/01/22/windows-2022-support-for-gitlab-saas-runners/ Signed-off-by: Richard Henderson --- .gitla

Re: [PATCH 6/9] tests/qtest/migration: Add tests for file migration with direct-io

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:39AM -0300, Fabiano Rosas wrote: > The tests are only allowed to run in systems that know about the > O_DIRECT flag and in filesystems which support it. > > Signed-off-by: Fabiano Rosas > --- > tests/qtest/migration-helpers.c | 42 + >

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-08 Thread Thomas Huth
On 07/05/2024 22.20, Cord Amfmgm wrote: On Wed, Apr 24, 2024 at 3:43 PM Cord Amfmgm > wrote: On Thu, Apr 18, 2024 at 10:43 AM Michael Tokarev mailto:m...@tls.msk.ru>> wrote: 06.02.2024 10:13, Cord Amfmgm wrote: > This changes the ohci validatio

Re: [PATCH v2 6/6] hw/i386/pc_sysfw: Alias rather than copy isa-bios region

2024-05-08 Thread Bernhard Beschow
Am 30. April 2024 15:39:21 UTC schrieb "Philippe Mathieu-Daudé" : >On 30/4/24 17:06, Bernhard Beschow wrote: >> In the -bios case the "isa-bios" memory region is an alias to the BIOS mapped >> to the top of the 4G memory boundary. Do the same in the -pflash case, but >> only >> for new machine

[RFC PATCH] tests/tcg: don't append QEMU_OPTS for armv6m-undef test

2024-05-08 Thread Alex Bennée
We don't want to build on the default machine setup here but define a custom one for the microbit. Signed-off-by: Alex Bennée --- tests/tcg/arm/Makefile.softmmu-target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makef

Re: [RFC PATCH-for-9.1 2/4] hw/i2c: Fix checkpatch line over 80 chars warnings

2024-05-08 Thread Thomas Huth
On 08/04/2024 23.33, Philippe Mathieu-Daudé wrote: We are going to modify these lines, fix their style in order to avoid checkpatch.pl warnings: WARNING: line over 80 characters I think the common sense is nowadays that it is OK to have lines with e.g. 82 characters when it looks better th

Re: [PATCH 8/9] migration: Add support for fdset with multifd + file

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:41AM -0300, Fabiano Rosas wrote: > Allow multifd to use an fdset when migrating to a file. This is useful > for the scenario where the management layer wants to have control over > the migration file. > > By receiving the file descriptors directly, QEMU can delegate s

Re: [RFC PATCH-for-9.1 3/4] hw/i2c: Convert to spec v7 terminology (automatically)

2024-05-08 Thread Thomas Huth
On 08/04/2024 23.33, Philippe Mathieu-Daudé wrote: One of the biggest change from I2C spec v6 -> v7 is: • Updated the terms "master/slave" to "controller/target" Since it follows the inclusive terminology from the "Conscious Language in your Open Source Projects" guidelines [*], replace the

[PATCH] tests/qtest/boot-serial-test: Add support on LoongArch system

2024-05-08 Thread Bibo Mao
Add boot-serial-test test case support on LoongArch system. Signed-off-by: Bibo Mao --- tests/qtest/boot-serial-test.c | 10 ++ tests/qtest/meson.build| 4 2 files changed, 14 insertions(+) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index

Re: [PATCH 9/9] tests/qtest/migration: Add a test for mapped-ram with passing of fds

2024-05-08 Thread Daniel P . Berrangé
On Fri, Apr 26, 2024 at 11:20:42AM -0300, Fabiano Rosas wrote: > Add a multifd test for mapped-ram with passing of fds into QEMU. This > is how libvirt will consume the feature. > > There are a couple of details to the fdset mechanism: > > - multifd needs two distinct file descriptors (not duplic

Re: [PATCH v4 01/12] libvhost-user: set msg.msg_control to NULL when it is empty

2024-05-08 Thread Daniel P . Berrangé
On Wed, May 08, 2024 at 09:44:45AM +0200, Stefano Garzarella wrote: > On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if > the `struct msghdr` has the field `msg_controllen` set to 0, but > `msg_control` is not NULL. > > Reviewed-by: Eric Blake > Reviewed-by: David Hildenbrand > Revi

Re: [PATCH v4 02/12] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-05-08 Thread Daniel P . Berrangé
On Wed, May 08, 2024 at 09:44:46AM +0200, Stefano Garzarella wrote: > In vu_message_write() we use sendmsg() to send the message header, > then a write() to send the payload. > > If sendmsg() fails we should avoid sending the payload, since we > were unable to send the header. > > Discovered befo

Re: [PATCH] tests/qtest/boot-serial-test: Add support on LoongArch system

2024-05-08 Thread Thomas Huth
On 08/05/2024 10.55, Bibo Mao wrote: Add boot-serial-test test case support on LoongArch system. ... and also the filter tests? Signed-off-by: Bibo Mao --- tests/qtest/boot-serial-test.c | 10 ++ tests/qtest/meson.build| 4 2 files changed, 14 insertions(+) diff --

Re: [PATCH v4 04/12] vhost-user-server: do not set memory fd non-blocking

2024-05-08 Thread Daniel P . Berrangé
On Wed, May 08, 2024 at 09:44:48AM +0200, Stefano Garzarella wrote: > In vhost-user-server we set all fd received from the other peer > in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.) > it's not really needed, because we don't use these fd with blocking > operations, but only to

[PATCH v5 02/19] vfio/container: Introduce TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO device

2024-05-08 Thread Zhenzhong Duan
TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO represents a host IOMMU device under VFIO legacy container backend. It will have its own realize implementation. Suggested-by: Eric Auger Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 3 +++ hw/vfio/containe

[PATCH v5 01/19] backends: Introduce HostIOMMUDevice abstract

2024-05-08 Thread Zhenzhong Duan
Introduce HostIOMMUDevice as an abstraction of host IOMMU device. Introduce .realize() to initialize HostIOMMUDevice further after instance init. Introduce a macro CONFIG_HOST_IOMMU_DEVICE to define the usage for VFIO, and VDPA in the future. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzh

[PATCH v5 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-05-08 Thread Zhenzhong Duan
Hi, This series introduce a HostIOMMUDevice abstraction and sub-classes. Also HostIOMMUDeviceCaps structure in HostIOMMUDevice and a new interface between vIOMMU and HostIOMMUDevice. HostIOMMUDeviceClass::realize() is introduced to initialize HostIOMMUDeviceCaps and other fields of HostIOMMUDevic

[PATCH v5 05/19] backends/host_iommu_device: Introduce HostIOMMUDeviceCaps

2024-05-08 Thread Zhenzhong Duan
HostIOMMUDeviceCaps's elements map to the host IOMMU's capabilities. Different platform IOMMU can support different elements. Currently only two elements, type and aw_bits, type hints the host platform IOMMU type, i.e., INTEL vtd, ARM smmu, etc; aw_bits hints host IOMMU address width. Introduce .

[PATCH v5 04/19] vfio/iommufd: Introduce TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO device

2024-05-08 Thread Zhenzhong Duan
TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO represents a host IOMMU device under VFIO iommufd backend. It will be created during VFIO device attaching and passed to vIOMMU. It will have its own .realize() implementation. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/

[PATCH v5 13/19] vfio: Create host IOMMU device instance

2024-05-08 Thread Zhenzhong Duan
Create host IOMMU device instance in vfio_attach_device() and call .realize() to initialize it further. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/common.c | 16 +++- 2 files changed, 16 insertions(+),

[PATCH v5 03/19] backends/iommufd: Introduce abstract TYPE_HOST_IOMMU_DEVICE_IOMMUFD device

2024-05-08 Thread Zhenzhong Duan
TYPE_HOST_IOMMU_DEVICE_IOMMUFD represents a host IOMMU device under iommufd backend. It will have its own .get_cap() implementation. Opportunistically, add missed header to include/sysemu/iommufd.h. Suggested-by: Cédric Le Goater Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- includ

[PATCH v5 17/19] intel_iommu: Extract out vtd_cap_init() to initialize cap/ecap

2024-05-08 Thread Zhenzhong Duan
Extract cap/ecap initialization in vtd_cap_init() to make code cleaner. No functional change intended. Reviewed-by: Eric Auger Signed-off-by: Zhenzhong Duan --- hw/i386/intel_iommu.c | 93 --- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git

[PATCH v5 06/19] range: Introduce range_get_last_bit()

2024-05-08 Thread Zhenzhong Duan
This helper get the highest 1 bit position of the upper bound. If the range is empty or upper bound is zero, -1 is returned. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/qemu/range.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/qemu/range

[PATCH v5 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-05-08 Thread Zhenzhong Duan
From: Yi Liu pci_device_[set|unset]_iommu_device() call pci_device_get_iommu_bus_devfn() to get iommu_bus->iommu_ops and call [set|unset]_iommu_device callback to set/unset HostIOMMUDevice for a given PCI device. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Nicolin Chen Signed-o

[PATCH v5 12/19] vfio: Introduce VFIOIOMMUClass::hiod_typename attribute

2024-05-08 Thread Zhenzhong Duan
Initialize attribute VFIOIOMMUClass::hiod_typename based on VFIO backend type. This attribute will facilitate HostIOMMUDevice creation in vfio_attach_device(). Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-container-base.h | 3 +++ hw/vfio/container.c

[PATCH v5 14/19] hw/pci: Introduce helper function pci_device_get_iommu_bus_devfn()

2024-05-08 Thread Zhenzhong Duan
Extract out pci_device_get_iommu_bus_devfn() from pci_device_iommu_address_space() to facilitate implementation of pci_device_[set|unset]_iommu_device() in following patch. No functional change intended. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Nicolin Chen Signed-off-by: Zhe

[PATCH v5 16/19] vfio/pci: Pass HostIOMMUDevice to vIOMMU

2024-05-08 Thread Zhenzhong Duan
With HostIOMMUDevice passed, vIOMMU can check compatibility with host IOMMU, call into IOMMUFD specific methods, etc. Originally-by: Yi Liu Signed-off-by: Nicolin Chen Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 19 ++- 1 file changed, 14 insertions

[PATCH v5 10/19] vfio/container: Implement HostIOMMUDeviceClass::get_cap() handler

2024-05-08 Thread Zhenzhong Duan
Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/container.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index b872f6f201..c9c5347da9 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -1152,11

[PATCH v5 07/19] vfio/container: Implement HostIOMMUDeviceClass::realize() handler

2024-05-08 Thread Zhenzhong Duan
Utilize range_get_last_bit() to get host IOMMU address width and package it in HostIOMMUDeviceCaps for query with .get_cap(). Signed-off-by: Zhenzhong Duan --- hw/vfio/container.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/hw/vfio/container.c b/hw/vfio/contai

[PATCH v5 09/19] vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler

2024-05-08 Thread Zhenzhong Duan
It calls iommufd_backend_get_device_info() to get host IOMMU related information and translate it into HostIOMMUDeviceCaps for query with .get_cap(). Introduce macro VTD_MGAW_FROM_CAP to get MGAW which equals to (aw_bits - 1). Signed-off-by: Zhenzhong Duan --- include/hw/i386/intel_iommu.h | 1

[PATCH v5 11/19] backends/iommufd: Implement HostIOMMUDeviceClass::get_cap() handler

2024-05-08 Thread Zhenzhong Duan
Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- backends/iommufd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/backends/iommufd.c b/backends/iommufd.c index c7e969d6f7..f2f7a762a0 100644 --- a/backends/iommufd.c +++ b/backends/iommufd.c @@ -230,6

[PATCH v5 19/19] intel_iommu: Check compatibility with host IOMMU capabilities

2024-05-08 Thread Zhenzhong Duan
If check fails, host device (either VFIO or VDPA device) is not compatible with current vIOMMU config and should not be passed to guest. Only aw_bits is checked for now, we don't care other capabilities before scalable modern mode is introduced. Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Dua

[PATCH v5 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-05-08 Thread Zhenzhong Duan
From: Yi Liu Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU. In set call, a new structure VTDHostIOMMUDevice which holds a reference to HostIOMMUDevice is stored in hash table indexed by PCI BDF. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- hw

[PATCH v5 08/19] backends/iommufd: Introduce helper function iommufd_backend_get_device_info()

2024-05-08 Thread Zhenzhong Duan
Introduce a helper function iommufd_backend_get_device_info() to get host IOMMU related information through iommufd uAPI. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- include/sysemu/iommufd.h | 3 +++ backends/iommufd.c | 22 ++ 2 fil

Re: Hermetic virtio-vsock in QEMU

2024-05-08 Thread Marc-André Lureau
Hi On Wed, May 8, 2024 at 11:50 AM Stefano Garzarella wrote: > > Hi Roman, > > On Tue, May 07, 2024 at 11:20:50PM GMT, Roman Kiryanov wrote: > >Hi Stefano, > > > >On Tue, May 7, 2024 at 1:10 AM Stefano Garzarella > >wrote: > >> I have no experience with Windows, but what we need for vhost-user

Re: [PATCH] tests/qtest/boot-serial-test: Add support on LoongArch system

2024-05-08 Thread maobibo
On 2024/5/8 下午5:00, Thomas Huth wrote: On 08/05/2024 10.55, Bibo Mao wrote: Add boot-serial-test test case support on LoongArch system. ... and also the filter tests? yes, it is :) Will update changelog in next version. Signed-off-by: Bibo Mao ---   tests/qtest/boot-serial-test.c | 10

[PATCH] hw/mips/loongson3_virt: Emulate suspend function

2024-05-08 Thread Jiaxun Yang
RT_LOWMEM].base, ram); --- base-commit: d762bf97931b58839316b68a570eecc6143c9e3e change-id: 20240508-loongson3v-suspend-cdd33a169eab Best regards, -- Jiaxun Yang

Re: [PATCH v4 01/12] libvhost-user: set msg.msg_control to NULL when it is empty

2024-05-08 Thread Stefano Garzarella
On Wed, May 08, 2024 at 09:57:13AM GMT, Daniel P. Berrangé wrote: On Wed, May 08, 2024 at 09:44:45AM +0200, Stefano Garzarella wrote: On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Review

Re: Hermetic virtio-vsock in QEMU

2024-05-08 Thread Stefano Garzarella
On Wed, May 08, 2024 at 01:13:09PM GMT, Marc-André Lureau wrote: Hi On Wed, May 8, 2024 at 11:50 AM Stefano Garzarella wrote: Hi Roman, On Tue, May 07, 2024 at 11:20:50PM GMT, Roman Kiryanov wrote: >Hi Stefano, > >On Tue, May 7, 2024 at 1:10 AM Stefano Garzarella wrote: >> I have no experie

Re: [PATCH 0/4] Fix "virtio-gpu: fix scanout migration post-load"

2024-05-08 Thread Fiona Ebner
Am 07.05.24 um 13:19 schrieb marcandre.lur...@redhat.com: > From: Marc-André Lureau > > Hi, > > The aforementioned patch breaks virtio-gpu device migrations for versions > pre-9.0/9.0, both forwards and backwards. Versioning of `VMS_STRUCT` is more > complex than it may initially appear, as evid

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 22:20, Cord Amfmgm wrote: On Wed, Apr 24, 2024 at 3:43 PM Cord Amfmgm > wrote: On Thu, Apr 18, 2024 at 10:43 AM Michael Tokarev mailto:m...@tls.msk.ru>> wrote: 06.02.2024 10:13, Cord Amfmgm wrote: > This changes the ohci validation to

Re: [PATCH v2 6/6] hw/i386/pc_sysfw: Alias rather than copy isa-bios region

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 10:17, Bernhard Beschow wrote: Am 30. April 2024 15:39:21 UTC schrieb "Philippe Mathieu-Daudé" : On 30/4/24 17:06, Bernhard Beschow wrote: In the -bios case the "isa-bios" memory region is an alias to the BIOS mapped to the top of the 4G memory boundary. Do the same in the -pflash

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-05-08 Thread Daniel P . Berrangé
On Tue, May 07, 2024 at 06:52:50AM +0200, Jinpu Wang wrote: > Hi Peter, hi Daniel, > On Mon, May 6, 2024 at 5:29 PM Peter Xu wrote: > > > > On Mon, May 06, 2024 at 12:08:43PM +0200, Jinpu Wang wrote: > > > Hi Peter, hi Daniel, > > > > Hi, Jinpu, > > > > Thanks for sharing this test results. Sound

Re: [PATCH v4 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- contrib/vhost-user-blk/vhost-user-blk.c | 9 + contrib/vh

Re: [RFC 0/1] hw/nvme: add atomic write support

2024-05-08 Thread Klaus Jensen
On Apr 15 16:46, Alan Adamson wrote: > Since there is discussion in the Linux NVMe Driver community to add NVMe > Atomic Write > support, it would be desirable to test it with qemu nvme emulation. > > Initially, this RFC will focus on supporting NVMe controller atomic write > parameters(AWUN, >

Re: [PATCH v4 02/12] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: In vu_message_write() we use sendmsg() to send the message header, then a write() to send the payload. If sendmsg() fails we should avoid sending the payload, since we were unable to send the header. Discovered before fixing the issue with the previous

Re: [PATCH v4 01/12] libvhost-user: set msg.msg_control to NULL when it is empty

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Reviewed-by: Eric Blake Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Sign

Re: [PATCH v4 05/12] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: On macOS passing `-s /tmp/vhost.socket` parameter to the vhost-user-blk application, the bind was done on `/tmp/vhost.socke` pathname, missing the last character. This sounds like one of the portability problems described in the unix(7) manpage: Pa

Re: [PATCH v4 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 12:13, Philippe Mathieu-Daudé wrote: On 8/5/24 09:44, Stefano Garzarella wrote: Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella ---   contrib/vhost-user-

Re: [PATCH v4 07/12] vhost-user: enable frontends on any POSIX system

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system. In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well. Signed-off-b

Re: [PATCH v4 09/12] contrib/vhost-user-blk: enable it on any POSIX system

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: Let's make the code more portable by adding defines from block/file-posix.c to support O_DIRECT in other systems (e.g. macOS). vhost-user-server.c is a dependency, let's enable it for any POSIX system. Signed-off-by: Stefano Garzarella --- v4: - moved

Re: [PATCH v4 08/12] libvhost-user: enable it on any POSIX system

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system. Compiling it on macOS and FreeBSD some problems came up: - avoid to include linux/vhost.h which is avaibale only on Linux "available" (vhost_

Re: [PATCH v4 03/12] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: libvhost-user will panic when receiving VHOST_USER_GET_INFLIGHT_FD message if MFD_ALLOW_SEALING is not defined, since it's not able to create a memfd. VHOST_USER_GET_INFLIGHT_FD is used only if VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is negotiated. So, let

Re: [PATCH v4 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: The vhost-user protocol is not really Linux-specific, so let's try support QEMU's frontends and backends (including libvhost-user) in any POSIX system with this series. The main use case is to be able to use virtio devices that we don't have built-in in

Re: [PATCH 8/9] hw/nvme: add reservation protocal command

2024-05-08 Thread Klaus Jensen
On May 8 17:36, Changqi Lu wrote: > Add reservation acquire, reservation register, > reservation release and reservation report commands > in the nvme device layer. > > By introducing these commands, this enables the nvme > device to perform reservation-related tasks, including > querying keys, q

RE: [PATCH V8 1/8] accel/kvm: Extract common KVM vCPU {creation,parking} code

2024-05-08 Thread Salil Mehta via
Hi Phillipe, Sorry, I missed this mail earlier. > From: Philippe Mathieu-Daudé > Sent: Friday, May 3, 2024 7:23 PM > To: Salil Mehta ; qemu-devel@nongnu.org; > qemu-...@nongnu.org > > On 3/5/24 17:57, Salil Mehta wrote: > > Hi Philippe, > > > >> From: Philippe Mathieu-Daudé > >>

Canceled event with note: QEMU/KVM developers conference call @ Tue 14 May 2024 14:00 - 15:00 (BST) (qemu-devel@nongnu.org)

2024-05-08 Thread Alex Bennée
BEGIN:VCALENDAR PRODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:CANCEL BEGIN:VTIMEZONE TZID:America/New_York X-LIC-LOCATION:America/New_York BEGIN:DAYLIGHT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 TZNAME:EDT DTSTART:19700308T02 RRULE:FREQ=YEARLY;BYMONTH=3;BYDA

Re: [PATCH v2 03/15] hw/riscv: add RISC-V IOMMU base emulation

2024-05-08 Thread Daniel Henrique Barboza
Hi Frank, I'll reply with that I've done so far. Still missing some stuff: On 5/2/24 08:37, Frank Chang wrote: Hi Daniel, Daniel Henrique Barboza 於 2024年3月8日 週五 上午12:04寫道: From: Tomasz Jeznach The RISC-V IOMMU specification is now ratified as-per the RISC-V international process. The late

Re: [RFC PATCH 0/1] pci: allocate a PCI ID for RISC-V IOMMU

2024-05-08 Thread Daniel Henrique Barboza
On 5/7/24 12:37, Frank Chang wrote: Hi Daniel, Daniel Henrique Barboza 於 2024年5月3日 週五 下午8:43寫道: Hi, In this RFC I want to check with Gerd and others if it's ok to add a PCI id for the RISC-V IOMMU device. It's currently under review in [1]. The Is the link [1] missing? Ooops. Here's t

Re: [RFC PATCH 0/1] pci: allocate a PCI ID for RISC-V IOMMU

2024-05-08 Thread Daniel Henrique Barboza
On 5/7/24 12:53, Gerd Hoffmann wrote: On Tue, May 07, 2024 at 11:37:05PM GMT, Frank Chang wrote: Hi Daniel, Daniel Henrique Barboza 於 2024年5月3日 週五 下午8:43寫道: Hi, In this RFC I want to check with Gerd and others if it's ok to add a PCI id for the RISC-V IOMMU device. It's currently under r

Re: [PATCH] target/riscv: Remove experimental prefix from "B" extension

2024-05-08 Thread Andrew Jones
On Tue, May 07, 2024 at 11:27:21AM GMT, Rob Bradford wrote: > This extension has now been ratified: > https://jira.riscv.org/browse/RVS-2006 so the "x-" prefix can be > removed. > > Signed-off-by: Rob Bradford > --- > target/riscv/cpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

[PATCH] virtio-blk: remove SCSI passthrough functionality

2024-05-08 Thread Paolo Bonzini
The legacy SCSI passthrough functionality has never been enabled for VIRTIO 1.0 and was deprecated more than four years ago. Get rid of it---almost, because QEMU is advertising it unconditionally for legacy virtio-blk devices. Just parse the header and return a nonzero status. Signed-off-by: Pao

Re: [PATCH v4 10/12] hostmem: add a new memory backend based on POSIX shm_open()

2024-05-08 Thread Markus Armbruster
Stefano Garzarella writes: > shm_open() creates and opens a new POSIX shared memory object. > A POSIX shared memory object allows creating memory backend with an > associated file descriptor that can be shared with external processes > (e.g. vhost-user). > > The new `memory-backend-shm` can be us

  1   2   3   4   >