[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

[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

[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 +

[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.

[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

[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 +++---

[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

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.

[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

[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 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 ---

[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 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

[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

[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 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 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

[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

[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

[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

[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)

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'. > >

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

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

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 ---

Re: [PATCH v10 09/10] virtio-gpu: Register capsets dynamically

2024-05-08 Thread Marc-André Lureau
On Sun, May 5, 2024 at 12:29 AM Dmitry Osipenko wrote: > > From: Pierre-Eric Pelloux-Prayer > > virtio_gpu_virgl_get_num_capsets will return "num_capsets", but we can't > assume that capset_index 1 is always VIRGL2 once we'll support more capsets, > like Venus and DRM capsets. Register capsets

Re: [PATCH] target/sh4: Update DisasContextBase.insn_start

2024-05-08 Thread Yoshinori Sato
On Tue, 07 May 2024 04:55:06 +0900, Richard Henderson wrote: > > Match the extra inserts of INDEX_op_insn_start, fixing > the db->num_insns != 1 assert in translator_loop. > > Fixes: dcd092a0636 ("accel/tcg: Improve can_do_io management") > Signed-off-by: Richard Henderson > --- >

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

2024-05-08 Thread Marc-André Lureau
On Sun, May 5, 2024 at 12:29 AM Dmitry Osipenko wrote: > > From: Robert Beckett > > Support displaying blob resources by handling SET_SCANOUT_BLOB > command. > > Signed-by: Antonio Caggiano > Signed-off-by: Robert Beckett > Signed-off-by: Huang Rui > Reviewed-by: Antonio Caggiano >

Re: [PATCH v10 05/10] virtio-gpu: Add virgl resource management

2024-05-08 Thread Marc-André Lureau
On Sun, May 5, 2024 at 12:29 AM Dmitry Osipenko wrote: > > From: Huang Rui > > In a preparation to adding host blobs support to virtio-gpu, add virgl > resource management that allows to retrieve resource based on its ID > and virgl resource wrapper on top of simple resource that will be contain

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

2024-05-08 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Gunthorpe >Subject: Re: [PATCH v3 00/19] Add a host IOMMU device abstraction to >check with vIOMMU > >On Tue, May 07, 2024 at 02:24:30AM +, Duan, Zhenzhong wrote: >> >On Mon, May 06, 2024 at 02:30:47AM +, Duan, Zhenzhong wrote: >> > >> >> I'm

Re: [PATCH v9 2/5] softmmu: Support concurrent bounce buffers

2024-05-08 Thread Mattias Nissler
On Tue, May 7, 2024 at 4:46 PM Philippe Mathieu-Daudé wrote: > > On 7/5/24 16:04, Mattias Nissler wrote: > > On Tue, May 7, 2024 at 2:57 PM Philippe Mathieu-Daudé > > wrote: > >> > >> On 7/5/24 11:42, Mattias Nissler wrote: > >>> When DMA memory can't be directly accessed, as is the case when >

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

2024-05-08 Thread Duan, Zhenzhong
Hi Clement, See inline. From: CLEMENT MATHIEU--DRIF Sent: Tuesday, May 7, 2024 7:40 PM To: Duan, Zhenzhong ; qemu-devel@nongnu.org Cc: alex.william...@redhat.com; c...@redhat.com; eric.au...@redhat.com; m...@redhat.com; pet...@redhat.com; jasow...@redhat.com; j...@nvidia.com;

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

2024-05-08 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v3 15/19] hw/pci: Introduce >pci_device_[set|unset]_iommu_device() > >On 5/7/24 09:48, Duan, Zhenzhong wrote: >> Hi Cédric, >> >>> -Original Message- >>> From: Cédric Le Goater >>> Subject: Re: [PATCH v3 15/19]

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

2024-05-08 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH v4 04/19] vfio/iommufd: Introduce >TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO device > >On 5/7/24 11:20, Zhenzhong Duan wrote: >> TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO represents a host IOMMU >device under >> VFIO iommufd backend.

Re: Hermetic virtio-vsock in QEMU

2024-05-08 Thread Roman Kiryanov
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_RIGHTS) As far as I understand, Windows does NOT support

Re: [PATCH v10 03/10] virtio-gpu: Support context-init feature with virglrenderer

2024-05-08 Thread Marc-André Lureau
Hi On Sun, May 5, 2024 at 12:29 AM Dmitry Osipenko wrote: > > From: Huang Rui > > Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init > feature flags. Expose this feature and support creating virglrenderer > context with flags using context_id if libvirglrenderer is new enough.

<    1   2   3   4