Re: [PATCH] iotests: fix 240

2025-05-29 Thread Thomas Huth
On 29/05/2025 22.31, Stefan Hajnoczi wrote: Commit 2e8e18c2e463 ("virtio-scsi: add iothread-vq-mapping parameter") removed the limitation that virtio-scsi devices must successfully set the AioContext on their BlockBackends. This was made possible thanks to the QEMU multi-queue block layer. This

Re: [PATCH 0/9] ui: Improve scale handling

2025-05-29 Thread Weifeng Liu
Hi Michael, On Thu, 2025-05-29 at 10:23 +0300, Michael Tokarev wrote: > On 11.05.2025 10:33, Weifeng Liu wrote: > > Hi all, > > > > Now we have quite a lot of display backends for different use > > cases. > > Even in the context of gtk, we have various implementations (e.g., > > gl=on > > vs gl=o

Re: [PATCH v2 07/25] s390x/diag: Implement DIAG 320 subcode 2

2025-05-29 Thread Thomas Huth
On 29/05/2025 21.09, Zhuoying Cai wrote: On 5/14/25 12:18 PM, Thomas Huth wrote: On 09/05/2025 00.50, Zhuoying Cai wrote: ... +int qcrypto_get_x509_cert_key_id(uint8_t *cert, size_t size, + QCryptoKeyidFlags flag, + uint8_t *resu

[PATCH 2/6] net/vhost-vdpa: Report hashing capability

2025-05-29 Thread Akihiko Odaki
Report hashing capability so that virtio-net can deliver the correct capability information to the guest. Signed-off-by: Akihiko Odaki --- include/net/net.h | 3 +++ net/net.c | 9 + net/vhost-vdpa.c | 28 3 files changed, 40 insertions(+) diff --

Re: Armbian TLS certificate expired

2025-05-29 Thread Thomas Huth
On 29/05/2025 16.45, Stefan Hajnoczi wrote: The OrangePi, Cubieboard, Banana Pi, and replay tests use a sunxi armhf Linux package URL that is failing due to an expired TLS certificate: 2025-05-29 13:37:56,005 - qemu-test - INFO - Downloading https://apt.armbian.com/pool/main/l/linux-6.6.16/linux

[PATCH 1/6] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()

2025-05-29 Thread Akihiko Odaki
DEFINE_PROP_ON_OFF_AUTO_BIT64() corresponds to DEFINE_PROP_ON_OFF_AUTO() as DEFINE_PROP_BIT64() corresponds to DEFINE_PROP_BOOL(). The difference is that DEFINE_PROP_ON_OFF_AUTO_BIT64() exposes OnOffAuto instead of bool. Signed-off-by: Akihiko Odaki --- include/hw/qdev-properties.h | 18

[PATCH v2] virtio-net: Add queues for RSS during migration

2025-05-29 Thread Akihiko Odaki
virtio_net_pre_load_queues() inspects vdev->guest_features to tell if VIRTIO_NET_F_RSS or VIRTIO_NET_F_MQ is enabled to infer the required number of queues. This works for VIRTIO_NET_F_MQ but it doesn't for VIRTIO_NET_F_RSS because only the lowest 32 bits of vdev->guest_features is set at the point

[PATCH 5/6] net/vhost-vdpa: Remove dummy SetSteeringEBPF

2025-05-29 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki --- net/vhost-vdpa.c | 8 1 file changed, 8 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 4f63ded40d47..149c0f7f1766 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -238,12 +238,6 @@ static void vhost_vdpa

[PATCH RFC v5 2/5] virtio-net: Offload hashing to peer

2025-05-29 Thread Akihiko Odaki
This allows offloading hash reporting and RSS to tap. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 69 +++-- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 52fe404b3431..0a3

[PATCH RFC v5 5/5] docs/devel/ebpf_rss.rst: Update for peer RSS

2025-05-29 Thread Akihiko Odaki
eBPF RSS virtio-net support was written in assumption that there is only one alternative RSS implementation: 'in-qemu' RSS. It is no longer true, and we now have yet another implementation; namely the peer RSS. Signed-off-by: Akihiko Odaki --- docs/devel/ebpf_rss.rst | 22 +++---

[PATCH RFC v5 0/5] virtio-net: Offload hashing without eBPF

2025-05-29 Thread Akihiko Odaki
I'm proposing to add a feature to offload virtio-net RSS/hash report to Linux. This series contain patches to utilize the proposed Linux feature. The patches for Linux are available at: https://lore.kernel.org/r/20250307-rss-v9-0-df7662402...@daynix.com/ Note that the referenced patches for Linux

[PATCH RFC v5 4/5] tap: Report virtio-net hashing support on Linux

2025-05-29 Thread Akihiko Odaki
This allows offloading virtio-net hashing to tap on Linux. Signed-off-by: Akihiko Odaki --- net/tap-linux.h | 1 + net/tap_int.h | 1 + net/tap-bsd.c | 5 + net/tap-linux.c | 5 + net/tap-solaris.c | 5 + net/tap-stub.c| 5 + net/tap.c | 8 7 file

[PATCH RFC v5 3/5] virtio-net: Offload hashing without vhost

2025-05-29 Thread Akihiko Odaki
This is necessary to offload hashing to tap. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 0a333d560d7b..3469c211b13a 100644 --- a/hw/net/virtio-net.c +++ b/

[PATCH RFC v5 1/5] net: Allow configuring virtio hashing

2025-05-29 Thread Akihiko Odaki
This adds functions to configure virtio hashing and implements it for Linux's tap. vDPA will have empty functions as configuring virtio hashing is done with the load(). Signed-off-by: Akihiko Odaki --- include/net/net.h | 13 + net/tap-linux.h | 3 +++ net/tap_int.h | 3 +++

[PATCH 6/6] virtio-net: Add hash type options

2025-05-29 Thread Akihiko Odaki
By default, virtio-net limits the hash types that will be advertised to the guest so that all hash types are covered by the offloading capability the client provides. This change allows to override this behavior and to advertise hash types that require user-space hash calculation by specifying "on"

[PATCH 4/6] virtio-net: Retrieve peer hashing capability

2025-05-29 Thread Akihiko Odaki
Retrieve peer hashing capability instead of hardcoding. Signed-off-by: Akihiko Odaki --- include/hw/virtio/virtio-net.h | 5 ++- hw/net/virtio-net.c| 71 ++ net/vhost-vdpa.c | 4 +-- 3 files changed, 64 insertions(+), 16 deletio

[PATCH 3/6] virtio-net: Move virtio_net_get_features() down

2025-05-29 Thread Akihiko Odaki
Move virtio_net_get_features() to the later part of the file so that it can call other functions. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 146 ++-- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/hw/net/virtio-net.c b

[PATCH 0/6] net/vhost-vdpa: Report hashing capability

2025-05-29 Thread Akihiko Odaki
This patch series was extracted from: https://lore.kernel.org/qemu-devel/20250313-hash-v4-0-c75c494b4...@daynix.com/ ("[PATCH RFC v4 00/11] virtio-net: Offload hashing without eBPF") According to the specification, virtio-net devices with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT can report sup

[PATCH v2] file-posix: Tolerate unaligned hole at middle

2025-05-29 Thread Akihiko Odaki
file-posix used to assume that existing holes satisfy the requested alignment, which equals to the estimated direct I/O alignment requirement if direct I/O is requested, and assert the assumption unless it is at EOF. However, the estimation of direct I/O alignment requirement is sometimes inexact

Re: [PATCH qemu] hw/cxl: Fix register block locator size

2025-05-29 Thread Zhijian Li (Fujitsu)
On 29/05/2025 21:48, Jonathan Cameron via wrote: > This has been wrong from day 1. For now we only have > two entries (component and device registers). Wow, I finally understood this. > > The wrong size could lead to arbitrary data off the stack being presented > in PCIe config space. > > S

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

2025-05-29 Thread BALATON Zoltan
On Thu, 29 May 2025, Bernhard Beschow wrote: Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" : From: BALATON Zoltan We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed wi

Re: [PATCH v4 0/2] Extend and configure PMP region count

2025-05-29 Thread Alistair Francis
On Thu, May 22, 2025 at 6:14 PM Jay Chang wrote: > > The first patch extends the number of PMP regions supported up to 64, > following the RISC-V Privileged Specification (version >1.12), where > RV32 can have up to 64 PMP regions configured through 16 CSRs. > > The second patch makes the PMP regi

[PULL 5/6] iotests: Improve mirror-sparse on ext4 and xfs

2025-05-29 Thread Eric Blake
Fiona reported that an ext4 filesystem on top of LVM can sometimes report over-allocation to du (based on the heuristics the filesystem is making while observing the contents being mirrored); even though the contents and actual size matched, about 50% of the time the size reported by disk_usage was

[PULL 6/6] iotests: Filter out ZFS in several tests

2025-05-29 Thread Eric Blake
Fiona reported that ZFS makes sparse file testing awkward, since: - it has asynchronous allocation (not even 'fsync $file' makes du see the desired size; it takes the slower 'fsync -f $file' which is not appropriate for the tests) - for tests of fully allocated files, ZFS with compression enabl

[PULL 1/6] io: Add helper for setting socket send buffer size

2025-05-29 Thread Eric Blake
From: Nir Soffer Testing reading and writing from qemu-nbd using a unix domain socket shows that the platform default send buffer size is too low, leading to poor performance and hight cpu usage. Add a helper for setting socket send buffer size to be used in NBD code. It can also be used in othe

[PULL 3/6] nbd: Set unix socket send buffer on Linux

2025-05-29 Thread Eric Blake
From: Nir Soffer Like macOS we have similar issue on Linux. For TCP socket the send buffer size is 2626560 bytes (~2.5 MiB) and we get good performance. However for unix socket the default and maximum buffer size is 212992 bytes (208 KiB) and we see poor performance when using one NBD connection,

[PULL 2/6] nbd: Set unix socket send buffer on macOS

2025-05-29 Thread Eric Blake
From: Nir Soffer On macOS we need to increase unix socket buffers size on the client and server to get good performance. We set socket buffers on macOS after connecting or accepting a client connection. Testing shows that setting socket receive buffer size (SO_RCVBUF) has no effect on performanc

[PULL 4/6] iotests: Use disk_usage in more places

2025-05-29 Thread Eric Blake
Commit be9bac07 added a utility disk_usage function, but there are a couple of other tests that could also use it. Signed-off-by: Eric Blake Message-ID: <20250523163041.2548675-6-ebl...@redhat.com> Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner --- tests/qemu-iotests/125 | 2 +- tests/qemu-io

[PULL 0/6] NBD patches through 2025-05-29

2025-05-29 Thread Eric Blake
The following changes since commit d2e9b78162e31b1eaf20f3a4f563da82da56908d: Merge tag 'pull-qapi-2025-05-28' of https://repo.or.cz/qemu/armbru into staging (2025-05-29 08:36:01 -0400) are available in the Git repository at: https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2025-05-29 for yo

Re: [PATCH] iotests: fix 240

2025-05-29 Thread Eric Blake
On Thu, May 29, 2025 at 04:31:47PM -0400, Stefan Hajnoczi wrote: > Commit 2e8e18c2e463 ("virtio-scsi: add iothread-vq-mapping parameter") > removed the limitation that virtio-scsi devices must successfully set > the AioContext on their BlockBackends. This was made possible thanks to > the QEMU mult

Re: [PATCH v1 1/6] backends/iommufd: Add a helper to invalidate user-managed HWPT

2025-05-29 Thread Nicolin Chen
On Thu, May 29, 2025 at 06:46:20AM +, Duan, Zhenzhong wrote: > >Looking at the kernel iommufd_hwpt_invalidate() routine and > >intel_nested_cache_invalidate_user(), it doesn't seem possible to > >return a different number of cache entries. Are you anticipating > >other implementations (sMMU) ?

Re: [RFC 11/11] block/io_uring: use aio_add_sqe()

2025-05-29 Thread Eric Blake
On Wed, May 28, 2025 at 03:09:16PM -0400, Stefan Hajnoczi wrote: > AioContext has its own io_uring instance for file descriptor monitoring. > The disk I/O io_uring code was developed separately. Originally I > thought the characteristics of file descriptor monitoring and disk I/O > were too differe

Re: [Qemu PATCH v2] hw/cxl: fix DC extent capacity tracking

2025-05-29 Thread Michael S. Tsirkin
On Thu, May 29, 2025 at 06:07:34PM +0100, Jonathan Cameron wrote: > On Thu, 29 May 2025 16:34:25 + > nifan@gmail.com wrote: > > > From: Fan Ni > > > > Per cxl r3.2 Section 9.13.3.3, extent capacity tracking should include > > extents in different states including added, pending, etc. > >

[PATCH] iotests: fix 240

2025-05-29 Thread Stefan Hajnoczi
Commit 2e8e18c2e463 ("virtio-scsi: add iothread-vq-mapping parameter") removed the limitation that virtio-scsi devices must successfully set the AioContext on their BlockBackends. This was made possible thanks to the QEMU multi-queue block layer. This change broke qemu-iotests 240, which checks th

[qemu PATCH 1/3] target/riscv/cpu.c: add 'sdtrig' in riscv,isa

2025-05-29 Thread Daniel Henrique Barboza
We have support for sdtrig for awhile but we are not advertising it. It is enabled by default via the 'debug' flag. Use the same flag to also advertise sdtrig. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/t

[qemu PATCH 2/3] target/riscv/cpu.c: add 'ssstrict' to riscv,isa

2025-05-29 Thread Daniel Henrique Barboza
'ssstrict' is a RVA23 profile-defined extension defined as follows: "No non-conforming extensions are present. Attempts to execute unimplemented opcodes or access unimplemented CSRs in the standard or reserved encoding spaces raises an illegal instruction exception that results in a contained trap

[qemu PATCH 3/3] target/riscv/cpu.c: do better with 'named features' doc

2025-05-29 Thread Daniel Henrique Barboza
Most of the named features are added directly in isa_edata_arr[], some of them are also added in riscv_cpu_named_features(). There is a reason for that, and the existing docs can do better explaining it. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 14 -- 1 file ch

[qemu PATCH 0/3] target/riscv: add missing named features

2025-05-29 Thread Daniel Henrique Barboza
Hi, These simple patches add two missing named features in riscv,isa. Third patch is a doc change I figured was worth doing. Drew, as far as Server SoC Reference platform goes, we don't have 'sdext'. I guess we'll have to postpone the Server Soc Ref work for now. Daniel Henrique Barboza (3):

Re: [RFC 10/11] aio-posix: avoid EventNotifier for cqe_handler_bh

2025-05-29 Thread Eric Blake
On Wed, May 28, 2025 at 03:09:15PM -0400, Stefan Hajnoczi wrote: > fdmon_ops->wait() is called with notify_me enabled. This makes it an > expensive place to call qemu_bh_schedule() because aio_notify() invokes > write(2) on the EventNotifier. > > Moving qemu_bh_schedule() after notify_me is reset

Re: [RFC 09/11] aio-posix: add aio_add_sqe() API for user-defined io_uring requests

2025-05-29 Thread Eric Blake
On Wed, May 28, 2025 at 03:09:14PM -0400, Stefan Hajnoczi wrote: > Introduce the aio_add_sqe() API for submitting io_uring requests in the > current AioContext. This allows other components in QEMU, like the block > layer, to take advantage of io_uring features without creating their own > io_uring

[PATCH V4 17/43] vfio-pci: skip reset during cpr

2025-05-29 Thread Steve Sistare
Do not reset a vfio-pci device during CPR, and do not complain if the kernel's PCI config space changes for non-emulated bits between the vmstate save and load, which can happen due to ongoing interrupt activity. Signed-off-by: Steve Sistare --- include/hw/vfio/vfio-cpr.h | 2 ++ hw/vfio/cpr.c

[PATCH V4 27/43] migration: cpr_get_fd_param helper

2025-05-29 Thread Steve Sistare
Add the helper function cpr_get_fd_param, to use when preserving a file descriptor that is opened externally and passed to QEMU. cpr_get_fd_param returns a descriptor number either from a QEMU command-line parameter, from a getfd command, or from CPR state. When a descriptor is passed to new QEMU

[PATCH v3 2/7] amd_iommu: Fix Device ID decoding for INVALIDATE_IOTLB_PAGES command

2025-05-29 Thread Alejandro Jimenez
The DeviceID bits are extracted using an incorrect offset in the call to amdvi_iotlb_remove_page(). This field is read (correctly) earlier, so use the value already retrieved for devid. Cc: qemu-sta...@nongnu.org Fixes: d29a09ca6842 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Alejandro Jimenez

[PATCH v3 6/7] amd_iommu: Fix the calculation for Device Table size

2025-05-29 Thread Alejandro Jimenez
Correctly calculate the Device Table size using the format encoded in the Device Table Base Address Register (MMIO Offset h). Cc: qemu-sta...@nongnu.org Fixes: d29a09ca6842 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Alejandro Jimenez Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c |

[PATCH v3 3/7] amd_iommu: Update bitmasks representing DTE reserved fields

2025-05-29 Thread Alejandro Jimenez
The DTE validation method verifies that all bits in reserved DTE fields are unset. Update them according to the latest definition available in AMD I/O Virtualization Technology (IOMMU) Specification - Section 2.2.2.1 Device Table Entry Format. Remove the magic numbers and use a macro helper to gene

[PATCH v3 1/7] amd_iommu: Fix Miscellaneous Information Register 0 offsets

2025-05-29 Thread Alejandro Jimenez
The definitions encoding the maximum Virtual, Physical, and Guest Virtual Address sizes supported by the IOMMU are using incorrect offsets i.e. the VASize and GVASize offsets are switched. Cc: qemu-sta...@nongnu.org Fixes: d29a09ca6842 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Alejandro Jime

[PATCH v3 7/7] amd_iommu: Remove duplicated definitions

2025-05-29 Thread Alejandro Jimenez
No functional change. Signed-off-by: Alejandro Jimenez Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.h | 4 1 file changed, 4 deletions(-) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 1836b7061d848..31e473924fa20 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h

[PATCH v3 0/7] amd_iommu: Fixes to align with AMDVi specification

2025-05-29 Thread Alejandro Jimenez
The main reason for sending this new revision so soon is that v2 included a duplicated [PATCH 5/7]. I fixed a typo in the commit subject and missed removing the old patch. Apologies for the mistake. Additional changes in v3: - Fixed typo on [PATCH 1/7] subject line (s/Miscellanous/Miscellaneous/).

[PATCH v3 4/7] amd_iommu: Fix masks for various IOMMU MMIO Registers

2025-05-29 Thread Alejandro Jimenez
Address various issues with definitions of the MMIO registers e.g. for the Device Table Address Register, the size mask currently encompasses reserved bits [11:9], so change it to only extract the bits [8:0] encoding size. Convert masks to use GENMASK64 for consistency, and make unrelated definiti

[PATCH v3 5/7] amd_iommu: Fix mask to retrieve Interrupt Table Root Pointer from DTE

2025-05-29 Thread Alejandro Jimenez
Fix an off-by-one error in the definition of AMDVI_IR_PHYS_ADDR_MASK. The current definition masks off the most significant bit of the Interrupt Table Root ptr i.e. it only generates a mask with bits [50:6] set. See the AMD I/O Virtualization Technology (IOMMU) Specification for the Interrupt Table

[PATCH V4 19/43] vfio/pci: vfio_notifier_init

2025-05-29 Thread Steve Sistare
Move event_notifier_init calls to a helper vfio_notifier_init. This version is trivial, but it will be expanded to support CPR in subsequent patches. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 40 +---

[PATCH V4 13/43] vfio/container: mdev cpr blocker

2025-05-29 Thread Steve Sistare
During CPR, after VFIO_DMA_UNMAP_FLAG_VADDR, the vaddr is temporarily invalid, so mediated devices cannot be supported. Add a blocker for them. This restriction will not apply to iommufd containers when CPR is added for them in a future patch. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le

[PATCH V4 23/43] vfio/pci: export MSI functions

2025-05-29 Thread Steve Sistare
Export various MSI functions, renamed with a vfio_pci prefix, for use by CPR in subsequent patches. No functional change. Signed-off-by: Steve Sistare --- hw/vfio/pci.h | 8 hw/vfio/pci.c | 29 + 2 files changed, 25 insertions(+), 12 deletions(-) diff --gi

[PATCH V4 26/43] migration: close kvm after cpr

2025-05-29 Thread Steve Sistare
cpr-transfer breaks vfio network connectivity to and from the guest, and the host system log shows: irq bypass consumer (token a03c32e5) registration fails: -16 which is EBUSY. This occurs because KVM descriptors are still open in the old QEMU process. Close them. Cc: Paolo Bonzini Si

[PATCH V4 21/43] vfio/pci: vfio_notifier_init cpr parameters

2025-05-29 Thread Steve Sistare
Pass vdev and nr to vfio_notifier_init, for use by CPR in a subsequent patch. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/vfio/pci.c b

[PATCH V4 36/43] migration: vfio cpr state hook

2025-05-29 Thread Steve Sistare
Define a list of vfio devices in CPR state, in a subsection so that older QEMU can be live updated to this version. However, new QEMU will not be live updateable to old QEMU. This is acceptable because CPR is not yet commonly used, and updates to older versions are unusual. The contents of each

[PATCH V4 03/43] vfio/container: pass MemoryRegion to DMA operations

2025-05-29 Thread Steve Sistare
Pass through the MemoryRegion to DMA operation handlers of vfio containers. The vfio-user container will need this later, to translate the vaddr into an offset for the dma map vfio-user message. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-o

[PATCH V4 29/43] backends/iommufd: change process ioctl

2025-05-29 Thread Steve Sistare
Define the change process ioctl Signed-off-by: Steve Sistare --- include/system/iommufd.h | 2 ++ backends/iommufd.c | 24 backends/trace-events| 1 + 3 files changed, 27 insertions(+) diff --git a/include/system/iommufd.h b/include/system/iommufd.h index ac

[PATCH V4 12/43] vfio/container: restore DMA vaddr

2025-05-29 Thread Steve Sistare
In new QEMU, do not register the memory listener at device creation time. Register it later, in the container post_load handler, after all vmstate that may affect regions and mapping boundaries has been loaded. The post_load registration will cause the listener to invoke its callback on each flat

Re: [PATCH v2 17/25] pc-bios/s390-ccw: Add signature verification for secure IPL in audit mode

2025-05-29 Thread Zhuoying Cai
On 5/20/25 6:25 AM, Thomas Huth wrote: > On 09/05/2025 00.50, Zhuoying Cai wrote: >> Enable secure IPL in audit mode, which performs signature verification, >> but any error does not terminate the boot process. Only warnings will be >> logged to the console instead. >> >> Add a comp_len variable

[PATCH V4 42/43] iommufd: preserve DMA mappings

2025-05-29 Thread Steve Sistare
During cpr-transfer load in new QEMU, the vfio_memory_listener causes spurious calls to map and unmap DMA regions, as devices are created and the address space is built. This memory was already already mapped by the device in old QEMU, so suppress the map and unmap callbacks during incoming CPR.

[PATCH V4 04/43] vfio/pci: vfio_pci_put_device on failure

2025-05-29 Thread Steve Sistare
If vfio_realize fails after vfio_device_attach, it should call vfio_device_detach during error recovery. If it fails after vfio_device_get_name, it should free vbasedev->name. If it fails after vfio_pci_config_setup, it should free vdev->msix. To fix all, call vfio_pci_put_device(). Signed-off-

[PATCH V4 37/43] vfio/iommufd: cpr state

2025-05-29 Thread Steve Sistare
VFIO iommufd devices will need access to ioas_id, devid, and hwpt_id in new QEMU at realize time, so add them to CPR state. Define CprVFIODevice as the object which holds the state and is serialized to the vmstate file. Define accessors to copy state between VFIODevice and CprVFIODevice. Signed-o

[PATCH V4 30/43] physmem: qemu_ram_get_fd_offset

2025-05-29 Thread Steve Sistare
Define qemu_ram_get_fd_offset, so CPR can map a memory region using IOMMU_IOAS_MAP_FILE in a subsequent patch. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: Zhenzhong Duan --- include/exec/cpu-common.h | 1 + system/physmem.c | 5 + 2 files changed, 6 insertions(

[PATCH V4 06/43] migration: lower handler priority

2025-05-29 Thread Steve Sistare
Define a vmstate priority that is lower than the default, so its handlers run after all default priority handlers. Since 0 is no longer the default priority, translate an uninitialized priority of 0 to MIG_PRI_DEFAULT. CPR for vfio will use this to install handlers for containers that run after h

[PATCH V4 24/43] vfio-pci: preserve MSI

2025-05-29 Thread Steve Sistare
Save the MSI message area as part of vfio-pci vmstate, and preserve the interrupt and notifier eventfd's. migrate_incoming loads the MSI data, then the vfio-pci post_load handler finds the eventfds in CPR state, rebuilds vector data structures, and attaches the interrupts to the new KVM instance.

[PATCH V4 40/43] vfio/iommufd: reconstruct hwpt

2025-05-29 Thread Steve Sistare
Skip allocation of, and attachment to, hwpt_id. Recover it from CPR state. Signed-off-by: Steve Sistare --- hw/vfio/iommufd.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 5119c17..f0abd41 100644 -

[PATCH V4 14/43] vfio/container: recover from unmap-all-vaddr failure

2025-05-29 Thread Steve Sistare
If there are multiple containers and unmap-all fails for some container, we need to remap vaddr for the other containers for which unmap-all succeeded. Recover by walking all address ranges of all containers to restore the vaddr for each. Do so by invoking the vfio listener callback, and passing a

[PATCH V4 32/43] vfio/iommufd: invariant device name

2025-05-29 Thread Steve Sistare
cpr-transfer will use the device name as a key to find the value of the device descriptor in new QEMU. However, if the descriptor number is specified by a command-line fd parameter, then vfio_device_get_name creates a name that includes the fd number. This causes a chicken-and-egg problem: new QEM

[PATCH V4 41/43] vfio/iommufd: change process

2025-05-29 Thread Steve Sistare
Finish CPR by change the owning process of the iommufd device in post load. Signed-off-by: Steve Sistare --- hw/vfio/cpr-iommufd.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/hw/vfio/cpr-iommufd.c b/hw/vfio/cpr-iommufd.c index 152a661..a9e3f68 100644 --- a

[PATCH V4 01/43] MAINTAINERS: Add reviewer for CPR

2025-05-29 Thread Steve Sistare
CPR is integrated with live migration, and has the same maintainers. But, add a CPR section to add a reviewer. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e27d145..e29fb4f

[PATCH V4 35/43] vfio/iommufd: register container for cpr

2025-05-29 Thread Steve Sistare
Register a vfio iommufd container and device for CPR, replacing the generic CPR register call with a more specific iommufd register call. Add a blocker if the kernel does not support IOMMU_IOAS_CHANGE_PROCESS. This is mostly boiler plate. The fields to to saved and restored are added in subseque

[PATCH V4 15/43] pci: export msix_is_pending

2025-05-29 Thread Steve Sistare
Export msix_is_pending for use by cpr. No functional change. Signed-off-by: Steve Sistare Acked-by: Michael S. Tsirkin --- include/hw/pci/msix.h | 1 + hw/pci/msix.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h inde

[PATCH V4 11/43] vfio/container: discard old DMA vaddr

2025-05-29 Thread Steve Sistare
In the container pre_save handler, discard the virtual addresses in DMA mappings with VFIO_DMA_UNMAP_FLAG_VADDR, because guest RAM will be remapped at a different VA after in new QEMU. DMA to already-mapped pages continues. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- hw/vfio

[PATCH V4 28/43] backends/iommufd: iommufd_backend_map_file_dma

2025-05-29 Thread Steve Sistare
Define iommufd_backend_map_file_dma to implement IOMMU_IOAS_MAP_FILE. This will be called as a substitute for iommufd_backend_map_dma, so the error conditions for BARs are copied as-is from that function. Signed-off-by: Steve Sistare Reviewed-by: Zhenzhong Duan --- include/system/iommufd.h | 3

[PATCH V4 34/43] vfio/iommufd: device name blocker

2025-05-29 Thread Steve Sistare
If an invariant device name cannot be created, block CPR. Signed-off-by: Steve Sistare --- include/hw/vfio/vfio-cpr.h | 1 + hw/vfio/device.c | 11 +++ 2 files changed, 12 insertions(+) diff --git a/include/hw/vfio/vfio-cpr.h b/include/hw/vfio/vfio-cpr.h index 25e74ee..170a11

[PATCH V4 20/43] vfio/pci: pass vector to virq functions

2025-05-29 Thread Steve Sistare
Pass the vector number to vfio_connect_kvm_msi_virq and vfio_remove_kvm_msi_virq, so it can be passed to their subroutines in a subsequent patch. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 13 +++-- 1 file changed, 7 insertions(

[PATCH V4 43/43] vfio/container: delete old cpr register

2025-05-29 Thread Steve Sistare
vfio_cpr_[un]register_container is no longer used since they were subsumed by container type-specific registration. Delete them. Signed-off-by: Steve Sistare --- include/hw/vfio/vfio-cpr.h | 4 hw/vfio/cpr.c | 13 - 2 files changed, 17 deletions(-) diff --git a/i

[PATCH V4 39/43] vfio/iommufd: reconstruct device

2025-05-29 Thread Steve Sistare
Reconstruct userland device state after CPR. During vfio_realize, skip all ioctls that configure the device, as it was already configured in old QEMU. Skip bind, and use the devid from CPR state. Skip allocation of, and attachment to, ioas_id. Recover ioas_id from CPR state, and use it to find

[PATCH V4 22/43] vfio/pci: vfio_notifier_cleanup

2025-05-29 Thread Steve Sistare
Move event_notifier_cleanup calls to a helper vfio_notifier_cleanup. This version is trivial, and does not yet use the vdev and nr parameters. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 28 +--- 1 file changed, 17

[PATCH V4 31/43] vfio/iommufd: use IOMMU_IOAS_MAP_FILE

2025-05-29 Thread Steve Sistare
Use IOMMU_IOAS_MAP_FILE when the mapped region is backed by a file. Such a mapping can be preserved without modification during CPR, because it depends on the file's address space, which does not change, rather than on the process's address space, which does change. Signed-off-by: Steve Sistare R

[PATCH V4 16/43] pci: skip reset during cpr

2025-05-29 Thread Steve Sistare
Do not reset a vfio-pci device during CPR. Signed-off-by: Steve Sistare --- include/hw/pci/pci_device.h | 3 +++ hw/pci/pci.c| 5 + hw/vfio/pci.c | 7 +++ 3 files changed, 15 insertions(+) diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device

[PATCH V4 25/43] vfio-pci: preserve INTx

2025-05-29 Thread Steve Sistare
Preserve vfio INTx state across cpr-transfer. Preserve VFIOINTx fields as follows: pin : Recover this from the vfio config in kernel space interrupt : Preserve its eventfd descriptor across exec. unmask : Ditto route.irq : This could perhaps be recovered in vfio_pci_post_load by callin

[PATCH V4 05/43] migration: cpr helpers

2025-05-29 Thread Steve Sistare
Add the cpr_incoming_needed, cpr_open_fd, and cpr_resave_fd helpers, for use when adding cpr support for vfio and iommufd. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- include/migration/cpr.h | 5 + migration/cpr.c | 36 2 file

[PATCH V4 33/43] vfio/iommufd: add vfio_device_free_name

2025-05-29 Thread Steve Sistare
Define vfio_device_free_name to free the name created by vfio_device_get_name. A subsequent patch will do more there. No functional change. Signed-off-by: Steve Sistare --- include/hw/vfio/vfio-device.h | 1 + hw/vfio/ap.c | 2 +- hw/vfio/ccw.c | 2 +- hw/vfio/d

[PATCH V4 02/43] vfio: return mr from vfio_get_xlat_addr

2025-05-29 Thread Steve Sistare
Modify memory_get_xlat_addr and vfio_get_xlat_addr to return the memory region that the translated address is found in. This will be needed by CPR in a subsequent patch to map blocks using IOMMU_IOAS_MAP_FILE. Also return the xlat offset, so we can simplify the interface by removing the out param

[PATCH V4 38/43] vfio/iommufd: preserve descriptors

2025-05-29 Thread Steve Sistare
Save the iommu and vfio device fd in CPR state when it is created. After CPR, the fd number is found in CPR state and reused. Signed-off-by: Steve Sistare --- backends/iommufd.c| 25 - hw/vfio/cpr-iommufd.c | 10 ++ hw/vfio/device.c | 9 + 3 file

[PATCH V4 10/43] vfio/container: preserve descriptors

2025-05-29 Thread Steve Sistare
At vfio creation time, save the value of vfio container, group, and device descriptors in CPR state. On qemu restart, vfio_realize() finds and uses the saved descriptors. During reuse, device and iommu state is already configured, so operations in vfio_realize that would modify the configuration,

[PATCH V4 18/43] vfio/pci: vfio_pci_vector_init

2025-05-29 Thread Steve Sistare
Extract a subroutine vfio_pci_vector_init. No functional change. Signed-off-by: Steve Sistare --- hw/vfio/pci.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 840590c..2d6dc54 100644 --- a/hw/vfio/pci.c +++ b/hw/

[PATCH V4 09/43] vfio/container: register container for cpr

2025-05-29 Thread Steve Sistare
Register a legacy container for cpr-transfer, replacing the generic CPR register call with a more specific legacy container register call. Add a blocker if the kernel does not support VFIO_UPDATE_VADDR or VFIO_UNMAP_ALL. This is mostly boiler plate. The fields to to saved and restored are added

[PATCH V4 00/43] Live update: vfio and iommufd

2025-05-29 Thread Steve Sistare
Support vfio and iommufd devices with the cpr-transfer live migration mode. Devices that do not support live migration can still support cpr-transfer, allowing live update to a new version of QEMU on the same host, with no loss of guest connectivity. No user-visible interfaces are added. For lega

[PATCH V4 07/43] vfio: vfio_find_ram_discard_listener

2025-05-29 Thread Steve Sistare
Define vfio_find_ram_discard_listener as a subroutine so additional calls to it may be added in a subsequent patch. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 3 +++ hw/vfio/listener.c| 35 ++---

[PATCH V4 08/43] vfio: move vfio-cpr.h

2025-05-29 Thread Steve Sistare
Move vfio-cpr.h to include/hw/vfio, because it will need to be included by other files there. Signed-off-by: Steve Sistare Reviewed-by: Cédric Le Goater --- MAINTAINERS| 1 + hw/vfio/vfio-cpr.h | 15 --- include/hw/vfio/vfio-cpr.h | 18 ++ hw

Re: [PATCH v2 07/25] s390x/diag: Implement DIAG 320 subcode 2

2025-05-29 Thread Zhuoying Cai
On 5/14/25 12:18 PM, Thomas Huth wrote: > On 09/05/2025 00.50, Zhuoying Cai wrote: >> DIAG 320 subcode 2 provides verification-certificates (VCs) that are in the >> certificate store. Only X509 certificates in DER format and SHA-256 hash >> type are recognized. >> >> The subcode value is denoted

Re: [PATCH v4 3/9] plugins: Add enforcement of QEMU_PLUGIN_CB flags in register R/W callbacks

2025-05-29 Thread Pierrick Bouvier
On 5/22/25 7:03 PM, Rowan Hart wrote: This patch adds functionality to enforce the requested QEMU_PLUGIN_CB_ flags level passed when registering a callback function using the plugins API. Each time a callback is about to be invoked, a thread-local variable will be updated with the level that call

Re: [PATCH v4 6/9] plugins: Add patcher plugin and test

2025-05-29 Thread Pierrick Bouvier
On 5/22/25 7:03 PM, Rowan Hart wrote: From: novafacing This patch adds a plugin that exercises the virtual and hardware memory read-write API functions added in a previous patch. The plugin takes a target and patch byte sequence, and will overwrite any instruction matching the target byte seque

Re: [PATCH v4 9/9] plugins: Update plugin version and add notes

2025-05-29 Thread Pierrick Bouvier
On 5/22/25 7:03 PM, Rowan Hart wrote: From: novafacing This patch updates the plugin version to gate new APIs and adds notes describing what has been added. Signed-off-by: Rowan Hart --- include/qemu/qemu-plugin.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/

Re: [PATCH v4 8/9] plugins: Remove use of qemu_plugin_read_register where it is not permitted

2025-05-29 Thread Pierrick Bouvier
On 5/22/25 7:03 PM, Rowan Hart wrote: This patch is required to make the insn plugin work after adding enforcement of QEMU_PLUGIN_CB_ flags in calls to read or write registers. Previously, these flags were not enforced and the API could be called from anywhere, but this was not intended as descri

Re: [PATCH v2 02/25] hw/s390x/ipl: Create certificate store

2025-05-29 Thread Zhuoying Cai
On 5/14/25 1:43 AM, Thomas Huth wrote: > On 09/05/2025 00.50, Zhuoying Cai wrote: >> Create a certificate store for boot certificates used for secure IPL. >> >> Load certificates from the -boot-certificate option into the cert store. > > Nit: Remove the "-" before the "boot-certificate" here now

Re: [PATCH v4 5/9] plugins: Add memory hardware address read/write API

2025-05-29 Thread Pierrick Bouvier
On 5/22/25 7:03 PM, Rowan Hart wrote: From: novafacing This patch adds functions to the plugins API to allow plugins to read and write memory via hardware addresses. The functions use the current address space of the current CPU in order to avoid exposing address space information to users. A l

  1   2   >