[PATCH rfcv2 11/20] intel_iommu: Check for compatibility with IOMMUFD backed device when x-flts=on

2025-02-19 Thread Zhenzhong Duan
When vIOMMU is configured x-flts=on in scalable mode, stage-1 page table is passed to host to construct nested page table. We need to check compatibility of some critical IOMMU capabilities between vIOMMU and host IOMMU to ensure guest stage-1 page table could be used by host. For instance, vIOMMU

[PATCH rfcv2 15/20] intel_iommu: ERRATA_772415 workaround

2025-02-19 Thread Zhenzhong Duan
On a system influenced by ERRATA_772415, IOMMU_HW_INFO_VTD_ERRATA_772415_SPR17 is repored by IOMMU_DEVICE_GET_HW_INFO. Due to this errata, even the readonly range mapped on stage-2 page table could still be written. Reference from 4th Gen Intel Xeon Processor Scalable Family Specification Update,

[PATCH rfcv2 14/20] intel_iommu: Bind/unbind guest page table to host

2025-02-19 Thread Zhenzhong Duan
This captures the guest PASID table entry modifications and propagates the changes to host to attach a hwpt with type determined per guest PGTT configuration. When PGTT is Pass-through(100b), the hwpt on host side is a stage-2 page table(GPA->HPA). When PGTT is First-stage Translation only(001b),

[PATCH rfcv2 00/20] intel_iommu: Enable stage-1 translation for passthrough device

2025-02-19 Thread Zhenzhong Duan
Hi, Per Jason Wang's suggestion, iommufd nesting series[1] is split into "Enable stage-1 translation for emulated device" series and "Enable stage-1 translation for passthrough device" series. This series is 2nd part focusing on passthrough device. We don't do shadowing of guest page table for pa

[PATCH rfcv2 16/20] intel_iommu: Replay pasid binds after context cache invalidation

2025-02-19 Thread Zhenzhong Duan
From: Yi Liu This replays guest pasid attachments after context cache invalidation. This is a behavior to ensure safety. Actually, programmer should issue pasid cache invalidation with proper granularity after issuing a context cache invalidation. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Si

[PATCH rfcv2 07/20] iommufd: Implement query of HOST_IOMMU_DEVICE_CAP_[NESTING|FS1GP]

2025-02-19 Thread Zhenzhong Duan
Implement query of HOST_IOMMU_DEVICE_CAP_[NESTING|FS1GP] for IOMMUFD backed host IOMMU device. Query on these two capabilities is not supported for legacy backend because there is no plan to support nesting with leacy backend backed host device. Signed-off-by: Zhenzhong Duan --- hw/i386/intel_i

[PATCH rfcv2 08/20] iommufd: Implement query of HOST_IOMMU_DEVICE_CAP_ERRATA

2025-02-19 Thread Zhenzhong Duan
Implement query of HOST_IOMMU_DEVICE_CAP_ERRATA for IOMMUFD backed host IOMMU device. Query on this capability is not supported for legacy backend because there is no plan to support nesting with leacy backend backed host device. Signed-off-by: Zhenzhong Duan --- include/system/host_iommu_devic

[PATCH rfcv2 18/20] intel_iommu: Refresh pasid bind when either SRTP or TE bit is changed

2025-02-19 Thread Zhenzhong Duan
From: Yi Liu When either 'Set Root Table Pointer' or 'Translation Enable' bit is changed, the pasid bindings on host side become stale and need to be updated. Introduce a helper function vtd_refresh_pasid_bind() for that purpose. Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- hw/i38

[PATCH rfcv2 13/20] intel_iommu: Add PASID cache management infrastructure

2025-02-19 Thread Zhenzhong Duan
This adds an new entry VTDPASIDCacheEntry in VTDAddressSpace to cache the pasid entry and track PASID usage and future PASID tagged DMA address translation support in vIOMMU. VTDAddressSpace of PCI_NO_PASID is allocated when device is plugged and never freed. For other pasid, VTDAddressSpace insta

[PATCH rfcv2 06/20] host_iommu_device: Define two new capabilities HOST_IOMMU_DEVICE_CAP_[NESTING|FS1GP]

2025-02-19 Thread Zhenzhong Duan
Signed-off-by: Zhenzhong Duan --- include/system/host_iommu_device.h | 8 1 file changed, 8 insertions(+) diff --git a/include/system/host_iommu_device.h b/include/system/host_iommu_device.h index df782598f2..18f8b5e5cf 100644 --- a/include/system/host_iommu_device.h +++ b/include/syst

[PATCH rfcv2 10/20] intel_iommu: Optimize context entry cache utilization

2025-02-19 Thread Zhenzhong Duan
There are many call sites referencing context entry by calling vtd_as_to_context_entry() which will traverse the DMAR table. In most cases we can use cached context entry in vtd_as->context_cache_entry except it's stale. Currently only global and domain context invalidation stales it. So introduc

[PATCH rfcv2 05/20] vfio/iommufd: Implement [at|de]tach_hwpt handlers

2025-02-19 Thread Zhenzhong Duan
Implement [at|de]tach_hwpt handlers in VFIO subsystem. vIOMMU utilizes them to attach to or detach from hwpt on host side. Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- hw/vfio/iommufd.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/hw/vfio/iommufd.c b/hw

[PATCH rfcv2 19/20] intel_iommu: Bypass replay in stage-1 page table mode

2025-02-19 Thread Zhenzhong Duan
VFIO utilizes replay to setup initial shadow iommu mappings. But when stage-1 page table is configured, it is passed to host to construct nested page table, there is no replay needed. Signed-off-by: Zhenzhong Duan --- hw/i386/intel_iommu.c | 8 1 file changed, 8 insertions(+) diff --gi

[PATCH rfcv2 17/20] intel_iommu: Propagate PASID-based iotlb invalidation to host

2025-02-19 Thread Zhenzhong Duan
From: Yi Liu This traps the guest PASID-based iotlb invalidation request and propagate it to host. Intel VT-d 3.0 supports nested translation in PASID granular. Guest SVA support could be implemented by configuring nested translation on specific PASID. This is also known as dual stage DMA transl

[PATCH rfcv2 02/20] vfio/iommufd: Add properties and handlers to TYPE_HOST_IOMMU_DEVICE_IOMMUFD

2025-02-19 Thread Zhenzhong Duan
New added properties include IOMMUFD handle, devid and hwpt_id. IOMMUFD handle and devid are used to allocate/free ioas and hwpt. hwpt_id is used to re-attach IOMMUFD backed device to its default VFIO sub-system created hwpt, i.e., when vIOMMU is disabled by guest. These properties are initialized

[PATCH rfcv2 04/20] vfio/iommufd: Implement HostIOMMUDeviceClass::realize_late() handler

2025-02-19 Thread Zhenzhong Duan
There are three iommufd related elements iommufd handle, devid and hwpt_id. hwpt_id is ready only after VFIO device attachment. Device id and iommufd handle are ready before attachment, but they are all iommufd related stuff, initialize them together with hwpt_id. Signed-off-by: Zhenzhong Duan --

[PATCH rfcv2 20/20] intel_iommu: Enable host device when x-flts=on in scalable mode

2025-02-19 Thread Zhenzhong Duan
Now that all infrastructures of supporting passthrough device running with stage-1 translation are there, enable it now. Signed-off-by: Zhenzhong Duan --- hw/i386/intel_iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c ind

Re: [PATCH v7 RESEND 0/5] i386: Support SMP Cache Topology

2025-02-19 Thread Zhao Liu
Hi Paolo, A gentle poke. I plan to add cache models for Intel CPUs and extend this smp_cache interface after this series. :-) (The 1st patch of general machine has been picked by Phili.) Thanks, Zhao > > Alireza Sanaee (1): > > i386/cpu: add has_caches flag to check smp_cache configuration >

Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers

2025-02-19 Thread Paolo Bonzini
On 2/18/25 10:07, Philippe Mathieu-Daudé wrote: On 18/2/25 09:53, Paolo Bonzini wrote: On 2/18/25 08:37, Zhao Liu wrote: "addr & 0x18" ignores invalid address, so that the trace in default branch (trace_hpet_ram_{read|write}_invalid()) doesn't work. Mask addr by "0x1f & ~4", in which 0x1f mean

Re: [PATCH 28/42] qapi/parser: prohibit untagged sections between tagged sections

2025-02-19 Thread Markus Armbruster
John Snow writes: > On Wed, Feb 12, 2025 at 4:06 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > This is being done primarily to ensure consistency between the source >> > documents and the final, rendered HTML output. Because >> > member/feature/returns sections will always appear i

[PATCH rfcv2 01/20] backends/iommufd: Add helpers for invalidating user-managed HWPT

2025-02-19 Thread Zhenzhong Duan
Signed-off-by: Nicolin Chen Signed-off-by: Zhenzhong Duan --- include/system/iommufd.h | 3 +++ backends/iommufd.c | 30 ++ backends/trace-events| 1 + 3 files changed, 34 insertions(+) diff --git a/include/system/iommufd.h b/include/system/iommufd.h inde

[PATCH rfcv2 12/20] intel_iommu: Introduce a new structure VTDHostIOMMUDevice

2025-02-19 Thread Zhenzhong Duan
Introduce a new structure VTDHostIOMMUDevice which replaces HostIOMMUDevice to be stored in hash table. It includes a reference to HostIOMMUDevice and IntelIOMMUState, also includes BDF information which will be used in future patches. Signed-off-by: Zhenzhong Duan --- hw/i386/intel_iommu_inter

[PATCH rfcv2 03/20] HostIOMMUDevice: Introduce realize_late callback

2025-02-19 Thread Zhenzhong Duan
Currently we have realize() callback which is called before attachment. But there are still some elements e.g., hwpt_id is not ready before attachment. So we need a realize_late() callback to further initialize them. Currently, this callback is only useful for iommufd backend. For legacy backend n

[PATCH rfcv2 09/20] intel_iommu: Rename vtd_ce_get_rid2pasid_entry to vtd_ce_get_pasid_entry

2025-02-19 Thread Zhenzhong Duan
In early days vtd_ce_get_rid2pasid_entry() is used to get pasid entry of rid2pasid, then extend to any pasid. So a new name vtd_ce_get_pasid_entry is better to match its functions. No functional change intended. Signed-off-by: Zhenzhong Duan --- hw/i386/intel_iommu.c | 14 +++--- 1 file

Re: [PATCH 29/42] qapi: Add "Details:" disambiguation marker

2025-02-19 Thread Markus Armbruster
John Snow writes: > On Mon, Feb 17, 2025 at 6:55 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > This clarifies sections that are mistaken by the parser as "intro" >> > sections to be "details" sections instead. >> > >> > Signed-off-by: John Snow >> > --- >> > qapi/machine.json

[PATCH 1/1] qapi/char.json: minor doc rewording for `hub` device

2025-02-19 Thread Roman Penyaev
Refine documentation for the hub device, specify the maximum. Signed-off-by: Roman Penyaev Cc: Marc-André Lureau Cc: Markus Armbruster Cc: qemu-devel@nongnu.org --- qapi/char.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/char.json b/qapi/char.json index f02b66c0

Re: [PATCH v9 2/4] chardev/char-hub: implement backend chardev aggregator

2025-02-19 Thread Roman Penyaev
On Tue, Feb 18, 2025 at 8:57 AM Markus Armbruster wrote: > > Just realized this has been committed already. I'm not complaining, I > was late. Address my doc nits in a followup patch? Sent. Please take a look. -- Roman

Re: [PATCH 1/2] migration: Prioritize RDMA in ram_save_target_page()

2025-02-19 Thread Zhijian Li (Fujitsu)
On 19/02/2025 06:03, Peter Xu wrote: > On Tue, Feb 18, 2025 at 05:30:40PM -0300, Fabiano Rosas wrote: >> Li Zhijian via writes: >> >>> Address an error in RDMA-based migration by ensuring RDMA is prioritized >>> when saving pages in `ram_save_target_page()`. >>> >>> Previously, the RDMA protocol

[PATCH] linux-user: fix resource leaks in gen-vdso

2025-02-19 Thread Daniel P . Berrangé
There are a number of resource leaks in gen-vdso. In theory they are harmless because this is a short lived process, but when building QEMU with --extra-cflags="-fsanitize=address" problems ensure. The gen-vdso program is run as part of the build, and that aborts due to the sanitizer identifying me

Re: [PATCH v7 08/52] i386/tdx: Initialize TDX before creating TD vcpus

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c > index 45867dbe0839..e35a9fbd687e 100644 > --- a/accel/kvm/kvm-all.c > +++ b/accel/kvm/kvm-all.c > @@ -540,8 +540,15 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) >   > trace_kvm_

Permissively Licensing the CPU Component

2025-02-19 Thread Faisal Al-Humaimidi
Hello QEMU developers, I understand from this page, https://wiki.qemu.org/License, that TCG is being licensed permissively (BSD license) so it can be integrated as a library in other projects, which is great! However, I'd like to know if the CPU part of QEMU, no peripherals included, is also permi

Re: Permissively Licensing the CPU Component

2025-02-19 Thread Daniel P . Berrangé
On Wed, Feb 19, 2025 at 01:59:08AM -0800, Faisal Al-Humaimidi wrote: > Hello QEMU developers, > > I understand from this page, https://wiki.qemu.org/License, that TCG is > being licensed permissively (BSD license) so it can be integrated as a > library in other projects, which is great! Not so fa

Re: [PATCH] meson: Display summary of Darwin libraries detected

2025-02-19 Thread Paolo Bonzini
On Tue, Feb 18, 2025 at 3:55 PM Phil Dennis-Jordan wrote: > It is not cross-architecture. So, the PVG guest drivers with x86-64 macOS > don't > give useful results with the aarch64 macOS host PVG framework. (I suspect a > mismatch in texture memory layout and perhaps some other data format issues

Re: [PATCH] meson: Display summary of Darwin libraries detected

2025-02-19 Thread Phil Dennis-Jordan
On Wed, 19 Feb 2025 at 11:28, Paolo Bonzini wrote: > On Tue, Feb 18, 2025 at 3:55 PM Phil Dennis-Jordan > wrote: > > It is not cross-architecture. So, the PVG guest drivers with x86-64 > macOS don't > > give useful results with the aarch64 macOS host PVG framework. (I > suspect a > > mismatch in

Re: [PATCH] meson: Display summary of Darwin libraries detected

2025-02-19 Thread Paolo Bonzini
On Wed, Feb 19, 2025 at 11:36 AM Phil Dennis-Jordan wrote: >> ... which boards should enable MAC_PVG_MMIO? Is it only VIRT, or something >> else? > > I doubt anyone will be able to use it productively with virt, but I am > regularly surprised by people's creativity. Ah okay, so for now it's effe

Re: [PATCH v7 16/52] i386/tdvf: Introduce function to parse TDVF metadata

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > +int tdvf_parse_metadata(TdxFirmware *fw, void *flash_ptr, int size) > +{ > +    g_autofree TdvfSectionEntry *sections = NULL; > +    TdvfMetadata *metadata; > +    ssize_t entries_size; > +    int i; > + > +    metadata = tdvf_get_metadata(fla

Re: [PATCH 1/4] hw/riscv/virt: KVM AIA refinement

2025-02-19 Thread Yong-Xuan Wang
Hi Daniel, On Tue, Feb 18, 2025 at 3:24 AM Daniel Henrique Barboza wrote: > > > > On 2/17/25 5:19 AM, Yong-Xuan Wang wrote: > > KVM AIA is only needed to be set when the virt machine use the AIA MSI. > > So we can move the KVM AIA configuration into virt_create_aia() to reduce > > the condition

Re: [PATCH v7 19/52] i386/tdx: Track mem_ptr for each firmware entry of TDVF

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > +static void tdx_finalize_vm(Notifier *notifier, void *unused) > +{ > +    TdxFirmware *tdvf = &tdx_guest->tdvf; > +    TdxFirmwareEntry *entry; > + > +    for_each_tdx_fw_entry(tdvf, entry) { > +    switch (entry->type) { > +    case T

Re: [PATCH 7/8] target/riscv/kvm: rename riscv-aia to riscv-imsic

2025-02-19 Thread Yong-Xuan Wang
Hi Andrew, On Mon, Feb 17, 2025 at 10:07 PM Andrew Jones wrote: > > On Mon, Feb 17, 2025 at 04:17:27PM +0800, Yong-Xuan Wang wrote: > > The riscv-aia property only controls the in-kernel IMSIC mode, the > > emulation of AIA MSI mode is controlled by the kernel-irqchip property. > > Rename the ris

Query on the dirty bitmap

2025-02-19 Thread prashant patil
Hello All, Hope this email finds you well. I have been trying with qemu for a while now, and have come across a problem specific to dirty bitmaps. I have enabled bitmap on the qcow2 disk image using 'qemu-img bitmap' command, exposed the bitmap over a unix socket using 'qemu-nbd' command. Now when

[Bug 2072564] Re: qemu-aarch64-static segfaults running ldconfig.real (amd64 host)

2025-02-19 Thread Dimitry Andric
Upstream has committed https://gitlab.com/qemu- project/qemu/-/commit/4b7b20a3 which fixes the segfaults. A prerequisite for the qemu 8.2.2 package in Ubuntu 24.04 is https://gitlab.com/qemu- project/qemu/-/commit/c81d1faf, so here is a patch that includes both. ** Patch added: "Fix qemu-aarch64-

Re: [PATCH] meson: Display summary of Darwin libraries detected

2025-02-19 Thread Philippe Mathieu-Daudé
On 19/2/25 11:38, Paolo Bonzini wrote: On Wed, Feb 19, 2025 at 11:36 AM Phil Dennis-Jordan wrote: ... which boards should enable MAC_PVG_MMIO? Is it only VIRT, or something else? I doubt anyone will be able to use it productively with virt, but I am regularly surprised by people's creativity

Re: [PATCH 2/2] hw/intc: Have ARM_GIC select ARM_GICV3 when KVM is not available

2025-02-19 Thread Philippe Mathieu-Daudé
On 7/1/25 17:05, Phil Dennis-Jordan wrote: On Sat, 28 Dec 2024 at 11:48, Phil Dennis-Jordan > wrote: On Fri, 27 Dec 2024 at 21:24, Philippe Mathieu-Daudé mailto:phi...@linaro.org>> wrote: When the KVM accelerator is selected, the Kconfig ARM_GIC k

Re: [PULL 23/32] tests/functional: extend test_aarch64_virt with vulkan test

2025-02-19 Thread Thomas Huth
On 19/02/2025 14.25, Philippe Mathieu-Daudé wrote: (+Markus for CLI) On 10/1/25 14:17, Alex Bennée wrote: Now that we have virtio-gpu Vulkan support, let's add a test for it. Currently this is using images build by buildroot:    https://lists.buildroot.org/pipermail/buildroot/2024-December/768

Re: [PATCH 2/2] [NOT-FOR-MERGE] Add qtest for migration over RDMA

2025-02-19 Thread Peter Xu
On Wed, Feb 19, 2025 at 10:20:21AM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Wed, Feb 19, 2025 at 05:33:26AM +, Zhijian Li (Fujitsu) wrote: > >> > >> > >> On 19/02/2025 06:40, Peter Xu wrote: > >> > On Tue, Feb 18, 2025 at 06:03:48PM -0300, Fabiano Rosas wrote: > >> >> Li Zhij

[RFC PATCH] tests/functional: Generic method to check required devices availability

2025-02-19 Thread Philippe Mathieu-Daudé
Not all binaries contain the same set of devices. Since some tests depend on specific devices, we need to check their availability in the binary. QemuSystemTest::require_device() allows for system tests to explicitly check for a particular device. Add a similar check_required_devices() method whic

Re: [PATCH 29/42] qapi: Add "Details:" disambiguation marker

2025-02-19 Thread Markus Armbruster
John Snow writes: > On Mon, Feb 17, 2025 at 7:13 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > This clarifies sections that are mistaken by the parser as "intro" >> > sections to be "details" sections instead. >> > >> > Signed-off-by: John Snow >> >> This is rather terse. >> > > M

Re: [PATCH 2/2] [NOT-FOR-MERGE] Add qtest for migration over RDMA

2025-02-19 Thread Peter Xu
On Wed, Feb 19, 2025 at 05:33:26AM +, Zhijian Li (Fujitsu) wrote: > > > On 19/02/2025 06:40, Peter Xu wrote: > > On Tue, Feb 18, 2025 at 06:03:48PM -0300, Fabiano Rosas wrote: > >> Li Zhijian via writes: > >> > >>> This qtest requirs there is RXE link in the host. > >>> > >>> Here is an exam

[Bug 2072564] Re: qemu-aarch64-static segfaults running ldconfig.real (amd64 host)

2025-02-19 Thread Christian Ehrhardt
Thank you! Adding to plucky soon and then planning SRUs as the queue gets freed of the former one in flight. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/2072564 Title: qemu-aarch64-static segfau

Re: [RFC PATCH] elfload: Fix alignment when unmapping excess reservation

2025-02-19 Thread Fabiano Rosas
Michael Tokarev writes: > 13.02.2025 17:35, Fabiano Rosas wrote: >> When complying with the alignment requested in the ELF and unmapping >> the excess reservation, having align_end not aligned to the guest page >> causes the unmap to be rejected by the alignment check at >> target_munmap and late

[PATCH v8 17/28] vfio-user: implement VFIO_USER_DEVICE_GET_REGION_INFO

2025-02-19 Thread John Levon
From: Jagannathan Raman Add support for per-region info fds. Unlike kernel vfio, vfio-user can have a separate fd to support mmap() of individual regions; add ->use_regfds as needed to support this difference. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannatha

[PATCH v8 03/28] vfio/container: support VFIO_DMA_UNMAP_FLAG_ALL

2025-02-19 Thread John Levon
Some containers can directly implement unmapping all regions; add a new flag to support this. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio/common.c | 24 +++-- hw/vfio/contain

[PATCH v8 01/28] vfio/container: pass MemoryRegion to DMA operations

2025-02-19 Thread John Levon
From: Jagannathan Raman Pass through the MemoryRegion to DMA operation handlers of vfio containers. The vfio-user container will need this later. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John Levon --- hw/vfio/common.c

[PATCH v8 06/28] vfio: refactor out vfio_interrupt_setup()

2025-02-19 Thread John Levon
Refactor the interrupt setup code out of vfio_realize(), as we will later need this for vfio-user too. Signed-off-by: John Levon --- hw/vfio/pci.c | 54 +++ 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci

[PATCH v8 11/28] vfio-user: introduce vfio-user protocol specification

2025-02-19 Thread John Levon
From: Thanos Makatos This patch introduces the vfio-user protocol specification (formerly known as VFIO-over-socket), which is designed to allow devices to be emulated outside QEMU, in a separate process. vfio-user reuses the existing VFIO defines, structs and concepts. It has been earlier discu

[PATCH v8 18/28] vfio-user: implement VFIO_USER_REGION_READ/WRITE

2025-02-19 Thread John Levon
From: Jagannathan Raman Also add support for posted writes on remote devices. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/common.c | 120 ++ hw/vfio-user/common

[PATCH v8 10/28] vfio: add device IO ops vector

2025-02-19 Thread John Levon
From: Jagannathan Raman For vfio-user, device operations such as IRQ handling and region read/writes are implemented in userspace over the control socket, not ioctl() or read()/write() to the vfio kernel driver; add an ops vector to generalize this, and implement vfio_dev_io_ioctl for interacting

[PATCH v8 15/28] vfio-user: implement message send infrastructure

2025-02-19 Thread John Levon
From: Jagannathan Raman Add plumbing for sending vfio-user messages on the control socket. Add initial version negotation on connection. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John Levon --- hw/vfio-user/common.c | 495

[PATCH v8 16/28] vfio-user: implement VFIO_USER_DEVICE_GET_INFO

2025-02-19 Thread John Levon
From: Jagannathan Raman Add support for getting basic device information. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/common.c | 34 ++ hw/vfio-user/common.h |

[PATCH v8 21/28] vfio-user: forward MSI-X PBA BAR accesses to server

2025-02-19 Thread John Levon
From: Jagannathan Raman For vfio-user, the server holds the pending IRQ state; set up an I/O region for the MSI-X PBA so we can ask the server for this state on a PBA read. If VFIO_IRQ_INFO_MASKABLE is set for VFIO_PCI_MSIX_IRQ_INDEX, record this in ->can_mask_msix, and use it to individually ma

[PATCH v8 12/28] vfio-user: add vfio-user class and container

2025-02-19 Thread John Levon
From: Jagannathan Raman Introduce basic plumbing for vfio-user behind a new --enable-vfio-user-client option. We introduce VFIOUserContainer in hw/vfio-user/container.c, which is a container type for the "IOMMU" type "vfio-iommu-user", and share some common container code from hw/vfio/container.

[PATCH v8 19/28] vfio-user: set up PCI in vfio_user_pci_realize()

2025-02-19 Thread John Levon
From: Jagannathan Raman Re-use PCI setup functions from hw/vfio/pci.c to realize the vfio-user PCI device. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/pci.c | 42 ++

[PATCH v8 20/28] vfio-user: implement VFIO_USER_DEVICE_GET/SET_IRQ*

2025-02-19 Thread John Levon
From: Jagannathan Raman IRQ setup uses the same semantics as the traditional vfio path, but we need to share the corresponding file descriptors with the server as necessary. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon

[PATCH v8 24/28] vfio-user: implement VFIO_USER_DMA_MAP/UNMAP

2025-02-19 Thread John Levon
From: John Levon When the vfio-user container gets mapping updates, share them with the vfio-user by sending a message; this can include the region fd, allowing the server to directly mmap() the region as needed. For performance, we only wait for the message responses when we're doing with a ser

[PATCH v8 14/28] vfio-user: implement message receive infrastructure

2025-02-19 Thread John Levon
From: Jagannathan Raman Add the basic implementation for receiving vfio-user messages from the control socket. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/common.c | 412 ++

[PATCH v8 09/28] vfio: split out VFIOKernelPCIDevice

2025-02-19 Thread John Levon
From: Jagannathan Raman Split out code specific to the kernel-side vfio implementation from the VFIOPCIDevice class into a VFIOKernelPCIDevice. The forthcoming VFIOUserPCIDevice will share the base VFIOPCIDevice class. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: J

[PATCH v8 08/28] vfio: add region cache

2025-02-19 Thread John Levon
From: Jagannathan Raman Instead of requesting region information on demand with VFIO_DEVICE_GET_REGION_INFO, maintain a cache: this will become necessary for performance for vfio-user, where this call becomes a message over the control socket, so is of higher overhead than the traditional path.

[PATCH v8 26/28] vfio-user: add 'no-direct-dma' option

2025-02-19 Thread John Levon
From: Jagannathan Raman Normally, the vfio-user client will share a region's file descriptor with the server to allow it directly mmap() the region memory. Add an option to disable this, so the server must use VFIO_USER_REGION_READ/WRITE instead. FIXME: doesn't actually stop sending the fd?? Or

[PATCH v8 13/28] vfio-user: connect vfio proxy to remote server

2025-02-19 Thread John Levon
From: Jagannathan Raman Introduce the vfio-user "proxy": this is the client code responsible for sending and receiving vfio-user messages across the control socket. The new files hw/vfio-user/common.[ch] contain some basic plumbing for managing the proxy; initialize the proxy during realization

[PATCH v8 23/28] vfio-user: implement VFIO_USER_DEVICE_RESET

2025-02-19 Thread John Levon
From: Jagannathan Raman Hook this call up to the legacy reset handler for vfio-user-pci. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/common.c | 12 hw/vfio-user/common.h | 1 + hw/vfio-u

[PATCH v8 02/28] vfio/container: pass listener_begin/commit callbacks

2025-02-19 Thread John Levon
From: John Levon The vfio-user container will later need to hook into these callbacks; set up vfio to use them, and optionally pass them through to the container. Signed-off-by: John Levon --- hw/vfio/common.c | 28 +++ include/hw/vfio/vfio-containe

[PATCH v8 00/28] vfio-user client

2025-02-19 Thread John Levon
This is the 8th revision of the vfio-user client implementation. The vfio-user protocol allows for implementing (PCI) devices in another userspace process; SPDK is one example, which includes a virtual NVMe implementation. The vfio-user framework consists of 3 parts: 1) The VFIO user protocol spe

[PATCH v8 05/28] vfio: add vfio_prepare_device()

2025-02-19 Thread John Levon
Commonize some initialization code shared by the legacy and iommufd vfio implementations (and later by vfio-user). Signed-off-by: John Levon --- hw/vfio/common.c | 19 +++ hw/vfio/container.c | 14 +- hw/vfio/iommufd.c | 9 +

Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers

2025-02-19 Thread Zhao Liu
On Wed, Feb 19, 2025 at 10:25:40AM +0100, Paolo Bonzini wrote: > Date: Wed, 19 Feb 2025 10:25:40 +0100 > From: Paolo Bonzini > Subject: Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers > > On 2/18/25 10:07, Philippe Mathieu-Daudé wrote: > > On 18/2/25 09:53, Paolo Bonzini wrote: >

[PATCH 1/4] tests/functional: move aarch64 GPU test into own file

2025-02-19 Thread Alex Bennée
I want to expand the number of tests to cover a wide range of configurations. That starts with splitting off from the normal virt test from which it doesn't really share much code. Signed-off-by: Alex Bennée --- tests/functional/meson.build | 2 + tests/functional/test_aarch64_vir

[PATCH 0/4] testing/next (aarch64 virt gpu tests)

2025-02-19 Thread Alex Bennée
Hi, As I was looking at the native context patches I realised our existing GPU testing is a little sparse. I took the opportunity to split the test from the main virt test and then extend it to exercise the 3 current display modes (virgl, virgl+blobs, vulkan). I've added some additional validatio

[PATCH 4/4] tests/functional: expand tests to cover virgl

2025-02-19 Thread Alex Bennée
Add two more test modes using glmark2-wayland to exercise the OpenGL pass-through modes with virgl. Virgl can run with or without the hostmem blob support. We might want to eventually add more directed tests and individual features later on but the glmark/vkmark tests are a good general smoke test

[PATCH v8 07/28] vfio: refactor out vfio_pci_config_setup()

2025-02-19 Thread John Levon
Refactor the PCI config setup code out of vfio_realize(), as we will later need this for vfio-user too. Signed-off-by: John Levon --- hw/vfio/pci.c | 176 +++--- 1 file changed, 94 insertions(+), 82 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pc

[PATCH 2/4] tests/functional: factor out common code in gpu test

2025-02-19 Thread Alex Bennée
In preparation for handling more tests split out the common machine setup details from the test specific stuff. Signed-off-by: Alex Bennée --- tests/functional/test_aarch64_virt_gpu.py | 30 +++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/tests/functional/

[PATCH 3/4] tests/functional: ensure we have a GPU device for tests

2025-02-19 Thread Alex Bennée
It's possible to build QEMU without support for the GL enabled GPU devices and we can catch that earlier with an explicit check. Signed-off-by: Alex Bennée --- tests/functional/test_aarch64_virt_gpu.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/functional/test_aarch64_virt_gpu.

[PATCH v8 25/28] vfio-user: implement VFIO_USER_DMA_READ/WRITE

2025-02-19 Thread John Levon
From: Jagannathan Raman Unlike most other messages, this is a server->client message, for when a server wants to do "DMA"; this is slow, so normally the server has memory directly mapped instead. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signe

[PATCH v8 27/28] vfio-user: add 'x-msg-timeout' option

2025-02-19 Thread John Levon
From: Jagannathan Raman By default, the vfio-user subsystem will wait 5 seconds for a message reply from the server. Add an option to allow this to be configurable. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/v

Re: [PATCH trivial] Makefile: "make dist" generates a .xz, not .bz2

2025-02-19 Thread Philippe Mathieu-Daudé
On 19/2/25 14:00, Michael Tokarev wrote: Fixes: 9bc9e9511944 (make-release: switch to .xz format by default) Signed-off-by: Michael Tokarev --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PULL 23/32] tests/functional: extend test_aarch64_virt with vulkan test

2025-02-19 Thread Philippe Mathieu-Daudé
On 19/2/25 14:43, Thomas Huth wrote: On 19/02/2025 14.25, Philippe Mathieu-Daudé wrote: (+Markus for CLI) On 10/1/25 14:17, Alex Bennée wrote: Now that we have virtio-gpu Vulkan support, let's add a test for it. Currently this is using images build by buildroot:    https://lists.buildroot.org

Re: [PATCH v6 2/4] migration: enable multifd and postcopy together

2025-02-19 Thread Prasad Pandit
Hello Fabiano, On Tue, 18 Feb 2025 at 19:52, Fabiano Rosas wrote: > Do you concede that this code has a hidden assumption? Either that > migrate_multifd() != migrate_postcopy_preempt() or that multifd channels > must be set up before postcopy preempt channel? Because that is enough > for us to ha

Re: [PATCH v2 09/11] rust/block: Add read support for block drivers

2025-02-19 Thread Kevin Wolf
Am 19.02.2025 um 07:11 hat Paolo Bonzini geschrieben: > On 2/18/25 19:20, Kevin Wolf wrote: > > +/// The described blocks are stored in a child node. > > +Data { > > +/// Child node in which the data is stored > > +node: Arc, > > Having Arc<> here shouldn't be necessary, si

Re: [PATCH 2/2] [NOT-FOR-MERGE] Add qtest for migration over RDMA

2025-02-19 Thread Fabiano Rosas
Peter Xu writes: > On Wed, Feb 19, 2025 at 05:33:26AM +, Zhijian Li (Fujitsu) wrote: >> >> >> On 19/02/2025 06:40, Peter Xu wrote: >> > On Tue, Feb 18, 2025 at 06:03:48PM -0300, Fabiano Rosas wrote: >> >> Li Zhijian via writes: >> >> >> >>> This qtest requirs there is RXE link in the host.

[PATCH trivial] Makefile: "make dist" generates a .xz, not .bz2

2025-02-19 Thread Michael Tokarev
Fixes: 9bc9e9511944 (make-release: switch to .xz format by default) Signed-off-by: Michael Tokarev --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b65b0bd41a..c92a3cf785 100644 --- a/Makefile +++ b/Makefile @@ -207,10 +207,10 @@ cle

Re: [PATCH 00/42] docs: add sphinx-domain rST generator to qapidoc

2025-02-19 Thread Markus Armbruster
John Snow writes: > "The text handler you add looks just like the existing latex handler. Does > LaTeX output lack "little headings", too?" > > Yes, almost certainly. Can you let me know which output formats we actually > "care about"? I'll have to test them all. As far as I can tell, our build

Re: [PATCH 1/2] migration: Prioritize RDMA in ram_save_target_page()

2025-02-19 Thread Peter Xu
On Wed, Feb 19, 2025 at 09:39:38AM +, Zhijian Li (Fujitsu) wrote: > > > On 19/02/2025 06:03, Peter Xu wrote: > > On Tue, Feb 18, 2025 at 05:30:40PM -0300, Fabiano Rosas wrote: > >> Li Zhijian via writes: > >> > >>> Address an error in RDMA-based migration by ensuring RDMA is prioritized > >>

Re: [PULL 23/32] tests/functional: extend test_aarch64_virt with vulkan test

2025-02-19 Thread Philippe Mathieu-Daudé
(+Markus for CLI) On 10/1/25 14:17, Alex Bennée wrote: Now that we have virtio-gpu Vulkan support, let's add a test for it. Currently this is using images build by buildroot: https://lists.buildroot.org/pipermail/buildroot/2024-December/768196.html Reviewed-by: Thomas Huth Signed-off-by: A

Re: [PATCH] target/arm: Fix signed integer overflow undefined behavior.

2025-02-19 Thread Peter Maydell
On Tue, 18 Feb 2025 at 22:22, Stephen Longfield wrote: > > The problem is internal to t32_expandimm_imm, the imm intermediate > immediate value. This value is sourced from x, which always comes from > the return of a deposit32 call, which returns uint32_t already. > > It's extracted via: int imm =

Re: [PATCH 1/2] rust: subprojects: add libc crate

2025-02-19 Thread Zhao Liu
On Thu, Feb 13, 2025 at 03:32:15PM +0100, Paolo Bonzini wrote: > Date: Thu, 13 Feb 2025 15:32:15 +0100 > From: Paolo Bonzini > Subject: [PATCH 1/2] rust: subprojects: add libc crate > X-Mailer: git-send-email 2.48.1 > > This allows access to errno values. > > Signed-off-by: Paolo Bonzini > ---

Re: [PATCH] microvm: do not use the lastest cpu version

2025-02-19 Thread Igor Mammedov
On Thu, 13 Feb 2025 15:11:00 +0530 Ani Sinha wrote: > Microvm machines are not versioned and therefore there is no requirement to > use > the latest cpu model by default. Let microvms use the non-versioned cpu model. > Those users who need spefific cpu versions can use explicit commandline to >

Re: [PATCH] target/arm: Fix signed integer overflow undefined behavior.

2025-02-19 Thread Stephen Longfield
On Wed, Feb 19, 2025 at 7:26 AM Peter Maydell wrote: > On Tue, 18 Feb 2025 at 22:22, Stephen Longfield > wrote: > > > > The problem is internal to t32_expandimm_imm, the imm intermediate > > immediate value. This value is sourced from x, which always comes from > > the return of a deposit32 call

Re: [PATCH 1/1] qapi/char.json: minor doc rewording for `hub` device

2025-02-19 Thread Markus Armbruster
Roman Penyaev writes: > Refine documentation for the hub device, specify the maximum. > > Signed-off-by: Roman Penyaev > Cc: Marc-André Lureau > Cc: Markus Armbruster > Cc: qemu-devel@nongnu.org > --- > qapi/char.json | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qa

[PATCH v2] target/arm: Fix signed integer overflow undefined behavior.

2025-02-19 Thread Stephen Longfield
The problem is internal to t32_expandimm_imm, the imm intermediate immediate value. It's extracted via: int imm = extract32(x, 0, 8);, so the value will be between 0-255 It is then multiplied by one of 1, 0x00010001, 0x01000100, 0x01010101, or 0x80. Values between 128-255 multiplied by 0x0100010

[PATCH v8 22/28] vfio-user: set up container access to the proxy

2025-02-19 Thread John Levon
From: Jagannathan Raman The user container will shortly need access to the underlying vfio-user proxy; set this up. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/container.c | 43 +++

[PATCH v8 04/28] vfio: add vfio_attach_device_by_iommu_type()

2025-02-19 Thread John Levon
Allow attachment by explicitly passing a TYPE_VFIO_IOMMU_* string; vfio-user will use this later. Signed-off-by: John Levon --- hw/vfio/common.c | 30 +++--- include/hw/vfio/vfio-common.h | 3 +++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --gi

[PATCH v8 28/28] vfio-user: add coalesced posted writes

2025-02-19 Thread John Levon
From: Jagannathan Raman Add new message to send multiple writes to server in a single message. Prevents the outgoing queue from overflowing when a long latency operation is followed by a series of posted writes. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannat

  1   2   3   >