virtio: features,fixes
Subsystems (5)
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 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:
hw/pci: Replace -1 with UINT32_MAX for romsize (2024-07-02 11:27:19 -0400)
----------------------------------------------------------------
virtio: features,fixes
A bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now support VIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user, VHOST_USER_SET_LOG_BASE is now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixes
----------------------------------------------------------------
Akihiko Odaki (11):
hw/virtio: Free vqs after vhost_dev_cleanup() hw/pci: Rename has_power to enabled hw/ppc/spapr_pci: Do not create DT for disabled PCI device hw/ppc/spapr_pci: Do not reject VFs created after a PF
pcie_sriov: Do not manually unrealize
pcie_sriov: Ensure VF function number does not overflow
pcie_sriov: Reuse SR-IOV VF device instances
pcie_sriov: Release VFs failed to realize
pcie_sriov: Remove num_vfs from PCIESriovPF
pcie_sriov: Register VFs after migration
hw/pci: Replace -1 with UINT32_MAX for romsize
Alejandro Jimenez (1):
pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal
BillXiang (1):
vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests
Christian Pötzsch (1):
Fix vhost user assertion when sending more than one fd
Cindy Lu (1):
virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()
Cédric Le Goater (1):
virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged
David Woodhouse (1):
hw/i386/fw_cfg: Add etc/e820 to fw_cfg late
Dmitry Frolov (1):
hw/net/virtio-net.c: fix crash in iov_copy()
Fan Ni (12):
hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative and mailbox command support include/hw/cxl/cxl_device: Rename mem_size as static_mem_size for type3 memory devices hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument hw/mem/cxl_type3: Add host backend and address space handling for DC regions hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support
hw/mem/cxl_type3: Allow to release extent superset in QMP interface
Gregory Price (2):
hw/cxl/mailbox: change CCI cmd set structure to be a member, not a reference hw/cxl/mailbox: interface to add CCI commands to an existing CCI
Halil Pasic (1):
vhost-vsock: add VIRTIO_F_RING_PACKED to feature_bits
Ira Weiny (1):
hw/cxl: Fix read from bogus memory
Jiqian Chen (2):
virtio-pci: only reset pm state during resetting
virtio-pci: implement No_Soft_Reset bit
Jonah Palmer (5):
virtio/virtio-pci: Handle extra notification data
virtio: Prevent creation of device using notification-data with ioeventfd
virtio-mmio: Handle extra notification data
virtio-ccw: Handle extra notification data
vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits
Jonathan Cameron (2):
hw/cxl/events: Improve QMP interfaces and documentation for add/release dynamic capacity. hw/cxl/events: Mark cxl-add-dynamic-capacity and cxl-release-dynamic-capcity unstable
Li Feng (2):
Revert "vhost-user: fix lost reconnect"
vhost-user: fix lost reconnect again
Manos Pitsidianakis (1):
virtio-iommu: add error check before assert
Marc-André Lureau (1):
vhost-user-gpu: fix import of DMABUF
Nicolin Chen (2):
hw/arm/virt-acpi-build: Drop local iort_node_offset hw/arm/virt-acpi-build: Fix id_count in build_iort_id_mapping
Si-Wei Liu (2):
vhost: dirty log should be per backend type
vhost: Perform memory section dirty scans once per iteration
Stefano Garzarella (15):
vhost-vdpa: check vhost_vdpa_set_vring_ready() return value
qapi: clarify that the default is backend dependent
libvhost-user: set msg.msg_control to NULL when it is empty
libvhost-user: fail vu_message_write() if sendmsg() is failing
libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported
vhost-user-server: do not set memory fd non-blocking contrib/vhost-user-blk: fix bind() using the right size of the address contrib/vhost-user-*: use QEMU bswap helper functions
vhost-user: enable frontends on any POSIX system
libvhost-user: enable it on any POSIX system contrib/vhost-user-blk: enable it on any POSIX system
hostmem: add a new memory backend based on POSIX shm_open() tests/qtest/vhost-user-blk-test: use memory-backend-shm tests/qtest/vhost-user-test: add a test case for memory-backend-shm
virtio: remove virtio_tswap16s() call in vring_packed_event_read()
Sunil V L (12):
uefi-test-tools/UefiTestToolsPkg: Add RISC-V support
uefi-test-tools: Add support for python based build script tests/data/uefi-boot-images: Add RISC-V ISO image
qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them tests/qtest/bios-tables-test.c: Add support for arch in path tests/qtest/bios-tables-test.c: Set "arch" for aarch64 tests tests/qtest/bios-tables-test.c: Set "arch" for x86 tests tests/data/acpi: Move x86 ACPI tables under x86/${machine} path tests/data/acpi/virt: Move ARM64 ACPI tables under aarch64/${machine} path meson.build: Add RISC-V to the edk2-target list pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V
Thomas Huth (1):
hw/virtio: Fix the de-initialization of vhost-user devices
Thomas Weißschuh (6):
linux-headers: update to 6.10-rc1
hw/misc/pvpanic: centralize definition of supported events tests/qtest/pvpanic: use centralized definition of supported events hw/misc/pvpanic: add support for normal shutdowns tests/qtest/pvpanic: add tests for pvshutdown event Revert "docs/specs/pvpanic: mark shutdown event as not implemented"
Wafer (1):
hw/virtio: Fix obtain the buffer id from the last descriptor
Yuxue Liu (1):
vhost-user-test: no set non-blocking for cal fd less than 0.
Zhao Liu (1):
i386/apic: Add hint on boot failure because of disabling x2APIC
docs/pcie_sriov.txt | 8 +-
qapi/cxl.json | 189 ++++++
qapi/qom.json | 27 +-
qapi/run-state.json | 14 +
hw/i386/e820_memory_layout.h | 8 +-
hw/i386/fw_cfg.h | 1 +
include/hw/cxl/cxl_device.h | 85 ++-
include/hw/cxl/cxl_events.h | 18 +
include/hw/misc/pvpanic.h | 6 +
include/hw/pci/pci.h | 2 +-
include/hw/pci/pci_device.h | 17 +-
include/hw/pci/pcie_sriov.h | 9 +-
include/hw/virtio/vhost-user.h | 3 +-
include/hw/virtio/vhost.h | 1 +
include/hw/virtio/virtio-pci.h | 5 +
include/hw/virtio/virtio.h | 10 +-
include/standard-headers/linux/ethtool.h | 55 ++
include/standard-headers/linux/pci_regs.h | 6 +
include/standard-headers/linux/virtio_bt.h | 1 -
include/standard-headers/linux/virtio_mem.h | 2 +
include/standard-headers/linux/virtio_net.h | 143 +++++
include/standard-headers/misc/pvpanic.h | 7 +-
include/sysemu/runstate.h | 1 +
linux-headers/asm-generic/unistd.h | 5 +-
linux-headers/asm-mips/unistd_n32.h | 1 +
linux-headers/asm-mips/unistd_n64.h | 1 +
linux-headers/asm-mips/unistd_o32.h | 1 +
linux-headers/asm-powerpc/unistd_32.h | 1 +
linux-headers/asm-powerpc/unistd_64.h | 1 +
linux-headers/asm-s390/unistd_32.h | 1 +
linux-headers/asm-s390/unistd_64.h | 1 +
linux-headers/asm-x86/unistd_32.h | 1 +
linux-headers/asm-x86/unistd_64.h | 1 +
linux-headers/asm-x86/unistd_x32.h | 2 +
linux-headers/linux/kvm.h | 4 +-
linux-headers/linux/stddef.h | 8 +
subprojects/libvhost-user/libvhost-user.h | 2 +-
backends/hostmem-shm.c | 123 ++++
contrib/vhost-user-blk/vhost-user-blk.c | 27 +-
contrib/vhost-user-input/main.c | 16 +-
hw/arm/virt-acpi-build.c | 22 +-
hw/block/vhost-user-blk.c | 6 +-
hw/core/machine.c | 1 +
hw/cxl/cxl-mailbox-utils.c | 658 ++++++++++++++++++++-
hw/display/vhost-user-gpu.c | 5 +-
hw/i386/e820_memory_layout.c | 17 +-
hw/i386/fw_cfg.c | 18 +-
hw/i386/microvm.c | 4 +-
hw/i386/pc.c | 1 +
hw/intc/apic_common.c | 7 +-
hw/mem/cxl_type3.c | 637 ++++++++++++++++++--
hw/mem/cxl_type3_stubs.c | 25 +
hw/misc/pvpanic-isa.c | 3 +-
hw/misc/pvpanic-pci.c | 2 +-
hw/misc/pvpanic.c | 7 +-
hw/net/igb.c | 13 +-
hw/net/vhost_net.c | 7 +
hw/net/virtio-net.c | 4 +
hw/nvme/ctrl.c | 24 +-
hw/pci/pci.c | 29 +-
hw/pci/pci_host.c | 4 +-
hw/pci/pcie_sriov.c | 149 ++---
hw/ppc/spapr_pci.c | 8 +-
hw/s390x/s390-virtio-ccw.c | 17 +-
hw/scsi/vhost-scsi.c | 1 +
hw/scsi/vhost-user-scsi.c | 7 +-
hw/virtio/vhost-user-base.c | 7 +-
hw/virtio/vhost-user-fs.c | 2 +-
hw/virtio/vhost-user-vsock.c | 1 +
hw/virtio/vhost-user.c | 19 +-
hw/virtio/vhost-vsock-common.c | 1 +
hw/virtio/vhost.c | 112 +++-
hw/virtio/virtio-iommu.c | 43 ++
hw/virtio/virtio-mmio.c | 11 +-
hw/virtio/virtio-pci.c | 67 ++-
hw/virtio/virtio.c | 46 +-
hw/xen/xen_pt_load_rom.c | 2 +-
net/vhost-vdpa.c | 16 +-
subprojects/libvhost-user/libvhost-user.c | 79 ++-
system/runstate.c | 6 +
target/i386/kvm/kvm.c | 6 +-
target/i386/kvm/xen-emu.c | 7 +-
tests/qtest/bios-tables-test.c | 143 ++++-
tests/qtest/pvpanic-pci-test.c | 44 +-
tests/qtest/pvpanic-test.c | 34 +-
tests/qtest/vhost-user-blk-test.c | 2 +-
tests/qtest/vhost-user-test.c | 28 +-
util/vhost-user-server.c | 12 +
backends/meson.build | 1 +
docs/specs/pvpanic.rst | 2 +-
docs/system/devices/vhost-user.rst | 5 +-
hw/block/Kconfig | 2 +-
hw/pci/trace-events | 2 +-
meson.build | 7 +-
pc-bios/meson.build | 2 +
qemu-options.hx | 16 +
tests/data/acpi/{ => aarch64}/virt/APIC | Bin
.../data/acpi/{ => aarch64}/virt/APIC.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/APIC.topology | Bin
tests/data/acpi/{ => aarch64}/virt/DBG2 | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT | Bin
.../data/acpi/{ => aarch64}/virt/DSDT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT.pxb | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT.topology | Bin
tests/data/acpi/{ => aarch64}/virt/FACP | Bin
tests/data/acpi/{ => aarch64}/virt/GTDT | Bin
.../data/acpi/{ => aarch64}/virt/HMAT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/IORT | Bin
tests/data/acpi/{ => aarch64}/virt/MCFG | Bin
tests/data/acpi/{ => aarch64}/virt/NFIT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/PPTT | Bin
.../data/acpi/{ => aarch64}/virt/PPTT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/PPTT.topology | Bin
tests/data/acpi/{pc => aarch64/virt}/SLIT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/SPCR | Bin
.../data/acpi/{ => aarch64}/virt/SRAT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/SRAT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/SRAT.numamem | Bin
tests/data/acpi/{ => aarch64}/virt/SSDT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/VIOT | Bin
tests/data/acpi/rebuild-expected-aml.sh | 5 +-
tests/data/acpi/{ => x86}/microvm/APIC | Bin
tests/data/acpi/{ => x86}/microvm/APIC.ioapic2 | Bin
tests/data/acpi/{ => x86}/microvm/APIC.pcie | Bin
tests/data/acpi/{ => x86}/microvm/DSDT | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.ioapic2 | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.pcie | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.rtc | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.usb | Bin
tests/data/acpi/{ => x86}/microvm/ERST.pcie | Bin
tests/data/acpi/{ => x86}/microvm/FACP | Bin
tests/data/acpi/{ => x86}/pc/APIC | Bin
tests/data/acpi/{ => x86}/pc/APIC.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/APIC.cphp | Bin
tests/data/acpi/{ => x86}/pc/APIC.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/DSDT | Bin
tests/data/acpi/{ => x86}/pc/DSDT.acpierst | Bin
tests/data/acpi/{ => x86}/pc/DSDT.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/DSDT.bridge | Bin
tests/data/acpi/{ => x86}/pc/DSDT.cphp | Bin
tests/data/acpi/{ => x86}/pc/DSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/DSDT.hpbridge | Bin
tests/data/acpi/{ => x86}/pc/DSDT.hpbrroot | Bin
tests/data/acpi/{ => x86}/pc/DSDT.ipmikcs | Bin
tests/data/acpi/{ => x86}/pc/DSDT.memhp | Bin
tests/data/acpi/{ => x86}/pc/DSDT.nohpet | Bin
tests/data/acpi/{ => x86}/pc/DSDT.numamem | Bin
tests/data/acpi/{ => x86}/pc/DSDT.roothp | Bin
tests/data/acpi/{ => x86}/pc/ERST.acpierst | Bin
tests/data/acpi/{ => x86}/pc/FACP | Bin
tests/data/acpi/{ => x86}/pc/FACP.nosmm | Bin
tests/data/acpi/{ => x86}/pc/FACS | Bin
tests/data/acpi/{ => x86}/pc/HMAT.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/HPET | Bin
tests/data/acpi/{ => x86}/pc/NFIT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/SLIT.cphp | Bin
tests/data/acpi/{q35 => x86/pc}/SLIT.memhp | Bin
tests/data/acpi/{ => x86}/pc/SRAT.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/SRAT.cphp | Bin
tests/data/acpi/{ => x86}/pc/SRAT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/SRAT.memhp | Bin
tests/data/acpi/{ => x86}/pc/SRAT.numamem | Bin
tests/data/acpi/{ => x86}/pc/SSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/WAET | Bin
tests/data/acpi/{ => x86}/q35/APIC | Bin
tests/data/acpi/{ => x86}/q35/APIC.acpihmat | Bin
.../acpi/{ => x86}/q35/APIC.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/APIC.core-count | Bin
tests/data/acpi/{ => x86}/q35/APIC.core-count2 | Bin
tests/data/acpi/{ => x86}/q35/APIC.cphp | Bin
tests/data/acpi/{ => x86}/q35/APIC.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/APIC.thread-count | Bin
tests/data/acpi/{ => x86}/q35/APIC.thread-count2 | Bin
tests/data/acpi/{ => x86}/q35/APIC.type4-count | Bin
tests/data/acpi/{ => x86}/q35/APIC.xapic | Bin
tests/data/acpi/{ => x86}/q35/CEDT.cxl | Bin
tests/data/acpi/{ => x86}/q35/DMAR.dmar | Bin
tests/data/acpi/{ => x86}/q35/DSDT | Bin
tests/data/acpi/{ => x86}/q35/DSDT.acpierst | Bin
tests/data/acpi/{ => x86}/q35/DSDT.acpihmat | Bin
.../acpi/{ => x86}/q35/DSDT.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/DSDT.applesmc | Bin
tests/data/acpi/{ => x86}/q35/DSDT.bridge | Bin
tests/data/acpi/{ => x86}/q35/DSDT.core-count | Bin
tests/data/acpi/{ => x86}/q35/DSDT.core-count2 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.cphp | Bin
tests/data/acpi/{ => x86}/q35/DSDT.cxl | Bin
tests/data/acpi/{ => x86}/q35/DSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/DSDT.ipmibt | Bin
tests/data/acpi/{ => x86}/q35/DSDT.ipmismbus | Bin
tests/data/acpi/{ => x86}/q35/DSDT.ivrs | Bin
tests/data/acpi/{ => x86}/q35/DSDT.memhp | Bin
tests/data/acpi/{ => x86}/q35/DSDT.mmio64 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.multi-bridge | Bin
tests/data/acpi/{ => x86}/q35/DSDT.noacpihp | Bin
tests/data/acpi/{ => x86}/q35/DSDT.nohpet | Bin
tests/data/acpi/{ => x86}/q35/DSDT.numamem | Bin
tests/data/acpi/{ => x86}/q35/DSDT.pvpanic-isa | Bin
tests/data/acpi/{ => x86}/q35/DSDT.thread-count | Bin
tests/data/acpi/{ => x86}/q35/DSDT.thread-count2 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm12 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm2 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.type4-count | Bin
tests/data/acpi/{ => x86}/q35/DSDT.viot | Bin
tests/data/acpi/{ => x86}/q35/DSDT.xapic | Bin
tests/data/acpi/{ => x86}/q35/ERST.acpierst | Bin
tests/data/acpi/{ => x86}/q35/FACP | Bin
tests/data/acpi/{ => x86}/q35/FACP.core-count | Bin
tests/data/acpi/{ => x86}/q35/FACP.core-count2 | Bin
tests/data/acpi/{ => x86}/q35/FACP.nosmm | Bin
tests/data/acpi/{ => x86}/q35/FACP.slic | Bin
tests/data/acpi/{ => x86}/q35/FACP.thread-count | Bin
tests/data/acpi/{ => x86}/q35/FACP.thread-count2 | Bin
tests/data/acpi/{ => x86}/q35/FACP.type4-count | Bin
tests/data/acpi/{ => x86}/q35/FACP.xapic | Bin
tests/data/acpi/{ => x86}/q35/FACS | Bin
tests/data/acpi/{ => x86}/q35/HMAT.acpihmat | Bin
.../acpi/{ => x86}/q35/HMAT.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/HPET | Bin
tests/data/acpi/{ => x86}/q35/IVRS.ivrs | Bin
tests/data/acpi/{ => x86}/q35/MCFG | Bin
tests/data/acpi/{ => x86}/q35/NFIT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/SLIC.slic | Bin
tests/data/acpi/{ => x86}/q35/SLIT.cphp | Bin
tests/data/acpi/{virt => x86/q35}/SLIT.memhp | Bin
tests/data/acpi/{ => x86}/q35/SRAT.acpihmat | Bin
.../acpi/{ => x86}/q35/SRAT.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/SRAT.cphp | Bin
tests/data/acpi/{ => x86}/q35/SRAT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/SRAT.memhp | Bin
tests/data/acpi/{ => x86}/q35/SRAT.mmio64 | Bin
tests/data/acpi/{ => x86}/q35/SRAT.numamem | Bin
tests/data/acpi/{ => x86}/q35/SRAT.xapic | Bin
tests/data/acpi/{ => x86}/q35/SSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/TCPA.tis.tpm12 | Bin
tests/data/acpi/{ => x86}/q35/TPM2.tis.tpm2 | Bin
tests/data/acpi/{ => x86}/q35/VIOT.viot | Bin
tests/data/acpi/{ => x86}/q35/WAET | Bin
.../bios-tables-test.riscv64.iso.qcow2 | Bin 0 -> 16896 bytes
tests/qtest/meson.build | 3 +
tests/uefi-test-tools/Makefile | 19 +-
.../UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +-
tests/uefi-test-tools/uefi-test-build.config | 52 ++
util/meson.build | 4 +-
245 files changed, 2933 insertions(+), 371 deletions(-)
create mode 100644 backends/hostmem-shm.c
rename tests/data/acpi/{ => aarch64}/virt/APIC (100%)
rename tests/data/acpi/{ => aarch64}/virt/APIC.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/APIC.topology (100%)
rename tests/data/acpi/{ => aarch64}/virt/DBG2 (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.pxb (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.topology (100%)
rename tests/data/acpi/{ => aarch64}/virt/FACP (100%)
rename tests/data/acpi/{ => aarch64}/virt/GTDT (100%)
rename tests/data/acpi/{ => aarch64}/virt/HMAT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/IORT (100%)
rename tests/data/acpi/{ => aarch64}/virt/MCFG (100%)
rename tests/data/acpi/{ => aarch64}/virt/NFIT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/PPTT (100%)
rename tests/data/acpi/{ => aarch64}/virt/PPTT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/PPTT.topology (100%)
rename tests/data/acpi/{pc => aarch64/virt}/SLIT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/SPCR (100%)
rename tests/data/acpi/{ => aarch64}/virt/SRAT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/SRAT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/SRAT.numamem (100%)
rename tests/data/acpi/{ => aarch64}/virt/SSDT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/VIOT (100%)
rename tests/data/acpi/{ => x86}/microvm/APIC (100%)
rename tests/data/acpi/{ => x86}/microvm/APIC.ioapic2 (100%)
rename tests/data/acpi/{ => x86}/microvm/APIC.pcie (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.ioapic2 (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.pcie (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.rtc (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.usb (100%)
rename tests/data/acpi/{ => x86}/microvm/ERST.pcie (100%)
rename tests/data/acpi/{ => x86}/microvm/FACP (100%)
rename tests/data/acpi/{ => x86}/pc/APIC (100%)
rename tests/data/acpi/{ => x86}/pc/APIC.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/APIC.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/APIC.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.acpierst (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.bridge (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.hpbridge (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.hpbrroot (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.ipmikcs (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.memhp (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.nohpet (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.numamem (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.roothp (100%)
rename tests/data/acpi/{ => x86}/pc/ERST.acpierst (100%)
rename tests/data/acpi/{ => x86}/pc/FACP (100%)
rename tests/data/acpi/{ => x86}/pc/FACP.nosmm (100%)
rename tests/data/acpi/{ => x86}/pc/FACS (100%)
rename tests/data/acpi/{ => x86}/pc/HMAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/HPET (100%)
rename tests/data/acpi/{ => x86}/pc/NFIT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/SLIT.cphp (100%)
rename tests/data/acpi/{q35 => x86/pc}/SLIT.memhp (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.memhp (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.numamem (100%)
rename tests/data/acpi/{ => x86}/pc/SSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/WAET (100%)
rename tests/data/acpi/{ => x86}/q35/APIC (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.core-count (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.core-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.thread-count (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.thread-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.type4-count (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/CEDT.cxl (100%)
rename tests/data/acpi/{ => x86}/q35/DMAR.dmar (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.acpierst (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.applesmc (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.bridge (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.core-count (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.core-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.cxl (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.ipmibt (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.ipmismbus (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.ivrs (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.memhp (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.mmio64 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.multi-bridge (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.noacpihp (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.nohpet (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.numamem (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.pvpanic-isa (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.thread-count (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.thread-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm12 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm2 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.type4-count (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.viot (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/ERST.acpierst (100%)
rename tests/data/acpi/{ => x86}/q35/FACP (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.core-count (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.core-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.nosmm (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.slic (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.thread-count (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.thread-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.type4-count (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/FACS (100%)
rename tests/data/acpi/{ => x86}/q35/HMAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/HMAT.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/HPET (100%)
rename tests/data/acpi/{ => x86}/q35/IVRS.ivrs (100%)
rename tests/data/acpi/{ => x86}/q35/MCFG (100%)
rename tests/data/acpi/{ => x86}/q35/NFIT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/SLIC.slic (100%)
rename tests/data/acpi/{ => x86}/q35/SLIT.cphp (100%)
rename tests/data/acpi/{virt => x86/q35}/SLIT.memhp (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.memhp (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.mmio64 (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.numamem (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/SSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/TCPA.tis.tpm12 (100%)
rename tests/data/acpi/{ => x86}/q35/TPM2.tis.tpm2 (100%)
rename tests/data/acpi/{ => x86}/q35/VIOT.viot (100%)
rename tests/data/acpi/{ => x86}/q35/WAET (100%)
create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2
create mode 100644 tests/uefi-test-tools/uefi-test-build.config[PULL v2 08/88] vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits
From: Jonah Palmer <[email protected]>
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 it can be disabled if the backend does not support it.
Message-Id: <[email protected]>
--- hw/block/vhost-user-blk.c | 1 + hw/net/vhost_net.c | 2 ++ hw/scsi/vhost-scsi.c | 1 + hw/scsi/vhost-user-scsi.c | 1 + hw/virtio/vhost-user-fs.c | 2 +- hw/virtio/vhost-user-vsock.c | 1 + net/vhost-vdpa.c | 1 + 7 files changed, 8 insertions(+), 1 deletion(-)
hw/block/vhost-user-blk.c +1 -0
@@ -51,6 +51,7 @@ static const int user_feature_bits[] = {VIRTIO_F_RING_PACKED ,VIRTIO_F_IOMMU_PLATFORM ,VIRTIO_F_RING_RESET , +VIRTIO_F_NOTIFICATION_DATA , VHOST_INVALID_FEATURE_BIT };
hw/net/vhost_net.c +2 -0
@@ -48,6 +48,7 @@ static const int kernel_feature_bits[] = {VIRTIO_F_IOMMU_PLATFORM ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_NET_F_HASH_REPORT , VHOST_INVALID_FEATURE_BIT };
@@ -55,6 +56,7 @@ static const int kernel_feature_bits[] = {/* Features supported by others. */ static const int user_feature_bits[] = {VIRTIO_F_NOTIFY_ON_EMPTY , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_RING_F_INDIRECT_DESC ,VIRTIO_RING_F_EVENT_IDX ,
hw/scsi/vhost-scsi.c +1 -0
@@ -38,6 +38,7 @@ static const int kernel_feature_bits[] = {VIRTIO_RING_F_EVENT_IDX ,VIRTIO_SCSI_F_HOTPLUG ,VIRTIO_F_RING_RESET , +VIRTIO_F_NOTIFICATION_DATA , VHOST_INVALID_FEATURE_BIT };
hw/scsi/vhost-user-scsi.c +1 -0
@@ -36,6 +36,7 @@ static const int user_feature_bits[] = {VIRTIO_RING_F_EVENT_IDX ,VIRTIO_SCSI_F_HOTPLUG ,VIRTIO_F_RING_RESET , +VIRTIO_F_NOTIFICATION_DATA , VHOST_INVALID_FEATURE_BIT };
hw/virtio/vhost-user-fs.c +1 -1
@@ -33,7 +33,7 @@ static const int user_feature_bits[] = {VIRTIO_F_RING_PACKED ,VIRTIO_F_IOMMU_PLATFORM ,VIRTIO_F_RING_RESET , - +VIRTIO_F_NOTIFICATION_DATA , VHOST_INVALID_FEATURE_BIT };
hw/virtio/vhost-user-vsock.c +1 -0
@@ -21,6 +21,7 @@ static const int user_feature_bits[] = {VIRTIO_RING_F_INDIRECT_DESC ,VIRTIO_RING_F_EVENT_IDX ,VIRTIO_F_NOTIFY_ON_EMPTY , +VIRTIO_F_NOTIFICATION_DATA , VHOST_INVALID_FEATURE_BIT };
net/vhost-vdpa.c +1 -0
@@ -62,6 +62,7 @@ const int vdpa_feature_bits[] = {VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET ,VIRTIO_F_VERSION_1 , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_NET_F_CSUM ,VIRTIO_NET_F_CTRL_GUEST_OFFLOADS , VIRTIO_NET_F_CTRL_MAC_ADDR,
Signature · 1 line
MST
[PULL v2 03/88] vhost-vdpa: check vhost_vdpa_set_vring_ready() return value
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
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 value anyway.
[1] https://lore.kernel.org/virtualization/[email protected]/T/#u
Message-Id: <[email protected]>
--- net/vhost-vdpa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
net/vhost-vdpa.c +12 -3
@@ -399,7 +399,10 @@ static int vhost_vdpa_net_data_load(NetClientState *nc) }for (int i =0 ; i < v->dev->nvqs; ++i) { -vhost_vdpa_set_vring_ready (v, i + v->dev->vq_index); +int ret =vhost_vdpa_set_vring_ready (v, i + v->dev->vq_index); +if (ret <0 ) { +return ret; + } }return 0 ; }
@@ -1238,7 +1241,10 @@ static int vhost_vdpa_net_cvq_load(NetClientState *nc)assert (nc->info->type ==NET_CLIENT_DRIVER_VHOST_VDPA ); -vhost_vdpa_set_vring_ready (v, v->dev->vq_index); + r =vhost_vdpa_set_vring_ready (v, v->dev->vq_index); +if (unlikely (r <0 )) { +return r; + }if (v->shadow_vqs_enabled) { n =VIRTIO_NET (v->dev->vdev);
@@ -1277,7 +1283,10 @@ static int vhost_vdpa_net_cvq_load(NetClientState *nc) }for (int i =0 ; i < v->dev->vq_index; ++i) { -vhost_vdpa_set_vring_ready (v, i); + r =vhost_vdpa_set_vring_ready (v, i); +if (unlikely (r <0 )) { +return r; + } }return 0 ;
Signature · 1 line
MST
[PULL v2 30/88] linux-headers: update to 6.10-rc1
In reply to Michael S. TsirkinFrom: Thomas Weißschuh <[email protected]>
Message-Id: <[email protected]>
--- include/standard-headers/linux/ethtool.h | 55 ++++++++ include/standard-headers/linux/pci_regs.h | 6 + include/standard-headers/linux/virtio_bt.h | 1 - include/standard-headers/linux/virtio_mem.h | 2 + include/standard-headers/linux/virtio_net.h | 143 ++++++++++++++++++++ include/standard-headers/misc/pvpanic.h | 7 +- linux-headers/asm-generic/unistd.h | 5 +- linux-headers/asm-mips/unistd_n32.h | 1 + linux-headers/asm-mips/unistd_n64.h | 1 + linux-headers/asm-mips/unistd_o32.h | 1 + linux-headers/asm-powerpc/unistd_32.h | 1 + linux-headers/asm-powerpc/unistd_64.h | 1 + linux-headers/asm-s390/unistd_32.h | 1 + linux-headers/asm-s390/unistd_64.h | 1 + linux-headers/asm-x86/unistd_32.h | 1 + linux-headers/asm-x86/unistd_64.h | 1 + linux-headers/asm-x86/unistd_x32.h | 2 + linux-headers/linux/kvm.h | 4 +- linux-headers/linux/stddef.h | 8 ++ 19 files changed, 236 insertions(+), 6 deletions(-)
include/standard-headers/linux/ethtool.h +55 -0
@@ -752,6 +752,61 @@ enum ethtool_module_power_mode { ETHTOOL_MODULE_POWER_MODE_HIGH, }; +/** +* enum ethtool_pse_types - Types of PSE controller. +* @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown +* @ETHTOOL_PSE_PODL: PSE controller which support PoDL +* @ETHTOOL_PSE_C33: PSE controller which support Clause 33 (PoE) +*/ +enum ethtool_pse_types { +ETHTOOL_PSE_UNKNOWN =1 <<0 , +ETHTOOL_PSE_PODL =1 <<1 , +ETHTOOL_PSE_C33 =1 <<2 , +}; + +/** +* enum ethtool_c33_pse_admin_state - operational state of the PoDL PSE +* functions. IEEE 802.3-2022 30.9.1.1.2 aPSEAdminState +* @ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN: state of PSE functions is unknown +* @ETHTOOL_C33_PSE_ADMIN_STATE_DISABLED: PSE functions are disabled +* @ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED: PSE functions are enabled +*/ +enum ethtool_c33_pse_admin_state { +ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN =1 , +ETHTOOL_C33_PSE_ADMIN_STATE_DISABLED , +ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED , +}; + +/** +* enum ethtool_c33_pse_pw_d_status - power detection status of the PSE. +* IEEE 802.3-2022 30.9.1.1.3 aPoDLPSEPowerDetectionStatus: +* @ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN: PSE status is unknown +* @ETHTOOL_C33_PSE_PW_D_STATUS_DISABLED: The enumeration "disabled" +* indicates that the PSE State diagram is in the state DISABLED. +* @ETHTOOL_C33_PSE_PW_D_STATUS_SEARCHING: The enumeration "searching" +* indicates the PSE State diagram is in a state other than those +* listed. +* @ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING: The enumeration +* "deliveringPower" indicates that the PSE State diagram is in the +* state POWER_ON. +* @ETHTOOL_C33_PSE_PW_D_STATUS_TEST: The enumeration "test" indicates that +* the PSE State diagram is in the state TEST_MODE. +* @ETHTOOL_C33_PSE_PW_D_STATUS_FAULT: The enumeration "fault" indicates that +* the PSE State diagram is in the state TEST_ERROR. +* @ETHTOOL_C33_PSE_PW_D_STATUS_OTHERFAULT: The enumeration "otherFault" +* indicates that the PSE State diagram is in the state IDLE due to +* the variable error_condition = true. +*/ +enum ethtool_c33_pse_pw_d_status { +ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN =1 , +ETHTOOL_C33_PSE_PW_D_STATUS_DISABLED , +ETHTOOL_C33_PSE_PW_D_STATUS_SEARCHING , +ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING , +ETHTOOL_C33_PSE_PW_D_STATUS_TEST , +ETHTOOL_C33_PSE_PW_D_STATUS_FAULT , +ETHTOOL_C33_PSE_PW_D_STATUS_OTHERFAULT , +}; +/** * enum ethtool_podl_pse_admin_state - operational state of the PoDL PSE * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState
include/standard-headers/linux/pci_regs.h +6 -0
@@ -1144,8 +1144,14 @@#define PCI_DOE_DATA_OBJECT_HEADER_2_LENGTH 0x0003ffff#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff +#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_VER 0x0000ff00#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000 +/* Compute Express Link (CXL r3.1, sec 8.1.5) */ +#define PCI_DVSEC_CXL_PORT 3 +#define PCI_DVSEC_CXL_PORT_CTL 0x0c +#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001 +#endif /* LINUX_PCI_REGS_H */
include/standard-headers/linux/virtio_bt.h +0 -1
@@ -13,7 +13,6 @@enum virtio_bt_config_type {VIRTIO_BT_CONFIG_TYPE_PRIMARY =0 , -VIRTIO_BT_CONFIG_TYPE_AMP =1 , };enum virtio_bt_config_vendor {
include/standard-headers/linux/virtio_mem.h +2 -0
@@ -90,6 +90,8 @@#define VIRTIO_MEM_F_ACPI_PXM 0/* unplugged memory must not be accessed */ #define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1 +/* plugged memory will remain plugged when suspending+resuming */ +#define VIRTIO_MEM_F_PERSISTENT_SUSPEND 2/* --- virtio-mem: guest -> host requests --- */
include/standard-headers/linux/virtio_net.h +143 -0
153 lines not on this page · raw message
include/standard-headers/misc/pvpanic.h +5 -2
@@ -3,7 +3,10 @@#ifndef __PVPANIC_H__#define __PVPANIC_H__ -#define PVPANIC_PANICKED (1 << 0) -#define PVPANIC_CRASH_LOADED (1 << 1) +#include "standard-headers/linux/const.h" + +#define PVPANIC_PANICKED _BITUL(0) +#define PVPANIC_CRASH_LOADED _BITUL(1) +#define PVPANIC_SHUTDOWN _BITUL(2)#endif /* __PVPANIC_H__ */
linux-headers/asm-generic/unistd.h +4 -1
@@ -842,8 +842,11 @@ __SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)#define __NR_lsm_list_modules 461 __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) +#define __NR_mseal 462 +__SYSCALL(__NR_mseal, sys_mseal) +#undef __NR_syscalls -#define __NR_syscalls 462 +#define __NR_syscalls 463/* * 32 bit systems traditionally used different
linux-headers/asm-mips/unistd_n32.h +1 -0
@@ -390,5 +390,6 @@#define __NR_lsm_get_self_attr (__NR_Linux + 459)#define __NR_lsm_set_self_attr (__NR_Linux + 460)#define __NR_lsm_list_modules (__NR_Linux + 461) +#define __NR_mseal (__NR_Linux + 462)#endif /* _ASM_UNISTD_N32_H */
linux-headers/asm-mips/unistd_n64.h +1 -0
@@ -366,5 +366,6 @@#define __NR_lsm_get_self_attr (__NR_Linux + 459)#define __NR_lsm_set_self_attr (__NR_Linux + 460)#define __NR_lsm_list_modules (__NR_Linux + 461) +#define __NR_mseal (__NR_Linux + 462)#endif /* _ASM_UNISTD_N64_H */
linux-headers/asm-mips/unistd_o32.h +1 -0
@@ -436,5 +436,6 @@#define __NR_lsm_get_self_attr (__NR_Linux + 459)#define __NR_lsm_set_self_attr (__NR_Linux + 460)#define __NR_lsm_list_modules (__NR_Linux + 461) +#define __NR_mseal (__NR_Linux + 462)#endif /* _ASM_UNISTD_O32_H */
linux-headers/asm-powerpc/unistd_32.h +1 -0
@@ -443,6 +443,7 @@#define __NR_lsm_get_self_attr 459#define __NR_lsm_set_self_attr 460#define __NR_lsm_list_modules 461 +#define __NR_mseal 462#endif /* _ASM_UNISTD_32_H */
linux-headers/asm-powerpc/unistd_64.h +1 -0
@@ -415,6 +415,7 @@#define __NR_lsm_get_self_attr 459#define __NR_lsm_set_self_attr 460#define __NR_lsm_list_modules 461 +#define __NR_mseal 462#endif /* _ASM_UNISTD_64_H */
linux-headers/asm-s390/unistd_32.h +1 -0
@@ -434,5 +434,6 @@#define __NR_lsm_get_self_attr 459#define __NR_lsm_set_self_attr 460#define __NR_lsm_list_modules 461 +#define __NR_mseal 462#endif /* _ASM_S390_UNISTD_32_H */
linux-headers/asm-s390/unistd_64.h +1 -0
@@ -382,5 +382,6 @@#define __NR_lsm_get_self_attr 459#define __NR_lsm_set_self_attr 460#define __NR_lsm_list_modules 461 +#define __NR_mseal 462#endif /* _ASM_S390_UNISTD_64_H */
linux-headers/asm-x86/unistd_32.h +1 -0
@@ -452,6 +452,7 @@#define __NR_lsm_get_self_attr 459#define __NR_lsm_set_self_attr 460#define __NR_lsm_list_modules 461 +#define __NR_mseal 462#endif /* _ASM_UNISTD_32_H */
linux-headers/asm-x86/unistd_64.h +1 -0
@@ -374,6 +374,7 @@#define __NR_lsm_get_self_attr 459#define __NR_lsm_set_self_attr 460#define __NR_lsm_list_modules 461 +#define __NR_mseal 462#endif /* _ASM_UNISTD_64_H */
linux-headers/asm-x86/unistd_x32.h +2 -0
@@ -318,6 +318,7 @@#define __NR_set_mempolicy_home_node (__X32_SYSCALL_BIT + 450)#define __NR_cachestat (__X32_SYSCALL_BIT + 451)#define __NR_fchmodat2 (__X32_SYSCALL_BIT + 452) +#define __NR_map_shadow_stack (__X32_SYSCALL_BIT + 453)#define __NR_futex_wake (__X32_SYSCALL_BIT + 454)#define __NR_futex_wait (__X32_SYSCALL_BIT + 455)#define __NR_futex_requeue (__X32_SYSCALL_BIT + 456)
@@ -326,6 +327,7 @@#define __NR_lsm_get_self_attr (__X32_SYSCALL_BIT + 459)#define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460)#define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461) +#define __NR_mseal (__X32_SYSCALL_BIT + 462)#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
linux-headers/linux/kvm.h +2 -2
@@ -1217,9 +1217,9 @@ struct kvm_vfio_spapr_tce {/* Available with KVM_CAP_SPAPR_RESIZE_HPT */ #define KVM_PPC_RESIZE_HPT_PREPARE _IOR(KVMIO, 0xad, struct kvm_ppc_resize_hpt)#define KVM_PPC_RESIZE_HPT_COMMIT _IOR(KVMIO, 0xae, struct kvm_ppc_resize_hpt) -/* Available with KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3 */ +/* Available with KVM_CAP_PPC_MMU_RADIX or KVM_CAP_PPC_MMU_HASH_V3 */ #define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg) -/* Available with KVM_CAP_PPC_RADIX_MMU */ +/* Available with KVM_CAP_PPC_MMU_RADIX */ #define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)/* Available with KVM_CAP_PPC_GET_CPU_CHAR */ #define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
linux-headers/linux/stddef.h +8 -0
@@ -55,4 +55,12 @@#define __counted_by (m)#endif +#ifndef __counted_by_le +#define __counted_by_le (m) +#endif + +#ifndef __counted_by_be +#define __counted_by_be (m) +#endif +#endif /* _LINUX_STDDEF_H */
Signature · 1 line
MST
[PULL v2 15/88] vhost-user: fix lost reconnect again
In reply to Michael S. TsirkinFrom: Li Feng <[email protected]>
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 called immediately.
vhost_dev_cleanup calls 'memset(hdev, 0, sizeof(struct vhost_dev))'.
The reconnect path is:vhost_user_blk_event
vhost_user_async_close(.. vhost_user_blk_disconnect ..)
qemu_chr_fe_set_handlers <----- clear the notifier callback
schedule vhost_user_async_close_bh
The vhost->vdev is null, so the vhost_user_blk_disconnect will not be called, then the event fd callback will not be reinstalled.
We need to ensure that even if vhost_dev_init initialization fails, the event handler still needs to be reinstalled when s->connected is false.
All vhost-user devices have this issue, including vhost-user-blk/scsi.
Message-Id: <[email protected]>
--- hw/block/vhost-user-blk.c | 3 ++- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-base.c | 3 ++- hw/virtio/vhost-user.c | 10 +--------- 4 files changed, 7 insertions(+), 12 deletions(-)
hw/block/vhost-user-blk.c +2 -1
@@ -354,7 +354,7 @@ static void vhost_user_blk_disconnect(DeviceState *dev)VHostUserBlk *s =VHOST_USER_BLK (vdev);if (!s->connected) { -return ; + goto done; } s->connected = false;
@@ -362,6 +362,7 @@ static void vhost_user_blk_disconnect(DeviceState *dev)vhost_dev_cleanup (&s->dev); +done:/* Re-instate the event handler for new connections */ qemu_chr_fe_set_handlers (&s->chardev,NULL ,NULL , vhost_user_blk_event,NULL , dev,NULL , true);
hw/scsi/vhost-user-scsi.c +2 -1
@@ -182,7 +182,7 @@ static void vhost_user_scsi_disconnect(DeviceState *dev)VirtIOSCSICommon *vs =VIRTIO_SCSI_COMMON (dev);if (!s->connected) { -return ; + goto done; } s->connected = false;
@@ -190,6 +190,7 @@ static void vhost_user_scsi_disconnect(DeviceState *dev)vhost_dev_cleanup (&vsc->dev); +done:/* Re-instate the event handler for new connections */ qemu_chr_fe_set_handlers (&vs->conf.chardev,NULL ,NULL , vhost_user_scsi_event,NULL , dev,NULL , true);
hw/virtio/vhost-user-base.c +2 -1
@@ -225,13 +225,14 @@ static void vub_disconnect(DeviceState *dev)VHostUserBase *vub =VHOST_USER_BASE (vdev);if (!vub->connected) { -return ; + goto done; } vub->connected = false;vub_stop (vdev);vhost_dev_cleanup (&vub->vhost_dev); +done:/* Re-instate the event handler for new connections */ qemu_chr_fe_set_handlers(&vub->chardev, NULL, NULL, vub_event,
hw/virtio/vhost-user.c +1 -9
@@ -2781,16 +2781,8 @@ typedef struct {static void vhost_user_async_close_bh (void *opaque) {VhostAsyncCallback *data = opaque; -struct vhost_dev *vhost = data->vhost; -/* -* If the vhost_dev has been cleared in the meantime there is -* nothing left to do as some other path has completed the -* cleanup. -*/ -if (vhost->vdev) { - data->cb (data->dev); - } + data->cb (data->dev);g_free (data); }
Signature · 1 line
MST
[PULL v2 10/88] vhost-vsock: add VIRTIO_F_RING_PACKED to feature_bits
In reply to Michael S. TsirkinFrom: Halil Pasic <[email protected]>
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 kernel vhost-vsock device does not support the packed queue layout (as vhost does not support packed), and does not offer VIRTIO_F_RING_PACKED. Thus when for example a vhost-vsock-ccw is used with packed=on, VIRTIO_F_RING_PACKED ends up being negotiated, despite the fact that the device does not actually support it, and one gets to keep the pieces.
Message-Id: <[email protected]>
--- hw/virtio/vhost-vsock-common.c | 1 + 1 file changed, 1 insertion(+)
hw/virtio/vhost-vsock-common.c +1 -0
@@ -22,6 +22,7 @@const int feature_bits[] = {VIRTIO_VSOCK_F_SEQPACKET ,VIRTIO_F_RING_RESET , +VIRTIO_F_RING_PACKED ,VHOST_INVALID_FEATURE_BIT };
Signature · 1 line
MST
[PULL v2 20/88] include/hw/cxl/cxl_device: Rename mem_size as static_mem_size for type3 memory devices
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 2 +- hw/cxl/cxl-mailbox-utils.c | 4 ++-- hw/mem/cxl_type3.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-)
include/hw/cxl/cxl_device.h +1 -1
@@ -234,7 +234,7 @@ typedef struct cxl_device_state { } timestamp;/* memory region size, HDM */ -uint64_t mem_size; +uint64_t static_mem_size;uint64_t pmem_size;uint64_t vmem_size;
hw/cxl/cxl-mailbox-utils.c +2 -2
@@ -803,7 +803,7 @@ static CXLRetCode cmd_identify_memory_device(const struct cxl_cmd *cmd,snprintf (id->fw_revision,0x10 ,"BWFW VERSION %02d" ,0 );stq_le_p (&id->total_capacity, - cxl_dstate->mem_size /CXL_CAPACITY_MULTIPLIER ); + cxl_dstate->static_mem_size /CXL_CAPACITY_MULTIPLIER );stq_le_p (&id->persistent_capacity, cxl_dstate->pmem_size /CXL_CAPACITY_MULTIPLIER ); stq_le_p(&id->volatile_capacity,
@@ -1179,7 +1179,7 @@ static CXLRetCode cmd_media_clear_poison(const struct cxl_cmd *cmd,struct clear_poison_pl *in = (void *)payload_in; dpa =ldq_le_p (&in->dpa); -if (dpa +CXL_CACHE_LINE_SIZE > cxl_dstate->mem_size) { +if (dpa +CXL_CACHE_LINE_SIZE > cxl_dstate->static_mem_size) {return CXL_MBOX_INVALID_PA ; }
hw/mem/cxl_type3.c +4 -4
@@ -608,7 +608,7 @@ static bool cxl_setup_memory(CXLType3Dev *ct3d, Error **errp) }address_space_init (&ct3d->hostvmem_as, vmr, v_name); ct3d->cxl_dstate.vmem_size =memory_region_size (vmr); - ct3d->cxl_dstate.mem_size +=memory_region_size (vmr); + ct3d->cxl_dstate.static_mem_size +=memory_region_size (vmr);g_free (v_name); }
@@ -631,7 +631,7 @@ static bool cxl_setup_memory(CXLType3Dev *ct3d, Error **errp) }address_space_init (&ct3d->hostpmem_as, pmr, p_name); ct3d->cxl_dstate.pmem_size =memory_region_size (pmr); - ct3d->cxl_dstate.mem_size +=memory_region_size (pmr); + ct3d->cxl_dstate.static_mem_size +=memory_region_size (pmr);g_free (p_name); }
@@ -837,7 +837,7 @@ static int cxl_type3_hpa_to_as_and_dpa(CXLType3Dev *ct3d,return -EINVAL ; } -if (*dpa_offset > ct3d->cxl_dstate.mem_size) { +if (*dpa_offset > ct3d->cxl_dstate.static_mem_size) {return -EINVAL ; }
@@ -1010,7 +1010,7 @@ static bool set_cacheline(CXLType3Dev *ct3d, uint64_t dpa_offset, uint8_t *data)return false; } -if (dpa_offset +CXL_CACHE_LINE_SIZE > ct3d->cxl_dstate.mem_size) { +if (dpa_offset +CXL_CACHE_LINE_SIZE > ct3d->cxl_dstate.static_mem_size) {return false; }
Signature · 1 line
MST
[PULL v2 12/88] virtio-pci: only reset pm state during resetting
In reply to Michael S. TsirkinFrom: Jiqian Chen <[email protected]>
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.
Only state of PM_CTRL is writable.
Only when flag VIRTIO_PCI_FLAG_INIT_PM is set, need to reset state.
Message-Id: <[email protected]>
--- hw/virtio/virtio-pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
hw/virtio/virtio-pci.c +7 -1
@@ -2306,10 +2306,16 @@ static void virtio_pci_bus_reset_hold(Object *obj, ResetType type)virtio_pci_reset (qdev);if (pci_is_express (dev)) { +VirtIOPCIProxy *proxy =VIRTIO_PCI (dev); +pcie_cap_deverr_reset (dev);pcie_cap_lnkctl_reset (dev); -pci_set_word (dev->config + dev->exp.pm_cap +PCI_PM_CTRL ,0 ); +if (proxy->flags &VIRTIO_PCI_FLAG_INIT_PM ) { +pci_word_test_and_clear_mask ( + dev->config + dev->exp.pm_cap +PCI_PM_CTRL , +PCI_PM_CTRL_STATE_MASK ); + } } }
Signature · 1 line
MST
[PULL v2 37/88] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/virtio/virtio-pci.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
hw/virtio/virtio-pci.c +2 -16
@@ -898,7 +898,7 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy *proxy, int queue_no) } ret =kvm_virtio_pci_vq_vector_use (proxy, vector);if (ret <0 ) { - goto undo; +return ret; }/* * If guest supports masking, set up irqfd now.
@@ -908,25 +908,11 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy *proxy, int queue_no) ret =kvm_virtio_pci_irqfd_use (proxy, n, vector);if (ret <0 ) {kvm_virtio_pci_vq_vector_release (proxy, vector); - goto undo; +return ret; } }return 0 ; -undo: - - vector =virtio_queue_vector (vdev, queue_no); -if (vector >=msix_nr_vectors_allocated (dev)) { -return ret; - } -if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); -if (ret <0 ) { -return ret; - } -kvm_virtio_pci_irqfd_release (proxy, n, vector); - } -return ret; }static int kvm_virtio_pci_vector_vq_use (VirtIOPCIProxy *proxy,int nvqs) {
Signature · 1 line
MST
[PULL v2 16/88] hw/cxl/mailbox: change CCI cmd set structure to be a member, not a reference
In reply to Michael S. TsirkinFrom: Gregory Price <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 2 +- hw/cxl/cxl-mailbox-utils.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-)
include/hw/cxl/cxl_device.h +1 -1
@@ -164,7 +164,7 @@ typedef struct CXLEventLog { } CXLEventLog; typedef struct CXLCCI { - const struct cxl_cmd (*cxl_cmd_set)[256]; + struct cxl_cmd cxl_cmd_set[256][256]; struct cel_log { uint16_t opcode; uint16_t effect;
hw/cxl/cxl-mailbox-utils.c +15 -4
@@ -1447,10 +1447,21 @@ void cxl_init_cci(CXLCCI *cci, size_t payload_max) bg_timercb, cci); } +static void cxl_copy_cci_commands (CXLCCI *cci,const struct cxl_cmd (*cxl_cmds)[256 ]) +{ +for (int set =0 ; set <256 ; set++) { +for (int cmd =0 ; cmd <256 ; cmd++) { +if (cxl_cmds[set][cmd].handler) { + cci->cxl_cmd_set[set][cmd] = cxl_cmds[set][cmd]; + } + } + } +} +void cxl_initialize_mailbox_swcci (CXLCCI *cci,DeviceState *intf,DeviceState *d,size_t payload_max) { - cci->cxl_cmd_set = cxl_cmd_set_sw; +cxl_copy_cci_commands (cci, cxl_cmd_set_sw); cci->d = d; cci->intf = intf;cxl_init_cci (cci, payload_max);
@@ -1458,7 +1469,7 @@ void cxl_initialize_mailbox_swcci(CXLCCI *cci, DeviceState *intf,void cxl_initialize_mailbox_t3 (CXLCCI *cci,DeviceState *d,size_t payload_max) { - cci->cxl_cmd_set = cxl_cmd_set; +cxl_copy_cci_commands (cci, cxl_cmd_set); cci->d = d;/* No separation for PCI MB as protocol handled in PCI device */
@@ -1476,7 +1487,7 @@ static const struct cxl_cmd cxl_cmd_set_t3_ld[256][256] = {void cxl_initialize_t3_ld_cci (CXLCCI *cci,DeviceState *d,DeviceState *intf,size_t payload_max) { - cci->cxl_cmd_set = cxl_cmd_set_t3_ld; +cxl_copy_cci_commands (cci, cxl_cmd_set_t3_ld); cci->d = d; cci->intf = intf;cxl_init_cci (cci, payload_max);
@@ -1496,7 +1507,7 @@ void cxl_initialize_t3_fm_owned_ld_mctpcci(CXLCCI *cci, DeviceState *d,DeviceState *intf, size_t payload_max) { - cci->cxl_cmd_set = cxl_cmd_set_t3_fm_owned_ld_mctp; +cxl_copy_cci_commands (cci ,cxl_cmd_set_t3_fm_owned_ld_mctp ); cci->d = d; cci->intf = intf;cxl_init_cci (cci, payload_max);
Signature · 1 line
MST
[PULL v2 61/88] hw/i386/fw_cfg: Add etc/e820 to fw_cfg late
In reply to Michael S. TsirkinFrom: David Woodhouse <[email protected]>
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 the etc/e820 file to the machine done notifier, via a new fw_cfg_add_e820() function.
Also make e820_table private and use an e820_get_table() accessor function for it, which sets a flag that will trigger an assert() for any *later* attempts to add to the table.
Make e820_add_entry() return void, as most callers don't check for error anyway.
Message-Id: <[email protected]>
--- hw/i386/e820_memory_layout.h | 8 ++------ hw/i386/fw_cfg.h | 1 + hw/i386/e820_memory_layout.c | 17 ++++++++++++----- hw/i386/fw_cfg.c | 18 +++++++++++++----- hw/i386/microvm.c | 4 ++-- hw/i386/pc.c | 1 + target/i386/kvm/kvm.c | 6 +----- target/i386/kvm/xen-emu.c | 7 +------ 8 files changed, 33 insertions(+), 29 deletions(-)
hw/i386/e820_memory_layout.h +2 -6
@@ -22,13 +22,9 @@ struct e820_entry {uint32_t type; } QEMU_PACKED __attribute((__aligned__(4))); -extern struct e820_entry *e820_table; - -int e820_add_entry (uint64_t address,uint64_t length,uint32_t type); -int e820_get_num_entries (void ); +void e820_add_entry (uint64_t address,uint64_t length,uint32_t type);bool e820_get_entry (int index,uint32_t type,uint64_t *address,uint64_t *length); - - +int e820_get_table (struct e820_entry **table);#endif
hw/i386/fw_cfg.h +1 -0
@@ -27,5 +27,6 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, SmbiosEntryPointType ep_type);void fw_cfg_build_feature_control (MachineState *ms,FWCfgState *fw_cfg);void fw_cfg_add_acpi_dsdt (Aml *scope,FWCfgState *fw_cfg); +void fw_cfg_add_e820 (FWCfgState *fw_cfg);#endif
hw/i386/e820_memory_layout.c +12 -5
@@ -11,22 +11,29 @@#include "e820_memory_layout.h" static size_t e820_entries; -struct e820_entry *e820_table; +static struct e820_entry *e820_table; +static gboolean e820_done; -int e820_add_entry (uint64_t address,uint64_t length,uint32_t type) +void e820_add_entry (uint64_t address,uint64_t length,uint32_t type) { +assert (!e820_done); +/* new "etc/e820" file -- include ram and reserved entries */ e820_table = g_renew(struct e820_entry, e820_table, e820_entries + 1); e820_table[e820_entries].address =cpu_to_le64 (address); e820_table[e820_entries].length =cpu_to_le64 (length); e820_table[e820_entries].type =cpu_to_le32 (type); e820_entries++; - -return e820_entries; } -int e820_get_num_entries (void ) +int e820_get_table (struct e820_entry **table) { + e820_done = true; + +if (table) { + *table = e820_table; + } +return e820_entries; }
hw/i386/fw_cfg.c +13 -5
@@ -48,6 +48,15 @@ const char *fw_cfg_arch_key_name(uint16_t key)return NULL ; } +/* Add etc/e820 late, once all regions should be present */ +void fw_cfg_add_e820 (FWCfgState *fw_cfg) +{ +struct e820_entry *table; +int nr_e820 =e820_get_table (&table); + +fw_cfg_add_file (fw_cfg,"etc/e820" , table, nr_e820 *sizeof (*table)); +} +void fw_cfg_build_smbios (PCMachineState *pcms,FWCfgState *fw_cfg,SmbiosEntryPointType ep_type) {
@@ -60,6 +69,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (pcms);MachineClass *mc =MACHINE_GET_CLASS (pcms);X86CPU *cpu =X86_CPU (ms->possible_cpus->cpus[0 ].cpu); +int nr_e820;if (pcmc->smbios_defaults) {/* These values are guest ABI, do not change */
@@ -78,8 +88,9 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, }/* build the array of physical mem area from e820 table */ - mem_array =g_malloc0 (sizeof (*mem_array) *e820_get_num_entries ()); -for (i =0 , array_count =0 ; i <e820_get_num_entries (); i++) { + nr_e820 =e820_get_table (NULL ); + mem_array =g_malloc0 (sizeof (*mem_array) * nr_e820); +for (i =0 , array_count =0 ; i < nr_e820; i++) {uint64_t addr, len;if (e820_get_entry (i,E820_RAM , &addr, &len)) {
@@ -138,9 +149,6 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms,#endif fw_cfg_add_i32 (fw_cfg,FW_CFG_IRQ0_OVERRIDE ,1 ); -fw_cfg_add_file (fw_cfg,"etc/e820" , e820_table, -sizeof (struct e820_entry ) *e820_get_num_entries ()); -fw_cfg_add_bytes (fw_cfg,FW_CFG_HPET , &hpet_cfg,sizeof (hpet_cfg));/* allocate memory for the NUMA channel: one (64bit) word for the number * of nodes, one word for each VCPU->node and one word for each node to
hw/i386/microvm.c +2 -2
@@ -324,8 +324,6 @@ static void microvm_memory_init(MicrovmMachineState *mms)fw_cfg_add_i16 (fw_cfg,FW_CFG_MAX_CPUS , machine->smp.max_cpus);fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )machine->ram_size);fw_cfg_add_i32 (fw_cfg,FW_CFG_IRQ0_OVERRIDE ,1 ); -fw_cfg_add_file (fw_cfg,"etc/e820" , e820_table, -sizeof (struct e820_entry ) *e820_get_num_entries ());rom_set_fw (fw_cfg);
@@ -586,9 +584,11 @@ static void microvm_machine_done(Notifier *notifier, void *data) {MicrovmMachineState *mms =container_of (notifier, MicrovmMachineState, machine_done); +X86MachineState *x86ms =X86_MACHINE (mms);acpi_setup_microvm (mms);dt_setup_microvm (mms); +fw_cfg_add_e820 (x86ms->fw_cfg); }static void microvm_powerdown_req (Notifier *notifier,void *data)
hw/i386/pc.c +1 -0
@@ -625,6 +625,7 @@ void pc_machine_done(Notifier *notifier, void *data)acpi_setup ();if (x86ms->fw_cfg) {fw_cfg_build_smbios (pcms, x86ms->fw_cfg, pcms->smbios_entry_point_type); +fw_cfg_add_e820 (x86ms->fw_cfg);fw_cfg_build_feature_control (MACHINE (pcms), x86ms->fw_cfg);/* update FW_CFG_NB_CPUS to account for -device added CPUs */ fw_cfg_modify_i16 (x86ms->fw_cfg,FW_CFG_NB_CPUS , x86ms->boot_cpus);
target/i386/kvm/kvm.c +1 -5
@@ -2706,11 +2706,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) }/* Tell fw_cfg to notify the BIOS to reserve the range. */ - ret =e820_add_entry (identity_base,0x4000 ,E820_RESERVED ); -if (ret <0 ) { -fprintf (stderr,"e820_add_entry() table is full\n" ); -return ret; - } +e820_add_entry (identity_base,0x4000 ,E820_RESERVED ); shadow_mem =object_property_get_int (OBJECT (s),"kvm-shadow-mem" , &error_abort);if (shadow_mem !=-1 ) {
target/i386/kvm/xen-emu.c +1 -6
@@ -176,12 +176,7 @@ int kvm_xen_init(KVMState *s, uint32_t hypercall_msr) s->xen_caps = xen_caps;/* Tell fw_cfg to notify the BIOS to reserve the range. */ - ret =e820_add_entry (XEN_SPECIAL_AREA_ADDR ,XEN_SPECIAL_AREA_SIZE , -E820_RESERVED ); -if (ret <0 ) { -fprintf (stderr,"e820_add_entry() table is full\n" ); -return ret; - } +e820_add_entry (XEN_SPECIAL_AREA_ADDR ,XEN_SPECIAL_AREA_SIZE ,E820_RESERVED );/* The pages couldn't be overlaid until KVM was initialized */ xen_primary_console_reset ();
Signature · 1 line
MST
[PULL v2 06/88] virtio-mmio: Handle extra notification data
In reply to Michael S. TsirkinFrom: Jonah Palmer <[email protected]>
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 the device's virtqueue layout.
The data passed to the virtio-mmio device is in the same format as the data passed to virtio-pci devices.
Message-Id: <[email protected]>
--- hw/virtio/virtio-mmio.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
hw/virtio/virtio-mmio.c +9 -2
@@ -248,6 +248,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, {VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque;VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); +uint16_t vq_idx;trace_virtio_mmio_write_offset (offset, value);
@@ -407,8 +408,14 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, }break ;case VIRTIO_MMIO_QUEUE_NOTIFY : -if (value <VIRTIO_QUEUE_MAX ) { -virtio_queue_notify (vdev, value); + vq_idx = value; +if (vq_idx <VIRTIO_QUEUE_MAX &&virtio_queue_get_num (vdev, vq_idx)) { +if (virtio_vdev_has_feature (vdev,VIRTIO_F_NOTIFICATION_DATA )) { +VirtQueue *vq =virtio_get_queue (vdev, vq_idx); + +virtio_queue_set_shadow_avail_idx (vq, (value >>16 ) &0xFFFF ); + } +virtio_queue_notify (vdev, vq_idx); }break ;case VIRTIO_MMIO_INTERRUPT_ACK :
Signature · 1 line
MST
[PULL v2 24/88] hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 22 +++++++++++ hw/cxl/cxl-mailbox-utils.c | 73 ++++++++++++++++++++++++++++++++++++- hw/mem/cxl_type3.c | 1 + 3 files changed, 95 insertions(+), 1 deletion(-)
include/hw/cxl/cxl_device.h +22 -0
@@ -424,6 +424,25 @@ typedef QLIST_HEAD(, CXLPoison) CXLPoisonList;#define DCD_MAX_NUM_REGION 8 +typedef struct CXLDCExtentRaw { +uint64_t start_dpa; +uint64_t len; +uint8_t tag[0x10 ]; +uint16_t shared_seq; +uint8_t rsvd[0x6 ]; +} QEMU_PACKED CXLDCExtentRaw; + +typedef struct CXLDCExtent { +uint64_t start_dpa; +uint64_t len; +uint8_t tag[0x10 ]; +uint16_t shared_seq; +uint8_t rsvd[0x6 ]; + +QTAILQ_ENTRY (CXLDCExtent) node; +}CXLDCExtent ; +typedef QTAILQ_HEAD(, CXLDCExtent) CXLDCExtentList; + typedef struct CXLDCRegion { uint64_t base; /* aligned to 256*MiB */ uint64_t decode_len; /* aligned to 256*MiB */
@@ -474,6 +493,9 @@ struct CXLType3Dev {* memory region size. */ uint64_t total_capacity;/* 256M aligned */ +CXLDCExtentList extents; +uint32_t total_extent_count; +uint32_t ext_list_gen_seq;uint8_t num_regions;/* 0-8 regions */ CXLDCRegion regions[DCD_MAX_NUM_REGION ];
hw/cxl/cxl-mailbox-utils.c +72 -1
97 lines not on this page · raw message
hw/mem/cxl_type3.c +1 -0
@@ -673,6 +673,7 @@ static bool cxl_create_dc_regions(CXLType3Dev *ct3d, Error **errp) }; ct3d->dc.total_capacity += region->len; } +QTAILQ_INIT (&ct3d->dc.extents);return true; }
Signature · 1 line
MST
[PULL v2 56/88] hostmem: add a new memory backend based on POSIX shm_open()
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
shm_open() creates and opens a new POSIX shared memory object. A POSIX shared memory object allows creating memory backend with an associated file descriptor that can be shared with external processes (e.g. vhost-user).
The new memory-backend-shm can be used as an alternative when memory-backend-memfd is not available (Linux only), since shm_open() should be provided by any POSIX-compliant operating system.
This backend mimics memfd, allocating memory that is practically anonymous. In theory shm_open() requires a name, but this is allocated for a short time interval and shm_unlink() is called right after shm_open(). After that, only fd is shared with external processes (e.g., vhost-user) as if it were associated with anonymous memory.
In the future we may also allow the user to specify the name to be passed to shm_open(), but for now we keep the backend simple, mimicking anonymous memory such as memfd.
Message-Id: <[email protected]>
--- qapi/qom.json | 23 +++++- backends/hostmem-shm.c | 123 +++++++++++++++++++++++++++++ backends/meson.build | 1 + docs/system/devices/vhost-user.rst | 5 +- qemu-options.hx | 16 ++++ 5 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 backends/hostmem-shm.c
qapi/qom.json +21 -2
@@ -601,8 +601,8 @@ # # @share: if false, the memory is private to QEMU; if true, it is # shared (default false for backends memory-backend-file and -# memory-backend-ram, true for backends memory-backend-epc and -# memory-backend-memfd) +# memory-backend-ram, true for backends memory-backend-epc, +# memory-backend-memfd, and memory-backend-shm) # # @reserve: if true, reserve swap space (or huge pages) if applicable # (default: true) (since 6.1)
@@ -721,6 +721,21 @@ '*hugetlbsize': 'size', '*seal': 'bool' } } +## +# @MemoryBackendShmProperties: +# +# Properties for memory-backend-shm objects. +# +# This memory backend supports only shared memory, which is the +# default. +# +# Since: 9.1 +## +{ 'struct': 'MemoryBackendShmProperties', + 'base': 'MemoryBackendProperties', + 'data': { }, + 'if': 'CONFIG_POSIX' } + ## # @MemoryBackendEpcProperties: #
@@ -1049,6 +1064,8 @@ { 'name': 'memory-backend-memfd', 'if': 'CONFIG_LINUX' }, 'memory-backend-ram', + { 'name': 'memory-backend-shm', + 'if': 'CONFIG_POSIX' }, 'pef-guest', { 'name': 'pr-manager-helper', 'if': 'CONFIG_LINUX' },
@@ -1121,6 +1138,8 @@ 'memory-backend-memfd': { 'type': 'MemoryBackendMemfdProperties', 'if': 'CONFIG_LINUX' }, 'memory-backend-ram': 'MemoryBackendProperties', + 'memory-backend-shm': { 'type': 'MemoryBackendShmProperties', + 'if': 'CONFIG_POSIX' }, 'pr-manager-helper': { 'type': 'PrManagerHelperProperties', 'if': 'CONFIG_LINUX' }, 'qtest': 'QtestProperties',
backends/hostmem-shm.c new file +123 -0
123 lines not on this page · raw message
backends/meson.build +1 -0
@@ -13,6 +13,7 @@ system_ss.add([files( if host_os != 'windows' system_ss.add(files('rng-random.c')) system_ss.add(files('hostmem-file.c')) + system_ss.add([files('hostmem-shm.c'), rt]) endif if host_os == 'linux' system_ss.add(files('hostmem-memfd.c'))
docs/system/devices/vhost-user.rst +3 -2
@@ -98,8 +98,9 @@ Shared memory object In order for the daemon to access the VirtIO queues to process the requests it needs access to the guest's address space. This is -achieved via the ``memory-backend-file`` or ``memory-backend-memfd`` -objects. A reference to a file-descriptor which can access this object +achieved via the ``memory-backend-file``, ``memory-backend-memfd``, or +``memory-backend-shm`` objects. +A reference to a file-descriptor which can access this object will be passed via the socket as part of the protocol negotiation. Currently the shared memory object needs to match the size of the main
qemu-options.hx +16 -0
@@ -5240,6 +5240,22 @@ SRST The ``share`` boolean option is on by default with memfd. + ``-object memory-backend-shm,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave`` + Creates a POSIX shared memory backend object, which allows + QEMU to share the memory with an external process (e.g. when + using vhost-user). + + ``memory-backend-shm`` is a more portable and less featureful version + of ``memory-backend-memfd``. It can then be used in any POSIX system, + especially when memfd is not supported. + + Please refer to ``memory-backend-file`` for a description of the + options. + + The ``share`` boolean option is on by default with shm. Setting it to + off will cause a failure during allocation because it is not supported + by this backend. + ``-object iommufd,id=id[,fd=fd]`` Creates an iommufd backend which allows control of DMA mapping through the ``/dev/iommu`` device.
Signature · 1 line
MST
[PULL v2 07/88] virtio-ccw: Handle extra notification data
In reply to Michael S. TsirkinFrom: Jonah Palmer <[email protected]>
Add support to virtio-ccw 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-ccw device when this feature is enabled varies depending on the device's virtqueue layout.
That data passed to the virtio-ccw device is in the same format as the data passed to virtio-pci devices.
Message-Id: <[email protected]>
--- hw/s390x/s390-virtio-ccw.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
hw/s390x/s390-virtio-ccw.c +13 -4
@@ -126,9 +126,11 @@ static void subsystem_reset(void)static int virtio_ccw_hcall_notify (const uint64_t *args) {uint64_t subch_id = args[0 ]; -uint64_t queue = args[1 ]; +uint64_t data = args[1 ];SubchDev *sch; +VirtIODevice *vdev;int cssid, ssid, schid, m; +uint16_t vq_idx = data;if (ioinst_disassemble_sch_ident (subch_id, &m, &cssid, &ssid, &schid)) {return -EINVAL ;
@@ -137,12 +139,19 @@ static int virtio_ccw_hcall_notify(const uint64_t *args)if (!sch || !css_subch_visible (sch)) {return -EINVAL ; } -if (queue >=VIRTIO_QUEUE_MAX ) { + + vdev =virtio_ccw_get_vdev (sch); +if (vq_idx >=VIRTIO_QUEUE_MAX || !virtio_queue_get_num (vdev, vq_idx)) {return -EINVAL ; } -virtio_queue_notify (virtio_ccw_get_vdev (sch), queue); -return 0 ; +if (virtio_vdev_has_feature (vdev,VIRTIO_F_NOTIFICATION_DATA )) { +virtio_queue_set_shadow_avail_idx (virtio_get_queue (vdev, vq_idx), + (data >>16 ) &0xFFFF ); + } + +virtio_queue_notify (vdev, vq_idx); +return 0 ; }static int virtio_ccw_hcall_early_printk (const uint64_t *args)
Signature · 1 line
MST
[PULL v2 14/88] Revert "vhost-user: fix lost reconnect"
In reply to Michael S. TsirkinFrom: Li Feng <[email protected]>
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 false, resulting in subsequent reconnection not being executed.
The next patch will completely fix this issue with a better approach.
Message-Id: <[email protected]>
--- include/hw/virtio/vhost-user.h | 3 +-- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c | 2 +- hw/virtio/vhost-user.c | 10 ++-------- 5 files changed, 6 insertions(+), 14 deletions(-)
include/hw/virtio/vhost-user.h +1 -2
@@ -108,7 +108,6 @@ typedef void (*vu_async_close_fn)(DeviceState *cb);void vhost_user_async_close (DeviceState *d,CharBackend *chardev,struct vhost_dev *vhost, -vu_async_close_fn cb, -IOEventHandler *event_cb); +vu_async_close_fn cb);#endif
hw/block/vhost-user-blk.c +1 -1
@@ -385,7 +385,7 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event)case CHR_EVENT_CLOSED :/* defer close until later to avoid circular close */ vhost_user_async_close (dev, &s->chardev, &s->dev, - vhost_user_blk_disconnect, vhost_user_blk_event); + vhost_user_blk_disconnect);break ;case CHR_EVENT_BREAK :case CHR_EVENT_MUX_IN :
hw/scsi/vhost-user-scsi.c +1 -2
@@ -215,8 +215,7 @@ static void vhost_user_scsi_event(void *opaque, QEMUChrEvent event)case CHR_EVENT_CLOSED :/* defer close until later to avoid circular close */ vhost_user_async_close (dev, &vs->conf.chardev, &vsc->dev, - vhost_user_scsi_disconnect, - vhost_user_scsi_event); + vhost_user_scsi_disconnect);break ;case CHR_EVENT_BREAK :case CHR_EVENT_MUX_IN :
hw/virtio/vhost-user-base.c +1 -1
@@ -254,7 +254,7 @@ static void vub_event(void *opaque, QEMUChrEvent event)case CHR_EVENT_CLOSED :/* defer close until later to avoid circular close */ vhost_user_async_close (dev, &vub->chardev, &vub->vhost_dev, - vub_disconnect, vub_event); + vub_disconnect);break ;case CHR_EVENT_BREAK :case CHR_EVENT_MUX_IN :
hw/virtio/vhost-user.c +2 -8
@@ -2776,7 +2776,6 @@ typedef struct {DeviceState *dev;CharBackend *cd;struct vhost_dev *vhost; -IOEventHandler *event_cb; } VhostAsyncCallback;static void vhost_user_async_close_bh (void *opaque)
@@ -2791,10 +2790,7 @@ static void vhost_user_async_close_bh(void *opaque)*/ if (vhost->vdev) { data->cb (data->dev); - }else if (data->event_cb) { -qemu_chr_fe_set_handlers (data->cd,NULL ,NULL , data->event_cb, -NULL , data->dev,NULL , true); - } + }g_free (data); }
@@ -2806,8 +2802,7 @@ static void vhost_user_async_close_bh(void *opaque)*/ void vhost_user_async_close (DeviceState *d,CharBackend *chardev,struct vhost_dev *vhost, -vu_async_close_fn cb, -IOEventHandler *event_cb) +vu_async_close_fn cb) {if (!runstate_check (RUN_STATE_SHUTDOWN )) {/*
@@ -2823,7 +2818,6 @@ void vhost_user_async_close(DeviceState *d, data->dev = d; data->cd = chardev; data->vhost = vhost; - data->event_cb = event_cb;/* Disable any further notifications on the chardev */ qemu_chr_fe_set_handlers(chardev,
Signature · 1 line
MST
[PULL v2 47/88] libvhost-user: set msg.msg_control to NULL when it is empty
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
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.
Message-Id: <[email protected]>
--- subprojects/libvhost-user/libvhost-user.c | 1 + 1 file changed, 1 insertion(+)
subprojects/libvhost-user/libvhost-user.c +1 -0
@@ -632,6 +632,7 @@ vu_message_write(VuDev *dev, int conn_fd, VhostUserMsg *vmsg)memcpy (CMSG_DATA (cmsg), vmsg->fds, fdsize); }else { msg.msg_controllen =0 ; + msg.msg_control =NULL ; } do {
Signature · 1 line
MST
[PULL v2 22/88] hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/mem/cxl_type3.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
hw/mem/cxl_type3.c +9 -6
@@ -44,7 +44,7 @@ enum { };static void ct3_build_cdat_entries_for_mr (CDATSubHeader **cdat_table, -int dsmad_handle,MemoryRegion *mr, +int dsmad_handle,uint64_t size,bool is_pmem,uint64_t dpa_base) {CDATDsmas *dsmas;
@@ -63,7 +63,7 @@ static void ct3_build_cdat_entries_for_mr(CDATSubHeader **cdat_table, .DSMADhandle = dsmad_handle, .flags = is_pmem ? CDAT_DSMAS_FLAG_NV : 0, .DPA_base = dpa_base, - .DPA_length = memory_region_size(mr), + .DPA_length = size, };/* For now, no memory side cache, plausiblish numbers */
@@ -132,7 +132,7 @@ static void ct3_build_cdat_entries_for_mr(CDATSubHeader **cdat_table,*/ .EFI_memory_type_attr = is_pmem ? 2 : 1, .DPA_offset = 0, - .DPA_length = memory_region_size(mr), + .DPA_length = size, };/* Header always at start of structure */
@@ -149,6 +149,7 @@ static int ct3_build_cdat_table(CDATSubHeader ***cdat_table, void *priv) g_autofree CDATSubHeader **table = NULL;CXLType3Dev *ct3d = priv;MemoryRegion *volatile_mr =NULL , *nonvolatile_mr =NULL ; +uint64_t vmr_size =0 , pmr_size =0 ;int dsmad_handle =0 ;int cur_ent =0 ;int len =0 ;
@@ -163,6 +164,7 @@ static int ct3_build_cdat_table(CDATSubHeader ***cdat_table, void *priv)return -EINVAL ; } len +=CT3_CDAT_NUM_ENTRIES ; + vmr_size =memory_region_size (volatile_mr); }if (ct3d->hostpmem) {
@@ -171,21 +173,22 @@ static int ct3_build_cdat_table(CDATSubHeader ***cdat_table, void *priv)return -EINVAL ; } len +=CT3_CDAT_NUM_ENTRIES ; + pmr_size =memory_region_size (nonvolatile_mr); } table =g_malloc0 (len *sizeof (*table));/* Now fill them in */ if (volatile_mr) { -ct3_build_cdat_entries_for_mr (table, dsmad_handle++, volatile_mr, +ct3_build_cdat_entries_for_mr (table, dsmad_handle++, vmr_size, false,0 ); cur_ent =CT3_CDAT_NUM_ENTRIES ; }if (nonvolatile_mr) { -uint64_t base = volatile_mr ?memory_region_size (volatile_mr) :0 ; +uint64_t base = vmr_size;ct3_build_cdat_entries_for_mr (&(table[cur_ent]), dsmad_handle++, - nonvolatile_mr, true, base); + pmr_size, true, base); cur_ent +=CT3_CDAT_NUM_ENTRIES ; }assert (len == cur_ent);
Signature · 1 line
MST
[PULL v2 19/88] hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative and mailbox command support
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 decode length as byte-wise length on the device, which should be divided by 256 * MiB before being returned to the host for "Get Dynamic Capacity Configuration" mailbox command per specification.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 16 +++++++ hw/cxl/cxl-mailbox-utils.c | 96 +++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+)
include/hw/cxl/cxl_device.h +16 -0
@@ -422,6 +422,17 @@ typedef struct CXLPoison { typedef QLIST_HEAD(, CXLPoison) CXLPoisonList;#define CXL_POISON_LIST_LIMIT 256 +#define DCD_MAX_NUM_REGION 8 + +typedef struct CXLDCRegion { +uint64_t base;/* aligned to 256*MiB */ +uint64_t decode_len;/* aligned to 256*MiB */ +uint64_t len; +uint64_t block_size; +uint32_t dsmadhandle; +uint8_t flags; +}CXLDCRegion ; +struct CXLType3Dev {/* Private */ PCIDevice parent_obj;
@@ -454,6 +465,11 @@ struct CXLType3Dev {unsigned int poison_list_cnt;bool poison_list_overflowed;uint64_t poison_list_overflow_ts; + +struct dynamic_capacity { +uint8_t num_regions;/* 0-8 regions */ +CXLDCRegion regions[DCD_MAX_NUM_REGION ]; + } dc; };#define TYPE_CXL_TYPE3 "cxl-type3"
hw/cxl/cxl-mailbox-utils.c +96 -0
127 lines not on this page · raw message
Signature · 1 line
MST
[PULL v2 28/88] hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/cxl/cxl-mailbox-utils.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)
hw/cxl/cxl-mailbox-utils.c +8 -13
@@ -1704,6 +1704,13 @@ static CXLRetCode cxl_dc_extent_release_dry_run(CXLType3Dev *ct3d, dpa = in->updated_entries[i].start_dpa; len = in->updated_entries[i].len; +/* Check if the DPA range is not fully backed with valid extents */ +if (!ct3_test_region_block_backed (ct3d, dpa, len)) { + ret =CXL_MBOX_INVALID_PA ; + goto free_and_exit; + } + +/* After this point, extent overflow is the only error can happen */ while (len >0 ) { QTAILQ_FOREACH(ent, updated_list, node) {range_init_nofail (&range, ent->start_dpa, ent->len);
@@ -1718,14 +1725,7 @@ static CXLRetCode cxl_dc_extent_release_dry_run(CXLType3Dev *ct3d,if (range_contains (&range, dpa + len -1 )) { len2 = ent_start_dpa + ent_len - dpa - len; }else { -/* -* TODO: we reject the attempt to remove an extent -* that overlaps with multiple extents in the device -* for now. We will allow it once superset release -* support is added. -*/ - ret =CXL_MBOX_INVALID_PA ; - goto free_and_exit; + dpa = ent_start_dpa + ent_len; } len_done = ent_len - len1 - len2;
@@ -1752,14 +1752,9 @@ static CXLRetCode cxl_dc_extent_release_dry_run(CXLType3Dev *ct3d, } len -= len_done; -/* len == 0 here until superset release is added */ break ; } } -if (len) { - ret =CXL_MBOX_INVALID_PA ; - goto free_and_exit; - } } } free_and_exit:
Signature · 1 line
MST
[PULL v2 42/88] hw/virtio: Free vqs after vhost_dev_cleanup()
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
This fixes LeakSanitizer warnings.
Message-Id: <[email protected]>
--- hw/virtio/vhost-user-base.c | 2 ++ 1 file changed, 2 insertions(+)
hw/virtio/vhost-user-base.c +2 -0
@@ -223,6 +223,7 @@ static void vub_disconnect(DeviceState *dev) {VirtIODevice *vdev =VIRTIO_DEVICE (dev);VHostUserBase *vub =VHOST_USER_BASE (vdev); +struct vhost_virtqueue *vhost_vqs = vub->vhost_dev.vqs;if (!vub->connected) { goto done;
@@ -231,6 +232,7 @@ static void vub_disconnect(DeviceState *dev)vub_stop (vdev);vhost_dev_cleanup (&vub->vhost_dev); +g_free (vhost_vqs); done:/* Re-instate the event handler for new connections */
Signature · 1 line
MST
[PULL v2 88/88] hw/pci: Replace -1 with UINT32_MAX for romsize
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
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 romsize, -1 will be implicitly casted into uint32_t, resulting in UINT32_MAX. On contrary, when evaluating romsize != -1, romsize will be casted into int, and it will be a comparison of UINT32_MAX and -1, and result in false.
Replace -1 with UINT32_MAX for statements involving the variable to clarify the intent and prevent potential breakage.
Message-Id: <[email protected]>
--- hw/pci/pci.c | 8 ++++---- hw/xen/xen_pt_load_rom.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
hw/pci/pci.c +4 -4
@@ -70,7 +70,7 @@ static bool pcie_has_upstream_port(PCIDevice *dev);static Property pci_props[] = {DEFINE_PROP_PCI_DEVFN ("addr" , PCIDevice, devfn,-1 ),DEFINE_PROP_STRING ("romfile" , PCIDevice, romfile), -DEFINE_PROP_UINT32 ("romsize" , PCIDevice, romsize,-1 ), +DEFINE_PROP_UINT32 ("romsize" , PCIDevice, romsize,UINT32_MAX ),DEFINE_PROP_UINT32 ("rombar" , PCIDevice, rom_bar,1 ),DEFINE_PROP_BIT ("multifunction" , PCIDevice, cap_present,QEMU_PCI_CAP_MULTIFUNCTION_BITNR , false),
@@ -2073,7 +2073,7 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp) g_cmp_uint32, NULL); } -if (pci_dev->romsize !=-1 && !is_power_of_2 (pci_dev->romsize)) { +if (pci_dev->romsize !=UINT32_MAX && !is_power_of_2 (pci_dev->romsize)) {error_setg (errp,"ROM size %u is not a power of two" , pci_dev->romsize);return ; }
@@ -2359,7 +2359,7 @@ static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom,return ; } -if (load_file || pdev->romsize ==-1 ) { +if (load_file || pdev->romsize ==UINT32_MAX ) { path =qemu_find_file (QEMU_FILE_TYPE_BIOS , pdev->romfile);if (path ==NULL ) { path =g_strdup (pdev->romfile);
@@ -2378,7 +2378,7 @@ static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom, pdev->romfile);return ; } -if (pdev->romsize !=-1 ) { +if (pdev->romsize !=UINT_MAX ) {if (size > pdev->romsize) { error_setg(errp, "romfile \"%s\" (%u bytes) " "is too large for ROM size %u",
hw/xen/xen_pt_load_rom.c +1 -1
@@ -53,7 +53,7 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev, }fseek (fp,0 ,SEEK_SET ); -if (dev->romsize !=-1 ) { +if (dev->romsize !=UINT_MAX ) {if (st.st_size > dev->romsize) {error_report ("ROM BAR \"%s\" (%ld bytes) is too large for ROM size %u" , rom_file, (long ) st.st_size, dev->romsize);
Signature · 1 line
MST
[PULL v2 49/88] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
libvhost-user will panic when receiving VHOST_USER_GET_INFLIGHT_FD message if MFD_ALLOW_SEALING is not defined, since it's not able to create a memfd.
VHOST_USER_GET_INFLIGHT_FD is used only if VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is negotiated. So, let's mask that feature if the backend is not able to properly handle these messages.
Message-Id: <[email protected]>
--- subprojects/libvhost-user/libvhost-user.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
subprojects/libvhost-user/libvhost-user.c +11 -0
@@ -1674,6 +1674,17 @@ vu_get_protocol_features_exec(VuDev *dev, VhostUserMsg *vmsg) features |= dev->iface->get_protocol_features (dev); } +#ifndef MFD_ALLOW_SEALING +/* +* If MFD_ALLOW_SEALING is not defined, we are not able to handle +* VHOST_USER_GET_INFLIGHT_FD messages, since we can't create a memfd. +* Those messages are used only if VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD +* is negotiated. A device implementation can enable it, so let's mask +* it to avoid a runtime panic. +*/ + features &= ~(1ULL <<VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD ); +#endif +vmsg_set_reply_u64 (vmsg, features);return true; }
Signature · 1 line
MST
[PULL v2 32/88] tests/qtest/pvpanic: use centralized definition of supported events
In reply to Michael S. TsirkinFrom: Thomas Weißschuh <[email protected]>
Avoid the necessity to update all tests when new events are added to the device.
Message-Id: <[email protected]>
--- tests/qtest/pvpanic-pci-test.c | 5 +++-- tests/qtest/pvpanic-test.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
tests/qtest/pvpanic-pci-test.c +3 -2
@@ -16,6 +16,7 @@#include "qapi/qmp/qdict.h" #include "libqos/pci.h" #include "libqos/pci-pc.h" +#include "hw/misc/pvpanic.h" #include "hw/pci/pci_regs.h" static void test_panic_nopause (void )
@@ -34,7 +35,7 @@ static void test_panic_nopause(void) bar =qpci_iomap (dev,0 ,NULL );qpci_memread (dev, bar,0 , &val,sizeof (val)); - g_assert_cmpuint(val, ==, 3); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); val =1 ;qpci_memwrite (dev, bar,0 , &val,sizeof (val));
@@ -67,7 +68,7 @@ static void test_panic(void) bar =qpci_iomap (dev,0 ,NULL );qpci_memread (dev, bar,0 , &val,sizeof (val)); - g_assert_cmpuint(val, ==, 3); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); val =1 ;qpci_memwrite (dev, bar,0 , &val,sizeof (val));
tests/qtest/pvpanic-test.c +3 -2
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "libqtest.h" #include "qapi/qmp/qdict.h" +#include "hw/misc/pvpanic.h" static void test_panic_nopause (void ) {
@@ -20,7 +21,7 @@ static void test_panic_nopause(void) qts =qtest_init ("-device pvpanic -action panic=none" ); val =qtest_inb (qts,0x505 ); - g_assert_cmpuint(val, ==, 3); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS);qtest_outb (qts,0x505 ,0x1 );
@@ -43,7 +44,7 @@ static void test_panic(void) qts =qtest_init ("-device pvpanic -action panic=pause" ); val =qtest_inb (qts,0x505 ); - g_assert_cmpuint(val, ==, 3); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS);qtest_outb (qts,0x505 ,0x1 );
Signature · 1 line
MST
[PULL v2 05/88] virtio: Prevent creation of device using notification-data with ioeventfd
In reply to Michael S. TsirkinFrom: Jonah Palmer <[email protected]>
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 therefore Qemu should not continue the device's realization process.
Although the device does not yet know if the feature will be successfully negotiated, many devices using this feature wont actually work without this extra data and would fail FEATURES_OK anyway.
If ioeventfd is able to work with the extra notification data in the future, this compatibility check can be removed.
Message-Id: <[email protected]>
--- hw/virtio/virtio.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
hw/virtio/virtio.c +22 -0
@@ -2980,6 +2980,20 @@ int virtio_set_features(VirtIODevice *vdev, uint64_t val)return ret; } +static void virtio_device_check_notification_compatibility (VirtIODevice *vdev, +Error **errp) +{ +VirtioBusState *bus =VIRTIO_BUS (qdev_get_parent_bus (DEVICE (vdev))); +VirtioBusClass *k =VIRTIO_BUS_GET_CLASS (bus); +DeviceState *proxy =DEVICE (BUS (bus)->parent); + +if (virtio_host_has_feature (vdev,VIRTIO_F_NOTIFICATION_DATA ) && + k->ioeventfd_enabled (proxy)) { +error_setg (errp, +"notification_data=on without ioeventfd=off is not supported" ); + } +} +size_t virtio_get_config_size (const VirtIOConfigSizeParams *params,uint64_t host_features) {
@@ -3740,6 +3754,14 @@ static void virtio_device_realize(DeviceState *dev, Error **errp) } } +/* Devices should not use both ioeventfd and notification data feature */ +virtio_device_check_notification_compatibility (vdev, &err); +if (err !=NULL ) { +error_propagate (errp, err); + vdc->unrealize (dev); +return ; + } +virtio_bus_device_plugged (vdev, &err);if (err !=NULL ) {error_propagate (errp, err);
Signature · 1 line
MST
[PULL v2 73/88] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
Update list of images supported in unpack_edk2_blobs to enable RISC-V ACPI table testing.
Message-Id: <[email protected]>
--- pc-bios/meson.build | 2 ++ tests/qtest/meson.build | 3 +++ 2 files changed, 5 insertions(+)
pc-bios/meson.build +2 -0
@@ -4,6 +4,8 @@ if unpack_edk2_blobs 'edk2-aarch64-code.fd', 'edk2-arm-code.fd', 'edk2-arm-vars.fd', + 'edk2-riscv-code.fd', + 'edk2-riscv-vars.fd', 'edk2-i386-code.fd', 'edk2-i386-secure-code.fd', 'edk2-i386-vars.fd',
tests/qtest/meson.build +3 -0
@@ -259,6 +259,9 @@ qtests_s390x = \ qtests_riscv32 = \ (config_all_devices.has_key('CONFIG_SIFIVE_E_AON') ? ['sifive-e-aon-watchdog-test'] : []) +qtests_riscv64 = \ + (unpack_edk2_blobs ? ['bios-tables-test'] : []) + qos_test_ss = ss.source_set() qos_test_ss.add( 'ac97-test.c',
Signature · 1 line
MST
[PULL v2 76/88] hw/cxl/events: Mark cxl-add-dynamic-capacity and cxl-release-dynamic-capcity unstable
In reply to Michael S. TsirkinFrom: Jonathan Cameron <[email protected]>
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. However, there seems little disadvantage in taking a cautious path for now and marking them as unstable interfaces.
Message-Id: <[email protected]>
--- qapi/cxl.json | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
qapi/cxl.json +12 -2
@@ -453,6 +453,10 @@ # @extents: The "Extent List" field as defined in Compute Express Link # (CXL) Specification, Revision 3.1, Table 7-70. # +# Features: +# +# @unstable: For now this command is subject to change. +# # Since : 9.1 ## { 'command': 'cxl-add-dynamic-capacity',
@@ -462,7 +466,8 @@ 'region': 'uint8', '*tag': 'str', 'extents': [ 'CxlDynamicCapacityExtent' ] - } + }, + 'features': [ 'unstable' ] } ##
@@ -527,6 +532,10 @@ # @extents: The "Extent List" field as defined in Compute Express # Link (CXL) Specification, Revision 3.1, Table 7-71. # +# Features: +# +# @unstable: For now this command is subject to change. +# # Since : 9.1 ## { 'command': 'cxl-release-dynamic-capacity',
@@ -538,5 +547,6 @@ 'region': 'uint8', '*tag': 'str', 'extents': [ 'CxlDynamicCapacityExtent' ] - } + }, + 'features': [ 'unstable' ] }
Signature · 1 line
MST
[PULL v2 69/88] tests/qtest/bios-tables-test.c: Set "arch" for x86 tests
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
To search for expected AML files under ${arch}/${machine} path, set this field for X86 related test cases.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 77 ++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 13 deletions(-)
tests/qtest/bios-tables-test.c +64 -13
@@ -933,6 +933,7 @@ static void test_acpi_piix4_tcg(void)* This is to make guest actually run. */ data.machine =MACHINE_PC ; + data.arch ="x86" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);test_acpi_one (NULL , &data);
@@ -944,6 +945,7 @@ static void test_acpi_piix4_tcg_bridge(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".bridge" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -981,6 +983,7 @@ static void test_acpi_piix4_no_root_hotplug(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".roothp" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -997,6 +1000,7 @@ static void test_acpi_piix4_no_bridge_hotplug(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".hpbridge" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -1013,6 +1017,7 @@ static void test_acpi_piix4_no_acpi_pci_hotplug(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".hpbrroot" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -1034,6 +1039,7 @@ static void test_acpi_q35_tcg(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);test_acpi_one (NULL , &data);
@@ -1049,6 +1055,7 @@ static void test_acpi_q35_kvm_type4_count(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".type4-count" , .required_struct_types = base_required_struct_types, .required_struct_types_len =ARRAY_SIZE (base_required_struct_types),
@@ -1065,6 +1072,7 @@ static void test_acpi_q35_kvm_core_count(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".core-count" , .required_struct_types = base_required_struct_types, .required_struct_types_len =ARRAY_SIZE (base_required_struct_types),
@@ -1082,6 +1090,7 @@ static void test_acpi_q35_kvm_core_count2(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".core-count2" , .required_struct_types = base_required_struct_types, .required_struct_types_len =ARRAY_SIZE (base_required_struct_types),
@@ -1099,6 +1108,7 @@ static void test_acpi_q35_kvm_thread_count(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".thread-count" , .required_struct_types = base_required_struct_types, .required_struct_types_len =ARRAY_SIZE (base_required_struct_types),
@@ -1116,6 +1126,7 @@ static void test_acpi_q35_kvm_thread_count2(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".thread-count2" , .required_struct_types = base_required_struct_types, .required_struct_types_len =ARRAY_SIZE (base_required_struct_types),
@@ -1134,6 +1145,7 @@ static void test_acpi_q35_tcg_bridge(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".bridge" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -1148,6 +1160,7 @@ static void test_acpi_q35_tcg_no_acpi_hotplug(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".noacpihp" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -1176,6 +1189,7 @@ static void test_acpi_q35_multif_bridge(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".multi-bridge" , }; test_vm_prepare("-S"
@@ -1225,6 +1239,7 @@ static void test_acpi_q35_tcg_mmio64(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".mmio64" , .tcg_only = true, .required_struct_types = base_required_struct_types,
@@ -1245,6 +1260,7 @@ static void test_acpi_piix4_tcg_cphp(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".cphp" ;test_acpi_one ("-smp 2,cores=3,sockets=2,maxcpus=6" " -object memory-backend-ram,id=ram0,size=64M"
@@ -1260,6 +1276,7 @@ static void test_acpi_q35_tcg_cphp(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".cphp" ;test_acpi_one (" -smp 2,cores=3,sockets=2,maxcpus=6" " -object memory-backend-ram,id=ram0,size=64M"
@@ -1279,6 +1296,7 @@ static void test_acpi_q35_tcg_ipmi(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".ipmibt" ; data.required_struct_types = ipmi_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (ipmi_required_struct_types);
@@ -1293,6 +1311,7 @@ static void test_acpi_q35_tcg_smbus_ipmi(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".ipmismbus" ; data.required_struct_types = ipmi_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (ipmi_required_struct_types);
@@ -1310,6 +1329,7 @@ static void test_acpi_piix4_tcg_ipmi(void)* This is to make guest actually run. */ data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".ipmikcs" ; data.required_struct_types = ipmi_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (ipmi_required_struct_types);
@@ -1324,6 +1344,7 @@ static void test_acpi_q35_tcg_memhp(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".memhp" ;test_acpi_one (" -m 128,slots=3,maxmem=1G" " -object memory-backend-ram,id=ram0,size=64M"
@@ -1339,6 +1360,7 @@ static void test_acpi_piix4_tcg_memhp(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".memhp" ;test_acpi_one (" -m 128,slots=3,maxmem=1G" " -object memory-backend-ram,id=ram0,size=64M"
@@ -1354,6 +1376,7 @@ static void test_acpi_piix4_tcg_nosmm(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".nosmm" ;test_acpi_one ("-machine smm=off" , &data);free_test_data (&data);
@@ -1364,6 +1387,7 @@ static void test_acpi_piix4_tcg_smm_compat(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".smm-compat" ;test_acpi_one ("-global PIIX4_PM.smm-compat=on" , &data);free_test_data (&data);
@@ -1374,6 +1398,7 @@ static void test_acpi_piix4_tcg_smm_compat_nosmm(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".smm-compat-nosmm" ;test_acpi_one ("-global PIIX4_PM.smm-compat=on -machine smm=off" , &data);free_test_data (&data);
@@ -1384,6 +1409,7 @@ static void test_acpi_piix4_tcg_nohpet(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.machine_param =",hpet=off" ; data.variant =".nohpet" ;test_acpi_one (NULL , &data);
@@ -1395,6 +1421,7 @@ static void test_acpi_q35_tcg_numamem(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".numamem" ;test_acpi_one (" -object memory-backend-ram,id=ram0,size=128M" " -numa node -numa node,memdev=ram0" , &data);
@@ -1406,6 +1433,7 @@ static void test_acpi_q35_kvm_xapic(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".xapic" ;test_acpi_one (" -object memory-backend-ram,id=ram0,size=128M" " -numa node -numa node,memdev=ram0"
@@ -1418,6 +1446,7 @@ static void test_acpi_q35_tcg_nosmm(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".nosmm" ;test_acpi_one ("-machine smm=off" , &data);free_test_data (&data);
@@ -1428,6 +1457,7 @@ static void test_acpi_q35_tcg_smm_compat(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".smm-compat" ;test_acpi_one ("-global ICH9-LPC.smm-compat=on" , &data);free_test_data (&data);
@@ -1438,6 +1468,7 @@ static void test_acpi_q35_tcg_smm_compat_nosmm(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".smm-compat-nosmm" ;test_acpi_one ("-global ICH9-LPC.smm-compat=on -machine smm=off" , &data);free_test_data (&data);
@@ -1448,6 +1479,7 @@ static void test_acpi_q35_tcg_nohpet(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.machine_param =",hpet=off" ; data.variant =".nohpet" ;test_acpi_one (NULL , &data);
@@ -1459,6 +1491,7 @@ static void test_acpi_q35_kvm_dmar(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".dmar" ;test_acpi_one ("-machine kernel-irqchip=split -accel kvm" " -device intel-iommu,intremap=on,device-iotlb=on" , &data);
@@ -1470,6 +1503,7 @@ static void test_acpi_q35_tcg_ivrs(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" , data.variant =".ivrs" ; data.tcg_only = true,test_acpi_one (" -device amd-iommu" , &data);
@@ -1481,6 +1515,7 @@ static void test_acpi_piix4_tcg_numamem(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.variant =".numamem" ;test_acpi_one (" -object memory-backend-ram,id=ram0,size=128M" " -numa node -numa node,memdev=ram0" , &data);
@@ -1489,8 +1524,9 @@ static void test_acpi_piix4_tcg_numamem(void)uint64_t tpm_tis_base_addr; -static void test_acpi_tcg_tpm (const char *machine,const char *tpm_if, -uint64_t base,enum TPMVersion tpm_version) +static void test_acpi_tcg_tpm (const char *machine,const char *arch, +const char *tpm_if,uint64_t base, +enum TPMVersion tpm_version) {gchar *tmp_dir_name =g_strdup_printf ("qemu-test_acpi_%s_tcg_%s.XXXXXX" , machine, tpm_if);
@@ -1517,6 +1553,7 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,tpm_emu_test_wait_cond (&test); data.machine = machine; + data.arch = arch; data.variant = variant; args = g_strdup_printf(
@@ -1540,19 +1577,20 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,static void test_acpi_q35_tcg_tpm2_tis (void ) { -test_acpi_tcg_tpm ("q35" ,"tis" ,0xFED40000 ,TPM_VERSION_2_0 ); +test_acpi_tcg_tpm ("q35" ,"x86" ,"tis" ,0xFED40000 ,TPM_VERSION_2_0 ); }static void test_acpi_q35_tcg_tpm12_tis (void ) { -test_acpi_tcg_tpm ("q35" ,"tis" ,0xFED40000 ,TPM_VERSION_1_2 ); +test_acpi_tcg_tpm ("q35" ,"x86" ,"tis" ,0xFED40000 ,TPM_VERSION_1_2 ); } -static void test_acpi_tcg_dimm_pxm (const char *machine) +static void test_acpi_tcg_dimm_pxm (const char *machine,const char *arch) {test_data data = {}; data.machine = machine; + data.arch = arch; data.variant =".dimmpxm" ;test_acpi_one (" -machine nvdimm=on,nvdimm-persistence=cpu" " -smp 4,sockets=4"
@@ -1579,12 +1617,12 @@ static void test_acpi_tcg_dimm_pxm(const char *machine)static void test_acpi_q35_tcg_dimm_pxm (void ) { -test_acpi_tcg_dimm_pxm (MACHINE_Q35 ); +test_acpi_tcg_dimm_pxm (MACHINE_Q35 ,"x86" ); }static void test_acpi_piix4_tcg_dimm_pxm (void ) { -test_acpi_tcg_dimm_pxm (MACHINE_PC ); +test_acpi_tcg_dimm_pxm (MACHINE_PC ,"x86" ); }static void test_acpi_aarch64_virt_tcg_memhp (void )
@@ -1621,6 +1659,7 @@ static void test_acpi_aarch64_virt_tcg_memhp(void)static void test_acpi_microvm_prepare (test_data *data) { data->machine ="microvm" ; + data->arch ="x86" ; data->required_struct_types =NULL ;/* no smbios */ data->required_struct_types_len =0 ; data->blkdev ="virtio-blk-device" ;
@@ -1737,11 +1776,12 @@ static void test_acpi_aarch64_virt_tcg_pxb(void)free_test_data (&data); } -static void test_acpi_tcg_acpi_hmat (const char *machine) +static void test_acpi_tcg_acpi_hmat (const char *machine,const char *arch) {test_data data = {}; data.machine = machine; + data.arch = arch; data.variant =".acpihmat" ;test_acpi_one (" -machine hmat=on" " -smp 2,sockets=2"
@@ -1770,12 +1810,12 @@ static void test_acpi_tcg_acpi_hmat(const char *machine)static void test_acpi_q35_tcg_acpi_hmat (void ) { -test_acpi_tcg_acpi_hmat (MACHINE_Q35 ); +test_acpi_tcg_acpi_hmat (MACHINE_Q35 ,"x86" ); }static void test_acpi_piix4_tcg_acpi_hmat (void ) { -test_acpi_tcg_acpi_hmat (MACHINE_PC ); +test_acpi_tcg_acpi_hmat (MACHINE_PC ,"x86" ); }static void test_acpi_aarch64_virt_tcg_acpi_hmat (void )
@@ -1841,6 +1881,7 @@ static void test_acpi_q35_tcg_acpi_hmat_noinitiator(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" ; data.variant =".acpihmat-noinitiator" ;test_acpi_one (" -machine hmat=on" " -smp 4,sockets=2"
@@ -1884,13 +1925,14 @@ static void test_acpi_q35_tcg_acpi_hmat_noinitiator(void) }#ifdef CONFIG_POSIX -static void test_acpi_erst (const char *machine) +static void test_acpi_erst (const char *machine,const char *arch) {gchar *tmp_path =g_dir_make_tmp ("qemu-test-erst.XXXXXX" ,NULL );gchar *params;test_data data = {}; data.machine = machine; + data.arch = arch; data.variant =".acpierst" ; params =g_strdup_printf ( " -object memory-backend-file,id=erstnvram,"
@@ -1905,12 +1947,12 @@ static void test_acpi_erst(const char *machine)static void test_acpi_piix4_acpi_erst (void ) { -test_acpi_erst (MACHINE_PC ); +test_acpi_erst (MACHINE_PC ,"x86" ); }static void test_acpi_q35_acpi_erst (void ) { -test_acpi_erst (MACHINE_Q35 ); +test_acpi_erst (MACHINE_Q35 ,"x86" ); }static void test_acpi_microvm_acpi_erst (void )
@@ -1978,6 +2020,7 @@ static void test_acpi_q35_viot(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".viot" , };
@@ -2002,6 +2045,7 @@ static void test_acpi_q35_cxl(void)test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".cxl" , };/*
@@ -2067,6 +2111,7 @@ static void test_acpi_q35_slic(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".slic" , };
@@ -2081,6 +2126,7 @@ static void test_acpi_q35_applesmc(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".applesmc" , };
@@ -2094,6 +2140,7 @@ static void test_acpi_q35_pvpanic_isa(void) {test_data data = { .machine =MACHINE_Q35 , + .arch ="x86" , .variant =".pvpanic-isa" , };
@@ -2106,6 +2153,7 @@ static void test_acpi_pc_smbios_options(void)uint8_t req_type11[] = {11 };test_data data = { .machine =MACHINE_PC , + .arch ="x86" , .variant =".pc_smbios_options" , .required_struct_types = req_type11, .required_struct_types_len =ARRAY_SIZE (req_type11),
@@ -2120,6 +2168,7 @@ static void test_acpi_pc_smbios_blob(void)uint8_t req_type11[] = {11 };test_data data = { .machine =MACHINE_PC , + .arch ="x86" , .variant =".pc_smbios_blob" , .required_struct_types = req_type11, .required_struct_types_len =ARRAY_SIZE (req_type11),
@@ -2169,6 +2218,7 @@ static void test_acpi_piix4_oem_fields(void)test_data data = {}; data.machine =MACHINE_PC ; + data.arch ="x86" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
@@ -2187,6 +2237,7 @@ static void test_acpi_q35_oem_fields(void)test_data data = {}; data.machine =MACHINE_Q35 ; + data.arch ="x86" ; data.required_struct_types = base_required_struct_types; data.required_struct_types_len =ARRAY_SIZE (base_required_struct_types);
Signature · 1 line
MST
[PULL v2 33/88] hw/misc/pvpanic: add support for normal shutdowns
In reply to Michael S. TsirkinFrom: Thomas Weißschuh <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/misc/pvpanic.h | 4 +++- include/sysemu/runstate.h | 1 + hw/misc/pvpanic.c | 5 +++++ system/runstate.c | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-)
include/hw/misc/pvpanic.h +3 -1
@@ -20,7 +20,9 @@#include "standard-headers/misc/pvpanic.h" -#define PVPANIC_EVENTS (PVPANIC_PANICKED | PVPANIC_CRASH_LOADED) +#define PVPANIC_EVENTS (PVPANIC_PANICKED | \ + PVPANIC_CRASH_LOADED | \ + PVPANIC_SHUTDOWN)#define TYPE_PVPANIC_ISA_DEVICE "pvpanic"#define TYPE_PVPANIC_PCI_DEVICE "pvpanic-pci"
include/sysemu/runstate.h +1 -0
@@ -104,6 +104,7 @@ void qemu_system_killed(int signal, pid_t pid);void qemu_system_reset (ShutdownCause reason);void qemu_system_guest_panicked (GuestPanicInformation *info);void qemu_system_guest_crashloaded (GuestPanicInformation *info); +void qemu_system_guest_pvshutdown (void );bool qemu_system_dump_in_progress (void );#endif
hw/misc/pvpanic.c +5 -0
@@ -41,6 +41,11 @@ static void handle_event(int event)qemu_system_guest_crashloaded (NULL );return ; } + +if (event &PVPANIC_SHUTDOWN ) { +qemu_system_guest_pvshutdown (); +return ; + } }/* return supported events on read */
system/runstate.c +5 -0
@@ -584,6 +584,11 @@ void qemu_system_guest_crashloaded(GuestPanicInformation *info)qapi_free_GuestPanicInformation (info); } +void qemu_system_guest_pvshutdown (void ) +{ +qemu_system_shutdown_request (SHUTDOWN_CAUSE_GUEST_SHUTDOWN ); +} +void qemu_system_reset_request (ShutdownCause reason) { if (reboot_action == REBOOT_ACTION_SHUTDOWN &&
Signature · 1 line
MST
[PULL v2 21/88] hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 are hard coded. If needed, these parameters can be added easily.
With the change, we can create DC regions with proper kernel side support like below:
region=$(cat /sys/bus/cxl/devices/decoder0.0/create_dc_region) echo $region > /sys/bus/cxl/devices/decoder0.0/create_dc_region echo 256 > /sys/bus/cxl/devices/$region/interleave_granularity echo 1 > /sys/bus/cxl/devices/$region/interleave_ways
echo "dc0" >/sys/bus/cxl/devices/decoder2.0/mode echo 0x40000000 >/sys/bus/cxl/devices/decoder2.0/dpa_size
echo 0x40000000 > /sys/bus/cxl/devices/$region/size echo "decoder2.0" > /sys/bus/cxl/devices/$region/target0 echo 1 > /sys/bus/cxl/devices/$region/commit echo $region > /sys/bus/cxl/drivers/cxl_region/bind
Message-Id: <[email protected]>
--- hw/mem/cxl_type3.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)
hw/mem/cxl_type3.c +53 -0
@@ -30,6 +30,7 @@#include "hw/pci/msix.h" #define DWORD_BYTE 4 +#define CXL_CAPACITY_MULTIPLIER (256 * MiB)/* Default CDAT entries for a memory region */ enum {
@@ -567,6 +568,50 @@ static void ct3d_reg_write(void *opaque, hwaddr offset, uint64_t value, } } +/* +* TODO: dc region configuration will be updated once host backend and address +* space support is added for DCD. +*/ +static bool cxl_create_dc_regions (CXLType3Dev *ct3d,Error **errp) +{ +int i; +uint64_t region_base =0 ; +uint64_t region_len =2 * GiB; +uint64_t decode_len =2 * GiB; +uint64_t blk_size =2 * MiB; +CXLDCRegion *region; +MemoryRegion *mr; + +if (ct3d->hostvmem) { + mr =host_memory_backend_get_memory (ct3d->hostvmem); + region_base +=memory_region_size (mr); + } +if (ct3d->hostpmem) { + mr =host_memory_backend_get_memory (ct3d->hostpmem); + region_base +=memory_region_size (mr); + } +if (region_base %CXL_CAPACITY_MULTIPLIER !=0 ) { +error_setg (errp,"DC region base not aligned to 0x%lx" , +CXL_CAPACITY_MULTIPLIER ); +return false; + } + +for (i =0 , region = &ct3d->dc.regions[0 ]; + i < ct3d->dc.num_regions; + i++, region++, region_base += region_len) { + *region = (CXLDCRegion ) { + .base = region_base, + .decode_len = decode_len, + .len = region_len, + .block_size = blk_size, +/* dsmad_handle set when creating CDAT table entries */ + .flags =0 , + }; + } + +return true; +} +static bool cxl_setup_memory (CXLType3Dev *ct3d,Error **errp) {DeviceState *ds =DEVICE (ct3d);
@@ -635,6 +680,13 @@ static bool cxl_setup_memory(CXLType3Dev *ct3d, Error **errp)g_free (p_name); } +if (ct3d->dc.num_regions >0 ) { +if (!cxl_create_dc_regions (ct3d, errp)) { +error_append_hint (errp,"setup DC regions failed" ); +return false; + } + } +return true; }
@@ -930,6 +982,7 @@ static Property ct3_props[] = { HostMemoryBackend *),DEFINE_PROP_UINT64 ("sn" , CXLType3Dev, sn,UI64_NULL ),DEFINE_PROP_STRING ("cdat" , CXLType3Dev, cxl_cstate.cdat.filename), +DEFINE_PROP_UINT8 ("num-dc-regions" , CXLType3Dev, dc.num_regions,0 ), DEFINE_PROP_END_OF_LIST(), };
Signature · 1 line
MST
[PULL v2 58/88] tests/qtest/vhost-user-test: add a test case for memory-backend-shm
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
memory-backend-shm can be used with vhost-user devices, so let's add a new test case for it.
Message-Id: <[email protected]>
--- tests/qtest/vhost-user-test.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
tests/qtest/vhost-user-test.c +23 -0
@@ -44,6 +44,8 @@ "mem-path=%s,share=on -numa node,memdev=mem"#define QEMU_CMD_MEMFD " -m %d -object memory-backend-memfd,id=mem,size=%dM," \ " -numa node,memdev=mem" +#define QEMU_CMD_SHM " -m %d -object memory-backend-shm,id=mem,size=%dM," \ + " -numa node,memdev=mem"#define QEMU_CMD_CHR " -chardev socket,id=%s,path=%s%s"#define QEMU_CMD_NETDEV " -netdev vhost-user,id=hs0,chardev=%s,vhostforce=on"
@@ -195,6 +197,7 @@ enum test_memfd {TEST_MEMFD_AUTO ,TEST_MEMFD_YES ,TEST_MEMFD_NO , + TEST_MEMFD_SHM, }; static void append_vhost_net_opts(TestServer *s, GString *cmd_line,
@@ -228,6 +231,8 @@ static void append_mem_opts(TestServer *server, GString *cmd_line,if (memfd ==TEST_MEMFD_YES ) {g_string_append_printf (cmd_line,QEMU_CMD_MEMFD , size, size); + }else if (memfd ==TEST_MEMFD_SHM ) { +g_string_append_printf (cmd_line,QEMU_CMD_SHM , size, size); }else {const char *root =init_hugepagefs () ? : server->tmpfs;
@@ -791,6 +796,19 @@ static void *vhost_user_test_setup_memfd(GString *cmd_line, void *arg)return server; } +static void *vhost_user_test_setup_shm (GString *cmd_line,void *arg) +{ +TestServer *server =test_server_new ("vhost-user-test" , arg); +test_server_listen (server); + +append_mem_opts (server, cmd_line,256 ,TEST_MEMFD_SHM ); + server->vu_ops->append_opts (server, cmd_line,"" ); + +g_test_queue_destroy (vhost_user_test_cleanup, server); + +return server; +} +static void test_read_guest_mem (void *obj,void *arg,QGuestAllocator *alloc) {TestServer *server = arg;
@@ -1084,6 +1102,11 @@ static void register_vhost_user_test(void)"virtio-net" , test_read_guest_mem, &opts); + opts.before = vhost_user_test_setup_shm; +qos_add_test ("vhost-user/read-guest-mem/shm" , +"virtio-net" , + test_read_guest_mem, &opts); +if (qemu_memfd_check (MFD_ALLOW_SEALING )) { opts.before = vhost_user_test_setup_memfd; qos_add_test("vhost-user/read-guest-mem/memfd",
Signature · 1 line
MST
[PULL v2 31/88] hw/misc/pvpanic: centralize definition of supported events
In reply to Michael S. TsirkinFrom: Thomas Weißschuh <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/misc/pvpanic.h | 4 ++++ hw/misc/pvpanic-isa.c | 3 +-- hw/misc/pvpanic-pci.c | 2 +- hw/misc/pvpanic.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-)
include/hw/misc/pvpanic.h +4 -0
@@ -18,6 +18,10 @@#include "exec/memory.h" #include "qom/object.h" +#include "standard-headers/misc/pvpanic.h" + +#define PVPANIC_EVENTS (PVPANIC_PANICKED | PVPANIC_CRASH_LOADED) +#define TYPE_PVPANIC_ISA_DEVICE "pvpanic"#define TYPE_PVPANIC_PCI_DEVICE "pvpanic-pci"
hw/misc/pvpanic-isa.c +1 -2
@@ -21,7 +21,6 @@#include "hw/misc/pvpanic.h" #include "qom/object.h" #include "hw/isa/isa.h" -#include "standard-headers/misc/pvpanic.h" #include "hw/acpi/acpi_aml_interface.h" OBJECT_DECLARE_SIMPLE_TYPE (PVPanicISAState,PVPANIC_ISA_DEVICE )
@@ -102,7 +101,7 @@ static void build_pvpanic_isa_aml(AcpiDevAmlIf *adev, Aml *scope)static Property pvpanic_isa_properties[] = {DEFINE_PROP_UINT16 (PVPANIC_IOPORT_PROP , PVPanicISAState, ioport,0x505 ),DEFINE_PROP_UINT8 ("events" , PVPanicISAState, pvpanic.events, -PVPANIC_PANICKED |PVPANIC_CRASH_LOADED ), +PVPANIC_EVENTS ),DEFINE_PROP_END_OF_LIST (), };
hw/misc/pvpanic-pci.c +1 -1
@@ -55,7 +55,7 @@ static void pvpanic_pci_realizefn(PCIDevice *dev, Error **errp)static Property pvpanic_pci_properties[] = {DEFINE_PROP_UINT8 ("events" , PVPanicPCIState, pvpanic.events, -PVPANIC_PANICKED |PVPANIC_CRASH_LOADED ), +PVPANIC_EVENTS ),DEFINE_PROP_END_OF_LIST (), };
hw/misc/pvpanic.c +1 -1
@@ -27,7 +27,7 @@ static void handle_event(int event) {static bool logged; -if (event & ~(PVPANIC_PANICKED |PVPANIC_CRASH_LOADED ) && !logged) { +if (event & ~PVPANIC_EVENTS && !logged) {qemu_log_mask (LOG_GUEST_ERROR ,"pvpanic: unknown event %#x.\n" , event); logged = true; }
Signature · 1 line
MST
[PULL v2 82/88] pcie_sriov: Do not manually unrealize
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
A device gets automatically unrealized when being unparented.
Message-Id: <[email protected]>
--- hw/pci/pcie_sriov.c | 4 ---- 1 file changed, 4 deletions(-)
hw/pci/pcie_sriov.c +0 -4
@@ -204,11 +204,7 @@ static void unregister_vfs(PCIDevice *dev)trace_sriov_unregister_vfs (dev->name,PCI_SLOT (dev->devfn),PCI_FUNC (dev->devfn), num_vfs);for (i =0 ; i < num_vfs; i++) { -Error *err =NULL ;PCIDevice *vf = dev->exp.sriov_pf.vf[i]; -if (!object_property_set_bool (OBJECT (vf),"realized" , false, &err)) { -error_reportf_err (err,"Failed to unplug: " ); - }object_unparent (OBJECT (vf));object_unref (OBJECT (vf)); }
Signature · 1 line
MST
[PULL v2 59/88] hw/virtio: Fix the de-initialization of vhost-user devices
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
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_should_start(vdev, status);
if (vhost_dev_is_started(&vvc->vhost_dev) == should_start) {
return;
}
if (should_start) {
/* ... do the initialization stuff ... */
} else {
/* ... do the cleanup stuff ... */
}The problem here is virtio_device_should_start(vdev, 0) currently always returns "true" since it internally only looks at vdev->started instead of looking at the "status" parameter. Thus once the device got started once, virtio_device_should_start() always returns true and thus the vhost_*_set_status() functions return early, without ever doing any clean-up when being called with status == 0. This causes e.g. problems when trying to hot-plug and hot-unplug a vhost user devices multiple times since the de-initialization step is completely skipped during the unplug operation.
This bug has been introduced in commit 9f6bcfd99f ("hw/virtio: move vm_running check to virtio_device_started") which replaced
should_start = status & VIRTIO_CONFIG_S_DRIVER_OK;
with
should_start = virtio_device_started(vdev, status);
which later got replaced by virtio_device_should_start(). This blocked the possibility to set should_start to false in case the status flag VIRTIO_CONFIG_S_DRIVER_OK was not set.
Fix it by adjusting the virtio_device_should_start() function to only consider the status flag instead of vdev->started. Since this function is only used in the various vhost_*_set_status() functions for exactly the same purpose, it should be fine to fix it in this central place there without any risk to change the behavior of other code.
Message-Id: <[email protected]>
--- include/hw/virtio/virtio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/hw/virtio/virtio.h +4 -4
@@ -472,9 +472,9 @@ static inline bool virtio_device_started(VirtIODevice *vdev, uint8_t status)* @vdev - the VirtIO device * @status - the devices status bits * -* This is similar to virtio_device_started() but also encapsulates a -* check on the VM status which would prevent a device starting -* anyway. +* This is similar to virtio_device_started() but ignores vdev->started +* and also encapsulates a check on the VM status which would prevent a +* device from starting anyway. */ static inline bool virtio_device_should_start (VirtIODevice *vdev,uint8_t status) {
@@ -482,7 +482,7 @@ static inline bool virtio_device_should_start(VirtIODevice *vdev, uint8_t statusreturn false; } -return virtio_device_started (vdev, status); +return status &VIRTIO_CONFIG_S_DRIVER_OK ; }static inline void virtio_set_started (VirtIODevice *vdev,bool started)
Signature · 1 line
MST
[PULL v2 17/88] hw/cxl/mailbox: interface to add CCI commands to an existing CCI
In reply to Michael S. TsirkinFrom: Gregory Price <[email protected]>
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.
Heavily edited by Jonathan Cameron to increase code reuse
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 2 ++ hw/cxl/cxl-mailbox-utils.c | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-)
include/hw/cxl/cxl_device.h +2 -0
@@ -301,6 +301,8 @@ void cxl_initialize_mailbox_t3(CXLCCI *cci, DeviceState *d, size_t payload_max);void cxl_initialize_mailbox_swcci (CXLCCI *cci,DeviceState *intf,DeviceState *d,size_t payload_max);void cxl_init_cci (CXLCCI *cci,size_t payload_max); +void cxl_add_cci_commands (CXLCCI *cci,const struct cxl_cmd (*cxl_cmd_set)[256 ], +size_t payload_max); int cxl_process_cci_message(CXLCCI *cci, uint8_t set, uint8_t cmd, size_t len_in, uint8_t *pl_in, size_t *len_out, uint8_t *pl_out,
hw/cxl/cxl-mailbox-utils.c +17 -2
@@ -1424,9 +1424,9 @@ static void bg_timercb(void *opaque) } } -void cxl_init_cci (CXLCCI *cci,size_t payload_max) +static void cxl_rebuild_cel (CXLCCI *cci) { - cci->payload_max = payload_max; + cci->cel_size =0 ;/* Reset for a fresh build */ for (int set =0 ; set <256 ; set++) {for (int cmd =0 ; cmd <256 ; cmd++) {if (cci->cxl_cmd_set[set][cmd].handler) {
@@ -1440,6 +1440,13 @@ void cxl_init_cci(CXLCCI *cci, size_t payload_max) } } } +} + +void cxl_init_cci (CXLCCI *cci,size_t payload_max) +{ + cci->payload_max = payload_max; +cxl_rebuild_cel (cci); + cci->bg.complete_pct =0 ; cci->bg.starttime =0 ; cci->bg.runtime =0 ;
@@ -1458,6 +1465,14 @@ static void cxl_copy_cci_commands(CXLCCI *cci, const struct cxl_cmd (*cxl_cmds)[ } } +void cxl_add_cci_commands (CXLCCI *cci,const struct cxl_cmd (*cxl_cmd_set)[256 ], +size_t payload_max) +{ + cci->payload_max =MAX (payload_max, cci->payload_max); +cxl_copy_cci_commands (cci, cxl_cmd_set); +cxl_rebuild_cel (cci); +} +void cxl_initialize_mailbox_swcci (CXLCCI *cci,DeviceState *intf,DeviceState *d,size_t payload_max) {
Signature · 1 line
MST
[PULL v2 79/88] hw/pci: Rename has_power to enabled
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
The renamed state will not only represent powering state of PFs, but also represent SR-IOV VF enablement in the future.
Message-Id: <[email protected]>
--- include/hw/pci/pci.h | 7 ++++++- include/hw/pci/pci_device.h | 2 +- hw/pci/pci.c | 14 +++++++------- hw/pci/pci_host.c | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-)
include/hw/pci/pci.h +6 -1
@@ -678,6 +678,11 @@ static inline void pci_irq_pulse(PCIDevice *pci_dev) }MSIMessage pci_get_msi_message (PCIDevice *dev,int vector); -void pci_set_power (PCIDevice *pci_dev,bool state); +void pci_set_enabled (PCIDevice *pci_dev,bool state); + +static inline void pci_set_power (PCIDevice *pci_dev,bool state) +{ +pci_set_enabled (pci_dev, state); +}#endif
include/hw/pci/pci_device.h +1 -1
@@ -56,7 +56,7 @@ typedef struct PCIReqIDCache PCIReqIDCache;struct PCIDevice {DeviceState qdev;bool partially_hotplugged; -bool has_power; +bool enabled;/* PCI config space */ uint8_t *config;
hw/pci/pci.c +7 -7
@@ -1525,7 +1525,7 @@ static void pci_update_mappings(PCIDevice *d)continue ; new_addr =pci_bar_address (d, i, r->type, r->size); -if (!d->has_power) { +if (!d->enabled) { new_addr =PCI_BAR_UNMAPPED ; }
@@ -1613,7 +1613,7 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val_in, intpci_update_irq_disabled (d, was_irq_disabled);memory_region_set_enabled (&d->bus_master_enable_region, (pci_get_word (d->config +PCI_COMMAND ) - &PCI_COMMAND_MASTER ) && d->has_power); + &PCI_COMMAND_MASTER ) && d->enabled); }msi_write_config (d, addr, val_in, l);
@@ -2884,18 +2884,18 @@ MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)return msg; } -void pci_set_power (PCIDevice *d,bool state) +void pci_set_enabled (PCIDevice *d,bool state) { -if (d->has_power == state) { +if (d->enabled == state) {return ; } - d->has_power = state; + d->enabled = state;pci_update_mappings (d);memory_region_set_enabled (&d->bus_master_enable_region, (pci_get_word (d->config +PCI_COMMAND ) - &PCI_COMMAND_MASTER ) && d->has_power); -if (!d->has_power) { + &PCI_COMMAND_MASTER ) && d->enabled); +if (!d->enabled) {pci_device_reset (d); } }
hw/pci/pci_host.c +2 -2
@@ -86,7 +86,7 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,* allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0 (pci_dev)) || - !pci_dev->has_power ||is_pci_dev_ejected (pci_dev)) { + !pci_dev->enabled ||is_pci_dev_ejected (pci_dev)) {return ; }
@@ -111,7 +111,7 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,* allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0 (pci_dev)) || - !pci_dev->has_power ||is_pci_dev_ejected (pci_dev)) { + !pci_dev->enabled ||is_pci_dev_ejected (pci_dev)) {return ~0x0 ; }
Signature · 1 line
MST
[PULL v2 74/88] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
Update the list of supported architectures to include RISC-V.
Message-Id: <[email protected]>
--- tests/data/acpi/rebuild-expected-aml.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tests/data/acpi/rebuild-expected-aml.sh +3 -2
@@ -12,7 +12,7 @@ # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. -qemu_arches="x86_64 aarch64" +qemu_arches="x86_64 aarch64 riscv64" if [ ! -e "tests/qtest/bios-tables-test" ]; then echo "Test: bios-tables-test is required! Run make check before this script."
@@ -36,7 +36,8 @@ fi if [ -z "$qemu_bins" ]; then echo "Only the following architectures are currently supported: $qemu_arches" echo "None of these configured!" - echo "To fix, run configure --target-list=x86_64-softmmu,aarch64-softmmu" + echo "To fix, run configure \ + --target-list=x86_64-softmmu,aarch64-softmmu,riscv64-softmmu" exit 1; fi
Signature · 1 line
MST
[PULL v2 83/88] pcie_sriov: Ensure VF function number does not overflow
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
pci_new() aborts when creating a VF with a function number equals to or is greater than PCI_DEVFN_MAX.
Message-Id: <[email protected]>
--- docs/pcie_sriov.txt | 8 +++++--- include/hw/pci/pcie_sriov.h | 5 +++-- hw/net/igb.c | 13 ++++++++++--- hw/nvme/ctrl.c | 24 ++++++++++++++++-------- hw/pci/pcie_sriov.c | 19 +++++++++++++++++-- 5 files changed, 51 insertions(+), 18 deletions(-)
docs/pcie_sriov.txt +5 -3
@@ -52,9 +52,11 @@ setting up a BAR for a VF. ... /* Add and initialize the SR/IOV capability */ - pcie_sriov_pf_init(d, 0x200, "your_virtual_dev", - vf_devid, initial_vfs, total_vfs, - fun_offset, stride); + if (!pcie_sriov_pf_init(d, 0x200, "your_virtual_dev", + vf_devid, initial_vfs, total_vfs, + fun_offset, stride, errp)) { + return; + } /* Set up individual VF BARs (parameters as for normal BARs) */ pcie_sriov_pf_init_vf_bar( ... )
include/hw/pci/pcie_sriov.h +3 -2
@@ -27,10 +27,11 @@ typedef struct PCIESriovVF {uint16_t vf_number;/* Logical VF number of this function */ } PCIESriovVF; -void pcie_sriov_pf_init (PCIDevice *dev,uint16_t offset, +bool pcie_sriov_pf_init (PCIDevice *dev,uint16_t offset,const char *vfname,uint16_t vf_dev_id,uint16_t init_vfs,uint16_t total_vfs, -uint16_t vf_offset,uint16_t vf_stride); +uint16_t vf_offset,uint16_t vf_stride, +Error **errp);void pcie_sriov_pf_exit (PCIDevice *dev);/* Set up a VF bar in the SR/IOV bar area */
hw/net/igb.c +10 -3
@@ -446,9 +446,16 @@ static void igb_pci_realize(PCIDevice *pci_dev, Error **errp)pcie_ari_init (pci_dev,0x150 ); -pcie_sriov_pf_init (pci_dev,IGB_CAP_SRIOV_OFFSET ,TYPE_IGBVF , -IGB_82576_VF_DEV_ID ,IGB_MAX_VF_FUNCTIONS ,IGB_MAX_VF_FUNCTIONS , -IGB_VF_OFFSET ,IGB_VF_STRIDE ); +if (!pcie_sriov_pf_init (pci_dev,IGB_CAP_SRIOV_OFFSET , +TYPE_IGBVF ,IGB_82576_VF_DEV_ID , +IGB_MAX_VF_FUNCTIONS ,IGB_MAX_VF_FUNCTIONS , +IGB_VF_OFFSET ,IGB_VF_STRIDE , + errp)) { +pcie_cap_exit (pci_dev); +igb_cleanup_msix (s); +msi_uninit (pci_dev); +return ; + } pcie_sriov_pf_init_vf_bar(pci_dev, IGBVF_MMIO_BAR_IDX, PCI_BASE_ADDRESS_MEM_TYPE_64 | PCI_BASE_ADDRESS_MEM_PREFETCH,
hw/nvme/ctrl.c +16 -8
@@ -8048,7 +8048,8 @@ out:return pow2ceil (bar_size); } -static void nvme_init_sriov (NvmeCtrl *n,PCIDevice *pci_dev,uint16_t offset) +static bool nvme_init_sriov (NvmeCtrl *n,PCIDevice *pci_dev,uint16_t offset, +Error **errp) {uint16_t vf_dev_id = n->params.use_intel_id ?PCI_DEVICE_ID_INTEL_NVME :PCI_DEVICE_ID_REDHAT_NVME ;
@@ -8057,12 +8058,17 @@ static void nvme_init_sriov(NvmeCtrl *n, PCIDevice *pci_dev, uint16_t offset)le16_to_cpu (cap->vifrsm), NULL, NULL); -pcie_sriov_pf_init (pci_dev, offset,"nvme" , vf_dev_id, - n->params.sriov_max_vfs, n->params.sriov_max_vfs, -NVME_VF_OFFSET ,NVME_VF_STRIDE ); +if (!pcie_sriov_pf_init (pci_dev, offset,"nvme" , vf_dev_id, + n->params.sriov_max_vfs, n->params.sriov_max_vfs, +NVME_VF_OFFSET ,NVME_VF_STRIDE , + errp)) { +return false; + }pcie_sriov_pf_init_vf_bar (pci_dev,0 ,PCI_BASE_ADDRESS_SPACE_MEMORY |PCI_BASE_ADDRESS_MEM_TYPE_64 , bar_size); + +return true; }static int nvme_add_pm_capability (PCIDevice *pci_dev,uint8_t offset)
@@ -8155,6 +8161,12 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)return false; } +if (!pci_is_vf (pci_dev) && n->params.sriov_max_vfs && + !nvme_init_sriov (n, pci_dev,0x120 , errp)) { +msix_uninit (pci_dev, &n->bar0, &n->bar0); +return false; + } +nvme_update_msixcap_ts (pci_dev, n->conf_msix_qsize);if (n->params.cmb_size_mb) {
@@ -8165,10 +8177,6 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)nvme_init_pmr (n, pci_dev); } -if (!pci_is_vf (pci_dev) && n->params.sriov_max_vfs) { -nvme_init_sriov (n, pci_dev,0x120 ); - } -return true; }
hw/pci/pcie_sriov.c +17 -2
@@ -24,14 +24,27 @@ static PCIDevice *register_vf(PCIDevice *pf, int devfn, const char *name, uint16_t vf_num);static void unregister_vfs (PCIDevice *dev); -void pcie_sriov_pf_init (PCIDevice *dev,uint16_t offset, +bool pcie_sriov_pf_init (PCIDevice *dev,uint16_t offset,const char *vfname,uint16_t vf_dev_id,uint16_t init_vfs,uint16_t total_vfs, -uint16_t vf_offset,uint16_t vf_stride) +uint16_t vf_offset,uint16_t vf_stride, +Error **errp) {uint8_t *cfg = dev->config + offset;uint8_t *wmask; +if (total_vfs) { +uint16_t ari_cap =pcie_find_capability (dev,PCI_EXT_CAP_ID_ARI ); +uint16_t first_vf_devfn = dev->devfn + vf_offset; +uint16_t last_vf_devfn = first_vf_devfn + vf_stride * (total_vfs -1 ); + +if ((!ari_cap &&PCI_SLOT (dev->devfn) !=PCI_SLOT (last_vf_devfn)) || + last_vf_devfn >=PCI_DEVFN_MAX ) { +error_setg (errp,"VF function number overflows" ); +return false; + } + } +pcie_add_capability (dev,PCI_EXT_CAP_ID_SRIOV ,1 , offset,PCI_EXT_CAP_SRIOV_SIZEOF ); dev->exp.sriov_cap = offset;
@@ -69,6 +82,8 @@ void pcie_sriov_pf_init(PCIDevice *dev, uint16_t offset,pci_set_word (wmask +PCI_SRIOV_SYS_PGSIZE ,0x553 );qdev_prop_set_bit (&dev->qdev,"multifunction" , true); + +return true; }void pcie_sriov_pf_exit (PCIDevice *dev)
Signature · 1 line
MST
[PULL v2 60/88] hw/arm/virt-acpi-build: Drop local iort_node_offset
In reply to Michael S. TsirkinFrom: Nicolin Chen <[email protected]>
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 directly.
Message-Id: <[email protected]>
--- hw/arm/virt-acpi-build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/arm/virt-acpi-build.c +1 -2
@@ -269,7 +269,6 @@ static void build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) {int i, nb_nodes, rc_mapping_count; -const uint32_t iort_node_offset =IORT_NODE_OFFSET ;size_t node_size, smmu_offset =0 ;AcpiIortIdMapping *idmap;uint32_t id =0 ;
@@ -415,7 +414,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) range = &g_array_index (its_idmaps, AcpiIortIdMapping, i);/* output IORT node is the ITS group node (the first node) */ build_iort_id_mapping (table_data, range->input_base, - range->id_count, iort_node_offset); + range->id_count,IORT_NODE_OFFSET ); } }else {/* output IORT node is the ITS group node (the first node) */
Signature · 1 line
MST
[PULL v2 54/88] libvhost-user: enable it on any POSIX system
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system.
Compiling it on macOS and FreeBSD some problems came up:
- avoid to include linux/vhost.h which is available only on Linux (vhost_types.h contains many of the things we need)
- macOS doesn't provide sys/endian.h, so let's define them (note: libvhost-user doesn't include QEMU's headers, so we can't use use "qemu/bswap.h")
- define eventfd_[write|read] as write/read wrapper when system doesn't provide those (e.g. macOS)
- copy SEAL defines from include/qemu/memfd.h to make the code works on FreeBSD where MFD_ALLOW_SEALING is defined
- define MAP_NORESERVE if it's not defined (e.g. on FreeBSD)
Message-Id: <[email protected]>
--- subprojects/libvhost-user/libvhost-user.h | 2 +- subprojects/libvhost-user/libvhost-user.c | 60 +++++++++++++++++++++-- meson.build | 2 +- 3 files changed, 59 insertions(+), 5 deletions(-)
subprojects/libvhost-user/libvhost-user.h +1 -1
@@ -18,9 +18,9 @@#include <stdbool.h> #include <stddef.h> #include <poll.h> -#include <linux/vhost.h> #include <pthread.h> #include "standard-headers/linux/virtio_ring.h" +#include "standard-headers/linux/vhost_types.h" /* Based on qemu/hw/virtio/vhost-user.c */ #define VHOST_USER_F_PROTOCOL_FEATURES 30
subprojects/libvhost-user/libvhost-user.c +57 -3
80 lines not on this page · raw message
meson.build +1 -1
@@ -3203,7 +3203,7 @@ if have_system and vfio_user_server_allowed endif vhost_user = not_found -if host_os == 'linux' and have_vhost_user +if have_vhost_user libvhost_user = subproject('libvhost-user') vhost_user = libvhost_user.get_variable('vhost_user_dep') endif
Signature · 1 line
MST
[PULL v2 02/88] vhost: Perform memory section dirty scans once per iteration
In reply to Michael S. TsirkinFrom: Si-Wei Liu <[email protected]>
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_region.isra.13 8 queues -> 40.50% [.] vhost_dev_sync_region.isra.13 1 queue -> 6.89% [.] vhost_dev_sync_region.isra.13
2 devices, 1 queue -> 18.60% [.] vhost_dev_sync_region.isra.14
With high memory rates the symptom is lack of convergence as soon as it has a vhost device with a sufficiently high number of queues, the sufficient number of vhost devices.
On every migration iteration (every 100msecs) it will redundantly query the *shared log* the number of queues configured with vhost that exist in the guest. For the virtqueue data, this is necessary, but not for the memory sections which are the same. So essentially we end up scanning the dirty log too often.
To fix that, select a vhost device responsible for scanning the log with regards to memory sections dirty tracking. It is selected when we enable the logger (during migration) and cleared when we disable the logger. If the vhost logger device goes away for some reason, the logger will be re-selected from the rest of vhost devices.
After making mem-section logger a singleton instance, constant cost of 7%-9% (like the 1 queue report) will be seen, no matter how many queues or how many vhost devices are configured:
48 queues -> 8.71% [.] vhost_dev_sync_region.isra.13
2 devices, 8 queues -> 7.97% [.] vhost_dev_sync_region.isra.14
Message-Id: <[email protected]>
--- include/hw/virtio/vhost.h | 1 + hw/virtio/vhost.c | 67 +++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 6 deletions(-)
include/hw/virtio/vhost.h +1 -0
@@ -129,6 +129,7 @@ struct vhost_dev {void *opaque;struct vhost_log *log;QLIST_ENTRY (vhost_dev) entry; +QLIST_ENTRY (vhost_dev) logdev_entry; QLIST_HEAD(, vhost_iommu) iommu_list;IOMMUNotifier n;const VhostDevConfigOps *config_ops;
hw/virtio/vhost.c +61 -6
103 lines not on this page · raw message
Signature · 1 line
MST
[PULL v2 70/88] tests/data/acpi: Move x86 ACPI tables under x86/${machine} path
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
To support multiple architectures using same machine name, create x86 folder and move all x86 related AML files for each machine type inside.
Message-Id: <[email protected]>
---
tests/data/acpi/{ => x86}/microvm/APIC | Bin
tests/data/acpi/{ => x86}/microvm/APIC.ioapic2 | Bin
tests/data/acpi/{ => x86}/microvm/APIC.pcie | Bin
tests/data/acpi/{ => x86}/microvm/DSDT | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.ioapic2 | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.pcie | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.rtc | Bin
tests/data/acpi/{ => x86}/microvm/DSDT.usb | Bin
tests/data/acpi/{ => x86}/microvm/ERST.pcie | Bin
tests/data/acpi/{ => x86}/microvm/FACP | Bin
tests/data/acpi/{ => x86}/pc/APIC | Bin
tests/data/acpi/{ => x86}/pc/APIC.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/APIC.cphp | Bin
tests/data/acpi/{ => x86}/pc/APIC.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/DSDT | Bin
tests/data/acpi/{ => x86}/pc/DSDT.acpierst | Bin
tests/data/acpi/{ => x86}/pc/DSDT.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/DSDT.bridge | Bin
tests/data/acpi/{ => x86}/pc/DSDT.cphp | Bin
tests/data/acpi/{ => x86}/pc/DSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/DSDT.hpbridge | Bin
tests/data/acpi/{ => x86}/pc/DSDT.hpbrroot | Bin
tests/data/acpi/{ => x86}/pc/DSDT.ipmikcs | Bin
tests/data/acpi/{ => x86}/pc/DSDT.memhp | Bin
tests/data/acpi/{ => x86}/pc/DSDT.nohpet | Bin
tests/data/acpi/{ => x86}/pc/DSDT.numamem | Bin
tests/data/acpi/{ => x86}/pc/DSDT.roothp | Bin
tests/data/acpi/{ => x86}/pc/ERST.acpierst | Bin
tests/data/acpi/{ => x86}/pc/FACP | Bin
tests/data/acpi/{ => x86}/pc/FACP.nosmm | Bin
tests/data/acpi/{ => x86}/pc/FACS | Bin
tests/data/acpi/{ => x86}/pc/HMAT.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/HPET | Bin
tests/data/acpi/{ => x86}/pc/NFIT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/SLIT.cphp | Bin
tests/data/acpi/{ => x86}/pc/SLIT.memhp | Bin
tests/data/acpi/{ => x86}/pc/SRAT.acpihmat | Bin
tests/data/acpi/{ => x86}/pc/SRAT.cphp | Bin
tests/data/acpi/{ => x86}/pc/SRAT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/SRAT.memhp | Bin
tests/data/acpi/{ => x86}/pc/SRAT.numamem | Bin
tests/data/acpi/{ => x86}/pc/SSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/pc/WAET | Bin
tests/data/acpi/{ => x86}/q35/APIC | Bin
tests/data/acpi/{ => x86}/q35/APIC.acpihmat | Bin
.../acpi/{ => x86}/q35/APIC.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/APIC.core-count | Bin
tests/data/acpi/{ => x86}/q35/APIC.core-count2 | Bin
tests/data/acpi/{ => x86}/q35/APIC.cphp | Bin
tests/data/acpi/{ => x86}/q35/APIC.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/APIC.thread-count | Bin
tests/data/acpi/{ => x86}/q35/APIC.thread-count2 | Bin
tests/data/acpi/{ => x86}/q35/APIC.type4-count | Bin
tests/data/acpi/{ => x86}/q35/APIC.xapic | Bin
tests/data/acpi/{ => x86}/q35/CEDT.cxl | Bin
tests/data/acpi/{ => x86}/q35/DMAR.dmar | Bin
tests/data/acpi/{ => x86}/q35/DSDT | Bin
tests/data/acpi/{ => x86}/q35/DSDT.acpierst | Bin
tests/data/acpi/{ => x86}/q35/DSDT.acpihmat | Bin
.../acpi/{ => x86}/q35/DSDT.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/DSDT.applesmc | Bin
tests/data/acpi/{ => x86}/q35/DSDT.bridge | Bin
tests/data/acpi/{ => x86}/q35/DSDT.core-count | Bin
tests/data/acpi/{ => x86}/q35/DSDT.core-count2 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.cphp | Bin
tests/data/acpi/{ => x86}/q35/DSDT.cxl | Bin
tests/data/acpi/{ => x86}/q35/DSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/DSDT.ipmibt | Bin
tests/data/acpi/{ => x86}/q35/DSDT.ipmismbus | Bin
tests/data/acpi/{ => x86}/q35/DSDT.ivrs | Bin
tests/data/acpi/{ => x86}/q35/DSDT.memhp | Bin
tests/data/acpi/{ => x86}/q35/DSDT.mmio64 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.multi-bridge | Bin
tests/data/acpi/{ => x86}/q35/DSDT.noacpihp | Bin
tests/data/acpi/{ => x86}/q35/DSDT.nohpet | Bin
tests/data/acpi/{ => x86}/q35/DSDT.numamem | Bin
tests/data/acpi/{ => x86}/q35/DSDT.pvpanic-isa | Bin
tests/data/acpi/{ => x86}/q35/DSDT.thread-count | Bin
tests/data/acpi/{ => x86}/q35/DSDT.thread-count2 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm12 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm2 | Bin
tests/data/acpi/{ => x86}/q35/DSDT.type4-count | Bin
tests/data/acpi/{ => x86}/q35/DSDT.viot | Bin
tests/data/acpi/{ => x86}/q35/DSDT.xapic | Bin
tests/data/acpi/{ => x86}/q35/ERST.acpierst | Bin
tests/data/acpi/{ => x86}/q35/FACP | Bin
tests/data/acpi/{ => x86}/q35/FACP.core-count | Bin
tests/data/acpi/{ => x86}/q35/FACP.core-count2 | Bin
tests/data/acpi/{ => x86}/q35/FACP.nosmm | Bin
tests/data/acpi/{ => x86}/q35/FACP.slic | Bin
tests/data/acpi/{ => x86}/q35/FACP.thread-count | Bin
tests/data/acpi/{ => x86}/q35/FACP.thread-count2 | Bin
tests/data/acpi/{ => x86}/q35/FACP.type4-count | Bin
tests/data/acpi/{ => x86}/q35/FACP.xapic | Bin
tests/data/acpi/{ => x86}/q35/FACS | Bin
tests/data/acpi/{ => x86}/q35/HMAT.acpihmat | Bin
.../acpi/{ => x86}/q35/HMAT.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/HPET | Bin
tests/data/acpi/{ => x86}/q35/IVRS.ivrs | Bin
tests/data/acpi/{ => x86}/q35/MCFG | Bin
tests/data/acpi/{ => x86}/q35/NFIT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/SLIC.slic | Bin
tests/data/acpi/{ => x86}/q35/SLIT.cphp | Bin
tests/data/acpi/{ => x86}/q35/SLIT.memhp | Bin
tests/data/acpi/{ => x86}/q35/SRAT.acpihmat | Bin
.../acpi/{ => x86}/q35/SRAT.acpihmat-noinitiator | Bin
tests/data/acpi/{ => x86}/q35/SRAT.cphp | Bin
tests/data/acpi/{ => x86}/q35/SRAT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/SRAT.memhp | Bin
tests/data/acpi/{ => x86}/q35/SRAT.mmio64 | Bin
tests/data/acpi/{ => x86}/q35/SRAT.numamem | Bin
tests/data/acpi/{ => x86}/q35/SRAT.xapic | Bin
tests/data/acpi/{ => x86}/q35/SSDT.dimmpxm | Bin
tests/data/acpi/{ => x86}/q35/TCPA.tis.tpm12 | Bin
tests/data/acpi/{ => x86}/q35/TPM2.tis.tpm2 | Bin
tests/data/acpi/{ => x86}/q35/VIOT.viot | Bin
tests/data/acpi/{ => x86}/q35/WAET | Bin
117 files changed, 0 insertions(+), 0 deletions(-)
rename tests/data/acpi/{ => x86}/microvm/APIC (100%)
rename tests/data/acpi/{ => x86}/microvm/APIC.ioapic2 (100%)
rename tests/data/acpi/{ => x86}/microvm/APIC.pcie (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.ioapic2 (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.pcie (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.rtc (100%)
rename tests/data/acpi/{ => x86}/microvm/DSDT.usb (100%)
rename tests/data/acpi/{ => x86}/microvm/ERST.pcie (100%)
rename tests/data/acpi/{ => x86}/microvm/FACP (100%)
rename tests/data/acpi/{ => x86}/pc/APIC (100%)
rename tests/data/acpi/{ => x86}/pc/APIC.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/APIC.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/APIC.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.acpierst (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.bridge (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.hpbridge (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.hpbrroot (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.ipmikcs (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.memhp (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.nohpet (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.numamem (100%)
rename tests/data/acpi/{ => x86}/pc/DSDT.roothp (100%)
rename tests/data/acpi/{ => x86}/pc/ERST.acpierst (100%)
rename tests/data/acpi/{ => x86}/pc/FACP (100%)
rename tests/data/acpi/{ => x86}/pc/FACP.nosmm (100%)
rename tests/data/acpi/{ => x86}/pc/FACS (100%)
rename tests/data/acpi/{ => x86}/pc/HMAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/HPET (100%)
rename tests/data/acpi/{ => x86}/pc/NFIT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/SLIT.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/SLIT.memhp (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.cphp (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.memhp (100%)
rename tests/data/acpi/{ => x86}/pc/SRAT.numamem (100%)
rename tests/data/acpi/{ => x86}/pc/SSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/pc/WAET (100%)
rename tests/data/acpi/{ => x86}/q35/APIC (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.core-count (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.core-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.thread-count (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.thread-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.type4-count (100%)
rename tests/data/acpi/{ => x86}/q35/APIC.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/CEDT.cxl (100%)
rename tests/data/acpi/{ => x86}/q35/DMAR.dmar (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.acpierst (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.applesmc (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.bridge (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.core-count (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.core-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.cxl (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.ipmibt (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.ipmismbus (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.ivrs (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.memhp (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.mmio64 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.multi-bridge (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.noacpihp (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.nohpet (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.numamem (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.pvpanic-isa (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.thread-count (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.thread-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm12 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.tis.tpm2 (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.type4-count (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.viot (100%)
rename tests/data/acpi/{ => x86}/q35/DSDT.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/ERST.acpierst (100%)
rename tests/data/acpi/{ => x86}/q35/FACP (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.core-count (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.core-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.nosmm (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.slic (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.thread-count (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.thread-count2 (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.type4-count (100%)
rename tests/data/acpi/{ => x86}/q35/FACP.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/FACS (100%)
rename tests/data/acpi/{ => x86}/q35/HMAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/HMAT.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/HPET (100%)
rename tests/data/acpi/{ => x86}/q35/IVRS.ivrs (100%)
rename tests/data/acpi/{ => x86}/q35/MCFG (100%)
rename tests/data/acpi/{ => x86}/q35/NFIT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/SLIC.slic (100%)
rename tests/data/acpi/{ => x86}/q35/SLIT.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/SLIT.memhp (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.acpihmat (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.acpihmat-noinitiator (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.cphp (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.memhp (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.mmio64 (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.numamem (100%)
rename tests/data/acpi/{ => x86}/q35/SRAT.xapic (100%)
rename tests/data/acpi/{ => x86}/q35/SSDT.dimmpxm (100%)
rename tests/data/acpi/{ => x86}/q35/TCPA.tis.tpm12 (100%)
rename tests/data/acpi/{ => x86}/q35/TPM2.tis.tpm2 (100%)
rename tests/data/acpi/{ => x86}/q35/VIOT.viot (100%)
rename tests/data/acpi/{ => x86}/q35/WAET (100%)tests/data/acpi/x86/microvm/APIC renamed from tests/data/acpi/microvm/APIC +0 -0
tests/data/acpi/x86/microvm/APIC.ioapic2 renamed from tests/data/acpi/microvm/APIC.ioapic2 +0 -0
tests/data/acpi/x86/microvm/APIC.pcie renamed from tests/data/acpi/microvm/APIC.pcie +0 -0
tests/data/acpi/x86/microvm/DSDT renamed from tests/data/acpi/microvm/DSDT +0 -0
tests/data/acpi/x86/microvm/DSDT.ioapic2 renamed from tests/data/acpi/microvm/DSDT.ioapic2 +0 -0
tests/data/acpi/x86/microvm/DSDT.pcie renamed from tests/data/acpi/microvm/DSDT.pcie +0 -0
tests/data/acpi/x86/microvm/DSDT.rtc renamed from tests/data/acpi/microvm/DSDT.rtc +0 -0
tests/data/acpi/x86/microvm/DSDT.usb renamed from tests/data/acpi/microvm/DSDT.usb +0 -0
tests/data/acpi/x86/microvm/ERST.pcie renamed from tests/data/acpi/microvm/ERST.pcie +0 -0
tests/data/acpi/x86/microvm/FACP renamed from tests/data/acpi/microvm/FACP +0 -0
tests/data/acpi/x86/pc/APIC renamed from tests/data/acpi/pc/APIC +0 -0
tests/data/acpi/x86/pc/APIC.acpihmat renamed from tests/data/acpi/pc/APIC.acpihmat +0 -0
tests/data/acpi/x86/pc/APIC.cphp renamed from tests/data/acpi/pc/APIC.cphp +0 -0
tests/data/acpi/x86/pc/APIC.dimmpxm renamed from tests/data/acpi/pc/APIC.dimmpxm +0 -0
tests/data/acpi/x86/pc/DSDT renamed from tests/data/acpi/pc/DSDT +0 -0
tests/data/acpi/x86/pc/DSDT.acpierst renamed from tests/data/acpi/pc/DSDT.acpierst +0 -0
tests/data/acpi/x86/pc/DSDT.acpihmat renamed from tests/data/acpi/pc/DSDT.acpihmat +0 -0
tests/data/acpi/x86/pc/DSDT.bridge renamed from tests/data/acpi/pc/DSDT.bridge +0 -0
tests/data/acpi/x86/pc/DSDT.cphp renamed from tests/data/acpi/pc/DSDT.cphp +0 -0
tests/data/acpi/x86/pc/DSDT.dimmpxm renamed from tests/data/acpi/pc/DSDT.dimmpxm +0 -0
tests/data/acpi/x86/pc/DSDT.hpbridge renamed from tests/data/acpi/pc/DSDT.hpbridge +0 -0
tests/data/acpi/x86/pc/DSDT.hpbrroot renamed from tests/data/acpi/pc/DSDT.hpbrroot +0 -0
tests/data/acpi/x86/pc/DSDT.ipmikcs renamed from tests/data/acpi/pc/DSDT.ipmikcs +0 -0
tests/data/acpi/x86/pc/DSDT.memhp renamed from tests/data/acpi/pc/DSDT.memhp +0 -0
tests/data/acpi/x86/pc/DSDT.nohpet renamed from tests/data/acpi/pc/DSDT.nohpet +0 -0
tests/data/acpi/x86/pc/DSDT.numamem renamed from tests/data/acpi/pc/DSDT.numamem +0 -0
tests/data/acpi/x86/pc/DSDT.roothp renamed from tests/data/acpi/pc/DSDT.roothp +0 -0
tests/data/acpi/x86/pc/ERST.acpierst renamed from tests/data/acpi/pc/ERST.acpierst +0 -0
tests/data/acpi/x86/pc/FACP renamed from tests/data/acpi/pc/FACP +0 -0
tests/data/acpi/x86/pc/FACP.nosmm renamed from tests/data/acpi/pc/FACP.nosmm +0 -0
tests/data/acpi/x86/pc/FACS renamed from tests/data/acpi/pc/FACS +0 -0
tests/data/acpi/x86/pc/HMAT.acpihmat renamed from tests/data/acpi/pc/HMAT.acpihmat +0 -0
tests/data/acpi/x86/pc/HPET renamed from tests/data/acpi/pc/HPET +0 -0
tests/data/acpi/x86/pc/NFIT.dimmpxm renamed from tests/data/acpi/pc/NFIT.dimmpxm +0 -0
tests/data/acpi/x86/pc/SLIT.cphp renamed from tests/data/acpi/pc/SLIT.cphp +0 -0
tests/data/acpi/x86/pc/SLIT.memhp renamed from tests/data/acpi/pc/SLIT.memhp +0 -0
tests/data/acpi/x86/pc/SRAT.acpihmat renamed from tests/data/acpi/pc/SRAT.acpihmat +0 -0
tests/data/acpi/x86/pc/SRAT.cphp renamed from tests/data/acpi/pc/SRAT.cphp +0 -0
tests/data/acpi/x86/pc/SRAT.dimmpxm renamed from tests/data/acpi/pc/SRAT.dimmpxm +0 -0
tests/data/acpi/x86/pc/SRAT.memhp renamed from tests/data/acpi/pc/SRAT.memhp +0 -0
tests/data/acpi/x86/pc/SRAT.numamem renamed from tests/data/acpi/pc/SRAT.numamem +0 -0
tests/data/acpi/x86/pc/SSDT.dimmpxm renamed from tests/data/acpi/pc/SSDT.dimmpxm +0 -0
tests/data/acpi/x86/pc/WAET renamed from tests/data/acpi/pc/WAET +0 -0
tests/data/acpi/x86/q35/APIC renamed from tests/data/acpi/q35/APIC +0 -0
tests/data/acpi/x86/q35/APIC.acpihmat renamed from tests/data/acpi/q35/APIC.acpihmat +0 -0
tests/data/acpi/x86/q35/APIC.acpihmat-noinitiator renamed from tests/data/acpi/q35/APIC.acpihmat-noinitiator +0 -0
tests/data/acpi/x86/q35/APIC.core-count renamed from tests/data/acpi/q35/APIC.core-count +0 -0
tests/data/acpi/x86/q35/APIC.core-count2 renamed from tests/data/acpi/q35/APIC.core-count2 +0 -0
tests/data/acpi/x86/q35/APIC.cphp renamed from tests/data/acpi/q35/APIC.cphp +0 -0
tests/data/acpi/x86/q35/APIC.dimmpxm renamed from tests/data/acpi/q35/APIC.dimmpxm +0 -0
tests/data/acpi/x86/q35/APIC.thread-count renamed from tests/data/acpi/q35/APIC.thread-count +0 -0
tests/data/acpi/x86/q35/APIC.thread-count2 renamed from tests/data/acpi/q35/APIC.thread-count2 +0 -0
tests/data/acpi/x86/q35/APIC.type4-count renamed from tests/data/acpi/q35/APIC.type4-count +0 -0
tests/data/acpi/x86/q35/APIC.xapic renamed from tests/data/acpi/q35/APIC.xapic +0 -0
tests/data/acpi/x86/q35/CEDT.cxl renamed from tests/data/acpi/q35/CEDT.cxl +0 -0
tests/data/acpi/x86/q35/DMAR.dmar renamed from tests/data/acpi/q35/DMAR.dmar +0 -0
tests/data/acpi/x86/q35/DSDT renamed from tests/data/acpi/q35/DSDT +0 -0
tests/data/acpi/x86/q35/DSDT.acpierst renamed from tests/data/acpi/q35/DSDT.acpierst +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat renamed from tests/data/acpi/q35/DSDT.acpihmat +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator renamed from tests/data/acpi/q35/DSDT.acpihmat-noinitiator +0 -0
tests/data/acpi/x86/q35/DSDT.applesmc renamed from tests/data/acpi/q35/DSDT.applesmc +0 -0
tests/data/acpi/x86/q35/DSDT.bridge renamed from tests/data/acpi/q35/DSDT.bridge +0 -0
tests/data/acpi/x86/q35/DSDT.core-count renamed from tests/data/acpi/q35/DSDT.core-count +0 -0
tests/data/acpi/x86/q35/DSDT.core-count2 renamed from tests/data/acpi/q35/DSDT.core-count2 +0 -0
tests/data/acpi/x86/q35/DSDT.cphp renamed from tests/data/acpi/q35/DSDT.cphp +0 -0
tests/data/acpi/x86/q35/DSDT.cxl renamed from tests/data/acpi/q35/DSDT.cxl +0 -0
tests/data/acpi/x86/q35/DSDT.dimmpxm renamed from tests/data/acpi/q35/DSDT.dimmpxm +0 -0
tests/data/acpi/x86/q35/DSDT.ipmibt renamed from tests/data/acpi/q35/DSDT.ipmibt +0 -0
tests/data/acpi/x86/q35/DSDT.ipmismbus renamed from tests/data/acpi/q35/DSDT.ipmismbus +0 -0
tests/data/acpi/x86/q35/DSDT.ivrs renamed from tests/data/acpi/q35/DSDT.ivrs +0 -0
tests/data/acpi/x86/q35/DSDT.memhp renamed from tests/data/acpi/q35/DSDT.memhp +0 -0
tests/data/acpi/x86/q35/DSDT.mmio64 renamed from tests/data/acpi/q35/DSDT.mmio64 +0 -0
tests/data/acpi/x86/q35/DSDT.multi-bridge renamed from tests/data/acpi/q35/DSDT.multi-bridge +0 -0
tests/data/acpi/x86/q35/DSDT.noacpihp renamed from tests/data/acpi/q35/DSDT.noacpihp +0 -0
tests/data/acpi/x86/q35/DSDT.nohpet renamed from tests/data/acpi/q35/DSDT.nohpet +0 -0
tests/data/acpi/x86/q35/DSDT.numamem renamed from tests/data/acpi/q35/DSDT.numamem +0 -0
tests/data/acpi/x86/q35/DSDT.pvpanic-isa renamed from tests/data/acpi/q35/DSDT.pvpanic-isa +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count renamed from tests/data/acpi/q35/DSDT.thread-count +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count2 renamed from tests/data/acpi/q35/DSDT.thread-count2 +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm12 renamed from tests/data/acpi/q35/DSDT.tis.tpm12 +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm2 renamed from tests/data/acpi/q35/DSDT.tis.tpm2 +0 -0
tests/data/acpi/x86/q35/DSDT.type4-count renamed from tests/data/acpi/q35/DSDT.type4-count +0 -0
tests/data/acpi/x86/q35/DSDT.viot renamed from tests/data/acpi/q35/DSDT.viot +0 -0
tests/data/acpi/x86/q35/DSDT.xapic renamed from tests/data/acpi/q35/DSDT.xapic +0 -0
tests/data/acpi/x86/q35/ERST.acpierst renamed from tests/data/acpi/q35/ERST.acpierst +0 -0
tests/data/acpi/x86/q35/FACP renamed from tests/data/acpi/q35/FACP +0 -0
tests/data/acpi/x86/q35/FACP.core-count renamed from tests/data/acpi/q35/FACP.core-count +0 -0
tests/data/acpi/x86/q35/FACP.core-count2 renamed from tests/data/acpi/q35/FACP.core-count2 +0 -0
tests/data/acpi/x86/q35/FACP.nosmm renamed from tests/data/acpi/q35/FACP.nosmm +0 -0
tests/data/acpi/x86/q35/FACP.slic renamed from tests/data/acpi/q35/FACP.slic +0 -0
tests/data/acpi/x86/q35/FACP.thread-count renamed from tests/data/acpi/q35/FACP.thread-count +0 -0
tests/data/acpi/x86/q35/FACP.thread-count2 renamed from tests/data/acpi/q35/FACP.thread-count2 +0 -0
tests/data/acpi/x86/q35/FACP.type4-count renamed from tests/data/acpi/q35/FACP.type4-count +0 -0
tests/data/acpi/x86/q35/FACP.xapic renamed from tests/data/acpi/q35/FACP.xapic +0 -0
tests/data/acpi/x86/q35/FACS renamed from tests/data/acpi/q35/FACS +0 -0
tests/data/acpi/x86/q35/HMAT.acpihmat renamed from tests/data/acpi/q35/HMAT.acpihmat +0 -0
tests/data/acpi/x86/q35/HMAT.acpihmat-noinitiator renamed from tests/data/acpi/q35/HMAT.acpihmat-noinitiator +0 -0
tests/data/acpi/x86/q35/HPET renamed from tests/data/acpi/q35/HPET +0 -0
tests/data/acpi/x86/q35/IVRS.ivrs renamed from tests/data/acpi/q35/IVRS.ivrs +0 -0
tests/data/acpi/x86/q35/MCFG renamed from tests/data/acpi/q35/MCFG +0 -0
tests/data/acpi/x86/q35/NFIT.dimmpxm renamed from tests/data/acpi/q35/NFIT.dimmpxm +0 -0
tests/data/acpi/x86/q35/SLIC.slic renamed from tests/data/acpi/q35/SLIC.slic +0 -0
tests/data/acpi/x86/q35/SLIT.cphp renamed from tests/data/acpi/q35/SLIT.cphp +0 -0
tests/data/acpi/x86/q35/SLIT.memhp renamed from tests/data/acpi/q35/SLIT.memhp +0 -0
tests/data/acpi/x86/q35/SRAT.acpihmat renamed from tests/data/acpi/q35/SRAT.acpihmat +0 -0
tests/data/acpi/x86/q35/SRAT.acpihmat-noinitiator renamed from tests/data/acpi/q35/SRAT.acpihmat-noinitiator +0 -0
tests/data/acpi/x86/q35/SRAT.cphp renamed from tests/data/acpi/q35/SRAT.cphp +0 -0
tests/data/acpi/x86/q35/SRAT.dimmpxm renamed from tests/data/acpi/q35/SRAT.dimmpxm +0 -0
tests/data/acpi/x86/q35/SRAT.memhp renamed from tests/data/acpi/q35/SRAT.memhp +0 -0
tests/data/acpi/x86/q35/SRAT.mmio64 renamed from tests/data/acpi/q35/SRAT.mmio64 +0 -0
tests/data/acpi/x86/q35/SRAT.numamem renamed from tests/data/acpi/q35/SRAT.numamem +0 -0
tests/data/acpi/x86/q35/SRAT.xapic renamed from tests/data/acpi/q35/SRAT.xapic +0 -0
tests/data/acpi/x86/q35/SSDT.dimmpxm renamed from tests/data/acpi/q35/SSDT.dimmpxm +0 -0
tests/data/acpi/x86/q35/TCPA.tis.tpm12 renamed from tests/data/acpi/q35/TCPA.tis.tpm12 +0 -0
tests/data/acpi/x86/q35/TPM2.tis.tpm2 renamed from tests/data/acpi/q35/TPM2.tis.tpm2 +0 -0
tests/data/acpi/x86/q35/VIOT.viot renamed from tests/data/acpi/q35/VIOT.viot +0 -0
tests/data/acpi/x86/q35/WAET renamed from tests/data/acpi/q35/WAET +0 -0
Signature · 1 line
MST
[PULL v2 27/88] hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 block. When a DC extent is accepted, all the bits representing the blocks in the extent are set, which will be cleared when the extent is released.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 7 ++++ hw/cxl/cxl-mailbox-utils.c | 3 ++ hw/mem/cxl_type3.c | 76 +++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+)
include/hw/cxl/cxl_device.h +7 -0
@@ -456,6 +456,7 @@ typedef struct CXLDCRegion {uint64_t block_size;uint32_t dsmadhandle;uint8_t flags; +unsigned long *blk_bitmap; } CXLDCRegion;struct CXLType3Dev {
@@ -577,4 +578,10 @@ CXLDCExtentGroup *cxl_insert_extent_to_extent_group(CXLDCExtentGroup *group,void cxl_extent_group_list_insert_tail (CXLDCExtentGroupList *list,CXLDCExtentGroup *group);void cxl_extent_group_list_delete_front (CXLDCExtentGroupList *list); +void ct3_set_region_block_backed (CXLType3Dev *ct3d,uint64_t dpa, +uint64_t len); +void ct3_clear_region_block_backed (CXLType3Dev *ct3d,uint64_t dpa, +uint64_t len); +bool ct3_test_region_block_backed (CXLType3Dev *ct3d,uint64_t dpa, +uint64_t len);#endif
hw/cxl/cxl-mailbox-utils.c +3 -0
@@ -1655,6 +1655,7 @@ static CXLRetCode cmd_dcd_add_dyn_cap_rsp(const struct cxl_cmd *cmd,cxl_insert_extent_to_extent_list (extent_list, dpa, len,NULL ,0 ); ct3d->dc.total_extent_count +=1 ; +ct3_set_region_block_backed (ct3d, dpa, len); }/* Remove the first extent group in the pending list */ cxl_extent_group_list_delete_front (&ct3d->dc.extents_pending);
@@ -1813,10 +1814,12 @@ static CXLRetCode cmd_dcd_release_dyn_cap(const struct cxl_cmd *cmd,* list and update the extent count; */ QTAILQ_FOREACH_SAFE(ent, &ct3d->dc.extents, node, ent_next) { +ct3_clear_region_block_backed (ct3d, ent->start_dpa, ent->len);cxl_remove_extent_from_extent_list (&ct3d->dc.extents, ent); }copy_extent_list (&ct3d->dc.extents, &updated_list); QTAILQ_FOREACH_SAFE(ent, &updated_list, node, ent_next) { +ct3_set_region_block_backed (ct3d, ent->start_dpa, ent->len);cxl_remove_extent_from_extent_list (&updated_list, ent); } ct3d->dc.total_extent_count = updated_list_size;
hw/mem/cxl_type3.c +76 -0
106 lines not on this page · raw message
Signature · 1 line
MST
[PULL v2 81/88] hw/ppc/spapr_pci: Do not reject VFs created after a PF
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
A PF may automatically create VFs and the PF may be function 0.
Message-Id: <[email protected]>
--- hw/ppc/spapr_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/ppc/spapr_pci.c +3 -1
@@ -1573,7 +1573,9 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler,* hotplug, we do not allow functions to be hotplugged to a * slot that already has function 0 present */ -if (plugged_dev->hotplugged && bus->devices[PCI_DEVFN (slotnr,0 )] && +if (plugged_dev->hotplugged && + !pci_is_vf (pdev) && + bus->devices[PCI_DEVFN (slotnr,0 )] &&PCI_FUNC (pdev->devfn) !=0 ) { error_setg(errp, "PCI: slot %d function 0 already occupied by %s," " additional functions can no longer be exposed to guest.",
Signature · 1 line
MST
[PULL v2 04/88] virtio/virtio-pci: Handle extra notification data
In reply to Michael S. TsirkinFrom: Jonah Palmer <[email protected]>
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 the device's virtqueue layout.
In a split virtqueue layout, this data includes:
- upper 16 bits: shadow_avail_idx
- lower 16 bits: virtqueue index
In a packed virtqueue layout, this data includes:
- upper 16 bits: 1-bit wrap counter & 15-bit shadow_avail_idx
- lower 16 bits: virtqueue index
Message-Id: <[email protected]>
--- include/hw/virtio/virtio.h | 2 ++ hw/virtio/virtio-pci.c | 12 +++++++++--- hw/virtio/virtio.c | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-)
include/hw/virtio/virtio.h +2 -0
@@ -307,6 +307,8 @@ int virtio_queue_ready(VirtQueue *vq);int virtio_queue_empty (VirtQueue *vq); +void virtio_queue_set_shadow_avail_idx (VirtQueue *vq,uint16_t idx); +/* Host binding interface. */ uint32_t virtio_config_readb (VirtIODevice *vdev,uint32_t addr);
hw/virtio/virtio-pci.c +9 -3
@@ -384,7 +384,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) {VirtIOPCIProxy *proxy = opaque;VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); -uint16_t vector; +uint16_t vector, vq_idx;hwaddr pa;switch (addr) {
@@ -408,8 +408,14 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) vdev->queue_sel = val;break ;case VIRTIO_PCI_QUEUE_NOTIFY : -if (val <VIRTIO_QUEUE_MAX ) { -virtio_queue_notify (vdev, val); + vq_idx = val; +if (vq_idx <VIRTIO_QUEUE_MAX &&virtio_queue_get_num (vdev, vq_idx)) { +if (virtio_vdev_has_feature (vdev,VIRTIO_F_NOTIFICATION_DATA )) { +VirtQueue *vq =virtio_get_queue (vdev, vq_idx); + +virtio_queue_set_shadow_avail_idx (vq, val >>16 ); + } +virtio_queue_notify (vdev, vq_idx); }break ;case VIRTIO_PCI_STATUS :
hw/virtio/virtio.c +18 -0
@@ -2264,6 +2264,24 @@ void virtio_queue_set_align(VirtIODevice *vdev, int n, int align) } } +void virtio_queue_set_shadow_avail_idx (VirtQueue *vq,uint16_t shadow_avail_idx) +{ +if (!vq->vring.desc) { +return ; + } + +/* +* 16-bit data for packed VQs include 1-bit wrap counter and +* 15-bit shadow_avail_idx. +*/ +if (virtio_vdev_has_feature (vq->vdev,VIRTIO_F_RING_PACKED )) { + vq->shadow_avail_wrap_counter = (shadow_avail_idx >>15 ) &0x1 ; + vq->shadow_avail_idx = shadow_avail_idx &0x7FFF ; + }else { + vq->shadow_avail_idx = shadow_avail_idx; + } +} +static void virtio_queue_notify_vq (VirtQueue *vq) {if (vq->vring.desc && vq->handle_output) {
Signature · 1 line
MST
[PULL v2 41/88] i386/apic: Add hint on boot failure because of disabling x2APIC
In reply to Michael S. TsirkinFrom: Zhao Liu <[email protected]>
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/apic_common.c:449:
qemu-system-i386: APIC ID 255 requires x2APIC feature in CPU Aborted (core dumped)
This error can be resolved by setting x2apic=on in -cpu. In order to better help users deal with this scenario, add the error hint to instruct users on how to enable the x2apic feature. Then, the error report becomes the following:
Unexpected error in apic_common_set_id() at ../hw/intc/apic_common.c:448:
qemu-system-i386: APIC ID 255 requires x2APIC feature in CPU Try x2apic=on in -cpu.
Aborted (core dumped)
Note since @errp is &error_abort, error_append_hint() can't be applied on @errp. And in order to separate the exact error message from the (perhaps effectively) hint, adding a hint via error_append_hint() is also necessary. Therefore, introduce @local_error in apic_common_set_id() to handle both the error message and the error hint.
Message-Id: <[email protected]>
--- hw/intc/apic_common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
hw/intc/apic_common.c +6 -1
@@ -433,6 +433,7 @@ static void apic_common_set_id(Object *obj, Visitor *v, const char *name,APICCommonState *s =APIC_COMMON (obj);DeviceState *dev =DEVICE (obj);uint32_t value; +Error *local_err =NULL ;if (dev->realized) {qdev_prop_set_after_realize (dev, name, errp);
@@ -444,7 +445,11 @@ static void apic_common_set_id(Object *obj, Visitor *v, const char *name, }if (value >=255 && !cpu_has_x2apic_feature (&s->cpu->env)) { -error_setg (errp,"APIC ID %d requires x2APIC feature in CPU" , value); +error_setg (&local_err, +"APIC ID %d requires x2APIC feature in CPU" , + value); +error_append_hint (&local_err,"Try x2apic=on in -cpu.\n" ); +error_propagate (errp, local_err);return ; }
Signature · 1 line
MST
[PULL v2 11/88] hw/virtio: Fix obtain the buffer id from the last descriptor
In reply to Michael S. TsirkinFrom: Wafer <[email protected]>
The virtio-1.3 specification
<https://docs.oasis-open.org/virtio/virtio/v1.3/virtio-v1.3.html> 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 descriptor in the virtqueue.
Therefor the buffer id should be obtained from the first descriptor.
In descriptor chaining scenarios, the buffer id should be obtained from the last descriptor.
Message-Id: <[email protected]>
--- hw/virtio/virtio.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/virtio/virtio.c +5 -0
@@ -1745,6 +1745,11 @@ static void *virtqueue_packed_pop(VirtQueue *vq, size_t sz) &indirect_desc_cache); }while (rc ==VIRTQUEUE_READ_DESC_MORE ); +if (desc_cache != &indirect_desc_cache) { +/* Buffer ID is included in the last descriptor in the list. */ + id = desc.id; + } +/* Now copy what we have collected and mapped */ elem =virtqueue_alloc_element (sz, out_num, in_num);for (i =0 ; i < out_num; i++) {
Signature · 1 line
MST
[PULL v2 62/88] hw/arm/virt-acpi-build: Fix id_count in build_iort_id_mapping
In reply to Michael S. TsirkinFrom: Nicolin Chen <[email protected]>
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 "minus one". Meanwhile, some of the callers pass in a 0xFFFF following the spec. So, this is a mismatch between the function and its callers.
Fix build_iort_id_mapping() by internally subtracting one from the pass-in @id_count. Accordingly make sure that all existing callers pass in a value without the "minus one", i.e. change all 0xFFFFs to 0x10000s.
Also, add a few lines of comments to highlight this change along with the referencing document for this build_iort_id_mapping().
Message-Id: <[email protected]>
--- hw/arm/virt-acpi-build.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
hw/arm/virt-acpi-build.c +13 -6
@@ -209,12 +209,19 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)#define ROOT_COMPLEX_ENTRY_SIZE 36#define IORT_NODE_OFFSET 48 +/* +* Append an ID mapping entry as described by "Table 4 ID mapping format" in +* "IO Remapping Table System Software on ARM Platforms", Chapter 3. +* Document number: ARM DEN 0049E.f, Apr 2024 +* +* Note that @id_count gets internally subtracted by one, following the spec. +*/ static void build_iort_id_mapping (GArray *table_data,uint32_t input_base,uint32_t id_count,uint32_t out_ref) { -/* Table 4 ID mapping format */ build_append_int_noprefix (table_data, input_base,4 );/* Input base */ -build_append_int_noprefix (table_data, id_count,4 );/* Number of IDs */ +/* Number of IDs - The number of IDs in the range minus one */ +build_append_int_noprefix (table_data, id_count -1 ,4 );build_append_int_noprefix (table_data, input_base,4 );/* Output base */ build_append_int_noprefix (table_data, out_ref,4 );/* Output Reference */ /* Flags */
@@ -305,8 +312,8 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) }/* Append the last RC -> ITS ID mapping */ -if (next_range.input_base <0xFFFF ) { - next_range.id_count =0xFFFF - next_range.input_base; +if (next_range.input_base <0x10000 ) { + next_range.id_count =0x10000 - next_range.input_base;g_array_append_val (its_idmaps, next_range); }
@@ -365,7 +372,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)build_append_int_noprefix (table_data,0 ,4 );/* output IORT node is the ITS group node (the first node) */ -build_iort_id_mapping (table_data,0 ,0xFFFF ,IORT_NODE_OFFSET ); +build_iort_id_mapping (table_data,0 ,0x10000 ,IORT_NODE_OFFSET ); }/* Table 17 Root Complex Node */
@@ -418,7 +425,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) } }else {/* output IORT node is the ITS group node (the first node) */ -build_iort_id_mapping (table_data,0 ,0xFFFF ,IORT_NODE_OFFSET ); +build_iort_id_mapping (table_data,0 ,0x10000 ,IORT_NODE_OFFSET ); }acpi_table_end (linker, &table);
Signature · 1 line
MST
[PULL v2 85/88] pcie_sriov: Release VFs failed to realize
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
Release VFs failed to realize just as we do in unregister_vfs().
Message-Id: <[email protected]>
--- hw/pci/pcie_sriov.c | 2 ++ 1 file changed, 2 insertions(+)
hw/pci/pcie_sriov.c +2 -0
@@ -99,6 +99,8 @@ bool pcie_sriov_pf_init(PCIDevice *dev, uint16_t offset, vf->exp.sriov_vf.vf_number = i;if (!qdev_realize (&vf->qdev, bus, errp)) { +object_unparent (OBJECT (vf)); +object_unref (vf);unparent_vfs (dev, i);return false; }
Signature · 1 line
MST
[PULL v2 77/88] virtio: remove virtio_tswap16s() call in vring_packed_event_read()
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
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 the endianess of the field, but virito_lduw_phys_cached() already handles it internally, so we no longer need to call virtio_tswap16s() (as the commit had done for off_wrap, but forgot for flags).
Message-Id: <[email protected]>
--- hw/virtio/virtio.c | 1 - 1 file changed, 1 deletion(-)
hw/virtio/virtio.c +0 -1
@@ -323,7 +323,6 @@ static void vring_packed_event_read(VirtIODevice *vdev,/* Make sure flags is seen before off_wrap */ smp_rmb (); e->off_wrap =virtio_lduw_phys_cached (vdev, cache, off_off); -virtio_tswap16s (vdev, &e->flags); } static void vring_packed_off_wrap_write(VirtIODevice *vdev,
Signature · 1 line
MST
[PULL v2 64/88] uefi-test-tools: Add support for python based build script
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
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.
Message-Id: <[email protected]>
--- tests/uefi-test-tools/Makefile | 19 +++---- tests/uefi-test-tools/uefi-test-build.config | 52 ++++++++++++++++++++ 2 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 tests/uefi-test-tools/uefi-test-build.config
tests/uefi-test-tools/Makefile +7 -12
@@ -12,7 +12,7 @@ edk2_dir := ../../roms/edk2 images_dir := ../data/uefi-boot-images -emulation_targets := arm aarch64 i386 x86_64 +emulation_targets := arm aarch64 i386 x86_64 riscv64 uefi_binaries := bios-tables-test intermediate_suffixes := .efi .fat .iso.raw
@@ -56,7 +56,8 @@ Build/%.iso.raw: Build/%.fat # stripped from, the argument. map_arm_to_uefi = $(subst arm,ARM,$(1)) map_aarch64_to_uefi = $(subst aarch64,AA64,$(call map_arm_to_uefi,$(1))) -map_i386_to_uefi = $(subst i386,IA32,$(call map_aarch64_to_uefi,$(1))) +map_riscv64_to_uefi = $(subst riscv64,RISCV64,$(call map_aarch64_to_uefi,$(1))) +map_i386_to_uefi = $(subst i386,IA32,$(call map_riscv64_to_uefi,$(1))) map_x86_64_to_uefi = $(subst x86_64,X64,$(call map_i386_to_uefi,$(1))) map_to_uefi = $(subst .,,$(call map_x86_64_to_uefi,$(1)))
@@ -70,7 +71,7 @@ Build/%.fat: Build/%.efi uefi_bin_b=$$(stat --format=%s -- $<) && \ uefi_fat_kb=$$(( (uefi_bin_b * 11 / 10 + 1023) / 1024 )) && \ uefi_fat_kb=$$(( uefi_fat_kb >= 64 ? uefi_fat_kb : 64 )) && \ - mkdosfs -C $@ -n $(basename $(@F)) -- $$uefi_fat_kb + mkdosfs -C $@ -n "bios-test" -- $$uefi_fat_kb MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI/BOOT MTOOLS_SKIP_CHECK=1 mcopy -i $@ -- $< \
@@ -95,15 +96,9 @@ Build/%.fat: Build/%.efi # we must mark the recipe manually as recursive, by using the "+" indicator. # This way, when the inner "make" starts a parallel build of the target edk2 # module, it can communicate with the outer "make"'s job server. -Build/bios-tables-test.%.efi: build-edk2-tools - +./build.sh $(edk2_dir) BiosTablesTest $* $@ - -build-edk2-tools: - cd $(edk2_dir)/BaseTools && git submodule update --init --force - $(MAKE) -C $(edk2_dir)/BaseTools \ - PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \ - EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \ - EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)' +Build/bios-tables-test.%.efi: + $(PYTHON) ../../roms/edk2-build.py --config uefi-test-build.config \ + --match $* clean: rm -rf Build Conf log
tests/uefi-test-tools/uefi-test-build.config new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
MST
[PULL v2 29/88] hw/mem/cxl_type3: Allow to release extent superset in QMP interface
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 extents, we allow the release.
Message-Id: <[email protected]>
--- hw/mem/cxl_type3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/cxl_type3.c +1 -1
@@ -1947,7 +1947,7 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path, "cannot release extent with pending DPA range");return ; } -if (!cxl_extents_contains_dpa_range (&dcd->dc.extents, dpa, len)) { +if (!ct3_test_region_block_backed (dcd, dpa, len)) {error_setg (errp,"cannot release extent with non-existing DPA range" );return ;
Signature · 1 line
MST
[PULL v2 18/88] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/cxl/cxl-mailbox-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/cxl/cxl-mailbox-utils.c +4 -1
@@ -21,6 +21,7 @@#include "sysemu/hostmem.h" #define CXL_CAPACITY_MULTIPLIER (256 * MiB) +#define CXL_DC_EVENT_LOG_SIZE 8/* * How to add a new command, example. The command set FOO, with cmd BAR.
@@ -780,8 +781,9 @@ static CXLRetCode cmd_identify_memory_device(const struct cxl_cmd *cmd,uint16_t inject_poison_limit;uint8_t poison_caps;uint8_t qos_telemetry_caps; +uint16_t dc_event_log_size; }QEMU_PACKED *id; -QEMU_BUILD_BUG_ON (sizeof (*id) !=0x43 ); +QEMU_BUILD_BUG_ON (sizeof (*id) !=0x45 );CXLType3Dev *ct3d =CXL_TYPE3 (cci->d);CXLType3Class *cvc =CXL_TYPE3_GET_CLASS (ct3d);CXLDeviceState *cxl_dstate = &ct3d->cxl_dstate;
@@ -807,6 +809,7 @@ static CXLRetCode cmd_identify_memory_device(const struct cxl_cmd *cmd,st24_le_p (id->poison_list_max_mer,256 );/* No limit - so limited by main poison record limit */ stw_le_p (&id->inject_poison_limit,0 ); +stw_le_p (&id->dc_event_log_size,CXL_DC_EVENT_LOG_SIZE ); *len_out =sizeof (*id);return CXL_MBOX_SUCCESS ;
Signature · 1 line
MST
[PULL v2 45/88] hw/net/virtio-net.c: fix crash in iov_copy()
In reply to Michael S. TsirkinFrom: Dmitry Frolov <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/net/virtio-net.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/net/virtio-net.c +4 -0
@@ -2735,6 +2735,10 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)*/ assert (n->host_hdr_len <= n->guest_hdr_len);if (n->host_hdr_len != n->guest_hdr_len) { +if (iov_size (out_sg, out_num) < n->guest_hdr_len) { +virtio_error (vdev,"virtio-net header is invalid" ); + goto detach; + }unsigned sg_num =iov_copy (sg,ARRAY_SIZE (sg), out_sg, out_num,0 , n->host_hdr_len);
Signature · 1 line
MST
[PULL v2 57/88] tests/qtest/vhost-user-blk-test: use memory-backend-shm
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
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, lets remove share=on` which is the default for shm (and also for memfd).
Message-Id: <[email protected]>
--- tests/qtest/vhost-user-blk-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/vhost-user-blk-test.c +1 -1
@@ -906,7 +906,7 @@ static void start_vhost_user_blk(GString *cmd_line, int vus_instances, vhost_user_blk_bin);g_string_append_printf (cmd_line, -" -object memory-backend-memfd,id=mem,size=256M,share=on " +" -object memory-backend-shm,id=mem,size=256M " " -M memory-backend=mem -m 256M " );for (i =0 ; i < vus_instances; i++) {
Signature · 1 line
MST
[PULL v2 43/88] virtio-iommu: add error check before assert
In reply to Michael S. TsirkinFrom: Manos Pitsidianakis <[email protected]>
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 -machine q35 -nodefaults \
-device virtio-iommu -qtest stdio
outl 0xcf8 0x80000804
outw 0xcfc 0x06
outl 0xcf8 0x80000820
outl 0xcfc 0xe0004000
write 0x10000e 0x1 0x01
write 0xe0004020 0x4 0x00001000
write 0xe0004028 0x4 0x00101000
write 0xe000401c 0x1 0x01
write 0x106000 0x1 0x05
write 0x100001 0x1 0x60
write 0x100002 0x1 0x10
write 0x100009 0x1 0x04
write 0x10000c 0x1 0x01
write 0x100018 0x1 0x04
write 0x10001c 0x1 0x02
write 0x101003 0x1 0x01
write 0xe0007001 0x1 0x00
EOF
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2359
Message-Id: <[email protected]>
--- hw/virtio/virtio-iommu.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
hw/virtio/virtio-iommu.c +22 -0
@@ -974,6 +974,9 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq) iov = elem->out_sg; sz =iov_to_buf (iov, iov_cnt,0 , &head,sizeof (head));if (unlikely (sz !=sizeof (head))) { +qemu_log_mask (LOG_GUEST_ERROR , +"%s: read %zu bytes from command head" +"but expected %zu\n" , __func__, sz,sizeof (head)); tail.status =VIRTIO_IOMMU_S_DEVERR ; goto out; }
@@ -1010,6 +1013,25 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq) out: sz =iov_from_buf (elem->in_sg, elem->in_num,0 , buf ? buf : &tail, output_size); +if (unlikely (sz != output_size)) { +qemu_log_mask (LOG_GUEST_ERROR , +"%s: wrote %zu bytes to command response" +"but response size is %zu\n" , + __func__, sz, output_size); + tail.status =VIRTIO_IOMMU_S_DEVERR ; +/* +* We checked that sizeof(tail) can fit to elem->in_sg at the +* beginning of the loop +*/ + output_size =sizeof (tail); +g_free (buf); + buf =NULL ; + sz =iov_from_buf (elem->in_sg, + elem->in_num, +0 , + &tail, + output_size); + }assert (sz == output_size);virtqueue_push (vq, elem, sz);
Signature · 1 line
MST
[PULL v2 65/88] tests/data/uefi-boot-images: Add RISC-V ISO image
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
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.
Message-Id: <[email protected]>
--- .../bios-tables-test.riscv64.iso.qcow2 | Bin 0 -> 16896 bytes tests/uefi-test-tools/uefi-test-build.config | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2
tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2 new file binary +0 -0
tests/uefi-test-tools/uefi-test-build.config +1 -1
@@ -24,7 +24,7 @@ cpy1 = AARCH64/BiosTablesTest.efi bios-tables-test.aarch64.efi #################################################################################### # riscv64 -[build.riscv] +[build.riscv64] conf = UefiTestToolsPkg/UefiTestToolsPkg.dsc plat = UefiTestTools dest = ./Build
Signature · 1 line
MST
[PULL v2 38/88] hw/cxl: Fix read from bogus memory
In reply to Michael S. TsirkinFrom: Ira Weiny <[email protected]>
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 start with a host pointer value and then continue with whatever happens to be on the host stack after that.
Indeed the intention was to write 64 bytes of data at the address given.
Fix the parameter to address_space_write().
Message-Id: <[email protected]>
--- hw/mem/cxl_type3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/cxl_type3.c +1 -1
@@ -1292,7 +1292,7 @@ static bool set_cacheline(CXLType3Dev *ct3d, uint64_t dpa_offset, uint8_t *data) dpa_offset -= (vmr_size + pmr_size); } -address_space_write (as, dpa_offset,MEMTXATTRS_UNSPECIFIED , &data, +address_space_write (as, dpa_offset,MEMTXATTRS_UNSPECIFIED , data,CXL_CACHE_LINE_SIZE );return true; }
Signature · 1 line
MST
[PULL v2 52/88] contrib/vhost-user-*: use QEMU bswap helper functions
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable.
Message-Id: <[email protected]>
--- contrib/vhost-user-blk/vhost-user-blk.c | 9 +++++---- contrib/vhost-user-input/main.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-)
contrib/vhost-user-blk/vhost-user-blk.c +5 -4
@@ -16,6 +16,7 @@*/ #include "qemu/osdep.h" +#include "qemu/bswap.h" #include "standard-headers/linux/virtio_blk.h" #include "libvhost-user-glib.h"
@@ -194,8 +195,8 @@ vub_discard_write_zeroes(VubReq *req, struct iovec *iov, uint32_t iovcnt,#if defined(__linux__) && defined(BLKDISCARD ) && defined(BLKZEROOUT )VubDev *vdev_blk = req->vdev_blk; desc = buf; -uint64_t range[2 ] = {le64toh (desc->sector) <<9 , -le32toh (desc->num_sectors) <<9 }; +uint64_t range[2 ] = {le64_to_cpu (desc->sector) <<9 , +le32_to_cpu (desc->num_sectors) <<9 };if (type ==VIRTIO_BLK_T_DISCARD ) {if (ioctl (vdev_blk->blk_fd,BLKDISCARD , range) ==0 ) {g_free (buf);
@@ -267,13 +268,13 @@ static int vub_virtio_process_req(VubDev *vdev_blk, req->in = (struct virtio_blk_inhdr *)elem->in_sg[in_num -1 ].iov_base; in_num--; - type =le32toh (req->out->type); + type =le32_to_cpu (req->out->type);switch (type & ~VIRTIO_BLK_T_BARRIER ) {case VIRTIO_BLK_T_IN :case VIRTIO_BLK_T_OUT : {ssize_t ret =0 ;bool is_write = type &VIRTIO_BLK_T_OUT ; - req->sector_num =le64toh (req->out->sector); + req->sector_num =le64_to_cpu (req->out->sector);if (is_write) { ret =vub_writev (req, &elem->out_sg[1 ], out_num); }else {
contrib/vhost-user-input/main.c +8 -8
@@ -51,8 +51,8 @@ static void vi_input_send(VuInput *vi, struct virtio_input_event *event) vi->queue[vi->qindex++].event = *event;/* ... until we see a report sync ... */ -if (event->type !=htole16 (EV_SYN ) || - event->code !=htole16 (SYN_REPORT )) { +if (event->type !=cpu_to_le16 (EV_SYN ) || + event->code !=cpu_to_le16 (SYN_REPORT )) {return ; }
@@ -103,9 +103,9 @@ vi_evdev_watch(VuDev *dev, int condition, void *data)g_debug ("input %d %d %d" , evdev.type, evdev.code, evdev.value); - virtio.type =htole16 (evdev.type); - virtio.code =htole16 (evdev.code); - virtio.value =htole32 (evdev.value); + virtio.type =cpu_to_le16 (evdev.type); + virtio.code =cpu_to_le16 (evdev.code); + virtio.value =cpu_to_le32 (evdev.value);vi_input_send (vi, &virtio); } }
@@ -124,9 +124,9 @@ static void vi_handle_status(VuInput *vi, virtio_input_event *event) evdev.input_event_sec = tval.tv_sec; evdev.input_event_usec = tval.tv_usec; - evdev.type =le16toh (event->type); - evdev.code =le16toh (event->code); - evdev.value =le32toh (event->value); + evdev.type =le16_to_cpu (event->type); + evdev.code =le16_to_cpu (event->code); + evdev.value =le32_to_cpu (event->value); rc =write (vi->evdevfd, &evdev,sizeof (evdev));if (rc ==-1 ) {
Signature · 1 line
MST
[PULL v2 23/88] hw/mem/cxl_type3: Add host backend and address space handling for DC regions
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 new property to type3 device "volatile-dc-memdev" to point to host memory backend for dynamic capacity. Currently, all DC regions share one host backend;
2. Add namespace for dynamic capacity for read/write support;
3. Create cdat entries for each dynamic capacity region.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 8 ++ hw/cxl/cxl-mailbox-utils.c | 16 +++- hw/mem/cxl_type3.c | 177 +++++++++++++++++++++++++++++------- 3 files changed, 164 insertions(+), 37 deletions(-)
include/hw/cxl/cxl_device.h +8 -0
@@ -467,6 +467,14 @@ struct CXLType3Dev {uint64_t poison_list_overflow_ts;struct dynamic_capacity { +HostMemoryBackend *host_dc; +AddressSpace host_dc_as; +/* +* total_capacity is equivalent to the dynamic capability +* memory region size. +*/ +uint64_t total_capacity;/* 256M aligned */ +uint8_t num_regions;/* 0-8 regions */ CXLDCRegion regions[DCD_MAX_NUM_REGION ]; } dc;
hw/cxl/cxl-mailbox-utils.c +11 -5
@@ -622,7 +622,8 @@ static CXLRetCode cmd_firmware_update_get_info(const struct cxl_cmd *cmd,size_t *len_out, CXLCCI *cci) { - CXLDeviceState *cxl_dstate = &CXL_TYPE3(cci->d)->cxl_dstate; + CXLType3Dev *ct3d = CXL_TYPE3(cci->d); +CXLDeviceState *cxl_dstate = &ct3d->cxl_dstate; struct { uint8_t slots_supported; uint8_t slot_info;
@@ -636,7 +637,8 @@ static CXLRetCode cmd_firmware_update_get_info(const struct cxl_cmd *cmd,QEMU_BUILD_BUG_ON (sizeof (*fw_info) !=0x50 );if ((cxl_dstate->vmem_size <CXL_CAPACITY_MULTIPLIER ) || - (cxl_dstate->pmem_size <CXL_CAPACITY_MULTIPLIER )) { + (cxl_dstate->pmem_size <CXL_CAPACITY_MULTIPLIER ) || + (ct3d->dc.total_capacity <CXL_CAPACITY_MULTIPLIER )) {return CXL_MBOX_INTERNAL_ERROR ; }
@@ -793,7 +795,8 @@ static CXLRetCode cmd_identify_memory_device(const struct cxl_cmd *cmd,CXLDeviceState *cxl_dstate = &ct3d->cxl_dstate;if ((!QEMU_IS_ALIGNED (cxl_dstate->vmem_size,CXL_CAPACITY_MULTIPLIER )) || - (!QEMU_IS_ALIGNED (cxl_dstate->pmem_size,CXL_CAPACITY_MULTIPLIER ))) { + (!QEMU_IS_ALIGNED (cxl_dstate->pmem_size,CXL_CAPACITY_MULTIPLIER )) || + (!QEMU_IS_ALIGNED (ct3d->dc.total_capacity,CXL_CAPACITY_MULTIPLIER ))) {return CXL_MBOX_INTERNAL_ERROR ; }
@@ -835,9 +838,11 @@ static CXLRetCode cmd_ccls_get_partition_info(const struct cxl_cmd *cmd,uint64_t next_pmem; }QEMU_PACKED *part_info = (void *)payload_out;QEMU_BUILD_BUG_ON (sizeof (*part_info) !=0x20 ); +CXLType3Dev *ct3d =container_of (cxl_dstate, CXLType3Dev, cxl_dstate);if ((!QEMU_IS_ALIGNED (cxl_dstate->vmem_size,CXL_CAPACITY_MULTIPLIER )) || - (!QEMU_IS_ALIGNED (cxl_dstate->pmem_size,CXL_CAPACITY_MULTIPLIER ))) { + (!QEMU_IS_ALIGNED (cxl_dstate->pmem_size,CXL_CAPACITY_MULTIPLIER )) || + (!QEMU_IS_ALIGNED (ct3d->dc.total_capacity,CXL_CAPACITY_MULTIPLIER ))) {return CXL_MBOX_INTERNAL_ERROR ; }
@@ -1179,7 +1184,8 @@ static CXLRetCode cmd_media_clear_poison(const struct cxl_cmd *cmd,struct clear_poison_pl *in = (void *)payload_in; dpa =ldq_le_p (&in->dpa); -if (dpa +CXL_CACHE_LINE_SIZE > cxl_dstate->static_mem_size) { +if (dpa +CXL_CACHE_LINE_SIZE > cxl_dstate->static_mem_size + + ct3d->dc.total_capacity) {return CXL_MBOX_INVALID_PA ; }
hw/mem/cxl_type3.c +145 -32
326 lines not on this page · raw message
Signature · 1 line
MST
[PULL v2 68/88] tests/qtest/bios-tables-test.c: Set "arch" for aarch64 tests
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
To search for expected AML files under ${arch}/${machine} path, set this field for AARCH64 related test cases.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 8 ++++++++ 1 file changed, 8 insertions(+)
tests/qtest/bios-tables-test.c +8 -0
@@ -1591,6 +1591,7 @@ static void test_acpi_aarch64_virt_tcg_memhp(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
@@ -1684,6 +1685,7 @@ static void test_acpi_aarch64_virt_tcg_numamem(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
@@ -1706,6 +1708,7 @@ static void test_acpi_aarch64_virt_tcg_pxb(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
@@ -1779,6 +1782,7 @@ static void test_acpi_aarch64_virt_tcg_acpi_hmat(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
@@ -1935,6 +1939,7 @@ static void test_acpi_aarch64_virt_tcg(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
@@ -1954,6 +1959,7 @@ static void test_acpi_aarch64_virt_tcg_topology(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .variant =".topology" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" ,
@@ -2037,6 +2043,7 @@ static void test_acpi_aarch64_virt_viot(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
@@ -2213,6 +2220,7 @@ static void test_acpi_aarch64_virt_oem_fields(void) {test_data data = { .machine ="virt" , + .arch ="aarch64" , .tcg_only = true, .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" ,
Signature · 1 line
MST
[PULL v2 72/88] meson.build: Add RISC-V to the edk2-target list
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
so that ACPI table test can be supported.
Message-Id: <[email protected]>
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
@@ -93,7 +93,7 @@ else iasl = find_program(get_option('iasl'), required: true) endif -edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ] +edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu', 'riscv64-softmmu' ] unpack_edk2_blobs = false foreach target : edk2_targets if target in target_dirs
Signature · 1 line
MST
[PULL v2 55/88] contrib/vhost-user-blk: enable it on any POSIX system
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
Let's make the code more portable by adding defines from block/file-posix.c to support O_DIRECT in other systems (e.g. macOS).
vhost-user-server.c is a dependency, let's enable it for any POSIX system.
Message-Id: <[email protected]>
--- contrib/vhost-user-blk/vhost-user-blk.c | 14 ++++++++++++++ meson.build | 2 -- util/meson.build | 4 +++- 3 files changed, 17 insertions(+), 3 deletions(-)
contrib/vhost-user-blk/vhost-user-blk.c +14 -0
@@ -25,6 +25,20 @@#include <sys/ioctl.h> #endif +/* OS X does not have O_DSYNC */ +#ifndef O_DSYNC +#ifdef O_SYNC +#define O_DSYNC O_SYNC +#elif defined(O_FSYNC ) +#define O_DSYNC O_FSYNC +#endif +#endif + +/* Approximate O_DIRECT with O_DSYNC if O_DIRECT isn't available */ +#ifndef O_DIRECT +#define O_DIRECT O_DSYNC +#endif +enum {VHOST_USER_BLK_MAX_QUEUES =8 , };
meson.build +0 -2
@@ -2026,8 +2026,6 @@ has_statx = cc.has_header_symbol('sys/stat.h', 'STATX_BASIC_STATS', prefix: gnu_ has_statx_mnt_id = cc.has_header_symbol('sys/stat.h', 'STATX_MNT_ID', prefix: gnu_source_prefix) have_vhost_user_blk_server = get_option('vhost_user_blk_server') \ - .require(host_os == 'linux', - error_message: 'vhost_user_blk_server requires linux') \ .require(have_vhost_user, error_message: 'vhost_user_blk_server requires vhost-user support') \ .disable_auto_if(not have_tools and not have_system) \
util/meson.build +3 -1
@@ -112,10 +112,12 @@ if have_block util_ss.add(files('filemonitor-stub.c')) endif if host_os == 'linux' - util_ss.add(files('vhost-user-server.c'), vhost_user) util_ss.add(files('vfio-helpers.c')) util_ss.add(files('chardev_open.c')) endif + if host_os != 'windows' + util_ss.add(files('vhost-user-server.c'), vhost_user) + endif util_ss.add(files('yank.c')) endif
Signature · 1 line
MST
[PULL v2 71/88] tests/data/acpi/virt: Move ARM64 ACPI tables under aarch64/${machine} path
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
Same machine name can be used by different architectures. Hence, create aarch64 folder and move all aarch64 related AML files for virt machine inside.
Message-Id: <[email protected]>
---
tests/data/acpi/{ => aarch64}/virt/APIC | Bin
.../data/acpi/{ => aarch64}/virt/APIC.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/APIC.topology | Bin
tests/data/acpi/{ => aarch64}/virt/DBG2 | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT | Bin
.../data/acpi/{ => aarch64}/virt/DSDT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT.pxb | Bin
tests/data/acpi/{ => aarch64}/virt/DSDT.topology | Bin
tests/data/acpi/{ => aarch64}/virt/FACP | Bin
tests/data/acpi/{ => aarch64}/virt/GTDT | Bin
.../data/acpi/{ => aarch64}/virt/HMAT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/IORT | Bin
tests/data/acpi/{ => aarch64}/virt/MCFG | Bin
tests/data/acpi/{ => aarch64}/virt/NFIT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/PPTT | Bin
.../data/acpi/{ => aarch64}/virt/PPTT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/PPTT.topology | Bin
tests/data/acpi/{ => aarch64}/virt/SLIT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/SPCR | Bin
.../data/acpi/{ => aarch64}/virt/SRAT.acpihmatvirt | Bin
tests/data/acpi/{ => aarch64}/virt/SRAT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/SRAT.numamem | Bin
tests/data/acpi/{ => aarch64}/virt/SSDT.memhp | Bin
tests/data/acpi/{ => aarch64}/virt/VIOT | Bin
25 files changed, 0 insertions(+), 0 deletions(-)
rename tests/data/acpi/{ => aarch64}/virt/APIC (100%)
rename tests/data/acpi/{ => aarch64}/virt/APIC.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/APIC.topology (100%)
rename tests/data/acpi/{ => aarch64}/virt/DBG2 (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.pxb (100%)
rename tests/data/acpi/{ => aarch64}/virt/DSDT.topology (100%)
rename tests/data/acpi/{ => aarch64}/virt/FACP (100%)
rename tests/data/acpi/{ => aarch64}/virt/GTDT (100%)
rename tests/data/acpi/{ => aarch64}/virt/HMAT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/IORT (100%)
rename tests/data/acpi/{ => aarch64}/virt/MCFG (100%)
rename tests/data/acpi/{ => aarch64}/virt/NFIT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/PPTT (100%)
rename tests/data/acpi/{ => aarch64}/virt/PPTT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/PPTT.topology (100%)
rename tests/data/acpi/{ => aarch64}/virt/SLIT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/SPCR (100%)
rename tests/data/acpi/{ => aarch64}/virt/SRAT.acpihmatvirt (100%)
rename tests/data/acpi/{ => aarch64}/virt/SRAT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/SRAT.numamem (100%)
rename tests/data/acpi/{ => aarch64}/virt/SSDT.memhp (100%)
rename tests/data/acpi/{ => aarch64}/virt/VIOT (100%)tests/data/acpi/aarch64/virt/APIC renamed from tests/data/acpi/virt/APIC +0 -0
tests/data/acpi/aarch64/virt/APIC.acpihmatvirt renamed from tests/data/acpi/virt/APIC.acpihmatvirt +0 -0
tests/data/acpi/aarch64/virt/APIC.topology renamed from tests/data/acpi/virt/APIC.topology +0 -0
tests/data/acpi/aarch64/virt/DBG2 renamed from tests/data/acpi/virt/DBG2 +0 -0
tests/data/acpi/aarch64/virt/DSDT renamed from tests/data/acpi/virt/DSDT +0 -0
tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt renamed from tests/data/acpi/virt/DSDT.acpihmatvirt +0 -0
tests/data/acpi/aarch64/virt/DSDT.memhp renamed from tests/data/acpi/virt/DSDT.memhp +0 -0
tests/data/acpi/aarch64/virt/DSDT.pxb renamed from tests/data/acpi/virt/DSDT.pxb +0 -0
tests/data/acpi/aarch64/virt/DSDT.topology renamed from tests/data/acpi/virt/DSDT.topology +0 -0
tests/data/acpi/aarch64/virt/FACP renamed from tests/data/acpi/virt/FACP +0 -0
tests/data/acpi/aarch64/virt/GTDT renamed from tests/data/acpi/virt/GTDT +0 -0
tests/data/acpi/aarch64/virt/HMAT.acpihmatvirt renamed from tests/data/acpi/virt/HMAT.acpihmatvirt +0 -0
tests/data/acpi/aarch64/virt/IORT renamed from tests/data/acpi/virt/IORT +0 -0
tests/data/acpi/aarch64/virt/MCFG renamed from tests/data/acpi/virt/MCFG +0 -0
tests/data/acpi/aarch64/virt/NFIT.memhp renamed from tests/data/acpi/virt/NFIT.memhp +0 -0
tests/data/acpi/aarch64/virt/PPTT renamed from tests/data/acpi/virt/PPTT +0 -0
tests/data/acpi/aarch64/virt/PPTT.acpihmatvirt renamed from tests/data/acpi/virt/PPTT.acpihmatvirt +0 -0
tests/data/acpi/aarch64/virt/PPTT.topology renamed from tests/data/acpi/virt/PPTT.topology +0 -0
tests/data/acpi/aarch64/virt/SLIT.memhp renamed from tests/data/acpi/virt/SLIT.memhp +0 -0
tests/data/acpi/aarch64/virt/SPCR renamed from tests/data/acpi/virt/SPCR +0 -0
tests/data/acpi/aarch64/virt/SRAT.acpihmatvirt renamed from tests/data/acpi/virt/SRAT.acpihmatvirt +0 -0
tests/data/acpi/aarch64/virt/SRAT.memhp renamed from tests/data/acpi/virt/SRAT.memhp +0 -0
tests/data/acpi/aarch64/virt/SRAT.numamem renamed from tests/data/acpi/virt/SRAT.numamem +0 -0
tests/data/acpi/aarch64/virt/SSDT.memhp renamed from tests/data/acpi/virt/SSDT.memhp +0 -0
tests/data/acpi/aarch64/virt/VIOT renamed from tests/data/acpi/virt/VIOT +0 -0
Signature · 1 line
MST
[PULL v2 09/88] Fix vhost user assertion when sending more than one fd
In reply to Michael S. TsirkinFrom: Christian Pötzsch <[email protected]>
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.
Message-Id: <[email protected]>
--- subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
subprojects/libvhost-user/libvhost-user.c +1 -1
@@ -568,7 +568,7 @@ vu_message_read_default(VuDev *dev, int conn_fd, VhostUserMsg *vmsg)if (cmsg->cmsg_level ==SOL_SOCKET && cmsg->cmsg_type ==SCM_RIGHTS ) { fd_size = cmsg->cmsg_len -CMSG_LEN (0 ); vmsg->fd_num = fd_size /sizeof (int ); -assert (fd_size <VHOST_MEMORY_BASELINE_NREGIONS ); +assert (vmsg->fd_num <=VHOST_MEMORY_BASELINE_NREGIONS );memcpy (vmsg->fds,CMSG_DATA (cmsg), fd_size);break ; }
Signature · 1 line
MST
[PULL v2 80/88] hw/ppc/spapr_pci: Do not create DT for disabled PCI device
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
Disabled means it is a disabled SR-IOV VF or it is powered off, and hidden from the guest.
Message-Id: <[email protected]>
--- hw/ppc/spapr_pci.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/ppc/spapr_pci.c +4 -0
@@ -1296,6 +1296,10 @@ static void spapr_dt_pci_device_cb(PCIBus *bus, PCIDevice *pdev,return ; } +if (!pdev->enabled) { +return ; + } + err =spapr_dt_pci_device (p->sphb, pdev, p->fdt, p->offset);if (err <0 ) { p->err = err;
Signature · 1 line
MST
[PULL v2 63/88] uefi-test-tools/UefiTestToolsPkg: Add RISC-V support
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
Enable building the test application for RISC-V with appropriate dependencies updated.
Message-Id: <[email protected]>
--- tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc +5 -1
@@ -19,7 +19,7 @@ PLATFORM_VERSION = 0.1 PLATFORM_NAME = UefiTestTools SKUID_IDENTIFIER = DEFAULT - SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64 + SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64|RISCV64 BUILD_TARGETS = DEBUG [BuildOptions.IA32]
@@ -60,6 +60,10 @@ [LibraryClasses.IA32, LibraryClasses.X64] BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf + RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf + +[LibraryClasses.RISCV64] + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf [PcdsFixedAtBuild] gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
Signature · 1 line
MST
[PULL v2 35/88] tests/qtest/pvpanic: add tests for pvshutdown event
In reply to Michael S. TsirkinFrom: Thomas Weißschuh <[email protected]>
Validate that a shutdown via the pvpanic device emits the correct QMP events.
Message-Id: <[email protected]>
--- tests/qtest/pvpanic-pci-test.c | 39 ++++++++++++++++++++++++++++++++++ tests/qtest/pvpanic-test.c | 29 +++++++++++++++++++++++++ 2 files changed, 68 insertions(+)
tests/qtest/pvpanic-pci-test.c +39 -0
@@ -85,11 +85,50 @@ static void test_panic(void)qtest_quit (qts); } +static void test_pvshutdown (void ) +{ +uint8_t val; +QDict *response, *data; +QTestState *qts; +QPCIBus *pcibus; +QPCIDevice *dev; +QPCIBar bar; + + qts =qtest_init ("-device pvpanic-pci,addr=04.0" ); + pcibus =qpci_new_pc (qts,NULL ); + dev =qpci_device_find (pcibus,QPCI_DEVFN (0x4 ,0x0 )); +qpci_device_enable (dev); + bar =qpci_iomap (dev,0 ,NULL ); + +qpci_memread (dev, bar,0 , &val,sizeof (val)); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); + + val =PVPANIC_SHUTDOWN ; +qpci_memwrite (dev, bar,0 , &val,sizeof (val)); + + response =qtest_qmp_eventwait_ref (qts,"GUEST_PVSHUTDOWN" ); +qobject_unref (response); + + response =qtest_qmp_eventwait_ref (qts,"SHUTDOWN" ); +g_assert (qdict_haskey (response,"data" )); + data =qdict_get_qdict (response,"data" ); +g_assert (qdict_haskey (data,"guest" )); +g_assert (qdict_get_bool (data,"guest" )); +g_assert (qdict_haskey (data,"reason" )); + g_assert_cmpstr(qdict_get_str(data, "reason"), ==, "guest-shutdown"); +qobject_unref (response); + +g_free (dev); +qpci_free_pc (pcibus); +qtest_quit (qts); +} +int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL );qtest_add_func ("/pvpanic-pci/panic" , test_panic);qtest_add_func ("/pvpanic-pci/panic-nopause" , test_panic_nopause); +qtest_add_func ("/pvpanic-pci/pvshutdown" , test_pvshutdown);return g_test_run (); }
tests/qtest/pvpanic-test.c +29 -0
@@ -58,11 +58,40 @@ static void test_panic(void)qtest_quit (qts); } +static void test_pvshutdown (void ) +{ +uint8_t val; +QDict *response, *data; +QTestState *qts; + + qts =qtest_init ("-device pvpanic" ); + + val =qtest_inb (qts,0x505 ); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); + +qtest_outb (qts,0x505 ,PVPANIC_SHUTDOWN ); + + response =qtest_qmp_eventwait_ref (qts,"GUEST_PVSHUTDOWN" ); +qobject_unref (response); + + response =qtest_qmp_eventwait_ref (qts,"SHUTDOWN" ); +g_assert (qdict_haskey (response,"data" )); + data =qdict_get_qdict (response,"data" ); +g_assert (qdict_haskey (data,"guest" )); +g_assert (qdict_get_bool (data,"guest" )); +g_assert (qdict_haskey (data,"reason" )); + g_assert_cmpstr(qdict_get_str(data, "reason"), ==, "guest-shutdown"); +qobject_unref (response); + +qtest_quit (qts); +} +int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL );qtest_add_func ("/pvpanic/panic" , test_panic);qtest_add_func ("/pvpanic/panic-nopause" , test_panic_nopause); +qtest_add_func ("/pvpanic/pvshutdown" , test_pvshutdown);return g_test_run (); }
Signature · 1 line
MST
[PULL v2 26/88] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 allow to release an extent only when its DPA range is contained by a single accepted extent in the device. That is to say, extent superset release is not supported yet.
1. Add dynamic capacity extents:
For example, the command to add two continuous extents (each 128MiB long) to region 0 (starting at DPA offset 0) looks like below:
{ "execute": "qmp_capabilities" }
{ "execute": "cxl-add-dynamic-capacity",
"arguments": {
"path": "/machine/peripheral/cxl-dcd0",
"host-id": 0,
"selection-policy": "prescriptive",
"region": 0,
"extents": [
{
"offset": 0,
"len": 134217728
},
{
"offset": 134217728,
"len": 134217728
}
] }
}
2. Release dynamic capacity extents:
For example, the command to release an extent of size 128MiB from region 0 (DPA offset 128MiB) looks like below:
{ "execute": "cxl-release-dynamic-capacity",
"arguments": {
"path": "/machine/peripheral/cxl-dcd0",
"host-id": 0,
"removal-policy":"prescriptive",
"region": 0,
"extents": [
{
"offset": 134217728,
"len": 134217728
}
] }
}
Message-Id: <[email protected]>
--- qapi/cxl.json | 143 +++++++++++++++++ include/hw/cxl/cxl_device.h | 22 +++ include/hw/cxl/cxl_events.h | 18 +++ hw/cxl/cxl-mailbox-utils.c | 62 ++++++-- hw/mem/cxl_type3.c | 306 +++++++++++++++++++++++++++++++++++- hw/mem/cxl_type3_stubs.c | 25 +++ 6 files changed, 563 insertions(+), 13 deletions(-)
qapi/cxl.json +143 -0
@@ -361,3 +361,146 @@ ## {'command': 'cxl-inject-correctable-error', 'data': {'path': 'str', 'type': 'CxlCorErrorType'}} + +## +# @CXLDynamicCapacityExtent: +# +# A single dynamic capacity extent +# +# @offset: The offset (in bytes) to the start of the region +# where the extent belongs to. +# +# @len: The length of the extent in bytes. +# +# Since: 9.1 +## +{ 'struct': 'CXLDynamicCapacityExtent', + 'data': { + 'offset':'uint64', + 'len': 'uint64' + } +} + +## +# @CXLExtSelPolicy: +# +# The policy to use for selecting which extents comprise the added +# capacity, as defined in cxl spec r3.1 Table 7-70. +# +# @free: 0h = Free +# +# @contiguous: 1h = Continuous +# +# @prescriptive: 2h = Prescriptive +# +# @enable-shared-access: 3h = Enable Shared Access +# +# Since: 9.1 +## +{ 'enum': 'CXLExtSelPolicy', + 'data': ['free', + 'contiguous', + 'prescriptive', + 'enable-shared-access'] +} + +## +# @cxl-add-dynamic-capacity: +# +# Command to initiate to add dynamic capacity extents to a host. It +# simulates operations defined in cxl spec r3.1 7.6.7.6.5. +# +# @path: CXL DCD canonical QOM path. +# +# @host-id: The "Host ID" field as defined in cxl spec r3.1 +# Table 7-70. +# +# @selection-policy: The "Selection Policy" bits as defined in +# cxl spec r3.1 Table 7-70. It specifies the policy to use for +# selecting which extents comprise the added capacity. +# +# @region: The "Region Number" field as defined in cxl spec r3.1 +# Table 7-70. The dynamic capacity region where the capacity +# is being added. Valid range is from 0-7. +# +# @tag: The "Tag" field as defined in cxl spec r3.1 Table 7-70. +# +# @extents: The "Extent List" field as defined in cxl spec r3.1 +# Table 7-70. +# +# Since : 9.1 +## +{ 'command': 'cxl-add-dynamic-capacity', + 'data': { 'path': 'str', + 'host-id': 'uint16', + 'selection-policy': 'CXLExtSelPolicy', + 'region': 'uint8', + '*tag': 'str', + 'extents': [ 'CXLDynamicCapacityExtent' ] + } +} + +## +# @CXLExtRemovalPolicy: +# +# The policy to use for selecting which extents comprise the released +# capacity, defined in the "Flags" field in cxl spec r3.1 Table 7-71. +# +# @tag-based: value = 0h. Extents are selected by the device based +# on tag, with no requirement for contiguous extents. +# +# @prescriptive: value = 1h. Extent list of capacity to release is +# included in the request payload. +# +# Since: 9.1 +## +{ 'enum': 'CXLExtRemovalPolicy', + 'data': ['tag-based', + 'prescriptive'] +} + +## +# @cxl-release-dynamic-capacity: +# +# Command to initiate to release dynamic capacity extents from a +# host. It simulates operations defined in cxl spec r3.1 7.6.7.6.6. +# +# @path: CXL DCD canonical QOM path. +# +# @host-id: The "Host ID" field as defined in cxl spec r3.1 +# Table 7-71. +# +# @removal-policy: Bit[3:0] of the "Flags" field as defined in cxl +# spec r3.1 Table 7-71. +# +# @forced-removal: Bit[4] of the "Flags" field in cxl spec r3.1 +# Table 7-71. When set, device does not wait for a Release +# Dynamic Capacity command from the host. Host immediately +# loses access to released capacity. +# +# @sanitize-on-release: Bit[5] of the "Flags" field in cxl spec r3.1 +# Table 7-71. When set, device should sanitize all released +# capacity as a result of this request. +# +# @region: The "Region Number" field as defined in cxl spec r3.1 +# Table 7-71. The dynamic capacity region where the capacity +# is being added. Valid range is from 0-7. +# +# @tag: The "Tag" field as defined in cxl spec r3.1 Table 7-71. +# +# @extents: The "Extent List" field as defined in cxl spec r3.1 +# Table 7-71. +# +# Since : 9.1 +## +{ 'command': 'cxl-release-dynamic-capacity', + 'data': { 'path': 'str', + 'host-id': 'uint16', + 'removal-policy': 'CXLExtRemovalPolicy', + '*forced-removal': 'bool', + '*sanitize-on-release': 'bool', + 'region': 'uint8', + '*tag': 'str', + 'extents': [ 'CXLDynamicCapacityExtent' ] + } +}
include/hw/cxl/cxl_device.h +22 -0
@@ -443,6 +443,12 @@ typedef struct CXLDCExtent { } CXLDCExtent; typedef QTAILQ_HEAD(, CXLDCExtent) CXLDCExtentList; +typedef struct CXLDCExtentGroup { +CXLDCExtentList list; +QTAILQ_ENTRY (CXLDCExtentGroup) node; +}CXLDCExtentGroup ; +typedef QTAILQ_HEAD(, CXLDCExtentGroup) CXLDCExtentGroupList; + typedef struct CXLDCRegion { uint64_t base; /* aligned to 256*MiB */ uint64_t decode_len; /* aligned to 256*MiB */
@@ -494,6 +500,7 @@ struct CXLType3Dev {*/ uint64_t total_capacity;/* 256M aligned */ CXLDCExtentList extents; +CXLDCExtentGroupList extents_pending;uint32_t total_extent_count;uint32_t ext_list_gen_seq;
@@ -555,4 +562,19 @@ CXLDCRegion *cxl_find_dc_region(CXLType3Dev *ct3d, uint64_t dpa, uint64_t len);void cxl_remove_extent_from_extent_list (CXLDCExtentList *list,CXLDCExtent *extent); +void cxl_insert_extent_to_extent_list (CXLDCExtentList *list,uint64_t dpa, +uint64_t len,uint8_t *tag, +uint16_t shared_seq); +bool test_any_bits_set (const unsigned long *addr,unsigned long nr, +unsigned long size); +bool cxl_extents_contains_dpa_range (CXLDCExtentList *list, +uint64_t dpa,uint64_t len); +CXLDCExtentGroup *cxl_insert_extent_to_extent_group (CXLDCExtentGroup *group, +uint64_t dpa, +uint64_t len, +uint8_t *tag, +uint16_t shared_seq); +void cxl_extent_group_list_insert_tail (CXLDCExtentGroupList *list, +CXLDCExtentGroup *group); +void cxl_extent_group_list_delete_front (CXLDCExtentGroupList *list);#endif
include/hw/cxl/cxl_events.h +18 -0
@@ -166,4 +166,22 @@ typedef struct CXLEventMemoryModule {uint8_t reserved[0x3d ]; } QEMU_PACKED CXLEventMemoryModule; +/* +* CXL r3.1 section Table 8-50: Dynamic Capacity Event Record +* All fields little endian. +*/ +typedef struct CXLEventDynamicCapacity { +CXLEventRecordHdr hdr; +uint8_t type; +uint8_t validity_flags; +uint16_t host_id; +uint8_t updated_region_id; +uint8_t flags; +uint8_t reserved2[2 ]; +uint8_t dynamic_capacity_extent[0x28 ];/* defined in cxl_device.h */ +uint8_t reserved[0x18 ]; +uint32_t extents_avail; +uint32_t tags_avail; +} QEMU_PACKED CXLEventDynamicCapacity; +#endif /* CXL_EVENTS_H */
hw/cxl/cxl-mailbox-utils.c +50 -12
106 lines not on this page · raw message
hw/mem/cxl_type3.c +305 -1
334 lines not on this page · raw message
hw/mem/cxl_type3_stubs.c +25 -0
@@ -67,3 +67,28 @@ void qmp_cxl_inject_correctable_error(const char *path, CxlCorErrorType type, {error_setg (errp,"CXL Type 3 support is not compiled in" ); } + +void qmp_cxl_add_dynamic_capacity (const char *path, +uint16_t host_id, +CXLExtSelPolicy sel_policy, +uint8_t region, +const char *tag, +CXLDynamicCapacityExtentList *extents, +Error **errp) +{ +error_setg (errp,"CXL Type 3 support is not compiled in" ); +} + +void qmp_cxl_release_dynamic_capacity (const char *path,uint16_t host_id, +CXLExtRemovalPolicy removal_policy, +bool has_forced_removal, +bool forced_removal, +bool has_sanitize_on_release, +bool sanitize_on_release, +uint8_t region, +const char *tag, +CXLDynamicCapacityExtentList *extents, +Error **errp) +{ +error_setg (errp,"CXL Type 3 support is not compiled in" ); +}
Signature · 1 line
MST
[PULL v2 87/88] pcie_sriov: Register VFs after migration
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/pci/pcie_sriov.h | 2 ++ hw/pci/pci.c | 7 +++++++ hw/pci/pcie_sriov.c | 7 +++++++ 3 files changed, 16 insertions(+)
include/hw/pci/pcie_sriov.h +2 -0
@@ -57,6 +57,8 @@ void pcie_sriov_pf_add_sup_pgsize(PCIDevice *dev, uint16_t opt_sup_pgsize);void pcie_sriov_config_write (PCIDevice *dev,uint32_t address,uint32_t val,int len); +void pcie_sriov_pf_post_load (PCIDevice *dev); +/* Reset SR/IOV */ void pcie_sriov_pf_reset (PCIDevice *dev);
hw/pci/pci.c +7 -0
@@ -733,10 +733,17 @@ static bool migrate_is_not_pcie(void *opaque, int version_id)return !pci_is_express ((PCIDevice *)opaque); } +static int pci_post_load (void *opaque,int version_id) +{ +pcie_sriov_pf_post_load (opaque); +return 0 ; +} +const VMStateDescription vmstate_pci_device = { .name ="PCIDevice" , .version_id =2 , .minimum_version_id =1 , + .post_load = pci_post_load, .fields = (const VMStateField []) {VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice), VMSTATE_BUFFER_UNSAFE_INFO_TEST(config, PCIDevice,
hw/pci/pcie_sriov.c +7 -0
@@ -252,6 +252,13 @@ void pcie_sriov_config_write(PCIDevice *dev, uint32_t address, } } +void pcie_sriov_pf_post_load (PCIDevice *dev) +{ +if (dev->exp.sriov_cap) { +register_vfs (dev); + } +} +/* Reset SR/IOV */ void pcie_sriov_pf_reset (PCIDevice *dev)
Signature · 1 line
MST
[PULL v2 46/88] qapi: clarify that the default is backend dependent
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
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.
Message-Id: <[email protected]>
--- qapi/qom.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
qapi/qom.json +3 -5
@@ -600,7 +600,9 @@ # preallocation threads (default: none) (since 7.2) # # @share: if false, the memory is private to QEMU; if true, it is -# shared (default: false) +# shared (default false for backends memory-backend-file and +# memory-backend-ram, true for backends memory-backend-epc and +# memory-backend-memfd) # # @reserve: if true, reserve swap space (or huge pages) if applicable # (default: true) (since 6.1)
@@ -700,8 +702,6 @@ # # Properties for memory-backend-memfd objects. # -# The @share boolean option is true by default with memfd. -# # @hugetlb: if true, the file to be created resides in the hugetlbfs # filesystem (default: false) #
@@ -726,8 +726,6 @@ # # Properties for memory-backend-epc objects. # -# The @share boolean option is true by default with epc -# # The @merge boolean option is false by default with epc # # The @dump boolean option is false by default with epc
Signature · 1 line
MST
[PULL v2 01/88] vhost: dirty log should be per backend type
In reply to Michael S. TsirkinFrom: Si-Wei Liu <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-)
hw/virtio/vhost.c +33 -12
@@ -43,8 +43,8 @@ do { } while (0)#endif -static struct vhost_log *vhost_log; -static struct vhost_log *vhost_log_shm; +static struct vhost_log *vhost_log[VHOST_BACKEND_TYPE_MAX ]; +static struct vhost_log *vhost_log_shm[VHOST_BACKEND_TYPE_MAX ];/* Memslots used by backends that support private memslots (without an fd). */ static unsigned int used_memslots;
@@ -287,6 +287,10 @@ static int vhost_set_backend_type(struct vhost_dev *dev, r =-1 ; } +if (r ==0 ) { +assert (dev->vhost_ops->backend_type == backend_type); + } +return r; }
@@ -319,16 +323,22 @@ static struct vhost_log *vhost_log_alloc(uint64_t size, bool share)return log; } -static struct vhost_log *vhost_log_get (uint64_t size,bool share) +static struct vhost_log *vhost_log_get (VhostBackendType backend_type, +uint64_t size,bool share) { -struct vhost_log *log = share ? vhost_log_shm : vhost_log; +struct vhost_log *log; + +assert (backend_type >VHOST_BACKEND_TYPE_NONE ); +assert (backend_type <VHOST_BACKEND_TYPE_MAX ); + + log = share ? vhost_log_shm[backend_type] : vhost_log[backend_type];if (!log || log->size != size) { log =vhost_log_alloc (size, share);if (share) { - vhost_log_shm = log; + vhost_log_shm[backend_type] = log; }else { - vhost_log = log; + vhost_log[backend_type] = log; } }else { ++log->refcnt;
@@ -340,11 +350,20 @@ static struct vhost_log *vhost_log_get(uint64_t size, bool share)static void vhost_log_put (struct vhost_dev *dev,bool sync) {struct vhost_log *log = dev->log; +VhostBackendType backend_type;if (!log) {return ; } +assert (dev->vhost_ops); + backend_type = dev->vhost_ops->backend_type; + +if (backend_type ==VHOST_BACKEND_TYPE_NONE || + backend_type >=VHOST_BACKEND_TYPE_MAX ) { +return ; + } + --log->refcnt;if (log->refcnt ==0 ) {/* Sync only the range covered by the old log */
@@ -352,13 +371,13 @@ static void vhost_log_put(struct vhost_dev *dev, bool sync)vhost_log_sync_range (dev,0 , dev->log_size *VHOST_LOG_CHUNK -1 ); } -if (vhost_log == log) { +if (vhost_log[backend_type] == log) {g_free (log->log); - vhost_log =NULL ; - }else if (vhost_log_shm == log) { + vhost_log[backend_type] =NULL ; + }else if (vhost_log_shm[backend_type] == log) {qemu_memfd_free (log->log, log->size *sizeof (*(log->log)), log->fd); - vhost_log_shm =NULL ; + vhost_log_shm[backend_type] =NULL ; }g_free (log);
@@ -376,7 +395,8 @@ static bool vhost_dev_log_is_shared(struct vhost_dev *dev)static inline void vhost_dev_log_resize (struct vhost_dev *dev,uint64_t size) { -struct vhost_log *log =vhost_log_get (size,vhost_dev_log_is_shared (dev)); +struct vhost_log *log =vhost_log_get (dev->vhost_ops->backend_type, + size,vhost_dev_log_is_shared (dev));uint64_t log_base = (uintptr_t )log->log;int r;
@@ -2044,7 +2064,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings)uint64_t log_base; hdev->log_size =vhost_get_log_size (hdev); - hdev->log =vhost_log_get (hdev->log_size, + hdev->log =vhost_log_get (hdev->vhost_ops->backend_type, + hdev->log_size,vhost_dev_log_is_shared (hdev)); log_base = (uintptr_t )hdev->log->log; r = hdev->vhost_ops->vhost_set_log_base(hdev,
Signature · 1 line
MST
[PULL v2 78/88] virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged
In reply to Michael S. TsirkinFrom: Cédric Le Goater <[email protected]>
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 machine. This can lead to an assert if the device is reattached again.
When reattached, the .get_address_space() handler reuses an IOMMUDevice entry allocated when the VFIO device was first attached. virtio_iommu_set_host_iova_ranges() is called later on from the .set_iommu_device() handler an fails with an assert on 'probe_done' because the device appears to have been already probed when this is not the case.
The IOMMUDevice entry is allocated in pci_device_iommu_address_space() called from under vfio_realize(), the VFIO PCI realize handler. Since pci_device_unset_iommu_device() is called from vfio_exitfn(), a sub function of the PCIDevice unrealize() handler, it seems that the .unset_iommu_device() handler is the best place to release resources allocated at realize time. Clear the IOMMUDevice cache entry there to fix hotplug.
Message-Id: <[email protected]>
--- hw/virtio/virtio-iommu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
hw/virtio/virtio-iommu.c +21 -0
@@ -467,6 +467,26 @@ static AddressSpace *virtio_iommu_find_add_as(PCIBus *bus, void *opaque,return &sdev->as; } +static void virtio_iommu_device_clear (VirtIOIOMMU *s,PCIBus *bus,int devfn) +{ +IOMMUPciBus *sbus =g_hash_table_lookup (s->as_by_busptr, bus); +IOMMUDevice *sdev; + +if (!sbus) { +return ; + } + + sdev = sbus->pbdev[devfn]; +if (!sdev) { +return ; + } + +g_list_free_full (sdev->resv_regions, g_free); + sdev->resv_regions =NULL ; +g_free (sdev); + sbus->pbdev[devfn] =NULL ; +} +static gboolean hiod_equal (gconstpointer v1,gconstpointer v2) {const struct hiod_key *key1 = v1;
@@ -650,6 +670,7 @@ virtio_iommu_unset_iommu_device(PCIBus *bus, void *opaque, int devfn) }g_hash_table_remove (viommu->host_iommu_devices, &key); +virtio_iommu_device_clear (viommu, bus, devfn); }static const PCIIOMMUOps virtio_iommu_ops = {
Signature · 1 line
MST
[PULL v2 25/88] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response
In reply to Michael S. TsirkinFrom: Fan Ni <[email protected]>
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 valid or not; if not, skip
Pass 2 and return mailbox process error.
Pass 2: Do the real work--add or release extents, respectively.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_device.h | 4 + hw/cxl/cxl-mailbox-utils.c | 394 ++++++++++++++++++++++++++++++++++++ hw/mem/cxl_type3.c | 11 + 3 files changed, 409 insertions(+)
include/hw/cxl/cxl_device.h +4 -0
@@ -551,4 +551,8 @@ void cxl_event_irq_assert(CXLType3Dev *ct3d);void cxl_set_poison_list_overflowed (CXLType3Dev *ct3d); +CXLDCRegion *cxl_find_dc_region (CXLType3Dev *ct3d,uint64_t dpa,uint64_t len); + +void cxl_remove_extent_from_extent_list (CXLDCExtentList *list, +CXLDCExtent *extent);#endif
hw/cxl/cxl-mailbox-utils.c +394 -0
418 lines not on this page · raw message
hw/mem/cxl_type3.c +11 -0
@@ -678,6 +678,15 @@ static bool cxl_create_dc_regions(CXLType3Dev *ct3d, Error **errp)return true; } +static void cxl_destroy_dc_regions (CXLType3Dev *ct3d) +{ +CXLDCExtent *ent, *ent_next; + + QTAILQ_FOREACH_SAFE(ent, &ct3d->dc.extents, node, ent_next) { +cxl_remove_extent_from_extent_list (&ct3d->dc.extents, ent); + } +} +static bool cxl_setup_memory (CXLType3Dev *ct3d,Error **errp) {DeviceState *ds =DEVICE (ct3d);
@@ -874,6 +883,7 @@ err_free_special_ops:g_free (regs->special_ops); err_address_space_free:if (ct3d->dc.host_dc) { +cxl_destroy_dc_regions (ct3d);address_space_destroy (&ct3d->dc.host_dc_as); }if (ct3d->hostpmem) {
@@ -895,6 +905,7 @@ static void ct3_exit(PCIDevice *pci_dev)cxl_doe_cdat_release (cxl_cstate);g_free (regs->special_ops);if (ct3d->dc.host_dc) { +cxl_destroy_dc_regions (ct3d);address_space_destroy (&ct3d->dc.host_dc_as); }if (ct3d->hostpmem) {
Signature · 1 line
MST
[PULL v2 67/88] tests/qtest/bios-tables-test.c: Add support for arch in path
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
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.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
tests/qtest/bios-tables-test.c +20 -3
@@ -78,6 +78,7 @@ typedef struct { bool tcg_only; const char *machine; + const char *arch; const char *machine_param; const char *variant; const char *uefi_fl1;
@@ -262,8 +263,19 @@ static void dump_aml_files(test_data *data, bool rebuild)g_assert (exp_sdt->aml);if (rebuild) { - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, data->machine, + aml_file =g_strdup_printf ("%s/%s/%s/%.4s%s" , data_dir, + data->arch, data->machine, sdt->aml, ext); + +/* +* To keep test cases not failing before the DATA files are moved to +* ${arch}/${machine} folder, add this check as well. +*/ +if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { + aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, + data->machine, sdt->aml, ext); + } +if (!g_file_test (aml_file,G_FILE_TEST_EXISTS ) && sdt->aml_len == exp_sdt->aml_len && !memcmp (sdt->aml, exp_sdt->aml, sdt->aml_len)) {
@@ -398,8 +410,13 @@ static GArray *load_expected_aml(test_data *data)memset (&exp_sdt,0 ,sizeof (exp_sdt)); try_again: - aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, data->machine, - sdt->aml, ext); + aml_file =g_strdup_printf ("%s/%s/%s/%.4s%s" , data_dir, data->arch, + data->machine, sdt->aml, ext); +if (!g_file_test (aml_file,G_FILE_TEST_EXISTS )) { + aml_file =g_strdup_printf ("%s/%s/%.4s%s" , data_dir, data->machine, + sdt->aml, ext); + } +if (verbosity_level >=2 ) {fprintf (stderr,"Looking for expected file '%s'\n" , aml_file); }
Signature · 1 line
MST
[PULL v2 34/88] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal
In reply to Michael S. TsirkinFrom: Alejandro Jimenez <[email protected]>
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 management layer application can detect the new GUEST_PVSHUTDOWN event to determine if the guest is using the pvpanic interface to request shutdowns.
Message-Id: <[email protected]>
--- qapi/run-state.json | 14 ++++++++++++++ system/runstate.c | 1 + 2 files changed, 15 insertions(+)
qapi/run-state.json +14 -0
@@ -462,6 +462,20 @@ { 'event': 'GUEST_CRASHLOADED', 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } } +## +# @GUEST_PVSHUTDOWN: +# +# Emitted when guest submits a shutdown request via pvpanic interface +# +# Since: 9.1 +# +# Example: +# +# <- { "event": "GUEST_PVSHUTDOWN", +# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } } +## +{ 'event': 'GUEST_PVSHUTDOWN' } + ## # @GuestPanicAction: #
system/runstate.c +1 -0
@@ -586,6 +586,7 @@ void qemu_system_guest_crashloaded(GuestPanicInformation *info)void qemu_system_guest_pvshutdown (void ) { +qapi_event_send_guest_pvshutdown ();qemu_system_shutdown_request (SHUTDOWN_CAUSE_GUEST_SHUTDOWN ); }
Signature · 1 line
MST
[PULL v2 40/88] vhost-user-test: no set non-blocking for cal fd less than 0.
In reply to Michael S. TsirkinFrom: Yuxue Liu <[email protected]>
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 case. Calling g_unix_set_fd_nonblocking at this point will cause the test to interrupt.
When vhost_user_write sets the call fd to -1, it sets the number of fds to 0, so the fds obtained by qemu_chr_fe_get_msgfds will also be 0.
Message-Id: <[email protected]>
--- tests/qtest/vhost-user-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tests/qtest/vhost-user-test.c +4 -1
@@ -458,7 +458,10 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)case VHOST_USER_SET_VRING_KICK :case VHOST_USER_SET_VRING_CALL :/* consume the fd */ -qemu_chr_fe_get_msgfds (chr, &fd,1 ); +if (!qemu_chr_fe_get_msgfds (chr, &fd,1 ) && fd <0 ) { +qos_printf ("call fd: %d, do not set non-blocking\n" , fd); +break ; + }/* * This is a non-blocking eventfd. * The receive function forces it to be blocking,
Signature · 1 line
MST
[PULL v2 51/88] contrib/vhost-user-blk: fix bind() using the right size of the address
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
On macOS passing -s /tmp/vhost.socket parameter to the vhost-user-blk application, the bind was done on /tmp/vhost.socke pathname, missing the last character.
This sounds like one of the portability problems described in the unix(7) manpage:
Pathname sockets
When binding a socket to a pathname, a few rules should be observed for maximum portability and ease of coding:
• The pathname in sun_path should be null-terminated.
• The length of the pathname, including the terminating null byte, should not exceed the size of sun_path.
• The addrlen argument that describes the enclosing sockaddr_un structure should have a value of at least:
offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path)+1
or, more simply, addrlen can be specified as
sizeof(struct sockaddr_un).
So let's follow the last advice and simplify the code as well.
Message-Id: <[email protected]>
--- contrib/vhost-user-blk/vhost-user-blk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
contrib/vhost-user-blk/vhost-user-blk.c +1 -3
@@ -469,7 +469,6 @@ static int unix_sock_new(char *unix_fn) {int sock;struct sockaddr_un un; -size_t len;assert (unix_fn);
@@ -481,10 +480,9 @@ static int unix_sock_new(char *unix_fn) un.sun_family =AF_UNIX ; (void )snprintf (un.sun_path,sizeof (un.sun_path),"%s" , unix_fn); - len =sizeof (un.sun_family) +strlen (un.sun_path); (void )unlink (unix_fn); -if (bind (sock, (struct sockaddr *)&un, len) <0 ) { +if (bind (sock, (struct sockaddr *)&un,sizeof (un)) <0 ) {perror ("bind" ); goto fail; }
Signature · 1 line
MST
[PULL v2 84/88] pcie_sriov: Reuse SR-IOV VF device instances
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
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.
Message-Id: <[email protected]>
--- include/hw/pci/pci.h | 5 -- include/hw/pci/pci_device.h | 15 ++++++ include/hw/pci/pcie_sriov.h | 1 - hw/pci/pci.c | 2 +- hw/pci/pcie_sriov.c | 95 ++++++++++++++++--------------------- 5 files changed, 56 insertions(+), 62 deletions(-)
include/hw/pci/pci.h +0 -5
@@ -680,9 +680,4 @@ static inline void pci_irq_pulse(PCIDevice *pci_dev)MSIMessage pci_get_msi_message (PCIDevice *dev,int vector);void pci_set_enabled (PCIDevice *pci_dev,bool state); -static inline void pci_set_power (PCIDevice *pci_dev,bool state) -{ -pci_set_enabled (pci_dev, state); -} -#endif
include/hw/pci/pci_device.h +15 -0
@@ -205,6 +205,21 @@ static inline uint16_t pci_get_bdf(PCIDevice *dev)return PCI_BUILD_BDF (pci_bus_num (pci_get_bus (dev)), dev->devfn); } +static inline void pci_set_power (PCIDevice *pci_dev,bool state) +{ +/* +* Don't change the enabled state of VFs when powering on/off the device. +* +* When powering on, VFs must not be enabled immediately but they must +* wait until the guest configures SR-IOV. +* When powering off, their corresponding PFs will be reset and disable +* VFs. +*/ +if (!pci_is_vf (pci_dev)) { +pci_set_enabled (pci_dev, state); + } +} +uint16_t pci_requester_id (PCIDevice *dev);/* DMA access functions */
include/hw/pci/pcie_sriov.h +0 -1
@@ -18,7 +18,6 @@typedef struct PCIESriovPF {uint16_t num_vfs;/* Number of virtual functions created */ uint8_t vf_bar_type[PCI_NUM_REGIONS ];/* Store type for each VF bar */ -const char *vfname;/* Reference to the device type used for the VFs */ PCIDevice **vf;/* Pointer to an array of num_vfs VF devices */ }PCIESriovPF ;
hw/pci/pci.c +1 -1
@@ -2895,7 +2895,7 @@ void pci_set_enabled(PCIDevice *d, bool state)memory_region_set_enabled (&d->bus_master_enable_region, (pci_get_word (d->config +PCI_COMMAND ) &PCI_COMMAND_MASTER ) && d->enabled); -if (!d->enabled) { +if (d->qdev.realized) {pci_device_reset (d); } }
hw/pci/pcie_sriov.c +40 -55
158 lines not on this page · raw message
Signature · 1 line
MST
[PULL v2 48/88] libvhost-user: fail vu_message_write() if sendmsg() is failing
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
In vu_message_write() we use sendmsg() to send the message header, then a write() to send the payload.
If sendmsg() fails we should avoid sending the payload, since we were unable to send the header.
Discovered before fixing the issue with the previous patch, where sendmsg() failed on macOS due to wrong parameters, but the frontend still sent the payload which the backend incorrectly interpreted as a wrong header.
Message-Id: <[email protected]>
--- subprojects/libvhost-user/libvhost-user.c | 5 +++++ 1 file changed, 5 insertions(+)
subprojects/libvhost-user/libvhost-user.c +5 -0
@@ -639,6 +639,11 @@ vu_message_write(VuDev *dev, int conn_fd, VhostUserMsg *vmsg) rc =sendmsg (conn_fd, &msg,0 ); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN )); +if (rc <=0 ) { +vu_panic (dev,"Error while writing: %s" ,strerror (errno)); +return false; + } +if (vmsg->size) { do { if (vmsg->data) {
Signature · 1 line
MST
[PULL v2 86/88] pcie_sriov: Remove num_vfs from PCIESriovPF
In reply to Michael S. TsirkinFrom: Akihiko Odaki <[email protected]>
num_vfs is not migrated so use PCI_SRIOV_CTRL_VFE and PCI_SRIOV_NUM_VF instead.
Message-Id: <[email protected]>
--- include/hw/pci/pcie_sriov.h | 1 - hw/pci/pcie_sriov.c | 28 ++++++++++++++++++++-------- hw/pci/trace-events | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-)
include/hw/pci/pcie_sriov.h +0 -1
@@ -16,7 +16,6 @@#include "hw/pci/pci.h" typedef struct PCIESriovPF { -uint16_t num_vfs;/* Number of virtual functions created */ uint8_t vf_bar_type[PCI_NUM_REGIONS ];/* Store type for each VF bar */ PCIDevice **vf;/* Pointer to an array of num_vfs VF devices */ }PCIESriovPF ;
hw/pci/pcie_sriov.c +20 -8
@@ -57,7 +57,6 @@ bool pcie_sriov_pf_init(PCIDevice *dev, uint16_t offset,pcie_add_capability (dev,PCI_EXT_CAP_ID_SRIOV ,1 , offset,PCI_EXT_CAP_SRIOV_SIZEOF ); dev->exp.sriov_cap = offset; - dev->exp.sriov_pf.num_vfs =0 ; dev->exp.sriov_pf.vf =NULL ;pci_set_word (cfg +PCI_SRIOV_VF_OFFSET , vf_offset);
@@ -186,6 +185,12 @@ void pcie_sriov_vf_register_bar(PCIDevice *dev, int region_num, } } +static void clear_ctrl_vfe (PCIDevice *dev) +{ +uint8_t *ctrl = dev->config + dev->exp.sriov_cap +PCI_SRIOV_CTRL ; +pci_set_word (ctrl,pci_get_word (ctrl) & ~PCI_SRIOV_CTRL_VFE ); +} +static void register_vfs (PCIDevice *dev) {uint16_t num_vfs;
@@ -195,6 +200,7 @@ static void register_vfs(PCIDevice *dev)assert (sriov_cap >0 ); num_vfs =pci_get_word (dev->config + sriov_cap +PCI_SRIOV_NUM_VF );if (num_vfs >pci_get_word (dev->config + sriov_cap +PCI_SRIOV_TOTAL_VF )) { +clear_ctrl_vfe (dev);return ; }
@@ -203,20 +209,18 @@ static void register_vfs(PCIDevice *dev)for (i =0 ; i < num_vfs; i++) {pci_set_enabled (dev->exp.sriov_pf.vf[i], true); } - dev->exp.sriov_pf.num_vfs = num_vfs; }static void unregister_vfs (PCIDevice *dev) { -uint16_t num_vfs = dev->exp.sriov_pf.num_vfs;uint16_t i; +uint8_t *cfg = dev->config + dev->exp.sriov_cap;trace_sriov_unregister_vfs (dev->name,PCI_SLOT (dev->devfn), -PCI_FUNC (dev->devfn), num_vfs); -for (i =0 ; i < num_vfs; i++) { +PCI_FUNC (dev->devfn)); +for (i =0 ; i <pci_get_word (cfg +PCI_SRIOV_TOTAL_VF ); i++) {pci_set_enabled (dev->exp.sriov_pf.vf[i], false); } - dev->exp.sriov_pf.num_vfs =0 ; } void pcie_sriov_config_write(PCIDevice *dev, uint32_t address,
@@ -242,6 +246,9 @@ void pcie_sriov_config_write(PCIDevice *dev, uint32_t address, }else {unregister_vfs (dev); } + }else if (range_covers_byte (off, len,PCI_SRIOV_NUM_VF )) { +clear_ctrl_vfe (dev); +unregister_vfs (dev); } }
@@ -304,7 +311,7 @@ PCIDevice *pcie_sriov_get_pf(PCIDevice *dev)PCIDevice *pcie_sriov_get_vf_at_index (PCIDevice *dev,int n) {assert (!pci_is_vf (dev)); -if (n < dev->exp.sriov_pf.num_vfs) { +if (n <pcie_sriov_num_vfs (dev)) {return dev->exp.sriov_pf.vf[n]; }return NULL ;
@@ -312,5 +319,10 @@ PCIDevice *pcie_sriov_get_vf_at_index(PCIDevice *dev, int n)uint16_t pcie_sriov_num_vfs (PCIDevice *dev) { -return dev->exp.sriov_pf.num_vfs; +uint16_t sriov_cap = dev->exp.sriov_cap; +uint8_t *cfg = dev->config + sriov_cap; + +return sriov_cap && + (pci_get_word (cfg +PCI_SRIOV_CTRL ) &PCI_SRIOV_CTRL_VFE ) ? +pci_get_word (cfg +PCI_SRIOV_NUM_VF ) :0 ; }
hw/pci/trace-events +1 -1
@@ -14,7 +14,7 @@ msix_write_config(char *name, bool enabled, bool masked) "dev %s enabled %d mask # hw/pci/pcie_sriov.c sriov_register_vfs(const char *name, int slot, int function, int num_vfs) "%s %02x:%x: creating %d vf devs" -sriov_unregister_vfs(const char *name, int slot, int function, int num_vfs) "%s %02x:%x: Unregistering %d vf devs" +sriov_unregister_vfs(const char *name, int slot, int function) "%s %02x:%x: Unregistering vf devs" sriov_config_write(const char *name, int slot, int fun, uint32_t offset, uint32_t val, uint32_t len) "%s %02x:%x: sriov offset 0x%x val 0x%x len %d" # pcie.c
Signature · 1 line
MST
[PULL v2 53/88] vhost-user: enable frontends on any POSIX system
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system.
In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well.
Message-Id: <[email protected]>
--- hw/net/vhost_net.c | 5 +++++ hw/block/Kconfig | 2 +- meson.build | 1 - 3 files changed, 6 insertions(+), 2 deletions(-)
hw/net/vhost_net.c +5 -0
@@ -34,8 +34,13 @@#include "standard-headers/linux/virtio_ring.h" #include "hw/virtio/vhost.h" #include "hw/virtio/virtio-bus.h" +#if defined(__linux__)#include "linux-headers/linux/vhost.h" +#endif +#ifndef VHOST_FILE_UNBIND +#define VHOST_FILE_UNBIND -1 +#endif /* Features supported by host kernel. */ static const int kernel_feature_bits[] = {
hw/block/Kconfig +1 -1
@@ -40,7 +40,7 @@ config VHOST_USER_BLK bool # Only PCI devices are provided for now default y if VIRTIO_PCI - depends on VIRTIO && VHOST_USER && LINUX + depends on VIRTIO && VHOST_USER config SWIM bool
meson.build +0 -1
@@ -151,7 +151,6 @@ have_tpm = get_option('tpm') \ # vhost have_vhost_user = get_option('vhost_user') \ - .disable_auto_if(host_os != 'linux') \ .require(host_os != 'windows', error_message: 'vhost-user is not available on Windows').allowed() have_vhost_vdpa = get_option('vhost_vdpa') \
Signature · 1 line
MST
[PULL v2 75/88] hw/cxl/events: Improve QMP interfaces and documentation for add/release dynamic capacity.
In reply to Michael S. TsirkinFrom: Jonathan Cameron <[email protected]>
New DCD command definitions updated in response to review comments from Markus.
- Used CxlXXXX instead of CXLXXXXX for newly added types.
- Expanded some abreviations in type names to be easier to read.
- Additional documentation for some fields.
- Replace slightly vague cxl r3.1 references with "Compute Express Link (CXL) Specification, Revision 3.1, XXXX" to bring them inline with what it says on the specification cover.
Message-Id: <[email protected]>
--- qapi/cxl.json | 144 ++++++++++++++++++++++++--------------- hw/mem/cxl_type3.c | 18 ++--- hw/mem/cxl_type3_stubs.c | 8 +-- 3 files changed, 103 insertions(+), 67 deletions(-)
qapi/cxl.json +90 -54
@@ -363,9 +363,11 @@ 'data': {'path': 'str', 'type': 'CxlCorErrorType'}} ## -# @CXLDynamicCapacityExtent: +# @CxlDynamicCapacityExtent: # -# A single dynamic capacity extent +# A single dynamic capacity extent. This is a contiguous allocation +# of memory by Device Physical Address within a single Dynamic +# Capacity Region on a CXL Type 3 Device. # # @offset: The offset (in bytes) to the start of the region # where the extent belongs to.
@@ -374,7 +376,7 @@ # # Since: 9.1 ## -{ 'struct': 'CXLDynamicCapacityExtent', +{ 'struct': 'CxlDynamicCapacityExtent', 'data': { 'offset':'uint64', 'len': 'uint64'
@@ -382,22 +384,40 @@ } ## -# @CXLExtSelPolicy: +# @CxlExtentSelectionPolicy: # # The policy to use for selecting which extents comprise the added -# capacity, as defined in cxl spec r3.1 Table 7-70. +# capacity, as defined in Compute Express Link (CXL) Specification, +# Revision 3.1, Table 7-70. # -# @free: 0h = Free +# @free: Device is responsible for allocating the requested memory +# capacity and is free to do this using any combination of +# supported extents. # -# @contiguous: 1h = Continuous +# @contiguous: Device is responsible for allocating the requested +# memory capacity but must do so as a single contiguous +# extent. # -# @prescriptive: 2h = Prescriptive +# @prescriptive: The precise set of extents to be allocated is +# specified by the command. Thus allocation is being managed +# by the issuer of the allocation command, not the device. # -# @enable-shared-access: 3h = Enable Shared Access +# @enable-shared-access: Capacity has already been allocated to a +# different host using free, contiguous or prescriptive policy +# with a known tag. This policy then instructs the device to +# make the capacity with the specified tag available to an +# additional host. Capacity is implicit as it matches that +# already associated with the tag. Note that the extent list +# (and hence Device Physical Addresses) used are per host, so +# a device may use different representations on each host. +# The ordering of the extents provided to each host is indicated +# to the host using per extent sequence numbers generated by +# the device. Has a similar meaning for temporal sharing, but +# in that case there may be only one host involved. # # Since: 9.1 ## -{ 'enum': 'CXLExtSelPolicy', +{ 'enum': 'CxlExtentSelectionPolicy', 'data': ['free', 'contiguous', 'prescriptive',
@@ -407,54 +427,60 @@ ## # @cxl-add-dynamic-capacity: # -# Command to initiate to add dynamic capacity extents to a host. It -# simulates operations defined in cxl spec r3.1 7.6.7.6.5. +# Initiate adding dynamic capacity extents to a host. This simulates +# operations defined in Compute Express Link (CXL) Specification, +# Revision 3.1, Section 7.6.7.6.5. Note that, currently, establishing +# success or failure of the full Add Dynamic Capacity flow requires +# out of band communication with the OS of the CXL host. # -# @path: CXL DCD canonical QOM path. +# @path: path to the CXL Dynamic Capacity Device in the QOM tree. # -# @host-id: The "Host ID" field as defined in cxl spec r3.1 -# Table 7-70. +# @host-id: The "Host ID" field as defined in Compute Express Link +# (CXL) Specification, Revision 3.1, Table 7-70. # # @selection-policy: The "Selection Policy" bits as defined in -# cxl spec r3.1 Table 7-70. It specifies the policy to use for -# selecting which extents comprise the added capacity. +# Compute Express Link (CXL) Specification, Revision 3.1, +# Table 7-70. It specifies the policy to use for selecting +# which extents comprise the added capacity. # -# @region: The "Region Number" field as defined in cxl spec r3.1 -# Table 7-70. The dynamic capacity region where the capacity -# is being added. Valid range is from 0-7. +# @region: The "Region Number" field as defined in Compute Express +# Link (CXL) Specification, Revision 3.1, Table 7-70. Valid +# range is from 0-7. # -# @tag: The "Tag" field as defined in cxl spec r3.1 Table 7-70. +# @tag: The "Tag" field as defined in Compute Express Link (CXL) +# Specification, Revision 3.1, Table 7-70. # -# @extents: The "Extent List" field as defined in cxl spec r3.1 -# Table 7-70. +# @extents: The "Extent List" field as defined in Compute Express Link +# (CXL) Specification, Revision 3.1, Table 7-70. # # Since : 9.1 ## { 'command': 'cxl-add-dynamic-capacity', 'data': { 'path': 'str', 'host-id': 'uint16', - 'selection-policy': 'CXLExtSelPolicy', + 'selection-policy': 'CxlExtentSelectionPolicy', 'region': 'uint8', '*tag': 'str', - 'extents': [ 'CXLDynamicCapacityExtent' ] + 'extents': [ 'CxlDynamicCapacityExtent' ] } } ## -# @CXLExtRemovalPolicy: +# @CxlExtentRemovalPolicy: # # The policy to use for selecting which extents comprise the released -# capacity, defined in the "Flags" field in cxl spec r3.1 Table 7-71. +# capacity, defined in the "Flags" field in Compute Express Link (CXL) +# Specification, Revision 3.1, Table 7-71. # -# @tag-based: value = 0h. Extents are selected by the device based -# on tag, with no requirement for contiguous extents. +# @tag-based: Extents are selected by the device based on tag, with +# no requirement for contiguous extents. # -# @prescriptive: value = 1h. Extent list of capacity to release is -# included in the request payload. +# @prescriptive: Extent list of capacity to release is included in +# the request payload. # # Since: 9.1 ## -{ 'enum': 'CXLExtRemovalPolicy', +{ 'enum': 'CxlExtentRemovalPolicy', 'data': ['tag-based', 'prescriptive'] }
@@ -462,45 +488,55 @@ ## # @cxl-release-dynamic-capacity: # -# Command to initiate to release dynamic capacity extents from a -# host. It simulates operations defined in cxl spec r3.1 7.6.7.6.6. +# Initiate release of dynamic capacity extents from a host. This +# simulates operations defined in Compute Express Link (CXL) +# Specification, Revision 3.1, Section 7.6.7.6.6. Note that, +# currently, success or failure of the full Release Dynamic Capacity +# flow requires out of band communication with the OS of the CXL host. # -# @path: CXL DCD canonical QOM path. +# @path: path to the CXL Dynamic Capacity Device in the QOM tree. # -# @host-id: The "Host ID" field as defined in cxl spec r3.1 +# @host-id: The "Host ID" field as defined in Compute Express Link +# (CXL) Specification, Revision 3.1, Table 7-71. +# +# @removal-policy: Bit[3:0] of the "Flags" field as defined in +# Compute Express Link (CXL) Specification, Revision 3.1, # Table 7-71. # -# @removal-policy: Bit[3:0] of the "Flags" field as defined in cxl -# spec r3.1 Table 7-71. +# @forced-removal: Bit[4] of the "Flags" field in Compute Express +# Link (CXL) Specification, Revision 3.1, Table 7-71. When set, +# the device does not wait for a Release Dynamic Capacity command +# from the host. Instead, the host immediately looses access to +# the released capacity. # -# @forced-removal: Bit[4] of the "Flags" field in cxl spec r3.1 -# Table 7-71. When set, device does not wait for a Release -# Dynamic Capacity command from the host. Host immediately -# loses access to released capacity. +# @sanitize-on-release: Bit[5] of the "Flags" field in Compute +# Express Link (CXL) Specification, Revision 3.1, Table 7-71. +# When set, the device should sanitize all released capacity as +# a result of this request. This ensures that all user data +# and metadata is made permanently unavailable by whatever +# means is appropriate for the media type. Note that changing +# encryption keys is not sufficient. # -# @sanitize-on-release: Bit[5] of the "Flags" field in cxl spec r3.1 -# Table 7-71. When set, device should sanitize all released -# capacity as a result of this request. +# @region: The "Region Number" field as defined in Compute Express +# Link Specification, Revision 3.1, Table 7-71. Valid range +# is from 0-7. # -# @region: The "Region Number" field as defined in cxl spec r3.1 -# Table 7-71. The dynamic capacity region where the capacity -# is being added. Valid range is from 0-7. +# @tag: The "Tag" field as defined in Compute Express Link (CXL) +# Specification, Revision 3.1, Table 7-71. # -# @tag: The "Tag" field as defined in cxl spec r3.1 Table 7-71. -# -# @extents: The "Extent List" field as defined in cxl spec r3.1 -# Table 7-71. +# @extents: The "Extent List" field as defined in Compute Express +# Link (CXL) Specification, Revision 3.1, Table 7-71. # # Since : 9.1 ## { 'command': 'cxl-release-dynamic-capacity', 'data': { 'path': 'str', 'host-id': 'uint16', - 'removal-policy': 'CXLExtRemovalPolicy', + 'removal-policy': 'CxlExtentRemovalPolicy', '*forced-removal': 'bool', '*sanitize-on-release': 'bool', 'region': 'uint8', '*tag': 'str', - 'extents': [ 'CXLDynamicCapacityExtent' ] + 'extents': [ 'CxlDynamicCapacityExtent' ] } }
hw/mem/cxl_type3.c +9 -9
@@ -1874,7 +1874,7 @@ static bool cxl_extent_groups_overlaps_dpa_range(CXLDCExtentGroupList *list,*/ static void qmp_cxl_process_dynamic_capacity_prescriptive (const char *path,uint16_t hid,CXLDCEventType type,uint8_t rid, -CXLDynamicCapacityExtentList *records,Error **errp) +CxlDynamicCapacityExtentList *records,Error **errp) {Object *obj;CXLEventDynamicCapacity dCap = {};
@@ -1882,7 +1882,7 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path,CXLType3Dev *dcd;uint8_t flags =1 <<CXL_EVENT_TYPE_INFO ;uint32_t num_extents =0 ; -CXLDynamicCapacityExtentList *list; +CxlDynamicCapacityExtentList *list;CXLDCExtentGroup *group =NULL ; g_autofree CXLDCExtentRaw *extents = NULL;uint8_t enc_log =CXL_EVENT_TYPE_DYNAMIC_CAP ;
@@ -2032,13 +2032,13 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path, }void qmp_cxl_add_dynamic_capacity (const char *path,uint16_t host_id, -CXLExtSelPolicy sel_policy,uint8_t region, -const char *tag, -CXLDynamicCapacityExtentList *extents, +CxlExtentSelectionPolicy sel_policy, +uint8_t region,const char *tag, +CxlDynamicCapacityExtentList *extents,Error **errp) {switch (sel_policy) { -case CXL_EXT_SEL_POLICY_PRESCRIPTIVE : +case CXL_EXTENT_SELECTION_POLICY_PRESCRIPTIVE :qmp_cxl_process_dynamic_capacity_prescriptive (path, host_id,DC_EVENT_ADD_CAPACITY , region, extents, errp);
@@ -2050,14 +2050,14 @@ void qmp_cxl_add_dynamic_capacity(const char *path, uint16_t host_id, }void qmp_cxl_release_dynamic_capacity (const char *path,uint16_t host_id, -CXLExtRemovalPolicy removal_policy, +CxlExtentRemovalPolicy removal_policy,bool has_forced_removal,bool forced_removal,bool has_sanitize_on_release,bool sanitize_on_release,uint8_t region,const char *tag, -CXLDynamicCapacityExtentList *extents, +CxlDynamicCapacityExtentList *extents,Error **errp) {CXLDCEventType type =DC_EVENT_RELEASE_CAPACITY ;
@@ -2070,7 +2070,7 @@ void qmp_cxl_release_dynamic_capacity(const char *path, uint16_t host_id, }switch (removal_policy) { -case CXL_EXT_REMOVAL_POLICY_PRESCRIPTIVE : +case CXL_EXTENT_REMOVAL_POLICY_PRESCRIPTIVE :qmp_cxl_process_dynamic_capacity_prescriptive (path, host_id, type, region, extents, errp);return ;
hw/mem/cxl_type3_stubs.c +4 -4
@@ -70,24 +70,24 @@ void qmp_cxl_inject_correctable_error(const char *path, CxlCorErrorType type,void qmp_cxl_add_dynamic_capacity (const char *path,uint16_t host_id, -CXLExtSelPolicy sel_policy, +CxlExtentSelectionPolicy sel_policy,uint8_t region,const char *tag, -CXLDynamicCapacityExtentList *extents, +CxlDynamicCapacityExtentList *extents,Error **errp) {error_setg (errp,"CXL Type 3 support is not compiled in" ); }void qmp_cxl_release_dynamic_capacity (const char *path,uint16_t host_id, -CXLExtRemovalPolicy removal_policy, +CxlExtentRemovalPolicy removal_policy,bool has_forced_removal,bool forced_removal,bool has_sanitize_on_release,bool sanitize_on_release,uint8_t region,const char *tag, -CXLDynamicCapacityExtentList *extents, +CxlDynamicCapacityExtentList *extents,Error **errp) {error_setg (errp,"CXL Type 3 support is not compiled in" );
Signature · 1 line
MST
[PULL v2 36/88] Revert "docs/specs/pvpanic: mark shutdown event as not implemented"
In reply to Michael S. TsirkinFrom: Thomas Weißschuh <[email protected]>
The missing functionality has been implemented now.
This reverts commit e739d1935c461d0668057e9dbba9d06f728d29ec.
Message-Id: <[email protected]>
--- docs/specs/pvpanic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
docs/specs/pvpanic.rst +1 -1
@@ -29,7 +29,7 @@ bit 1 a guest panic has happened and will be handled by the guest; the host should record it or report it, but should not affect the execution of the guest. -bit 2 (to be implemented) +bit 2 a regular guest shutdown has happened and should be processed by the host PCI Interface
Signature · 1 line
MST
[PULL v2 39/88] virtio-pci: implement No_Soft_Reset bit
In reply to Michael S. TsirkinFrom: Jiqian Chen <[email protected]>
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 register, then guest can check this bit, if this bit is set, the devices resetting will not be done, and then the display can work after resuming.
No_Soft_Reset bit is implemented for all virtio devices, and was tested only on virtio-gpu device. Set it false by default for safety.
Message-Id: <[email protected]>
--- include/hw/virtio/virtio-pci.h | 5 +++++ hw/core/machine.c | 1 + hw/virtio/virtio-pci.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+)
include/hw/virtio/virtio-pci.h +5 -0
@@ -43,6 +43,7 @@ enum {VIRTIO_PCI_FLAG_INIT_FLR_BIT ,VIRTIO_PCI_FLAG_AER_BIT ,VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT , + VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET_BIT, };/* Need to activate work-arounds for buggy guests at vmstate load. */
@@ -79,6 +80,10 @@ enum {/* Init Power Management */ #define VIRTIO_PCI_FLAG_INIT_PM (1 << VIRTIO_PCI_FLAG_INIT_PM_BIT) +/* Init The No_Soft_Reset bit of Power Management */ +#define VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET \ + (1 << VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET_BIT) +/* Init Function Level Reset capability */ #define VIRTIO_PCI_FLAG_INIT_FLR (1 << VIRTIO_PCI_FLAG_INIT_FLR_BIT)
hw/core/machine.c +1 -0
@@ -38,6 +38,7 @@ GlobalProperty hw_compat_9_0[] = { {"arm-cpu", "backcompat-cntfrq", "true" }, {"scsi-disk-base", "migrate-emulated-scsi-request", "false" }, {"vfio-pci", "skip-vsc-check", "false" }, + { "virtio-pci", "x-pcie-pm-no-soft-reset", "off" }, };const size_t hw_compat_9_0_len =G_N_ELEMENTS (hw_compat_9_0);
hw/virtio/virtio-pci.c +29 -0
@@ -2222,6 +2222,11 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)pcie_cap_lnkctl_init (pci_dev); } +if (proxy->flags &VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET ) { +pci_set_word (pci_dev->config + pos +PCI_PM_CTRL , +PCI_PM_CTRL_NO_SOFT_RESET ); + } +if (proxy->flags &VIRTIO_PCI_FLAG_INIT_PM ) {/* Init Power Management Control Register */ pci_set_word(pci_dev->wmask + pos + PCI_PM_CTRL,
@@ -2284,11 +2289,33 @@ static void virtio_pci_reset(DeviceState *qdev) } } +static bool virtio_pci_no_soft_reset (PCIDevice *dev) +{ +uint16_t pmcsr; + +if (!pci_is_express (dev) || !dev->exp.pm_cap) { +return false; + } + + pmcsr =pci_get_word (dev->config + dev->exp.pm_cap +PCI_PM_CTRL ); + +/* +* When No_Soft_Reset bit is set and the device +* is in D3hot state, don't reset device +*/ +return (pmcsr &PCI_PM_CTRL_NO_SOFT_RESET ) && + (pmcsr &PCI_PM_CTRL_STATE_MASK ) ==3 ; +} +static void virtio_pci_bus_reset_hold (Object *obj,ResetType type) {PCIDevice *dev =PCI_DEVICE (obj);DeviceState *qdev =DEVICE (obj); +if (virtio_pci_no_soft_reset (dev)) { +return ; + } +virtio_pci_reset (qdev);if (pci_is_express (dev)) {
@@ -2328,6 +2355,8 @@ static Property virtio_pci_properties[] = { VIRTIO_PCI_FLAG_INIT_LNKCTL_BIT, true),DEFINE_PROP_BIT ("x-pcie-pm-init" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_INIT_PM_BIT , true), +DEFINE_PROP_BIT ("x-pcie-pm-no-soft-reset" , VirtIOPCIProxy, flags, +VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET_BIT , false),DEFINE_PROP_BIT ("x-pcie-flr-init" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_INIT_FLR_BIT , true), DEFINE_PROP_BIT("aer", VirtIOPCIProxy, flags,
Signature · 1 line
MST
[PULL v2 44/88] vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests
In reply to Michael S. TsirkinFrom: BillXiang <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/virtio/vhost-user.c | 1 + 1 file changed, 1 insertion(+)
hw/virtio/vhost-user.c +1 -0
@@ -371,6 +371,7 @@ static bool vhost_user_per_device_request(VhostUserRequest request)case VHOST_USER_RESET_DEVICE :case VHOST_USER_ADD_MEM_REG :case VHOST_USER_REM_MEM_REG : +case VHOST_USER_SET_LOG_BASE :return true;default :return false;
Signature · 1 line
MST
[PULL v2 50/88] vhost-user-server: do not set memory fd non-blocking
In reply to Michael S. TsirkinFrom: Stefano Garzarella <[email protected]>
In vhost-user-server we set all fd received from the other peer in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.) it's not really needed, because we don't use these fd with blocking operations, but only to map memory.
In addition, in some systems this operation can fail (e.g. in macOS setting an fd returned by shm_open() non-blocking fails with errno = ENOTTY).
So, let's avoid setting fd non-blocking for those messages that we know carry memory fd (e.g. VHOST_USER_ADD_MEM_REG, VHOST_USER_SET_MEM_TABLE).
Message-Id: <[email protected]>
--- util/vhost-user-server.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
util/vhost-user-server.c +12 -0
@@ -65,6 +65,18 @@ static void vmsg_close_fds(VhostUserMsg *vmsg)static void vmsg_unblock_fds (VhostUserMsg *vmsg) {int i; + +/* +* These messages carry fd used to map memory, not to send/receive messages, +* so this operation is useless. In addition, in some systems this +* operation can fail (e.g. in macOS setting an fd returned by shm_open() +* non-blocking fails with errno = ENOTTY) +*/ +if (vmsg->request ==VHOST_USER_ADD_MEM_REG || + vmsg->request ==VHOST_USER_SET_MEM_TABLE ) { +return ; + } +for (i =0 ; i < vmsg->fd_num; i++) {qemu_socket_set_nonblock (vmsg->fds[i]); }
Signature · 1 line
MST
[PULL v2 13/88] vhost-user-gpu: fix import of DMABUF
In reply to Michael S. TsirkinFrom: Marc-André Lureau <[email protected]>
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 texture dimension.
Message-Id: <[email protected]>
--- hw/display/vhost-user-gpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/display/vhost-user-gpu.c +3 -2
@@ -281,8 +281,9 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUserGpuMsg *msg) modifier = m2->modifier; } - dmabuf =qemu_dmabuf_new (m->fd_width, m->fd_height, - m->fd_stride,0 ,0 ,0 ,0 , + dmabuf =qemu_dmabuf_new (m->width, m->height, + m->fd_stride,0 ,0 , + m->fd_width, m->fd_height, m->fd_drm_fourcc, modifier, fd, false, m->fd_flags &VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP );
Signature · 1 line
MST
[PULL v2 66/88] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them
In reply to Michael S. TsirkinFrom: Sunil V L <[email protected]>
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.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-)
tests/qtest/bios-tables-test.c +19 -16
@@ -1570,7 +1570,7 @@ static void test_acpi_piix4_tcg_dimm_pxm(void)test_acpi_tcg_dimm_pxm (MACHINE_PC ); } -static void test_acpi_virt_tcg_memhp (void ) +static void test_acpi_aarch64_virt_tcg_memhp (void ) {test_data data = { .machine ="virt" ,
@@ -1663,7 +1663,7 @@ static void test_acpi_microvm_ioapic2_tcg(void)free_test_data (&data); } -static void test_acpi_virt_tcg_numamem (void ) +static void test_acpi_aarch64_virt_tcg_numamem (void ) {test_data data = { .machine ="virt" ,
@@ -1685,7 +1685,7 @@ static void test_acpi_virt_tcg_numamem(void) } -static void test_acpi_virt_tcg_pxb (void ) +static void test_acpi_aarch64_virt_tcg_pxb (void ) {test_data data = { .machine ="virt" ,
@@ -1758,7 +1758,7 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)test_acpi_tcg_acpi_hmat (MACHINE_PC ); } -static void test_acpi_virt_tcg_acpi_hmat (void ) +static void test_acpi_aarch64_virt_tcg_acpi_hmat (void ) {test_data data = { .machine ="virt" ,
@@ -1914,7 +1914,7 @@ static void test_acpi_microvm_acpi_erst(void) }#endif /* CONFIG_POSIX */ -static void test_acpi_virt_tcg (void ) +static void test_acpi_aarch64_virt_tcg (void ) {test_data data = { .machine ="virt" ,
@@ -1933,7 +1933,7 @@ static void test_acpi_virt_tcg(void)free_test_data (&data); } -static void test_acpi_virt_tcg_topology (void ) +static void test_acpi_aarch64_virt_tcg_topology (void ) {test_data data = { .machine ="virt" ,
@@ -2016,7 +2016,7 @@ static void test_acpi_q35_cxl(void) }#endif /* CONFIG_POSIX */ -static void test_acpi_virt_viot (void ) +static void test_acpi_aarch64_virt_viot (void ) {test_data data = { .machine ="virt" ,
@@ -2192,7 +2192,7 @@ static void test_acpi_microvm_oem_fields(void)g_free (args); } -static void test_acpi_virt_oem_fields (void ) +static void test_acpi_aarch64_virt_oem_fields (void ) {test_data data = { .machine ="virt" ,
@@ -2364,16 +2364,19 @@ int main(int argc, char *argv[]) } }else if (strcmp (arch,"aarch64" ) ==0 ) {if (has_tcg &&qtest_has_device ("virtio-blk-pci" )) { -qtest_add_func ("acpi/virt" , test_acpi_virt_tcg); +qtest_add_func ("acpi/virt" , test_acpi_aarch64_virt_tcg);qtest_add_func ("acpi/virt/acpihmatvirt" , - test_acpi_virt_tcg_acpi_hmat); -qtest_add_func ("acpi/virt/topology" , test_acpi_virt_tcg_topology); -qtest_add_func ("acpi/virt/numamem" , test_acpi_virt_tcg_numamem); -qtest_add_func ("acpi/virt/memhp" , test_acpi_virt_tcg_memhp); -qtest_add_func ("acpi/virt/pxb" , test_acpi_virt_tcg_pxb); -qtest_add_func ("acpi/virt/oem-fields" , test_acpi_virt_oem_fields); + test_acpi_aarch64_virt_tcg_acpi_hmat); +qtest_add_func ("acpi/virt/topology" , + test_acpi_aarch64_virt_tcg_topology); +qtest_add_func ("acpi/virt/numamem" , + test_acpi_aarch64_virt_tcg_numamem); +qtest_add_func ("acpi/virt/memhp" , test_acpi_aarch64_virt_tcg_memhp); +qtest_add_func ("acpi/virt/pxb" , test_acpi_aarch64_virt_tcg_pxb); +qtest_add_func ("acpi/virt/oem-fields" , + test_acpi_aarch64_virt_oem_fields);if (qtest_has_device ("virtio-iommu-pci" )) { -qtest_add_func ("acpi/virt/viot" , test_acpi_virt_viot); +qtest_add_func ("acpi/virt/viot" , test_acpi_aarch64_virt_viot); } } }
Signature · 1 line
MST
Quoted 29 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with UINT32_MAX for romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixes
Quoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>
Fails testing:
https://gitlab.com/qemu-project/qemu/-/jobs/7257337667
qemu-system-loongarch64: -chardev socket,id=chr-reconnect,path=/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on: info: QEMU waiting for connection on: disconnected:unix:/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on **
ERROR:../src/tests/qtest/vhost-user-test.c:255:wait_for_fds: assertion failed: (s->fds_num)
qemu-system-loongarch64: Failed to set msg fds.
qemu-system-loongarch64: vhost VQ 0 ring restore failed: -22: Invalid argument (22)
qemu-system-loongarch64: Failed to set msg fds.
qemu-system-loongarch64: vhost VQ 1 ring restore failed: -22: Invalid argument (22)
qemu-system-loongarch64: Failed to write msg. Wrote -1 instead of 12.
qemu-system-loongarch64: vhost_backend_init failed: Protocol error
qemu-system-loongarch64: failed to init vhost_net for queue 0
# child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) exit status: 1 (error) # child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) stdout: "" # child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) stderr: "qemu-system-loongarch64: -chardev socket,id=chr-reconnect,path=/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on: info: QEMU waiting for connection on: disconnected:unix:/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on\n**\nERROR:../src/tests/qtest/vhost-user-test.c:255:wait_for_fds: assertion failed: (s->fds_num)\nqemu-system-loongarch64: Failed to set msg fds.\nqemu-system-loongarch64: vhost VQ 0 ring restore failed: -22: Invalid argument (22)\nqemu-system-loongarch64: Failed to set msg fds.\nqemu-system-loongarch64: vhost VQ 1 ring restore failed: -22: Invalid argument (22)\nqemu-system-loongarch64: Failed to write msg. Wrote -1 instead of 12.\nqemu-system-loongarch64: vhost_backend_init failed: Protocol error\nqemu-system-loongarch64: failed to init vhost_net for queue 0\n" ** ERROR:../src/tests/qtest/qos-test.c:190:subprocess_run_one_test: child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) failed unexpectedly not ok /loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect - ERROR:../src/tests/qtest/qos-test.c:190:subprocess_run_one_test: child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) failed unexpectedly Bail out! Abort trap (core dumped)
r~
Quoted 30 lines · Richard Henderson
Quoted 29 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with UINT32_MAX for romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixes
Quoted 5 lines
Quoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
Quoted 41 lines
qemu-system-loongarch64: -chardev socket,id=chr-reconnect,path=/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on:
info: QEMU waiting for connection on:
disconnected:unix:/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on
**
ERROR:../src/tests/qtest/vhost-user-test.c:255:wait_for_fds: assertion failed: (s->fds_num)
qemu-system-loongarch64: Failed to set msg fds.
qemu-system-loongarch64: vhost VQ 0 ring restore failed: -22: Invalid argument (22)
qemu-system-loongarch64: Failed to set msg fds.
qemu-system-loongarch64: vhost VQ 1 ring restore failed: -22: Invalid argument (22)
qemu-system-loongarch64: Failed to write msg. Wrote -1 instead of 12.
qemu-system-loongarch64:vhost_backend_initfailed: Protocol error
qemu-system-loongarch64: failed to initvhost_netfor queue 0# child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) exit status: 1 (error) # child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) stdout: "" # child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) stderr: "qemu-system-loongarch64: -chardev socket,id=chr-reconnect,path=/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on: info: QEMU waiting for connection on: disconnected:unix:/tmp/vhost-test-9Y0NQ2/reconnect.sock,server=on\n**\nERROR:../src/tests/qtest/vhost-user-test.c:255:wait_for_fds: assertion failed: (s->fds_num)\nqemu-system-loongarch64: Failed to set msg fds.\nqemu-system-loongarch64: vhost VQ 0 ring restore failed: -22: Invalid argument (22)\nqemu-system-loongarch64: Failed to set msg fds.\nqemu-system-loongarch64: vhost VQ 1 ring restore failed: -22: Invalid argument (22)\nqemu-system-loongarch64: Failed to write msg. Wrote -1 instead of 12.\nqemu-system-loongarch64: vhost_backend_init failed: Protocol error\nqemu-system-loongarch64: failed to init vhost_net for queue 0\n" ** ERROR:../src/tests/qtest/qos-test.c:190:subprocess_run_one_test: child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) failed unexpectedly not ok /loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect - ERROR:../src/tests/qtest/qos-test.c:190:subprocess_run_one_test: child process (/loongarch64/virt/generic-pcihost/pci-bus-generic/pci-bus/virtio-net-pci/virtio-net/virtio-net-tests/vhost-user/reconnect/subprocess [43438]) failed unexpectedly Bail out! Abort trap (core dumped)r~
Quoted 33 lines · Michael S. Tsirkin
Quoted 32 lines · Richard Henderson
Quoted 30 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with UINT32_MAX for romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesSigned-off-by Michael S. Tsirkin<[email protected]>
Quoted 7 lines
Quoted 3 lines
Fails testing:
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
r~
Quoted 37 lines · Richard Henderson
Quoted 36 lines · Michael S. Tsirkin
Quoted 35 lines · Richard Henderson
Quoted 30 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See .gitlab-ci.d/cirrus/README.rst for information how to enable it in your private gitlab repo.
Quoted 3 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
HTH,
Thomas
Quoted 59 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Quoted 6 lines
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
HTH,
Thomas
Well 1st failure had to do with inabilit to find qemu-img. Which I guess should be used from build directory really?
After adding that to path for now, it crashes with:
./scripts/archive-source.sh: line 55: meson: command not found
Would appreciate some help here.
Quoted 70 lines · Michael S. Tsirkin
Quoted 59 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Quoted 6 lines
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
HTH,
ThomasWell 1st failure had to do with inabilit to find qemu-img. Which I guess should be used from build directory really?
Quoted 6 lines
After adding that to path for now, it crashes with:
./scripts/archive-source.sh: line 55: meson: command not foundWould appreciate some help here.
Hmm adding build/pyenv/bin to PATH helps.
Let's see how far I can get ...
Signature · 1 line
MST
Quoted 67 lines · Michael S. Tsirkin
Quoted 59 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701'
ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize
(2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Quoted 6 lines
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
HTH,
Thomas
Quoted 8 lines
Well 1st failure had to do with inabilit to find qemu-img. Which I guess should be used from build directory really?
After adding that to path for now, it crashes with:
./scripts/archive-source.sh: line 55: meson: command not foundWould appreciate some help here.
Hmm, you've got to run the command from your build directory, not from the source tree ... maybe that's the problem?
Thomas
Quoted 59 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701' ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize (2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Quoted 6 lines
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
HTH,
Thomas
Thanks!
As a side, is there some way to persist the stuff fetched over the network so it does not happen each time I re-run make?
Signature · 1 line
MST
Quoted 64 lines · Michael S. Tsirkin
Quoted 63 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701'
ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize
(2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
Quoted 6 lines
Quoted 2 lines
HTH,
ThomasThanks!
As a side, is there some way to persist the stuff fetched over the network so it does not happen each time I re-run make?
That's why I use a proper vm install of freebsd.
r~
Quoted 68 lines · Richard Henderson
Quoted 67 lines · Michael S. Tsirkin
Quoted 65 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701'
ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize
(2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
HTH,
Thomas
Quoted 8 lines
Quoted 3 lines
Thanks!
As a side, is there some way to persist the stuff fetched over the network so it does not happen each time I re-run make?That's why I use a proper vm install of freebsd.
r~
Anyway. This pull attempted to enable vhost user on freebsd, and it looks like that's failing. So I just dropped the patches enabling it for now.
Signature · 1 line
MST
Quoted 64 lines · Michael S. Tsirkin
Quoted 63 lines · Thomas Huth
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Michael S. Tsirkin
Quoted 38 lines · Richard Henderson
Quoted 33 lines · Michael S. Tsirkin
The following changes since commit
1152a0414944f03231f3177207d379d58125890e:Merge tag 'pull-xen-20240701'
ofhttps://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2024-07-01 09:06:25 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
29e45afd8d6abf7a67dab5db0ab1cfbc388daefe:hw/pci: Replace -1 with
UINT32_MAXfor romsize
(2024-07-02 11:27:19 -0400)----------------------------------------------------------------
virtio: features,fixesA bunch of improvements:
- vhost dirty log is now only scanned once, not once per device
- virtio and vhost now supportVIRTIO_F_NOTIFICATION_DATA
- cxl gained DCD emulation support
- pvpanic gained shutdown support
- beginning of patchset for Generic Port Affinity Structure
- s3 support
- friendlier error messages when boot fails on some illegal configs
- for vhost-user,VHOST_USER_SET_LOG_BASEis now only sent once
- vhost-user now works on any POSIX system
- sr-iov VF setup code has been reworked significantly
- new tests, particularly for risc-v ACPI
- bugfixesQuoted 1 line
Signed-off-by Michael S. Tsirkin<[email protected]>Fails testing:
Quoted 7 lines
Quoted 5 lines
Could you give me a hint how to trigger this in CI pls? All tests seem to pass when I push it to gitlab. Any special variables to set?
In CI, FreeBSD uses travis; I'm not sure what's involved.
s/travis/cirrus-ci/
See
.gitlab-ci.d/cirrus/README.rstfor information how to enable it in your private gitlab repo.Quoted 4 lines
I replicated it locally within a FreeBSD VM.
It should be reproducible with 'make vm-build-freebsd', but I think that's more difficult to debug after the fact than a full vm.
Just use "make vm-build-freebsd DEBUG=1" and you should get a shell prompt for interactive debugging, so that's likely the best way to tackle such issues.
Quoted 6 lines
Quoted 2 lines
HTH,
ThomasThanks!
As a side, is there some way to persist the stuff fetched over the network so it does not happen each time I re-run make?
The download should get cached in ~/.cache/qemu-vm/ ... if that does not work, there is likely another bug in the scripts somewhere...
Thomas