Re: [PATCH v3] virtio: Implement Virtio Backend for SD/MMC in QEMU

2024-07-03 Thread Michael S. Tsirkin
On Wed, Jul 03, 2024 at 10:55:17PM +0300, Mikhail Krasheninnikov wrote: > > Hello, Alex! > > No, there's no patch to the VirtIO specification yet. This is > proof-of-concept solution since I'm not sure that I did everything > correct with the design (and as folks' reviews show, for a good reaso

Re: [PATCH 3/4] iotests: Change imports for Python 3.13

2024-07-03 Thread John Snow
On Tue, Jul 2, 2024, 1:51 PM Nir Soffer wrote: > > On 2 Jul 2024, at 17:44, John Snow wrote: > > > > On Tue, Jul 2, 2024 at 7:52 AM Nir Soffer wrote: > >> On Thu, Jun 27, 2024 at 2:23 AM John Snow wrote: >> > >> > Python 3.13 isn't out yet, but it's in beta and Fedora is ramping up to >> > mak

Re: [PATCH v4 02/14] hw/riscv: add riscv-iommu-bits.h

2024-07-03 Thread Daniel Henrique Barboza
On 6/25/24 9:59 PM, Alistair Francis wrote: On Tue, Jun 25, 2024 at 6:20 AM Daniel Henrique Barboza wrote: From: Tomasz Jeznach This header will be used by the RISC-V IOMMU emulation to be added in the next patch. Due to its size it's being sent in separate for an easier review. One thin

Re: [PULL v2 00/88] virtio: features,fixes

2024-07-03 Thread Michael S. Tsirkin
On Wed, Jul 03, 2024 at 08:46:38PM +0200, Thomas Huth wrote: > On 03/07/2024 19.01, Richard Henderson wrote: > > On 7/3/24 09:51, Michael S. Tsirkin wrote: > > > On Wed, Jul 03, 2024 at 09:31:45AM -0700, Richard Henderson wrote: > > > > On 7/2/24 13:15, Michael S. Tsirkin wrote: > > > > > The follo

[PATCH v2 1/2] qom/object, qdev: move globals functions to object.c

2024-07-03 Thread Daniel Henrique Barboza
Next patch will add Accel globals support. This means that globals won't be qdev exclusive logic since it'll have to deal with TYPE_ACCEL objects. Move all globals related functions and declarations to object.c. Each function is renamed from 'qdev_' to 'object_': - qdev_prop_register_global() is

[PATCH v2 0/2] object,accel-system: allow Accel type globals

2024-07-03 Thread Daniel Henrique Barboza
Hi, In this new version we followed Daniel's suggestion in the v1 review [1] and moved all 'globals' related functions and definitions from qdev to object. Functions were renamed as follows: - qdev_prop_register_global() is now object_prop_register_global() - qdev_find_global_prop() is now object

[PATCH v2 2/2] qom/object, accel-system: add support to Accel globals

2024-07-03 Thread Daniel Henrique Barboza
We're not honouring KVM options that are provided by any -accel option aside from the first. In this example: qemu-system-riscv64 -accel kvm,riscv-aia=emul (...) \ -accel kvm,riscv-aia=hwaccel 'riscv-aia' will be set to 'emul', ignoring the last occurrence of the option that set 'riscv-aia' t

[PATCH 2/8] docs/qapidoc: create qmp-example directive

2024-07-03 Thread John Snow
This is a directive that creates a syntactic sugar for creating "Example" boxes very similar to the ones already used in the bitmaps.rst document, please see e.g. https://www.qemu.org/docs/master/interop/bitmaps.html#creation-block-dirty-bitmap-add In its simplest form, when a custom title is not

[PATCH 1/8] docs/qapidoc: factor out do_parse()

2024-07-03 Thread John Snow
Factor out the compatibility parser helper into a base class, so it can be shared by other directives. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 64 +++--- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/doc

[PATCH 6/8] qapi: convert "Example" sections with titles

2024-07-03 Thread John Snow
When an Example section has a brief explanation, convert it to a qmp-example:: section using the :title: option. Rule of thumb: If the title can fit on a single line and requires no rST markup, it's a good candidate for using the :title: option of qmp-example. In this patch, trailing punctuation

[PATCH 8/8] qapi: remove "Example" doc section

2024-07-03 Thread John Snow
Fully eliminate the "Example" sections in QAPI doc blocks now that they have all been converted to arbitrary rST syntax using the ".. qmp-example::" directive. Update tests to match. Migrating to the new syntax --- The old "Example:" or "Examples:" section syntax is now ca

[PATCH 0/8] qapi: convert example sections to qmp-example rST directives

2024-07-03 Thread John Snow
GitLab: https://gitlab.com/jsnow/qemu/-/pipelines/1359714660 This patchset focuses on converting example sections to rST directives using a new `.. qmp-example::` directive. It is based on what I *assume* will be Markus' next pull request that covers note conversion. Pull these patches from GitLa

[PATCH 5/8] qapi: convert "Example" sections without titles

2024-07-03 Thread John Snow
Use the no-option form of ".. qmp-example::" to convert any Examples that do not have any form of caption or explanation whatsoever. Note that in a few cases, example sections are split into two or more separate example blocks. This is only done stylistically to create a delineation between two or

[PATCH 4/8] docs/sphinx: add CSS styling for qmp-example directive

2024-07-03 Thread John Snow
From: Harmonie Snow Add CSS styling for qmp-example directives to increase readability and consistently style all example blocks. Signed-off-by: Harmonie Snow Signed-off-by: John Snow --- docs/sphinx-static/theme_overrides.css | 49 ++ 1 file changed, 49 insertions(+)

[PATCH 3/8] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks

2024-07-03 Thread John Snow
For any code literal blocks inside of a qmp-example directive, apply and enforce the QMP lexer/highlighter to those blocks. This way, you won't need to write: ``` .. qmp-example:: :annotated: Blah blah .. code-block:: QMP -> { "lorem": "ipsum" } ``` But instead, simply: ``` ..

[PATCH 7/8] qapi: convert "Example" sections with longer prose

2024-07-03 Thread John Snow
These examples require longer explanations or have explanations that require markup to look reasonable when rendered and so use the longer form of the ".. qmp-example::" directive. By using the :annotated: option, the content in the example block is assumed *not* to be a code block literal and is

Re: [PULL 4/4] block: Parse filenames only when explicitly requested

2024-07-03 Thread Michael Tokarev
02.07.2024 19:39, Kevin Wolf wrote: When handling image filenames from legacy options such as -drive or from tools, these filenames are parsed for protocol prefixes, including for the json:{} pseudo-protocol. This behaviour is intended for filenames that come directly from the command line and f

Question about OS/2 support under QEMU....

2024-07-03 Thread Roderick Klein
Hello Recently a bug was opened to get QEMU to support OS/2 again (newer versions of OS/2). https://gitlab.com/qemu-project/qemu/-/issues/2198 I would like to point out a company from the US supports a current version of OS/2 called ArcaOS. I was trying to help out to figure out where I cou

[PATCH] hw/intc: sifive_plic: Fix heap-buffer-overflow in SiFive PLIC read operation

2024-07-03 Thread Zheyu Ma
The sifive_plic_read function in hw/intc/sifive_plic.c had a potential heap-buffer-overflow issue when reading from the pending_base region. This occurred because the code did not check if the calculated word index was within valid bounds before accessing the pending array. This fix prevents out-o

Re: [PULL 0/7] tcg patch queue

2024-07-03 Thread Richard Henderson
gitlab.com/rth7680/qemu tags/pull-tcg-20240703 for you to fetch changes up to a71d9dfbf63db42d6e6ae87fc112d1f5502183bd: tcg/optimize: Fix TCG_COND_TST* simplification of setcond2 (2024-07-03 10:24:12 -0700) util: cpuinfo portability

Re: [PULL v2 00/88] virtio: features,fixes

2024-07-03 Thread Richard Henderson
On 7/3/24 13:26, Michael S. Tsirkin wrote: On Wed, Jul 03, 2024 at 08:46:38PM +0200, Thomas Huth wrote: On 03/07/2024 19.01, Richard Henderson wrote: On 7/3/24 09:51, Michael S. Tsirkin wrote: On Wed, Jul 03, 2024 at 09:31:45AM -0700, Richard Henderson wrote: On 7/2/24 13:15, Michael S. Tsirk

[PULL v3 00/85] virtio: features,fixes

2024-07-03 Thread Michael S. Tsirkin
changes from v2: drop part of vhost-user posix support due to test failures on freebsd The following changes since commit 1152a0414944f03231f3177207d379d58125890e: Merge tag 'pull-xen-20240701' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25

[PULL v3 02/85] vhost: Perform memory section dirty scans once per iteration

2024-07-03 Thread Michael S. Tsirkin
From: Si-Wei Liu On setups with one or more virtio-net devices with vhost on, dirty tracking iteration increases cost the bigger the number amount of queues are set up e.g. on idle guests migration the following is observed with virtio-net with vhost=on: 48 queues -> 78.11% [.] vhost_dev_sync_r

[PULL v3 04/85] virtio/virtio-pci: Handle extra notification data

2024-07-03 Thread Michael S. Tsirkin
From: Jonah Palmer Add support to virtio-pci devices for handling the extra data sent from the driver to the device when the VIRTIO_F_NOTIFICATION_DATA transport feature has been negotiated. The extra data that's passed to the virtio-pci device when this feature is enabled varies depending on th

[PULL v3 05/85] virtio: Prevent creation of device using notification-data with ioeventfd

2024-07-03 Thread Michael S. Tsirkin
From: Jonah Palmer Prevent the realization of a virtio device that attempts to use the VIRTIO_F_NOTIFICATION_DATA transport feature without disabling ioeventfd. Due to ioeventfd not being able to carry the extra data associated with this feature, having both enabled is a functional mismatch and

[PULL v3 01/85] vhost: dirty log should be per backend type

2024-07-03 Thread Michael S. Tsirkin
From: Si-Wei Liu There could be a mix of both vhost-user and vhost-kernel clients in the same QEMU process, where separate vhost loggers for the specific vhost type have to be used. Make the vhost logger per backend type, and have them properly reference counted. Suggested-by: Michael S. Tsirkin

[PULL v3 11/85] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-07-03 Thread Michael S. Tsirkin
From: Wafer The virtio-1.3 specification writes: 2.8.6 Next Flag: Descriptor Chaining Buffer ID is included in the last descriptor in the list. If the feature (_F_INDIRECT_DESC) has been negotiated, install only one descript

[PULL v3 10/85] vhost-vsock: add VIRTIO_F_RING_PACKED to feature_bits

2024-07-03 Thread Michael S. Tsirkin
From: Halil Pasic Not having VIRTIO_F_RING_PACKED in feature_bits[] is a problem when the vhost-vsock device does not offer the feature bit VIRTIO_F_RING_PACKED but the in QEMU device is configured to try to use the packed layout (the virtio property "packed" is on). As of today, the Linux kern

[PULL v3 06/85] virtio-mmio: Handle extra notification data

2024-07-03 Thread Michael S. Tsirkin
From: Jonah Palmer Add support to virtio-mmio devices for handling the extra data sent from the driver to the device when the VIRTIO_F_NOTIFICATION_DATA transport feature has been negotiated. The extra data that's passed to the virtio-mmio device when this feature is enabled varies depending on

[PULL v3 15/85] vhost-user: fix lost reconnect again

2024-07-03 Thread Michael S. Tsirkin
From: Li Feng When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fail at get_features, the vhost_dev_cleanup will be calle

[PULL v3 16/85] hw/cxl/mailbox: change CCI cmd set structure to be a member, not a reference

2024-07-03 Thread Michael S. Tsirkin
From: Gregory Price This allows devices to have fully customized CCIs, along with complex devices where wrapper devices can override or add additional CCI commands without having to replicate full command structures or pollute a base device with every command that might ever be used. Signed-off-

[PULL v3 09/85] Fix vhost user assertion when sending more than one fd

2024-07-03 Thread Michael S. Tsirkin
From: Christian Pötzsch If the client sends more than one region this assert triggers. The reason is that two fd's are 8 bytes and VHOST_MEMORY_BASELINE_NREGIONS is exactly 8. The assert is wrong because it should not test for the size of the fd array, but for the numbers of regions. Signed-off

[PULL v3 03/85] vhost-vdpa: check vhost_vdpa_set_vring_ready() return value

2024-07-03 Thread Michael S. Tsirkin
From: Stefano Garzarella vhost_vdpa_set_vring_ready() could already fail, but if Linux's patch [1] will be merged, it may fail with more chance if userspace does not activate virtqueues before DRIVER_OK when VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK is not negotiated. So better check its return val

[PULL v3 19/85] hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative and mailbox command support

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Per cxl spec r3.1, add dynamic capacity (DC) region representative based on Table 8-165 and extend the cxl type3 device definition to include DC region information. Also, based on info in 8.2.9.9.9.1, add 'Get Dynamic Capacity Configuration' mailbox support. Note: we store region de

[PULL v3 13/85] vhost-user-gpu: fix import of DMABUF

2024-07-03 Thread Michael S. Tsirkin
From: Marc-André Lureau When using vhost-user-gpu with GL, qemu -display gtk doesn't show output and prints: qemu: eglCreateImageKHR failed Since commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties"), egl_dmabuf_import_texture() uses backing_{width,height} for the

[PULL v3 18/85] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Based on CXL spec r3.1 Table 8-127 (Identify Memory Device Output Payload), dynamic capacity event log size should be part of output of the Identify command. Add dc_event_log_size to the output payload for the host to get the info. Reviewed-by: Gregory Price Reviewed-by: Jonathan C

[PULL v3 29/85] hw/mem/cxl_type3: Allow to release extent superset in QMP interface

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Before the change, the QMP interface used for add/release DC extents only allows to release an extent whose DPA range is contained by a single accepted extent in the device. With the change, we relax the constraints. As long as the DPA range of the extent is covered by accepted ext

[PULL v3 27/85] hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni All DPA ranges in the DC regions are invalid to access until an extent covering the range has been successfully accepted by the host. A bitmap is added to each region to record whether a DC block in the region has been backed by a DC extent. Each bit in the bitmap represents a DC blo

[PULL v3 31/85] hw/misc/pvpanic: centralize definition of supported events

2024-07-03 Thread Michael S. Tsirkin
From: Thomas Weißschuh The different components of pvpanic duplicate the list of supported events. Move it to the shared header file to minimize changes when new events are added. MST: tweak: keep header included in pvpanic.c to avoid header dependency, rebase. Reviewed-by: Thomas Huth Reviewe

[PULL v3 23/85] hw/mem/cxl_type3: Add host backend and address space handling for DC regions

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Add (file/memory backed) host backend for DCD. All the dynamic capacity regions will share a single, large enough host backend. Set up address space for DC regions to support read/write operations to dynamic capacity for DCD. With the change, the following support is added: 1. Add a

[PULL v3 24/85] hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Add dynamic capacity extent list representative to the definition of CXLType3Dev and implement get DC extent list mailbox command per CXL.spec.3.1:.8.2.9.9.9.2. Tested-by: Svetly Todorov Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni Message-Id: <20240523174651.1089554-10-ni

[PULL v3 26/85] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni To simulate FM functionalities for initiating Dynamic Capacity Add (Opcode 5604h) and Dynamic Capacity Release (Opcode 5605h) as in CXL spec r3.1 7.6.7.6.5 and 7.6.7.6.6, we implemented two QMP interfaces to issue add/release dynamic capacity extents requests. With the change, we al

[PULL v3 33/85] hw/misc/pvpanic: add support for normal shutdowns

2024-07-03 Thread Michael S. Tsirkin
From: Thomas Weißschuh Shutdown requests are normally hardware dependent. By extending pvpanic to also handle shutdown requests, guests can submit such requests with an easily implementable and cross-platform mechanism. Acked-by: Cornelia Huck Signed-off-by: Thomas Weißschuh Message-Id: <20240

[PULL v3 20/85] include/hw/cxl/cxl_device: Rename mem_size as static_mem_size for type3 memory devices

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Rename mem_size as static_mem_size for type3 memdev to cover static RAM and pmem capacity, preparing for the introduction of dynamic capacity to support dynamic capacity devices. Reviewed-by: Gregory Price Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni Message-Id: <202405231

[PULL v3 30/85] linux-headers: update to 6.10-rc1

2024-07-03 Thread Michael S. Tsirkin
From: Thomas Weißschuh Signed-off-by: Thomas Weißschuh Message-Id: <20240527-pvpanic-shutdown-v8-2-5a28ec025...@t-8ch.de> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/standard-headers/linux/ethtool.h| 55 include/standard-headers/linux/pci_regs.h

[PULL v3 35/85] tests/qtest/pvpanic: add tests for pvshutdown event

2024-07-03 Thread Michael S. Tsirkin
From: Thomas Weißschuh Validate that a shutdown via the pvpanic device emits the correct QMP events. Signed-off-by: Thomas Weißschuh Reviewed-by: Thomas Huth Message-Id: <20240527-pvpanic-shutdown-v8-7-5a28ec025...@t-8ch.de> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin -

[PULL v3 39/85] virtio-pci: implement No_Soft_Reset bit

2024-07-03 Thread Michael S. Tsirkin
From: Jiqian Chen In current code, when guest does S3, virtio-gpu are reset due to the bit No_Soft_Reset is not set. After resetting, the display resources of virtio-gpu are destroyed, then the display can't come back and only show blank after resuming. Implement No_Soft_Reset bit of PCI_PM_CTRL

[PULL v3 44/85] vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests

2024-07-03 Thread Michael S. Tsirkin
From: BillXiang The VHOST_USER_SET_LOG_BASE requests should be categorized into non-vring specific messages, and should be sent only once. If send more than once, dpdk will munmap old log_addr which may has been used and cause segmentation fault. Signed-off-by: BillXiang Message-Id: <202406130

[PULL v3 54/85] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-07-03 Thread Michael S. Tsirkin
From: 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. Since we are here, let`s remove `share=on` which is the default for shm

[PULL v3 53/85] hostmem: add a new memory backend based on POSIX shm_open()

2024-07-03 Thread Michael S. Tsirkin
From: 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 alte

[PULL v3 21/85] hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni With the change, when setting up memory for type3 memory device, we can create DC regions. A property 'num-dc-regions' is added to ct3_props to allow users to pass the number of DC regions to create. To make it easier, other region parameters like region base, length, and block size

[PULL v3 32/85] tests/qtest/pvpanic: use centralized definition of supported events

2024-07-03 Thread Michael S. Tsirkin
From: Thomas Weißschuh Avoid the necessity to update all tests when new events are added to the device. Acked-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Weißschuh Message-Id: <20240527-pvpanic-shutdown-v8-4-5a28ec025...@t-8ch.de> Reviewed-by: Michael S. Tsirkin Signed-o

[PULL v3 50/85] vhost-user-server: do not set memory fd non-blocking

2024-07-03 Thread Michael S. Tsirkin
From: 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 o

[PULL v3 42/85] hw/virtio: Free vqs after vhost_dev_cleanup()

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Message-Id: <20240627-san-v2-7-750bb0946...@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/

[PULL v3 57/85] hw/arm/virt-acpi-build: Drop local iort_node_offset

2024-07-03 Thread Michael S. Tsirkin
From: Nicolin Chen Both the other two callers of build_iort_id_mapping() just directly pass in the IORT_NODE_OFFSET macro. Keeping a "const uint32_t" local variable storing the same value doesn't have any gain. Simplify this by replacing the only place using this local variable with the macro di

[PULL v3 17/85] hw/cxl/mailbox: interface to add CCI commands to an existing CCI

2024-07-03 Thread Michael S. Tsirkin
From: Gregory Price This enables wrapper devices to customize the base device's CCI (for example, with custom commands outside the specification) without the need to change the base device. The also enabled the base device to dispatch those commands without requiring additional driver support.

[PULL v3 56/85] hw/virtio: Fix the de-initialization of vhost-user devices

2024-07-03 Thread Michael S. Tsirkin
From: Thomas Huth The unrealize functions of the various vhost-user devices are calling the corresponding vhost_*_set_status() functions with a status of 0 to shut down the device correctly. Now these vhost_*_set_status() functions all follow this scheme: bool should_start = virtio_device_s

[PULL v3 34/85] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal

2024-07-03 Thread Michael S. Tsirkin
From: Alejandro Jimenez Emit a QMP event on receiving a PVPANIC_SHUTDOWN event. Even though a typical SHUTDOWN event will be sent, it will be indistinguishable from a shutdown originating from other cases (e.g. KVM exit due to KVM_SYSTEM_EVENT_SHUTDOWN) that also issue the guest-shutdown cause. A

[PULL v3 28/85] hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni With the change, we extend the extent release mailbox command processing to allow more flexible release. As long as the DPA range of the extent to release is covered by accepted extent(s) in the device, the release can be performed. Tested-by: Svetly Todorov Reviewed-by: Gregory Pr

[PULL v3 55/85] tests/qtest/vhost-user-test: add a test case for memory-backend-shm

2024-07-03 Thread Michael S. Tsirkin
From: Stefano Garzarella `memory-backend-shm` can be used with vhost-user devices, so let's add a new test case for it. Acked-by: Thomas Huth Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella Message-Id: <202406181

[PULL v3 65/85] tests/qtest/bios-tables-test.c: Set "arch" for aarch64 tests

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L To search for expected AML files under ${arch}/${machine} path, set this field for AARCH64 related test cases. Signed-off-by: Sunil V L Acked-by: Alistair Francis Reviewed-by: Igor Mammedov Message-Id: <20240625150839.1358279-8-suni...@ventanamicro.com> Reviewed-by: Michael S.

[PULL v3 51/85] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-07-03 Thread Michael S. Tsirkin
From: 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

[PULL v3 25/85] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni Per CXL spec 3.1, two mailbox commands are implemented: Add Dynamic Capacity Response (Opcode 4802h) 8.2.9.9.9.3, and Release Dynamic Capacity (Opcode 4803h) 8.2.9.9.9.4. For the process of the above two commands, we use two-pass approach. Pass 1: Check whether the input payload is

[PULL v3 59/85] hw/arm/virt-acpi-build: Fix id_count in build_iort_id_mapping

2024-07-03 Thread Michael S. Tsirkin
From: Nicolin Chen It's observed that Linux kernel booting with the VM reports a "conflicting mapping for input ID" FW_BUG. The IORT doc defines "Number of IDs" to be "the number of IDs in the range minus one", while virt-acpi-build.c simply stores the number of IDs in the id_count without the "

[PULL v3 67/85] tests/data/acpi: Move x86 ACPI tables under x86/${machine} path

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L To support multiple architectures using same machine name, create x86 folder and move all x86 related AML files for each machine type inside. Signed-off-by: Sunil V L Reviewed-by: Igor Mammedov Message-Id: <20240625150839.1358279-10-suni...@ventanamicro.com> Reviewed-by: Michae

[PULL v3 14/85] Revert "vhost-user: fix lost reconnect"

2024-07-03 Thread Michael S. Tsirkin
From: Li Feng This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. Since the current patch cannot completely fix the lost reconnect problem, there is a scenario that is not considered: - When the virtio-blk driver is removed from the guest os, s->connected has no chance to be set to f

[PULL v3 60/85] uefi-test-tools/UefiTestToolsPkg: Add RISC-V support

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L Enable building the test application for RISC-V with appropriate dependencies updated. Signed-off-by: Sunil V L Acked-by: Gerd Hoffmann Acked-by: Alistair Francis Acked-by: Igor Mammedov Message-Id: <20240625150839.1358279-3-suni...@ventanamicro.com> Reviewed-by: Michael S. T

[PULL v3 45/85] hw/net/virtio-net.c: fix crash in iov_copy()

2024-07-03 Thread Michael S. Tsirkin
From: Dmitry Frolov A crash found while fuzzing device virtio-net-socket-check-used. Assertion "offset == 0" in iov_copy() fails if less than guest_hdr_len bytes were transmited. Signed-off-by: Dmitry Frolov Message-Id: <20240613143529.602591-2-fro...@swemel.ru> Reviewed-by: Michael S. Tsirkin

[PULL v3 12/85] virtio-pci: only reset pm state during resetting

2024-07-03 Thread Michael S. Tsirkin
From: Jiqian Chen Fix bug imported by 27ce0f3afc9dd ("fix Power Management Control Register for PCI Express virtio devices" After this change, observe that QEMU may erroneously clear the power status of the device, or may erroneously clear non writable registers, such as NO_SOFT_RESET, etc. On

[PULL v3 58/85] hw/i386/fw_cfg: Add etc/e820 to fw_cfg late

2024-07-03 Thread Michael S. Tsirkin
From: David Woodhouse In e820_add_entry() the e820_table is reallocated with g_renew() to make space for a new entry. However, fw_cfg_arch_create() just uses the existing e820_table pointer. This leads to a use-after-free if anything adds a new entry after fw_cfg is set up. Shift the addition of

[PULL v3 46/85] qapi: clarify that the default is backend dependent

2024-07-03 Thread Michael S. Tsirkin
From: Stefano Garzarella The default value of the @share option of the @MemoryBackendProperties really depends on the backend type, so let's document the default values in the same place where we define the option to avoid dispersing the information. Cc: David Hildenbrand Suggested-by: Markus A

[PULL v3 49/85] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-07-03 Thread Michael S. Tsirkin
From: 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 featu

[PULL v3 41/85] i386/apic: Add hint on boot failure because of disabling x2APIC

2024-07-03 Thread Michael S. Tsirkin
From: Zhao Liu Currently, the Q35 supports up to 4096 vCPUs (since v9.0), but for TCG cases, if x2APIC is not actively enabled to boot more than 255 vCPUs ( e.g., qemu-system-i386 -M pc-q35-9.0 -smp 666), the following error is reported: Unexpected error in apic_common_set_id() at ../hw/intc/api

[PULL v3 40/85] vhost-user-test: no set non-blocking for cal fd less than 0.

2024-07-03 Thread Michael S. Tsirkin
From: Yuxue Liu In the scenario where vhost-user sets eventfd to -1, qemu_chr_fe_get_msgfds retrieves fd as -1. When vhost_user_read receives, it does not perform blocking operations on the descriptor with fd=-1, so non-blocking operations should not be performed here either.This is a normal use

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

2024-07-03 Thread Michael S. Tsirkin
On Tue, Jun 18, 2024 at 12:00:30PM +0200, Stefano Garzarella wrote: > As discussed with Michael and Markus [1], this version also includes the patch > on which v7 depended to simplify the merge in Michael's tree. > > The series is all reviewed, so if there are no new changes required, I would > as

[PULL v3 37/85] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()

2024-07-03 Thread Michael S. Tsirkin
From: Cindy Lu In function kvm_virtio_pci_vector_use_one(), the function will only use the irqfd/vector for itself. Therefore, in the undo label, the failing process is incorrect. To fix this, we can just remove this label. Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") Cc: qem

[PULL v3 73/85] hw/cxl/events: Mark cxl-add-dynamic-capacity and cxl-release-dynamic-capcity unstable

2024-07-03 Thread Michael S. Tsirkin
From: Jonathan Cameron Markus suggested that we make the unstable. I don't expect these interfaces to change because of their tight coupling to the Compute Express Link (CXL) Specification, Revision 3.1 Fabric Management API definitions which can only be extended in backwards compatible way. Howe

[PULL v3 08/85] vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits

2024-07-03 Thread Michael S. Tsirkin
From: Jonah Palmer Add support for the VIRTIO_F_NOTIFICATION_DATA feature across a variety of vhost devices. The inclusion of VIRTIO_F_NOTIFICATION_DATA in the feature bits arrays for these devices ensures that the backend is capable of offering and providing support for this feature, and that i

[PULL v3 70/85] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L Update list of images supported in unpack_edk2_blobs to enable RISC-V ACPI table testing. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis Reviewed-by: Igor Mammedov Message-Id: <20240625150839.1358279-13-suni...@ventanamicro.com> Reviewed-by: Michael S. Tsirkin Signed-

[PULL v3 82/85] pcie_sriov: Release VFs failed to realize

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki Release VFs failed to realize just as we do in unregister_vfs(). Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-7-7ca0b8ed3...@daynix.com> Reviewed-by: Michael S. Tsirkin Si

[PULL v3 22/85] hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument

2024-07-03 Thread Michael S. Tsirkin
From: Fan Ni The function ct3_build_cdat_entries_for_mr only uses size of the passed memory region argument, refactor the function definition to make the passed arguments more specific. Reviewed-by: Gregory Price Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni Message-Id: <20240523174651.

[PULL v3 66/85] tests/qtest/bios-tables-test.c: Set "arch" for x86 tests

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L To search for expected AML files under ${arch}/${machine} path, set this field for X86 related test cases. Signed-off-by: Sunil V L Reviewed-by: Igor Mammedov Message-Id: <20240625150839.1358279-9-suni...@ventanamicro.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael

[PULL v3 43/85] virtio-iommu: add error check before assert

2024-07-03 Thread Michael S. Tsirkin
From: Manos Pitsidianakis A fuzzer case discovered by Zheyu Ma causes an assert failure. Add a check before the assert, and respond with an error before moving on to the next queue element. To reproduce the failure: cat << EOF | \ qemu-system-x86_64 \ -display none -machine accel=qtest -m 512M

[PULL v3 75/85] virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged

2024-07-03 Thread Michael S. Tsirkin
From: Cédric Le Goater When a VFIO device is hoplugged in a VM using virtio-iommu, IOMMUPciBus and IOMMUDevice cache entries are created in the .get_address_space() handler of the machine IOMMU device. However, these entries are never destroyed, not even when the VFIO device is detached from the

[PULL v3 47/85] libvhost-user: set msg.msg_control to NULL when it is empty

2024-07-03 Thread Michael S. Tsirkin
From: 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é Tested-by: Philippe Ma

[PULL v3 52/85] contrib/vhost-user-*: use QEMU bswap helper functions

2024-07-03 Thread Michael S. Tsirkin
From: 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é Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbr

[PULL v3 79/85] pcie_sriov: Do not manually unrealize

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki A device gets automatically unrealized when being unparented. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-4-7ca0b8ed3...@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci/pcie_sriov.c | 4 1 file changed, 4 dele

[PULL v3 38/85] hw/cxl: Fix read from bogus memory

2024-07-03 Thread Michael S. Tsirkin
From: Ira Weiny Peter and coverity report: We've passed '&data' to address_space_write(), which means "read from the address on the stack where the function argument 'data' lives", so instead of writing 64 bytes of data to the guest , we'll write 64 bytes which st

[PULL v3 84/85] pcie_sriov: Register VFs after migration

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki pcie_sriov doesn't have code to restore its state after migration, but igb, which uses pcie_sriov, naively claimed its migration capability. Add code to register VFs after migration and fix igb migration. Fixes: 3a977deebe6b ("Intrdocue igb device emulation") Signed-off-by:

[PULL v3 76/85] hw/pci: Rename has_power to enabled

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki The renamed state will not only represent powering state of PFs, but also represent SR-IOV VF enablement in the future. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-1-7ca0b8ed3...@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin

[PULL v3 77/85] hw/ppc/spapr_pci: Do not create DT for disabled PCI device

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki Disabled means it is a disabled SR-IOV VF or it is powered off, and hidden from the guest. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-2-7ca0b8ed3...@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ppc/spapr_pci.c | 4

[PULL v3 74/85] virtio: remove virtio_tswap16s() call in vring_packed_event_read()

2024-07-03 Thread Michael S. Tsirkin
From: Stefano Garzarella Commit d152cdd6f6 ("virtio: use virtio accessor to access packed event") switched using of address_space_read_cached() to virito_lduw_phys_cached() to access packed descriptor event. When we used address_space_read_cached(), we needed to call virtio_tswap16s() to handle

[PULL v3 78/85] hw/ppc/spapr_pci: Do not reject VFs created after a PF

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki A PF may automatically create VFs and the PF may be function 0. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-3-7ca0b8ed3...@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ppc/spapr_pci.c | 4 +++- 1 file changed, 3 ins

[PULL v3 80/85] pcie_sriov: Ensure VF function number does not overflow

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki pci_new() aborts when creating a VF with a function number equals to or is greater than PCI_DEVFN_MAX. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-5-7ca0b8ed3...@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/pcie_s

[PULL v3 61/85] uefi-test-tools: Add support for python based build script

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L edk2-funcs.sh which is used in this Makefile, was removed in the commit c28a2891f3 ("edk2: update build script"). It is replaced with a python based script. So, update the Makefile and add the configuration file as required to support the python based build script. Signed-off-by:

[PULL v3 62/85] tests/data/uefi-boot-images: Add RISC-V ISO image

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L To test ACPI tables, edk2 needs to be booted with a disk image having EFI partition. This image is created using UefiTestToolsPkg. The image is generated using tests/uefi-test-tools source. Signed-off-by: Sunil V L Message-Id: <20240625150839.1358279-5-suni...@ventanamicro.com>

[PULL v3 81/85] pcie_sriov: Reuse SR-IOV VF device instances

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki Disable SR-IOV VF devices by reusing code to power down PCI devices instead of removing them when the guest requests to disable VFs. This allows to realize devices and report VF realization errors at PF realization time. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reu

[PULL v3 64/85] tests/qtest/bios-tables-test.c: Add support for arch in path

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L Since machine name can be common for multiple architectures (ex: virt), add "arch" in the path to search for expected AML files. Since the AML files are still under old path, add support for searching with and without arch in the path. Signed-off-by: Sunil V L Acked-by: Alistair

[PULL v3 63/85] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them

2024-07-03 Thread Michael S. Tsirkin
From: Sunil V L Existing AARCH64 virt test functions do not have AARCH64 in their name. To add RISC-V virt related test cases, better to rename existing functions to indicate they are ARM only. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis Reviewed-by: Igor Mammedov Message-Id: <2024

[PULL v3 85/85] hw/pci: Replace -1 with UINT32_MAX for romsize

2024-07-03 Thread Michael S. Tsirkin
From: Akihiko Odaki romsize is an uint32_t variable. Specifying -1 as an uint32_t value is obscure way to denote UINT32_MAX. Worse, if int is wider than 32-bit, it will change the behavior of a construct like the following: romsize = -1; if (romsize != -1) { ... } When -1 is assigned to rom

<    1   2   3   4   >