virtio,pc,pci: features, cleanups, fixes
Subsystems (7)
[PULL 02/51] virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it
In reply to Michael S. TsirkinFrom: Eugenio Pérez <[email protected]>
Status part of the emulated feature. It will follow device model, so we must copy it as long as NIC device model has it set.
Message-Id: <[email protected]>
--- hw/net/virtio-net.c | 2 ++ 1 file changed, 2 insertions(+)
hw/net/virtio-net.c +2 -0
@@ -183,6 +183,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)memcpy (netcfg.mac, n->mac,ETH_ALEN ); } + netcfg.status |=virtio_tswap16 (vdev, + n->status &VIRTIO_NET_S_ANNOUNCE );memcpy (config, &netcfg, n->config_size); } }
Signature · 1 line
MST
[PULL 15/51] virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
To support configure interrupt for vhost-vdpa
Introduce VIRTIO_CONFIG_IRQ_IDX -1 as configure interrupt's queue index, Then we can reuse the functions guest_notifier_mask and guest_notifier_pending. Add the check of queue index in these drivers, if the driver does not support configure interrupt, the function will just return
Message-Id: <[email protected]>
--- include/hw/virtio/virtio.h | 3 +++ hw/display/vhost-user-gpu.c | 18 ++++++++++++++++++ hw/net/virtio-net.c | 22 ++++++++++++++++++++-- hw/virtio/vhost-user-fs.c | 18 ++++++++++++++++++ hw/virtio/vhost-user-gpio.c | 10 ++++++++++ hw/virtio/vhost-vsock-common.c | 18 ++++++++++++++++++ hw/virtio/virtio-crypto.c | 18 ++++++++++++++++++ 7 files changed, 105 insertions(+), 2 deletions(-)
include/hw/virtio/virtio.h +3 -0
@@ -79,6 +79,9 @@ typedef struct VirtQueueElement#define VIRTIO_NO_VECTOR 0xffff +/* special index value used internally for config irqs */ +#define VIRTIO_CONFIG_IRQ_IDX -1 +#define TYPE_VIRTIO_DEVICE "virtio-device"OBJECT_DECLARE_TYPE (VirtIODevice, VirtioDeviceClass,VIRTIO_DEVICE )
hw/display/vhost-user-gpu.c +18 -0
@@ -486,6 +486,15 @@ vhost_user_gpu_guest_notifier_pending(VirtIODevice *vdev, int idx) {VhostUserGPU *g =VHOST_USER_GPU (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return false; + }return vhost_virtqueue_pending (&g->vhost->dev, idx); }
@@ -494,6 +503,15 @@ vhost_user_gpu_guest_notifier_mask(VirtIODevice *vdev, int idx, bool mask) {VhostUserGPU *g =VHOST_USER_GPU (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return ; + }vhost_virtqueue_mask (&g->vhost->dev, vdev, idx, mask); }
hw/net/virtio-net.c +20 -2
@@ -3325,6 +3325,15 @@ static bool virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx) }else { nc =qemu_get_subqueue (n->nic,vq2q (idx)); } +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return false +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return false; + }return vhost_net_virtqueue_pending (get_vhost_net (nc->peer), idx); }
@@ -3348,8 +3357,17 @@ static void virtio_net_guest_notifier_mask(VirtIODevice *vdev, int idx, }else { nc =qemu_get_subqueue (n->nic,vq2q (idx)); } -vhost_net_virtqueue_mask (get_vhost_net (nc->peer), - vdev, idx, mask); +/* +*Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return ; + } + +vhost_net_virtqueue_mask (get_vhost_net (nc->peer), vdev, idx, mask); }static void virtio_net_set_config_size (VirtIONet *n,uint64_t host_features)
hw/virtio/vhost-user-fs.c +18 -0
@@ -159,6 +159,15 @@ static void vuf_guest_notifier_mask(VirtIODevice *vdev, int idx, {VHostUserFS *fs =VHOST_USER_FS (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return ; + }vhost_virtqueue_mask (&fs->vhost_dev, vdev, idx, mask); }
@@ -166,6 +175,15 @@ static bool vuf_guest_notifier_pending(VirtIODevice *vdev, int idx) {VHostUserFS *fs =VHOST_USER_FS (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return false; + }return vhost_virtqueue_pending (&fs->vhost_dev, idx); }
hw/virtio/vhost-user-gpio.c +10 -0
@@ -191,6 +191,16 @@ static void vu_gpio_guest_notifier_mask(VirtIODevice *vdev, int idx, bool mask) {VHostUserGPIO *gpio =VHOST_USER_GPIO (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return ; + } +vhost_virtqueue_mask (&gpio->vhost_dev, vdev, idx, mask); }
hw/virtio/vhost-vsock-common.c +18 -0
@@ -127,6 +127,15 @@ static void vhost_vsock_common_guest_notifier_mask(VirtIODevice *vdev, int idx, {VHostVSockCommon *vvc =VHOST_VSOCK_COMMON (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return ; + }vhost_virtqueue_mask (&vvc->vhost_dev, vdev, idx, mask); }
@@ -135,6 +144,15 @@ static bool vhost_vsock_common_guest_notifier_pending(VirtIODevice *vdev, {VHostVSockCommon *vvc =VHOST_VSOCK_COMMON (vdev); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return false; + }return vhost_virtqueue_pending (&vvc->vhost_dev, idx); }
hw/virtio/virtio-crypto.c +18 -0
@@ -1182,6 +1182,15 @@ static void virtio_crypto_guest_notifier_mask(VirtIODevice *vdev, int idx,assert (vcrypto->vhost_started); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return ; + }cryptodev_vhost_virtqueue_mask (vdev, queue, idx, mask); }
@@ -1192,6 +1201,15 @@ static bool virtio_crypto_guest_notifier_pending(VirtIODevice *vdev, int idx)assert (vcrypto->vhost_started); +/* +* Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 +* as the Marco of configure interrupt's IDX, If this driver does not +* support, the function will return +*/ + +if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +return false; + }return cryptodev_vhost_virtqueue_pending (vdev, queue, idx); }
Signature · 1 line
MST
[PULL 10/51] i386, mips: Resolve redundant ACPI and APM dependencies
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
Now that all ACPI controllers select the ACPI and APM dependencies themselves, these explicit dependencies became redundant. Remove them.
Message-Id: <[email protected]>
--- configs/devices/mips-softmmu/common.mak | 3 --- hw/i386/Kconfig | 2 -- 2 files changed, 5 deletions(-)
configs/devices/mips-softmmu/common.mak +0 -3
@@ -17,9 +17,7 @@ CONFIG_I8254=y CONFIG_PCSPK=y CONFIG_PCKBD=y CONFIG_FDC=y -CONFIG_ACPI=y CONFIG_ACPI_PIIX4=y -CONFIG_APM=y CONFIG_I8257=y CONFIG_PIIX4=y CONFIG_IDE_ISA=y
@@ -32,6 +30,5 @@ CONFIG_MIPS_ITU=y CONFIG_MALTA=y CONFIG_PCNET_PCI=y CONFIG_MIPSSIM=y -CONFIG_ACPI_SMBUS=y CONFIG_SMBUS_EEPROM=y CONFIG_TEST_DEVICES=y
hw/i386/Kconfig +0 -2
@@ -51,7 +51,6 @@ config PC_PCI bool select APIC select IOAPIC - select APM select PC config PC_ACPI
@@ -72,7 +71,6 @@ config I440FX select ACPI_PIIX4 select PC_PCI select PC_ACPI - select ACPI_SMBUS select PCI_I440FX select PIIX3 select IDE_PIIX
Signature · 1 line
MST
[PULL 06/51] hw/acpi/Kconfig: Add missing dependencies to ACPI_ICH9
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
ich9_lpc_realize() uses apm_init() and ich9_smbus_realize() uses pm_smbus_init(), so both APM and ACPI_SMBUS are provided by the device models managed by ACPI_ICH9.
Message-Id: <[email protected]>
--- hw/acpi/Kconfig | 2 ++ hw/isa/Kconfig | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
hw/acpi/Kconfig +2 -0
@@ -15,7 +15,9 @@ config ACPI_X86 config ACPI_ICH9 bool + select ACPI_SMBUS select ACPI_X86 + select APM config ACPI_CPU_HOTPLUG bool
hw/isa/Kconfig +0 -1
@@ -77,5 +77,4 @@ config LPC_ICH9 # for ICH9. select I8257 select ISA_BUS - select ACPI_SMBUS select ACPI_ICH9
Signature · 1 line
MST
[PULL 03/51] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail
In reply to Michael S. TsirkinFrom: Eugenio Pérez <[email protected]>
Since this capability is emulated by qemu shadowed CVQ cannot forward it to the device. Process all that command within qemu.
Message-Id: <[email protected]>
--- net/vhost-vdpa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
net/vhost-vdpa.c +12 -3
@@ -616,9 +616,18 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq, out.iov_len =iov_to_buf (elem->out_sg, elem->out_num,0 , s->cvq_cmd_out_buffer,vhost_vdpa_net_cvq_cmd_len ()); - dev_written =vhost_vdpa_net_cvq_add (s, out.iov_len,sizeof (status)); -if (unlikely (dev_written <0 )) { - goto out; +if (*(uint8_t *)s->cvq_cmd_out_buffer ==VIRTIO_NET_CTRL_ANNOUNCE ) { +/* +* Guest announce capability is emulated by qemu, so don't forward to +* the device. +*/ + dev_written =sizeof (status); + *s->status =VIRTIO_NET_OK ; + }else { + dev_written =vhost_vdpa_net_cvq_add (s, out.iov_len,sizeof (status)); +if (unlikely (dev_written <0 )) { + goto out; + } }if (unlikely (dev_written <sizeof (status))) {
Signature · 1 line
MST
[PULL 12/51] vhost-user: Refactor vhost acked features saving
In reply to Michael S. TsirkinFrom: Hyman Huang(黄勇) <[email protected]>
Abstract vhost acked features saving into vhost_user_save_acked_features, export it as util function.
Message-Id: <50dc9b09b0635e3052551efcc1046c2a85332fcb.1671627406.git.huangy81@chinatelecom.cn>
--- include/net/vhost-user.h | 1 + net/vhost-user.c | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-)
include/net/vhost-user.h +1 -0
@@ -14,5 +14,6 @@struct vhost_net ;struct vhost_net *vhost_user_get_vhost_net (NetClientState *nc);uint64_t vhost_user_get_acked_features (NetClientState *nc); +void vhost_user_save_acked_features (NetClientState *nc);#endif /* VHOST_USER_H */
net/vhost-user.c +15 -6
@@ -45,10 +45,23 @@ uint64_t vhost_user_get_acked_features(NetClientState *nc)return s->acked_features; } -static void vhost_user_stop (int queues,NetClientState *ncs[]) +void vhost_user_save_acked_features (NetClientState *nc) {NetVhostUserState *s; + + s =DO_UPCAST (NetVhostUserState, nc, nc); +if (s->vhost_net) { +uint64_t features =vhost_net_get_acked_features (s->vhost_net); +if (features) { + s->acked_features = features; + } + } +} + +static void vhost_user_stop (int queues,NetClientState *ncs[]) +{int i; +NetVhostUserState *s;for (i =0 ; i < queues; i++) {assert (ncs[i]->info->type ==NET_CLIENT_DRIVER_VHOST_USER );
@@ -56,11 +69,7 @@ static void vhost_user_stop(int queues, NetClientState *ncs[]) s =DO_UPCAST (NetVhostUserState, nc, ncs[i]);if (s->vhost_net) { -/* save acked features */ -uint64_t features =vhost_net_get_acked_features (s->vhost_net); -if (features) { - s->acked_features = features; - } +vhost_user_save_acked_features (ncs[i]);vhost_net_cleanup (s->vhost_net); } }
Signature · 1 line
MST
[PULL 27/51] include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
hw/pci/pci_bridge.h and hw/cxl/cxl.h include each other.
Fortunately, breaking the loop is merely a matter of deleting unnecessary includes from headers, and adding them back in places where they are now missing.
Message-Id: <[email protected]>
--- hw/alpha/alpha_sys.h | 1 - hw/rdma/rdma_utils.h | 1 - hw/rdma/vmw/pvrdma.h | 1 - hw/usb/hcd-ehci.h | 1 - hw/xen/xen_pt.h | 1 - include/hw/cxl/cxl.h | 1 - include/hw/cxl/cxl_cdat.h | 1 + include/hw/cxl/cxl_device.h | 1 + include/hw/cxl/cxl_pci.h | 2 -- include/hw/i386/ich9.h | 4 ---- include/hw/i386/x86-iommu.h | 1 - include/hw/isa/vt82c686.h | 1 - include/hw/pci-host/designware.h | 3 --- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/ls7a.h | 2 -- include/hw/pci-host/pnv_phb3.h | 2 -- include/hw/pci-host/pnv_phb4.h | 3 +-- include/hw/pci-host/xilinx-pcie.h | 1 - include/hw/pci/pcie.h | 1 - include/hw/virtio/virtio-scsi.h | 1 - hw/alpha/pci.c | 1 + hw/alpha/typhoon.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/pci-bridge/i82801b11.c | 2 +- hw/rdma/rdma_utils.c | 1 + hw/scsi/virtio-scsi.c | 1 + 26 files changed, 10 insertions(+), 30 deletions(-)
hw/alpha/alpha_sys.h +0 -1
@@ -5,7 +5,6 @@#include "target/alpha/cpu-qom.h" #include "hw/pci/pci.h" -#include "hw/pci/pci_host.h" #include "hw/boards.h" #include "hw/intc/i8259.h"
hw/rdma/rdma_utils.h +0 -1
@@ -18,7 +18,6 @@#define RDMA_UTILS_H #include "qemu/error-report.h" -#include "hw/pci/pci.h" #include "sysemu/dma.h" #define rdma_error_report (fmt, ...) \
hw/rdma/vmw/pvrdma.h +0 -1
@@ -18,7 +18,6 @@#include "qemu/units.h" #include "qemu/notify.h" -#include "hw/pci/pci.h" #include "hw/pci/msix.h" #include "chardev/char-fe.h" #include "hw/net/vmxnet3_defs.h"
hw/usb/hcd-ehci.h +0 -1
@@ -23,7 +23,6 @@#include "sysemu/dma.h" #include "hw/pci/pci.h" #include "hw/sysbus.h" -#include "qom/object.h" #ifndef EHCI_DEBUG #define EHCI_DEBUG 0
hw/xen/xen_pt.h +0 -1
@@ -2,7 +2,6 @@#define XEN_PT_H #include "hw/xen/xen_common.h" -#include "hw/pci/pci.h" #include "xen-host-pci-device.h" #include "qom/object.h"
include/hw/cxl/cxl.h +0 -1
@@ -13,7 +13,6 @@#include "qapi/qapi-types-machine.h" #include "qapi/qapi-visit-machine.h" -#include "hw/pci/pci_bridge.h" #include "hw/pci/pci_host.h" #include "cxl_pci.h" #include "cxl_component.h"
include/hw/cxl/cxl_cdat.h +1 -0
@@ -11,6 +11,7 @@#define CXL_CDAT_H #include "hw/cxl/cxl_pci.h" +#include "hw/pci/pcie_doe.h" /* * Reference:
include/hw/cxl/cxl_device.h +1 -0
@@ -10,6 +10,7 @@#ifndef CXL_DEVICE_H #define CXL_DEVICE_H +#include "hw/pci/pci.h" #include "hw/register.h" /*
include/hw/cxl/cxl_pci.h +0 -2
@@ -11,8 +11,6 @@#define CXL_PCI_H #include "qemu/compiler.h" -#include "hw/pci/pci.h" -#include "hw/pci/pcie.h" #include "hw/cxl/cxl_cdat.h" #define CXL_VENDOR_ID 0x1e98
include/hw/i386/ich9.h +0 -4
@@ -5,12 +5,8 @@#include "hw/sysbus.h" #include "hw/i386/pc.h" #include "hw/isa/apm.h" -#include "hw/pci/pci.h" -#include "hw/pci/pcie_host.h" -#include "hw/pci/pci_bridge.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" -#include "hw/pci/pci_bus.h" #include "qom/object.h" void ich9_lpc_set_irq (void *opaque,int irq_num,int level);
include/hw/i386/x86-iommu.h +0 -1
@@ -21,7 +21,6 @@#define HW_I386_X86_IOMMU_H #include "hw/sysbus.h" -#include "hw/pci/pci.h" #include "hw/pci/msi.h" #include "qom/object.h"
include/hw/isa/vt82c686.h +0 -1
@@ -1,7 +1,6 @@#ifndef HW_VT82C686_H #define HW_VT82C686_H -#include "hw/pci/pci.h" #define TYPE_VT82C686B_ISA "vt82c686b-isa"#define TYPE_VT82C686B_USB_UHCI "vt82c686b-usb-uhci"
include/hw/pci-host/designware.h +0 -3
@@ -22,9 +22,6 @@#define DESIGNWARE_H #include "hw/sysbus.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_bus.h" -#include "hw/pci/pcie_host.h" #include "hw/pci/pci_bridge.h" #include "qom/object.h"
include/hw/pci-host/i440fx.h +1 -1
@@ -11,7 +11,7 @@#ifndef HW_PCI_I440FX_H #define HW_PCI_I440FX_H -#include "hw/pci/pci_bus.h" +#include "hw/pci/pci.h" #include "hw/pci-host/pam.h" #include "qom/object.h"
include/hw/pci-host/ls7a.h +0 -2
@@ -8,8 +8,6 @@#ifndef HW_LS7A_H #define HW_LS7A_H -#include "hw/pci/pci.h" -#include "hw/pci/pcie_host.h" #include "hw/pci-host/pam.h" #include "qemu/units.h" #include "qemu/range.h"
include/hw/pci-host/pnv_phb3.h +0 -2
@@ -10,8 +10,6 @@#ifndef PCI_HOST_PNV_PHB3_H #define PCI_HOST_PNV_PHB3_H -#include "hw/pci/pcie_host.h" -#include "hw/pci/pcie_port.h" #include "hw/ppc/xics.h" #include "qom/object.h" #include "hw/pci-host/pnv_phb.h"
include/hw/pci-host/pnv_phb4.h +1 -2
@@ -10,8 +10,7 @@#ifndef PCI_HOST_PNV_PHB4_H #define PCI_HOST_PNV_PHB4_H -#include "hw/pci/pcie_host.h" -#include "hw/pci/pcie_port.h" +#include "hw/pci/pci_bus.h" #include "hw/ppc/xive.h" #include "qom/object.h"
include/hw/pci-host/xilinx-pcie.h +0 -1
@@ -21,7 +21,6 @@#define HW_XILINX_PCIE_H #include "hw/sysbus.h" -#include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pcie_host.h" #include "qom/object.h"
include/hw/pci/pcie.h +0 -1
@@ -26,7 +26,6 @@#include "hw/pci/pcie_aer.h" #include "hw/pci/pcie_sriov.h" #include "hw/hotplug.h" -#include "hw/pci/pcie_doe.h" typedef enum { /* for attention and power indicator */
include/hw/virtio/virtio-scsi.h +0 -1
@@ -20,7 +20,6 @@#define VIRTIO_SCSI_SENSE_SIZE 0#include "standard-headers/linux/virtio_scsi.h" #include "hw/virtio/virtio.h" -#include "hw/pci/pci.h" #include "hw/scsi/scsi.h" #include "chardev/char-fe.h" #include "sysemu/iothread.h"
hw/alpha/pci.c +1 -0
@@ -7,6 +7,7 @@*/ #include "qemu/osdep.h" +#include "hw/pci/pci_host.h" #include "alpha_sys.h" #include "qemu/log.h" #include "trace.h"
hw/alpha/typhoon.c +1 -1
@@ -10,10 +10,10 @@#include "qemu/module.h" #include "qemu/units.h" #include "qapi/error.h" +#include "hw/pci/pci_host.h" #include "cpu.h" #include "hw/irq.h" #include "alpha_sys.h" -#include "qom/object.h" #define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost"
hw/i386/acpi-build.c +1 -1
@@ -27,7 +27,7 @@#include "acpi-common.h" #include "qemu/bitmap.h" #include "qemu/error-report.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_bridge.h" #include "hw/cxl/cxl.h" #include "hw/core/cpu.h" #include "target/i386/cpu.h"
hw/pci-bridge/i82801b11.c +1 -1
@@ -42,7 +42,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_bridge.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "hw/i386/ich9.h"
hw/rdma/rdma_utils.c +1 -0
@@ -14,6 +14,7 @@*/ #include "qemu/osdep.h" +#include "hw/pci/pci.h" #include "trace.h" #include "rdma_utils.h"
hw/scsi/virtio-scsi.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/iov.h" #include "qemu/module.h" #include "sysemu/block-backend.h" +#include "sysemu/dma.h" #include "hw/qdev-properties.h" #include "hw/scsi/scsi.h" #include "scsi/constants.h"
Signature · 1 line
MST
[PULL 31/51] include/hw/pci: Split pci_device.h off pci.h
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
PCIDeviceClass and PCIDevice are defined in pci.h. Many users of the header don't actually need them. Similar structs live in their own
headers: PCIBusClass and PCIBus in pci_bus.h, PCIBridge in pci_bridge.h, PCIHostBridgeClass and PCIHostState in pci_host.h, PCIExpressHost in pcie_host.h, and PCIERootPortClass, PCIEPort, and PCIESlot in pcie_port.h.
Move PCIDeviceClass and PCIDeviceClass to new pci_device.h, along with the code that needs them. Adjust include directives.
This also enables the next commit.
Message-Id: <[email protected]>
--- hw/display/ati_int.h | 2 +- hw/display/qxl.h | 3 +- hw/ide/ahci_internal.h | 2 +- hw/net/vmxnet3_defs.h | 2 +- hw/nvme/nvme.h | 2 +- hw/rdma/vmw/pvrdma.h | 1 + hw/scsi/mptsas.h | 2 +- hw/usb/hcd-ehci.h | 2 +- hw/usb/hcd-uhci.h | 2 +- hw/usb/hcd-xhci-pci.h | 1 + hw/vfio/pci.h | 2 +- include/hw/acpi/piix4.h | 2 +- include/hw/arm/allwinner-a10.h | 1 + include/hw/cxl/cxl_device.h | 2 +- include/hw/ide/pci.h | 2 +- include/hw/misc/macio/macio.h | 2 +- include/hw/pci-host/gpex.h | 2 +- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/q35.h | 2 +- include/hw/pci-host/sabre.h | 2 +- include/hw/pci/msi.h | 2 +- include/hw/pci/pci.h | 344 ------------------------------ include/hw/pci/pci_bridge.h | 2 +- include/hw/pci/pci_device.h | 350 +++++++++++++++++++++++++++++++ include/hw/pci/pcie_port.h | 1 + include/hw/pci/shpc.h | 2 +- include/hw/remote/iohub.h | 2 +- include/hw/remote/proxy.h | 2 +- include/hw/sd/sdhci.h | 2 +- include/hw/southbridge/piix.h | 3 +- include/hw/xen/xen_common.h | 2 +- hw/acpi/erst.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/char/serial-pci-multi.c | 2 +- hw/char/serial-pci.c | 2 +- hw/core/qdev-properties-system.c | 1 + hw/display/bochs-display.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/sm501.c | 2 +- hw/display/vga-pci.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/pci_ipmi_bt.c | 2 +- hw/ipmi/pci_ipmi_kcs.c | 2 +- hw/isa/i82378.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/net/can/can_kvaser_pci.c | 2 +- hw/net/can/can_mioe3680_pci.c | 2 +- hw/net/can/can_pcm3680_pci.c | 2 +- hw/net/can/ctucan_pci.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000x_common.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/net_tx_pkt.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rocker/rocker_desc.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/virtio-net.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/pci-host/dino.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/raven.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci-hmp-cmds.c | 1 + hw/pci/pcie_host.c | 2 +- hw/pci/pcie_sriov.c | 2 +- hw/pci/slotid_cap.c | 2 +- hw/ppc/ppc440_pcix.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 1 + hw/rdma/rdma_utils.c | 2 +- hw/s390x/s390-pci-inst.c | 1 + hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/smbios/smbios.c | 1 + hw/usb/hcd-ohci-pci.c | 2 +- hw/watchdog/wdt_i6300esb.c | 2 +- tests/qtest/fuzz/generic_fuzz.c | 1 + ui/util.c | 2 +- 93 files changed, 441 insertions(+), 427 deletions(-) create mode 100644 include/hw/pci/pci_device.h
hw/display/ati_int.h +1 -1
@@ -10,7 +10,7 @@#define ATI_INT_H #include "qemu/timer.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/i2c/bitbang_i2c.h" #include "vga_int.h" #include "qom/object.h"
hw/display/qxl.h +1 -2
@@ -1,8 +1,7 @@#ifndef HW_QXL_H #define HW_QXL_H - -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "vga_int.h" #include "qemu/thread.h"
hw/ide/ahci_internal.h +1 -1
@@ -26,7 +26,7 @@#include "hw/ide/ahci.h" #include "hw/ide/internal.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #define AHCI_MEM_BAR_SIZE 0x1000#define AHCI_MAX_PORTS 32
hw/net/vmxnet3_defs.h +1 -1
@@ -19,7 +19,7 @@#include "net/net.h" #include "hw/net/vmxnet3.h" -#include "qom/object.h" +#include "hw/pci/pci_device.h" #define TYPE_VMXNET3 "vmxnet3"typedef struct VMXNET3State VMXNET3State ;
hw/nvme/nvme.h +1 -1
@@ -19,7 +19,7 @@#define HW_NVME_NVME_H #include "qemu/uuid.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/block/block.h" #include "block/nvme.h"
hw/rdma/vmw/pvrdma.h +1 -0
@@ -19,6 +19,7 @@#include "qemu/units.h" #include "qemu/notify.h" #include "hw/pci/msix.h" +#include "hw/pci/pci_device.h" #include "chardev/char-fe.h" #include "hw/net/vmxnet3_defs.h"
hw/scsi/mptsas.h +1 -1
@@ -2,7 +2,7 @@#define MPTSAS_H #include "mpi.h" -#include "qom/object.h" +#include "hw/pci/pci_device.h" #define MPTSAS_NUM_PORTS 8#define MPTSAS_MAX_FRAMES 2048/* Firmware limit at 65535 */
hw/usb/hcd-ehci.h +1 -1
@@ -21,7 +21,7 @@#include "qemu/timer.h" #include "hw/usb.h" #include "sysemu/dma.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/sysbus.h" #ifndef EHCI_DEBUG
hw/usb/hcd-uhci.h +1 -1
@@ -30,7 +30,7 @@#include "exec/memory.h" #include "qemu/timer.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/usb.h" typedef struct UHCIQueue UHCIQueue ;
hw/usb/hcd-xhci-pci.h +1 -0
@@ -24,6 +24,7 @@#ifndef HW_USB_HCD_XHCI_PCI_H #define HW_USB_HCD_XHCI_PCI_H +#include "hw/pci/pci_device.h" #include "hw/usb.h" #include "hcd-xhci.h"
hw/vfio/pci.h +1 -1
@@ -13,7 +13,7 @@#define HW_VFIO_VFIO_PCI_H #include "exec/memory.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/vfio/vfio-common.h" #include "qemu/event_notifier.h" #include "qemu/queue.h"
include/hw/acpi/piix4.h +1 -1
@@ -22,7 +22,7 @@#ifndef HW_ACPI_PIIX4_H #define HW_ACPI_PIIX4_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/memory_hotplug.h"
include/hw/arm/allwinner-a10.h +1 -0
@@ -4,6 +4,7 @@#include "qemu/error-report.h" #include "hw/char/serial.h" #include "hw/arm/boot.h" +#include "hw/pci/pci_device.h" #include "hw/timer/allwinner-a10-pit.h" #include "hw/intc/allwinner-a10-pic.h" #include "hw/net/allwinner_emac.h"
include/hw/cxl/cxl_device.h +1 -1
@@ -11,7 +11,7 @@#define CXL_DEVICE_H #include "hw/cxl/cxl_component.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/register.h" /*
include/hw/ide/pci.h +1 -1
@@ -2,7 +2,7 @@#define HW_IDE_PCI_H #include "hw/ide/internal.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" #define BM_STATUS_DMAING 0x01
include/hw/misc/macio/macio.h +1 -1
@@ -27,7 +27,7 @@#define MACIO_H #include "hw/char/escc.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/ide/internal.h" #include "hw/intc/heathrow_pic.h" #include "hw/misc/macio/cuda.h"
include/hw/pci-host/gpex.h +1 -1
@@ -22,7 +22,7 @@#include "exec/hwaddr.h" #include "hw/sysbus.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" #include "qom/object.h"
include/hw/pci-host/i440fx.h +1 -1
@@ -11,7 +11,7 @@#ifndef HW_PCI_I440FX_H #define HW_PCI_I440FX_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci-host/pam.h" #include "qom/object.h"
include/hw/pci-host/q35.h +1 -1
@@ -22,7 +22,7 @@#ifndef HW_Q35_H #define HW_Q35_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" #include "hw/pci-host/pam.h" #include "qemu/units.h"
include/hw/pci-host/sabre.h +1 -1
@@ -1,7 +1,7 @@#ifndef HW_PCI_HOST_SABRE_H #define HW_PCI_HOST_SABRE_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "hw/sparc/sun4u_iommu.h" #include "qom/object.h"
include/hw/pci/msi.h +1 -1
@@ -21,7 +21,7 @@ #ifndef QEMU_MSI_H #define QEMU_MSI_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" struct MSIMessage { uint64_t address;
include/hw/pci/pci.h +0 -344
380 lines not on this page · raw message
include/hw/pci/pci_bridge.h +1 -1
@@ -26,7 +26,7 @@#ifndef QEMU_PCI_BRIDGE_H #define QEMU_PCI_BRIDGE_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/cxl/cxl.h" #include "qom/object.h"
include/hw/pci/pci_device.h new file +350 -0
350 lines not on this page · raw message
include/hw/pci/pcie_port.h +1 -0
@@ -23,6 +23,7 @@#include "hw/pci/pci_bridge.h" #include "hw/pci/pci_bus.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" #define TYPE_PCIE_PORT "pcie-port"
include/hw/pci/shpc.h +1 -1
@@ -3,7 +3,7 @@#include "exec/memory.h" #include "hw/hotplug.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" struct SHPCDevice {
include/hw/remote/iohub.h +1 -1
@@ -11,7 +11,7 @@#ifndef REMOTE_IOHUB_H #define REMOTE_IOHUB_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qemu/event_notifier.h" #include "qemu/thread-posix.h" #include "hw/remote/mpqemu-link.h"
include/hw/remote/proxy.h +1 -1
@@ -9,7 +9,7 @@#ifndef PROXY_H #define PROXY_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "io/channel.h" #include "hw/remote/proxy-memory-listener.h" #include "qemu/event_notifier.h"
include/hw/sd/sdhci.h +1 -1
@@ -25,7 +25,7 @@#ifndef SDHCI_H #define SDHCI_H -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/sysbus.h" #include "hw/sd/sd.h" #include "qom/object.h"
include/hw/southbridge/piix.h +1 -2
@@ -12,8 +12,7 @@#ifndef HW_SOUTHBRIDGE_PIIX_H #define HW_SOUTHBRIDGE_PIIX_H -#include "hw/pci/pci.h" -#include "qom/object.h" +#include "hw/pci/pci_device.h" /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60
include/hw/xen/xen_common.h +1 -1
@@ -15,7 +15,7 @@#include "hw/xen/interface/io/xenbus.h" #include "hw/xen/xen.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/xen/trace.h" extern xc_interface *xen_xc;
hw/acpi/erst.c +1 -1
@@ -14,7 +14,7 @@#include "hw/qdev-core.h" #include "exec/memory.h" #include "qom/object.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object_interfaces.h" #include "qemu/error-report.h" #include "migration/vmstate.h"
hw/audio/ac97.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "hw/audio/soundhw.h" #include "audio/audio.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/module.h"
hw/audio/es1370.c +1 -1
@@ -29,7 +29,7 @@#include "qemu/osdep.h" #include "hw/audio/soundhw.h" #include "audio/audio.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/dma.h"
hw/audio/via-ac97.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/osdep.h" #include "hw/isa/vt82c686.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" static void via_ac97_realize (PCIDevice *pci_dev,Error **errp) {
hw/char/serial-pci-multi.c +1 -1
@@ -31,7 +31,7 @@#include "qapi/error.h" #include "hw/char/serial.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h"
hw/char/serial-pci.c +1 -1
@@ -30,7 +30,7 @@#include "qemu/module.h" #include "hw/char/serial.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h"
hw/core/qdev-properties-system.c +1 -0
@@ -32,6 +32,7 @@#include "sysemu/blockdev.h" #include "net/net.h" #include "hw/pci/pci.h" +#include "hw/pci/pcie.h" #include "util/block-helpers.h" static bool check_prop_still_unset(Object *obj, const char *name,
hw/display/bochs-display.c +1 -1
@@ -8,7 +8,7 @@#include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/display/bochs-vbe.h"
hw/display/cirrus_vga.c +1 -1
@@ -39,7 +39,7 @@#include "sysemu/reset.h" #include "qapi/error.h" #include "trace.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "ui/pixel_ops.h"
hw/display/sm501.c +1 -1
@@ -32,7 +32,7 @@#include "ui/console.h" #include "hw/sysbus.h" #include "migration/vmstate.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/i2c/i2c.h" #include "hw/display/i2c-ddc.h"
hw/display/vga-pci.c +1 -1
@@ -25,7 +25,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "vga_int.h"
hw/display/vmware_vga.c +1 -1
@@ -29,7 +29,7 @@#include "qemu/log.h" #include "hw/loader.h" #include "trace.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h"
hw/i386/xen/xen_pvdevice.c +1 -1
@@ -32,7 +32,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "trace.h"
hw/ipack/tpci200.c +1 -1
@@ -12,7 +12,7 @@#include "qemu/units.h" #include "hw/ipack/ipack.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qemu/bitops.h" #include "qemu/module.h"
hw/ipmi/pci_ipmi_bt.c +1 -1
@@ -25,7 +25,7 @@#include "migration/vmstate.h" #include "qapi/error.h" #include "hw/ipmi/ipmi_bt.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" #define TYPE_PCI_IPMI_BT "pci-ipmi-bt"
hw/ipmi/pci_ipmi_kcs.c +1 -1
@@ -25,7 +25,7 @@#include "migration/vmstate.h" #include "qapi/error.h" #include "hw/ipmi/ipmi_kcs.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" #define TYPE_PCI_IPMI_KCS "pci-ipmi-kcs"
hw/isa/i82378.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "hw/intc/i8259.h" #include "hw/timer/i8254.h"
hw/mips/gt64xxx_pci.c +1 -1
@@ -26,7 +26,7 @@#include "qapi/error.h" #include "qemu/units.h" #include "qemu/log.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "migration/vmstate.h" #include "hw/intc/i8259.h"
hw/misc/pci-testdev.c +1 -1
@@ -19,7 +19,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "qemu/event_notifier.h" #include "qemu/module.h"
hw/misc/pvpanic-pci.c +1 -1
@@ -20,7 +20,7 @@#include "migration/vmstate.h" #include "hw/misc/pvpanic.h" #include "qom/object.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "standard-headers/linux/pvpanic.h" OBJECT_DECLARE_SIMPLE_TYPE (PVPanicPCIState,PVPANIC_PCI_DEVICE )
hw/net/can/can_kvaser_pci.c +1 -1
@@ -37,7 +37,7 @@#include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h"
hw/net/can/can_mioe3680_pci.c +1 -1
@@ -33,7 +33,7 @@#include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h"
hw/net/can/can_pcm3680_pci.c +1 -1
@@ -33,7 +33,7 @@#include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h"
hw/net/can/ctucan_pci.c +1 -1
@@ -34,7 +34,7 @@#include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h"
hw/net/e1000.c +1 -1
@@ -26,7 +26,7 @@#include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/eth.h"
hw/net/e1000x_common.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/osdep.h" #include "qemu/units.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "net/net.h" #include "e1000x_common.h"
hw/net/eepro100.c +1 -1
@@ -42,7 +42,7 @@#include "qemu/osdep.h" #include "qemu/units.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/net.h"
hw/net/ne2000-pci.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "ne2000.h"
hw/net/net_tx_pkt.c +1 -1
@@ -21,7 +21,7 @@#include "net/checksum.h" #include "net/tap.h" #include "net/net.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" enum {NET_TX_PKT_VHDR_FRAG =0 ,
hw/net/pcnet-pci.c +1 -1
@@ -29,7 +29,7 @@#include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/net.h"
hw/net/rocker/rocker.c +1 -1
@@ -16,7 +16,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h"
hw/net/rocker/rocker_desc.c +1 -1
@@ -16,7 +16,7 @@#include "qemu/osdep.h" #include "net/net.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "rocker.h" #include "rocker_hw.h"
hw/net/rtl8139.c +1 -1
@@ -53,7 +53,7 @@#include "qemu/osdep.h" #include <zlib.h> -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "sysemu/dma.h"
hw/net/sungem.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/log.h"
hw/net/sunhme.c +1 -1
@@ -23,7 +23,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/net/mii.h"
hw/net/tulip.c +1 -1
@@ -9,7 +9,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/nvram/eeprom93xx.h" #include "migration/vmstate.h"
hw/net/virtio-net.c +1 -1
@@ -42,7 +42,7 @@#include "sysemu/sysemu.h" #include "trace.h" #include "monitor/qdev.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "net_rx_pkt.h" #include "hw/virtio/vhost.h" #include "sysemu/qtest.h"
hw/pci-host/bonito.c +1 -1
@@ -42,7 +42,7 @@#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "hw/mips/mips.h" #include "hw/pci/pci_host.h"
hw/pci-host/dino.c +1 -1
@@ -15,7 +15,7 @@#include "qemu/units.h" #include "qapi/error.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h" #include "hw/pci-host/dino.h"
hw/pci-host/grackle.c +1 -1
@@ -25,7 +25,7 @@#include "qemu/osdep.h" #include "hw/qdev-properties.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "qapi/error.h" #include "qemu/module.h"
hw/pci-host/mv64361.c +1 -1
@@ -13,7 +13,7 @@#include "qapi/error.h" #include "hw/hw.h" #include "hw/sysbus.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "hw/irq.h" #include "hw/intc/i8259.h"
hw/pci-host/ppce500.c +1 -1
@@ -19,7 +19,7 @@#include "hw/ppc/e500-ccsr.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" #include "qemu/module.h"
hw/pci-host/raven.c +1 -1
@@ -28,7 +28,7 @@#include "qemu/units.h" #include "qemu/log.h" #include "qapi/error.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/qdev-properties.h"
hw/pci-host/sh_pci.c +1 -1
@@ -26,7 +26,7 @@#include "hw/sysbus.h" #include "hw/sh4/sh.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" #include "qemu/module.h"
hw/pci-host/uninorth.c +1 -1
@@ -26,7 +26,7 @@#include "hw/irq.h" #include "hw/qdev-properties.h" #include "qemu/module.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/uninorth.h" #include "trace.h"
hw/pci-host/versatile.c +1 -1
@@ -12,7 +12,7 @@#include "hw/sysbus.h" #include "migration/vmstate.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/qdev-properties.h"
hw/pci/pci-hmp-cmds.c +1 -0
@@ -15,6 +15,7 @@#include "qemu/osdep.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "monitor/hmp.h" #include "monitor/monitor.h" #include "pci-internal.h"
hw/pci/pcie_host.c +1 -1
@@ -20,7 +20,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" #include "qemu/module.h"
hw/pci/pcie_sriov.c +1 -1
@@ -11,7 +11,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie.h" #include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h"
hw/pci/slotid_cap.c +1 -1
@@ -1,6 +1,6 @@#include "qemu/osdep.h" #include "hw/pci/slotid_cap.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qemu/error-report.h" #include "qapi/error.h"
hw/ppc/ppc440_pcix.c +1 -1
@@ -26,7 +26,7 @@#include "hw/irq.h" #include "hw/ppc/ppc.h" #include "hw/ppc/ppc4xx.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "trace.h" #include "qom/object.h"
hw/ppc/ppc4xx_pci.c +1 -1
@@ -29,7 +29,7 @@#include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/reset.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "trace.h" #include "qom/object.h"
hw/ppc/spapr_pci_vfio.c +1 -0
@@ -22,6 +22,7 @@#include "hw/ppc/spapr.h" #include "hw/pci-host/spapr.h" #include "hw/pci/msix.h" +#include "hw/pci/pci_device.h" #include "hw/vfio/vfio.h" #include "qemu/error-report.h"
hw/rdma/rdma_utils.c +1 -1
@@ -14,7 +14,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "trace.h" #include "rdma_utils.h"
hw/s390x/s390-pci-inst.c +1 -0
@@ -16,6 +16,7 @@#include "exec/memory-internal.h" #include "qemu/error-report.h" #include "sysemu/hw_accel.h" +#include "hw/pci/pci_device.h" #include "hw/s390x/s390-pci-inst.h" #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/s390-pci-kvm.h"
hw/scsi/esp-pci.c +1 -1
@@ -24,7 +24,7 @@*/ #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "hw/nvram/eeprom93xx.h" #include "hw/scsi/esp.h"
hw/scsi/lsi53c895a.c +1 -1
@@ -16,7 +16,7 @@#include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/scsi/scsi.h" #include "migration/vmstate.h" #include "sysemu/dma.h"
hw/smbios/smbios.c +1 -0
@@ -28,6 +28,7 @@#include "hw/loader.h" #include "hw/boards.h" #include "hw/pci/pci_bus.h" +#include "hw/pci/pci_device.h" #include "smbios_build.h" /* legacy structures and constants for <= 2.0 machines */
hw/usb/hcd-ohci-pci.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/timer.h" #include "hw/usb.h" #include "migration/vmstate.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/sysbus.h" #include "hw/qdev-dma.h" #include "hw/qdev-properties.h"
hw/watchdog/wdt_i6300esb.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/module.h" #include "qemu/timer.h" #include "sysemu/watchdog.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qom/object.h"
tests/qtest/fuzz/generic_fuzz.c +1 -0
@@ -24,6 +24,7 @@#include "exec/ramblock.h" #include "hw/qdev-core.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/boards.h" #include "generic_fuzz_configs.h" #include "hw/mem/sparse-mem.h"
ui/util.c +1 -1
@@ -17,7 +17,7 @@#include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "qapi/error.h" #include "ui/console.h"
Signature · 1 line
MST
[PULL 35/51] include: Include headers where needed
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
A number of headers neglect to include everything they need. They compile only if the headers they need are already included from elsewhere. Fix that.
Message-Id: <[email protected]>
--- include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h | 3 +++ include/hw/char/cmsdk-apb-uart.h | 1 + include/hw/char/goldfish_tty.h | 1 + include/hw/char/xilinx_uartlite.h | 1 + include/hw/cris/etraxfs.h | 1 + include/hw/display/macfb.h | 3 ++- include/hw/dma/sifive_pdma.h | 2 ++ include/hw/i386/ioapic_internal.h | 1 + include/hw/i386/sgx-epc.h | 1 + include/hw/intc/goldfish_pic.h | 2 ++ include/hw/intc/loongarch_pch_msi.h | 2 ++ include/hw/intc/loongarch_pch_pic.h | 2 ++ include/hw/intc/nios2_vic.h | 2 ++ include/hw/misc/mchp_pfsoc_dmc.h | 2 ++ include/hw/misc/mchp_pfsoc_ioscb.h | 2 ++ include/hw/misc/mchp_pfsoc_sysreg.h | 2 ++ include/hw/misc/pvpanic.h | 1 + include/hw/misc/sifive_e_prci.h | 3 ++- include/hw/misc/sifive_u_otp.h | 3 ++- include/hw/misc/sifive_u_prci.h | 3 ++- include/hw/misc/virt_ctrl.h | 2 ++ include/hw/misc/xlnx-versal-pmc-iou-slcr.h | 1 + include/hw/net/lasi_82596.h | 2 +- include/hw/net/xlnx-zynqmp-can.h | 1 + include/hw/ppc/pnv_psi.h | 2 +- include/hw/riscv/boot_opensbi.h | 2 ++ include/hw/riscv/microchip_pfsoc.h | 3 +++ include/hw/riscv/numa.h | 1 + include/hw/riscv/sifive_u.h | 2 ++ include/hw/riscv/spike.h | 2 +- include/hw/riscv/virt.h | 2 +- include/hw/ssi/sifive_spi.h | 3 +++ include/hw/timer/sse-timer.h | 1 + include/hw/usb/hcd-dwc3.h | 1 + include/hw/usb/hcd-musb.h | 2 ++ include/hw/usb/xlnx-usb-subsystem.h | 2 ++ include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 3 +++ include/hw/virtio/virtio-mmio.h | 2 +- include/qemu/plugin-memory.h | 3 +++ include/sysemu/dirtyrate.h | 2 ++ include/sysemu/dump.h | 1 + include/user/syscall-trace.h | 1 + 43 files changed, 71 insertions(+), 9 deletions(-)
include/exec/plugin-gen.h +1 -0
@@ -12,6 +12,7 @@#ifndef QEMU_PLUGIN_GEN_H #define QEMU_PLUGIN_GEN_H +#include "exec/cpu_ldst.h" #include "qemu/plugin.h" #include "tcg/tcg.h"
include/hw/acpi/erst.h +3 -0
@@ -11,6 +11,9 @@#ifndef HW_ACPI_ERST_H #define HW_ACPI_ERST_H +#include "hw/acpi/bios-linker-loader.h" +#include "qom/object.h" +void build_erst (GArray *table_data,BIOSLinker *linker,Object *erst_dev,const char *oem_id,const char *oem_table_id);
include/hw/char/cmsdk-apb-uart.h +1 -0
@@ -15,6 +15,7 @@#include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qapi/error.h" #include "qom/object.h" #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart"
include/hw/char/goldfish_tty.h +1 -0
@@ -12,6 +12,7 @@#include "qemu/fifo8.h" #include "chardev/char-fe.h" +#include "hw/sysbus.h" #define TYPE_GOLDFISH_TTY "goldfish_tty"OBJECT_DECLARE_SIMPLE_TYPE (GoldfishTTYState,GOLDFISH_TTY )
include/hw/char/xilinx_uartlite.h +1 -0
@@ -17,6 +17,7 @@#include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "qapi/error.h" static inline DeviceState *xilinx_uartlite_create(hwaddr addr, qemu_irq irq,
include/hw/cris/etraxfs.h +1 -0
@@ -29,6 +29,7 @@#include "hw/cris/etraxfs_dma.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "qapi/error.h" DeviceState *etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr, struct etraxfs_dma_client *dma_out,
include/hw/display/macfb.h +2 -1
@@ -15,9 +15,10 @@#include "exec/memory.h" #include "hw/irq.h" +#include "hw/nubus/nubus.h" +#include "hw/sysbus.h" #include "ui/console.h" #include "qemu/timer.h" -#include "qom/object.h" typedef enum { MACFB_DISPLAY_APPLE_21_COLOR = 0,
include/hw/dma/sifive_pdma.h +2 -0
@@ -23,6 +23,8 @@ #ifndef SIFIVE_PDMA_H #define SIFIVE_PDMA_H +#include "hw/sysbus.h" + struct sifive_pdma_chan { uint32_t control; uint32_t next_config;
include/hw/i386/ioapic_internal.h +1 -0
@@ -23,6 +23,7 @@#define QEMU_IOAPIC_INTERNAL_H #include "exec/memory.h" +#include "hw/i386/ioapic.h" #include "hw/sysbus.h" #include "qemu/notify.h" #include "qom/object.h"
include/hw/i386/sgx-epc.h +1 -0
@@ -12,6 +12,7 @@#ifndef QEMU_SGX_EPC_H #define QEMU_SGX_EPC_H +#include "hw/qdev-core.h" #include "hw/i386/hostmem-epc.h" #define TYPE_SGX_EPC "sgx-epc"
include/hw/intc/goldfish_pic.h +2 -0
@@ -10,6 +10,8 @@#ifndef HW_INTC_GOLDFISH_PIC_H #define HW_INTC_GOLDFISH_PIC_H +#include "hw/sysbus.h" +#define TYPE_GOLDFISH_PIC "goldfish_pic"OBJECT_DECLARE_SIMPLE_TYPE (GoldfishPICState,GOLDFISH_PIC )
include/hw/intc/loongarch_pch_msi.h +2 -0
@@ -5,6 +5,8 @@* Copyright (C) 2021 Loongson Technology Corporation Limited */ +#include "hw/sysbus.h" +#define TYPE_LOONGARCH_PCH_MSI "loongarch_pch_msi"OBJECT_DECLARE_SIMPLE_TYPE (LoongArchPCHMSI,LOONGARCH_PCH_MSI )
include/hw/intc/loongarch_pch_pic.h +2 -0
@@ -5,6 +5,8 @@* Copyright (c) 2021 Loongson Technology Corporation Limited */ +#include "hw/sysbus.h" +#define TYPE_LOONGARCH_PCH_PIC "loongarch_pch_pic"#define PCH_PIC_NAME (name) TYPE_LOONGARCH_PCH_PIC#nameOBJECT_DECLARE_SIMPLE_TYPE (LoongArchPCHPIC,LOONGARCH_PCH_PIC )
include/hw/intc/nios2_vic.h +2 -0
@@ -35,6 +35,8 @@#ifndef HW_INTC_NIOS2_VIC_H #define HW_INTC_NIOS2_VIC_H +#include "hw/sysbus.h" +#define TYPE_NIOS2_VIC "nios2-vic"OBJECT_DECLARE_SIMPLE_TYPE (Nios2VIC,NIOS2_VIC )
include/hw/misc/mchp_pfsoc_dmc.h +2 -0
@@ -23,6 +23,8 @@#ifndef MCHP_PFSOC_DMC_H #define MCHP_PFSOC_DMC_H +#include "hw/sysbus.h" +/* DDR SGMII PHY module */ #define MCHP_PFSOC_DDR_SGMII_PHY_REG_SIZE 0x1000
include/hw/misc/mchp_pfsoc_ioscb.h +2 -0
@@ -23,6 +23,8 @@ #ifndef MCHP_PFSOC_IOSCB_H #define MCHP_PFSOC_IOSCB_H +#include "hw/sysbus.h" + typedef struct MchpPfSoCIoscbState { SysBusDevice parent; MemoryRegion container;
include/hw/misc/mchp_pfsoc_sysreg.h +2 -0
@@ -23,6 +23,8 @@ #ifndef MCHP_PFSOC_SYSREG_H #define MCHP_PFSOC_SYSREG_H +#include "hw/sysbus.h" + #define MCHP_PFSOC_SYSREG_REG_SIZE 0x2000 typedef struct MchpPfSoCSysregState {
include/hw/misc/pvpanic.h +1 -0
@@ -15,6 +15,7 @@#ifndef HW_MISC_PVPANIC_H #define HW_MISC_PVPANIC_H +#include "exec/memory.h" #include "qom/object.h" #define TYPE_PVPANIC_ISA_DEVICE "pvpanic"
include/hw/misc/sifive_e_prci.h +2 -1
@@ -18,7 +18,8 @@#ifndef HW_SIFIVE_E_PRCI_H #define HW_SIFIVE_E_PRCI_H -#include "qom/object.h" + +#include "hw/sysbus.h" enum { SIFIVE_E_PRCI_HFROSCCFG = 0x0,
include/hw/misc/sifive_u_otp.h +2 -1
@@ -18,7 +18,8 @@#ifndef HW_SIFIVE_U_OTP_H #define HW_SIFIVE_U_OTP_H -#include "qom/object.h" + +#include "hw/sysbus.h" #define SIFIVE_U_OTP_PA 0x00#define SIFIVE_U_OTP_PAIO 0x04
include/hw/misc/sifive_u_prci.h +2 -1
@@ -18,7 +18,8 @@#ifndef HW_SIFIVE_U_PRCI_H #define HW_SIFIVE_U_PRCI_H -#include "qom/object.h" + +#include "hw/sysbus.h" #define SIFIVE_U_PRCI_HFXOSCCFG 0x00#define SIFIVE_U_PRCI_COREPLLCFG0 0x04
include/hw/misc/virt_ctrl.h +2 -0
@@ -7,6 +7,8 @@#ifndef VIRT_CTRL_H #define VIRT_CTRL_H +#include "hw/sysbus.h" +#define TYPE_VIRT_CTRL "virt-ctrl"OBJECT_DECLARE_SIMPLE_TYPE (VirtCtrlState,VIRT_CTRL )
include/hw/misc/xlnx-versal-pmc-iou-slcr.h +1 -0
@@ -54,6 +54,7 @@#ifndef XLNX_VERSAL_PMC_IOU_SLCR_H #define XLNX_VERSAL_PMC_IOU_SLCR_H +#include "hw/sysbus.h" #include "hw/register.h" #define TYPE_XILINX_VERSAL_PMC_IOU_SLCR "xlnx.versal-pmc-iou-slcr"
include/hw/net/lasi_82596.h +1 -1
@@ -10,7 +10,7 @@#include "net/net.h" #include "hw/net/i82596.h" -#include "qom/object.h" +#include "hw/sysbus.h" #define TYPE_LASI_82596 "lasi_82596"typedef struct SysBusI82596State SysBusI82596State ;
include/hw/net/xlnx-zynqmp-can.h +1 -0
@@ -30,6 +30,7 @@#ifndef XLNX_ZYNQMP_CAN_H #define XLNX_ZYNQMP_CAN_H +#include "hw/sysbus.h" #include "hw/register.h" #include "net/can_emu.h" #include "net/can_host.h"
include/hw/ppc/pnv_psi.h +1 -1
@@ -23,7 +23,7 @@#include "hw/sysbus.h" #include "hw/ppc/xics.h" #include "hw/ppc/xive.h" -#include "qom/object.h" +#include "hw/qdev-core.h" #define TYPE_PNV_PSI "pnv-psi" OBJECT_DECLARE_TYPE(PnvPsi, PnvPsiClass,
include/hw/riscv/boot_opensbi.h +2 -0
@@ -8,6 +8,8 @@#ifndef RISCV_BOOT_OPENSBI_H #define RISCV_BOOT_OPENSBI_H +#include "exec/cpu-defs.h" +/** Expected value of info magic ('OSBI' ascii string in hex) */ #define FW_DYNAMIC_INFO_MAGIC_VALUE 0x4942534f
include/hw/riscv/microchip_pfsoc.h +3 -0
@@ -22,13 +22,16 @@ #ifndef HW_MICROCHIP_PFSOC_H #define HW_MICROCHIP_PFSOC_H +#include "hw/boards.h" #include "hw/char/mchp_pfsoc_mmuart.h" +#include "hw/cpu/cluster.h" #include "hw/dma/sifive_pdma.h" #include "hw/misc/mchp_pfsoc_dmc.h" #include "hw/misc/mchp_pfsoc_ioscb.h" #include "hw/misc/mchp_pfsoc_sysreg.h" #include "hw/net/cadence_gem.h" #include "hw/sd/cadence_sdhci.h" +#include "hw/riscv/riscv_hart.h" typedef struct MicrochipPFSoCState { /*< private >*/
include/hw/riscv/numa.h +1 -0
@@ -19,6 +19,7 @@#ifndef RISCV_NUMA_H #define RISCV_NUMA_H +#include "hw/boards.h" #include "hw/sysbus.h" #include "sysemu/numa.h"
include/hw/riscv/sifive_u.h +2 -0
@@ -19,6 +19,8 @@#ifndef HW_SIFIVE_U_H #define HW_SIFIVE_U_H +#include "hw/boards.h" +#include "hw/cpu/cluster.h" #include "hw/dma/sifive_pdma.h" #include "hw/net/cadence_gem.h" #include "hw/riscv/riscv_hart.h"
include/hw/riscv/spike.h +1 -1
@@ -19,9 +19,9 @@#ifndef HW_RISCV_SPIKE_H #define HW_RISCV_SPIKE_H +#include "hw/boards.h" #include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" -#include "qom/object.h" #define SPIKE_CPUS_MAX 8#define SPIKE_SOCKETS_MAX 8
include/hw/riscv/virt.h +1 -1
@@ -19,10 +19,10 @@#ifndef HW_RISCV_VIRT_H #define HW_RISCV_VIRT_H +#include "hw/boards.h" #include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" #include "hw/block/flash.h" -#include "qom/object.h" #define VIRT_CPUS_MAX_BITS 9#define VIRT_CPUS_MAX (1 << VIRT_CPUS_MAX_BITS)
include/hw/ssi/sifive_spi.h +3 -0
@@ -22,6 +22,9 @@#ifndef HW_SIFIVE_SPI_H #define HW_SIFIVE_SPI_H +#include "qemu/fifo8.h" +#include "hw/sysbus.h" +#define SIFIVE_SPI_REG_NUM (0x78 / 4)#define TYPE_SIFIVE_SPI "sifive.spi"
include/hw/timer/sse-timer.h +1 -0
@@ -25,6 +25,7 @@#define SSE_TIMER_H #include "hw/sysbus.h" +#include "qemu/timer.h" #include "qom/object.h" #include "hw/timer/sse-counter.h"
include/hw/usb/hcd-dwc3.h +1 -0
@@ -26,6 +26,7 @@#ifndef HCD_DWC3_H #define HCD_DWC3_H +#include "hw/register.h" #include "hw/usb/hcd-xhci.h" #include "hw/usb/hcd-xhci-sysbus.h"
include/hw/usb/hcd-musb.h +2 -0
@@ -13,6 +13,8 @@#ifndef HW_USB_HCD_MUSB_H #define HW_USB_HCD_MUSB_H +#include "exec/hwaddr.h" +enum musb_irq_source_e { musb_irq_suspend =0 , musb_irq_resume,
include/hw/usb/xlnx-usb-subsystem.h +2 -0
@@ -25,6 +25,8 @@#ifndef XLNX_USB_SUBSYSTEM_H #define XLNX_USB_SUBSYSTEM_H +#include "hw/register.h" +#include "hw/sysbus.h" #include "hw/usb/xlnx-versal-usb2-ctrl-regs.h" #include "hw/usb/hcd-dwc3.h"
include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +3 -0
@@ -26,6 +26,9 @@#ifndef XLNX_VERSAL_USB2_CTRL_REGS_H #define XLNX_VERSAL_USB2_CTRL_REGS_H +#include "hw/register.h" +#include "hw/sysbus.h" +#define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs"#define XILINX_VERSAL_USB2_CTRL_REGS (obj) \
include/hw/virtio/virtio-mmio.h +1 -1
@@ -22,8 +22,8 @@#ifndef HW_VIRTIO_MMIO_H #define HW_VIRTIO_MMIO_H +#include "hw/sysbus.h" #include "hw/virtio/virtio-bus.h" -#include "qom/object.h" /* QOM macros */ /* virtio-mmio-bus */
include/qemu/plugin-memory.h +3 -0
@@ -9,6 +9,9 @@ #ifndef PLUGIN_MEMORY_H #define PLUGIN_MEMORY_H +#include "exec/cpu-defs.h" +#include "exec/hwaddr.h" + struct qemu_plugin_hwaddr { bool is_io; bool is_store;
include/sysemu/dirtyrate.h +2 -0
@@ -13,6 +13,8 @@ #ifndef QEMU_DIRTYRATE_H #define QEMU_DIRTYRATE_H +#include "qapi/qapi-types-migration.h" + typedef struct VcpuStat { int nvcpu; /* number of vcpu */ DirtyRateVcpu *rates; /* array of dirty rate for each vcpu */
include/sysemu/dump.h +1 -0
@@ -15,6 +15,7 @@#define DUMP_H #include "qapi/qapi-types-dump.h" +#include "qemu/thread.h" #define MAKEDUMPFILE_SIGNATURE "makedumpfile"#define MAX_SIZE_MDF_HEADER (4096)/* max size of makedumpfile_header */
include/user/syscall-trace.h +1 -0
@@ -10,6 +10,7 @@#ifndef SYSCALL_TRACE_H #define SYSCALL_TRACE_H +#include "exec/user/abitypes.h" #include "trace/trace-root.h" /*
Signature · 1 line
MST
[PULL 36/51] include: Don't include qemu/osdep.h
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
docs/devel/style.rst mandates:
The "qemu/osdep.h" header contains preprocessor macros that affect the behavior of core system headers like <stdint.h>. It must be the first include so that core system headers included by external libraries get the preprocessor macros that QEMU depends on.
Do not include "qemu/osdep.h" from header files since the .c file will have already included it.
A few violations have crept in. Fix them.
Message-Id: <[email protected]>
--- bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - include/hw/cxl/cxl_host.h | 1 - include/hw/input/pl050.h | 1 - include/hw/tricore/triboard.h | 1 - include/qemu/userfaultfd.h | 1 - net/vmnet_int.h | 1 - qga/cutils.h | 1 - target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - qga/cutils.c | 3 ++- 12 files changed, 2 insertions(+), 12 deletions(-)
bsd-user/qemu.h +0 -1
@@ -17,7 +17,6 @@#ifndef QEMU_H #define QEMU_H -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h"
crypto/block-luks-priv.h +0 -1
@@ -18,7 +18,6 @@* */ -#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/bswap.h"
include/hw/cxl/cxl_host.h +0 -1
@@ -7,7 +7,6 @@* COPYING file in the top-level directory. */ -#include "qemu/osdep.h" #include "hw/cxl/cxl.h" #include "hw/boards.h"
include/hw/input/pl050.h +0 -1
@@ -10,7 +10,6 @@#ifndef HW_PL050_H #define HW_PL050_H -#include "qemu/osdep.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "hw/input/ps2.h"
include/hw/tricore/triboard.h +0 -1
@@ -18,7 +18,6 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/boards.h" #include "sysemu/sysemu.h"
include/qemu/userfaultfd.h +0 -1
@@ -13,7 +13,6 @@#ifndef USERFAULTFD_H #define USERFAULTFD_H -#include "qemu/osdep.h" #include "exec/hwaddr.h" #include <linux/userfaultfd.h>
net/vmnet_int.h +0 -1
@@ -10,7 +10,6 @@#ifndef VMNET_INT_H #define VMNET_INT_H -#include "qemu/osdep.h" #include "vmnet_int.h" #include "clients.h"
qga/cutils.h +0 -1
@@ -1,7 +1,6 @@#ifndef CUTILS_H_ #define CUTILS_H_ -#include "qemu/osdep.h" int qga_open_cloexec (const char *name,int flags,mode_t mode);
target/hexagon/hex_arch_types.h +0 -1
@@ -18,7 +18,6 @@#ifndef HEXAGON_HEX_ARCH_TYPES_H #define HEXAGON_HEX_ARCH_TYPES_H -#include "qemu/osdep.h" #include "mmvec/mmvec.h" #include "qemu/int128.h"
target/hexagon/mmvec/macros.h +0 -1
@@ -18,7 +18,6 @@#ifndef HEXAGON_MMVEC_MACROS_H #define HEXAGON_MMVEC_MACROS_H -#include "qemu/osdep.h" #include "qemu/host-utils.h" #include "arch.h" #include "mmvec/system_ext_mmvec.h"
target/riscv/pmu.h +0 -1
@@ -16,7 +16,6 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" #include "qemu/main-loop.h"
qga/cutils.c +2 -1
@@ -2,8 +2,9 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#include "cutils.h" +#include "qemu/osdep.h" +#include "cutils.h" #include "qapi/error.h" /**
Signature · 1 line
MST
[PULL 26/51] hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c
In reply to Michael S. TsirkinFrom: Philippe Mathieu-Daudé <[email protected]>
virtio.c is big enough, extract more QMP related code to virtio-qmp.c. To do so, expose qmp_find_virtio_device() and declar virtio_list in the internal virtio-qmp.h header.
Note we have to leave qmp_x_query_virtio_queue_status() and qmp_x_query_virtio_queue_element(), because they access VirtQueue internal fields, and VirtQueue is only declared within virtio.c.
Message-Id: <[email protected]>
--- hw/virtio/virtio-qmp.h | 9 ++ hw/virtio/virtio-qmp.c | 192 ++++++++++++++++++++++++++++++++++++++++- hw/virtio/virtio.c | 191 +--------------------------------------- 3 files changed, 201 insertions(+), 191 deletions(-)
hw/virtio/virtio-qmp.h +9 -0
@@ -12,7 +12,16 @@#define HW_VIRTIO_QMP_H #include "qapi/qapi-types-virtio.h" +#include "hw/virtio/virtio.h" +#include "qemu/queue.h" + +typedef QTAILQ_HEAD(QmpVirtIODeviceList, VirtIODevice) QmpVirtIODeviceList; + +/* QAPI list of realized VirtIODevices */ +extern QmpVirtIODeviceList virtio_list; + +VirtIODevice *qmp_find_virtio_device (const char *path);VirtioDeviceStatus *qmp_decode_status (uint8_t bitmap);VhostDeviceProtocols *qmp_decode_protocols (uint64_t bitmap);VirtioDeviceFeatures *qmp_decode_features (uint16_t device_id,uint64_t bitmap);
hw/virtio/virtio-qmp.c +191 -1
203 lines not on this page · raw message
hw/virtio/virtio.c +1 -190
210 lines not on this page · raw message
Signature · 1 line
MST
[PULL 17/51] virtio-pci: decouple the single vector from the interrupt process
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
To reuse the interrupt process in configure interrupt
Need to decouple the single vector from the interrupt process. We add new function kvm_virtio_pci_vector_use_one and _release_one. These functions are used for the single vector, the whole process will finish in the loop with vq number.
Message-Id: <[email protected]>
--- hw/virtio/virtio-pci.c | 131 +++++++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 58 deletions(-)
hw/virtio/virtio-pci.c +73 -58
@@ -784,7 +784,6 @@ static uint32_t virtio_read_config(PCIDevice *pci_dev, }static int kvm_virtio_pci_vq_vector_use (VirtIOPCIProxy *proxy, -unsigned int queue_no,unsigned int vector) {VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector];
@@ -849,87 +848,103 @@ static int virtio_pci_get_notifier(VirtIOPCIProxy *proxy, int queue_no,return 0 ; } -static int kvm_virtio_pci_vector_use (VirtIOPCIProxy *proxy,int nvqs) +static int kvm_virtio_pci_vector_use_one (VirtIOPCIProxy *proxy,int queue_no) { +unsigned int vector; +int ret; +EventNotifier *n;PCIDevice *dev = &proxy->pci_dev;VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus);VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev); -unsigned int vector; -int ret, queue_no; -EventNotifier *n; -for (queue_no =0 ; queue_no < nvqs; queue_no++) { -if (!virtio_queue_get_num (vdev, queue_no)) { -break ; - } - ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); -if (ret <0 ) { -break ; - } -if (vector >=msix_nr_vectors_allocated (dev)) { -continue ; - } - ret =kvm_virtio_pci_vq_vector_use (proxy, queue_no, vector); + + ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); +if (ret <0 ) { +return ret; + } +if (vector >=msix_nr_vectors_allocated (dev)) { +return 0 ; + } + ret =kvm_virtio_pci_vq_vector_use (proxy, vector); +if (ret <0 ) { + goto undo; + } +/* +* If guest supports masking, set up irqfd now. +* Otherwise, delay until unmasked in the frontend. +*/ +if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + ret =kvm_virtio_pci_irqfd_use (proxy, n, vector);if (ret <0 ) { +kvm_virtio_pci_vq_vector_release (proxy, vector); goto undo; } -/* If guest supports masking, set up irqfd now. -* Otherwise, delay until unmasked in the frontend. -*/ -if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =kvm_virtio_pci_irqfd_use (proxy, n, vector); -if (ret <0 ) { -kvm_virtio_pci_vq_vector_release (proxy, vector); - goto undo; - } - } } -return 0 ; +return 0 ; undo: -while (--queue_no >=0 ) { - vector =virtio_queue_vector (vdev, queue_no); -if (vector >=msix_nr_vectors_allocated (dev)) { -continue ; + + 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; } -if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); -if (ret <0 ) { -break ; - } -kvm_virtio_pci_irqfd_release (proxy, n, vector); +kvm_virtio_pci_irqfd_release (proxy, n, vector); + } +return ret; +} +static int kvm_virtio_pci_vector_use (VirtIOPCIProxy *proxy,int nvqs) +{ +int queue_no; +int ret =0 ; +VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); + +for (queue_no =0 ; queue_no < nvqs; queue_no++) { +if (!virtio_queue_get_num (vdev, queue_no)) { +return -1 ; } -kvm_virtio_pci_vq_vector_release (proxy, vector); + ret =kvm_virtio_pci_vector_use_one (proxy, queue_no); }return ret; } -static void kvm_virtio_pci_vector_release (VirtIOPCIProxy *proxy,int nvqs) + +static void kvm_virtio_pci_vector_release_one (VirtIOPCIProxy *proxy, +int queue_no) { -PCIDevice *dev = &proxy->pci_dev;VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus);unsigned int vector; -int queue_no; -VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev);EventNotifier *n; -int ret ; +int ret; +VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev); +PCIDevice *dev = &proxy->pci_dev; + + ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); +if (ret <0 ) { +return ; + } +if (vector >=msix_nr_vectors_allocated (dev)) { +return ; + } +if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { +kvm_virtio_pci_irqfd_release (proxy, n, vector); + } +kvm_virtio_pci_vq_vector_release (proxy, vector); +} + +static void kvm_virtio_pci_vector_release (VirtIOPCIProxy *proxy,int nvqs) +{ +int queue_no; +VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); +for (queue_no =0 ; queue_no < nvqs; queue_no++) {if (!virtio_queue_get_num (vdev, queue_no)) {break ; } - ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); -if (ret <0 ) { -break ; - } -if (vector >=msix_nr_vectors_allocated (dev)) { -continue ; - } -/* If guest supports masking, clean up irqfd now. -* Otherwise, it was cleaned when masked in the frontend. -*/ -if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { -kvm_virtio_pci_irqfd_release (proxy, n, vector); - } -kvm_virtio_pci_vq_vector_release (proxy, vector); +kvm_virtio_pci_vector_release_one (proxy, queue_no); } }
Signature · 1 line
MST
[PULL 09/51] hw/isa/Kconfig: Add missing dependency to VT82C686
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
The ACPIREGS are provided by TYPE_VIA_PM, so needs to select ACPI.
Message-Id: <[email protected]>
--- hw/isa/Kconfig | 1 + 1 file changed, 1 insertion(+)
hw/isa/Kconfig +1 -0
@@ -52,6 +52,7 @@ config PIIX4 config VT82C686 bool select ISA_SUPERIO + select ACPI select ACPI_SMBUS select SERIAL_ISA select FDC_ISA
Signature · 1 line
MST
[PULL 04/51] vdpa: do not handle VIRTIO_NET_F_GUEST_ANNOUNCE in vhost-vdpa
In reply to Michael S. TsirkinFrom: Eugenio Pérez <[email protected]>
So qemu emulates it even in case the device does not support it.
Message-Id: <[email protected]>
--- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-)
net/vhost-vdpa.c +0 -1
@@ -74,7 +74,6 @@ const int vdpa_feature_bits[] = {VIRTIO_F_RING_RESET ,VIRTIO_NET_F_RSS ,VIRTIO_NET_F_HASH_REPORT , -VIRTIO_NET_F_GUEST_ANNOUNCE ,VIRTIO_NET_F_STATUS , VHOST_INVALID_FEATURE_BIT };
Signature · 1 line
MST
[PULL 29/51] include/hw/cxl: Include hw/cxl/*.h where needed
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
hw/cxl/cxl_component.h needs CDATObject from hw/cxl/cxl_cdat.h.
hw/cxl/cxl_device.h needs CXLComponentState fromhw/cxl/cxl_component.h.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h | 1 + 2 files changed, 2 insertions(+)
include/hw/cxl/cxl_component.h +1 -0
@@ -18,6 +18,7 @@#include "qemu/compiler.h" #include "qemu/range.h" #include "qemu/typedefs.h" +#include "hw/cxl/cxl_cdat.h" #include "hw/register.h" #include "qapi/error.h"
include/hw/cxl/cxl_device.h +1 -0
@@ -10,6 +10,7 @@#ifndef CXL_DEVICE_H #define CXL_DEVICE_H +#include "hw/cxl/cxl_component.h" #include "hw/pci/pci.h" #include "hw/register.h"
Signature · 1 line
MST
[PULL 47/51] tests: acpi: Add and whitelist *.topology blobs
In reply to Michael S. TsirkinFrom: Yicong Yang <[email protected]>
Add and whitelist *.topology blobs, prepares for the aarch64's ACPI topology building test.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 3 +++ tests/data/acpi/virt/APIC.topology | 0 tests/data/acpi/virt/DSDT.topology | 0 tests/data/acpi/virt/PPTT.topology | 0 4 files changed, 3 insertions(+) create mode 100644 tests/data/acpi/virt/APIC.topology create mode 100644 tests/data/acpi/virt/DSDT.topology create mode 100644 tests/data/acpi/virt/PPTT.topology
tests/qtest/bios-tables-test-allowed-diff.h +3 -0
@@ -1 +1,4 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/APIC.topology" , +"tests/data/acpi/virt/DSDT.topology" , +"tests/data/acpi/virt/PPTT.topology",
tests/data/acpi/virt/APIC.topology new file +0 -0
tests/data/acpi/virt/DSDT.topology new file +0 -0
tests/data/acpi/virt/PPTT.topology new file +0 -0
Signature · 1 line
MST
[PULL 41/51] vhost: configure all host notifiers in a single MR transaction
In reply to Michael S. TsirkinFrom: Longpeng <[email protected]>
This allows the vhost device to batch the setup of all its host notifiers. This significantly reduces the device starting time, e.g. the time spend on enabling notifiers reduce from 376ms to 9.1ms for a VM with 64 vCPUs and 3 vhost-vDPA generic devices (vdpa_sim_blk, 64vq per device)
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
hw/virtio/vhost.c +24 -0
@@ -1562,16 +1562,25 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)return r; } +/* +* Batch all the host notifiers in a single transaction to avoid +* quadratic time complexity in address_space_update_ioeventfds(). +*/ +memory_region_transaction_begin (); +for (i =0 ; i < hdev->nvqs; ++i) { r =virtio_bus_set_host_notifier (VIRTIO_BUS (qbus), hdev->vq_index + i, true);if (r <0 ) {error_report ("vhost VQ %d notifier binding failed: %d" , i, -r); +memory_region_transaction_commit ();vhost_dev_disable_notifiers (hdev, vdev);return r; } } +memory_region_transaction_commit (); +return 0 ; }
@@ -1585,6 +1594,12 @@ void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)BusState *qbus =BUS (qdev_get_parent_bus (DEVICE (vdev)));int i, r; +/* +* Batch all the host notifiers in a single transaction to avoid +* quadratic time complexity in address_space_update_ioeventfds(). +*/ +memory_region_transaction_begin (); +for (i =0 ; i < hdev->nvqs; ++i) { r =virtio_bus_set_host_notifier (VIRTIO_BUS (qbus), hdev->vq_index + i, false);
@@ -1592,6 +1607,15 @@ void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)error_report ("vhost VQ %d notifier cleanup failed: %d" , i, -r); }assert (r >=0 ); + } + +/* +* The transaction expects the ioeventfds to be open when it +* commits. Do it now, before the cleanup loop. +*/ +memory_region_transaction_commit (); + +for (i =0 ; i < hdev->nvqs; ++i) {virtio_bus_cleanup_host_notifier (VIRTIO_BUS (qbus), hdev->vq_index + i); }virtio_device_release_ioeventfd (vdev);
Signature · 1 line
MST
[PULL 44/51] tests: virt: Allow changes to PPTT test table
In reply to Michael S. TsirkinFrom: Yicong Yang <[email protected]>
Allow changes to test/data/acpi/virt/PPTT*, prepare to change the building policy of the cluster topology.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ 1 file changed, 2 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +2 -0
@@ -1 +1,3 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/PPTT" , +"tests/data/acpi/virt/PPTT.acpihmatvirt",
Signature · 1 line
MST
[PULL 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
In reply to Michael S. TsirkinFrom: Laszlo Ersek <[email protected]>
The modern ACPI CPU hotplug interface was introduced in the following series (aa1dd39ca307..679dd1a957df), released in v2.7.0:
1 abd49bc2ed2f docs: update ACPI CPU hotplug spec with new protocol 2 16bcab97eb9f pc: piix4/ich9: add 'cpu-hotplug-legacy' property 3 5e1b5d93887b acpi: cpuhp: add CPU devices AML with _STA method 4 ac35f13ba8f8 pc: acpi: introduce AcpiDeviceIfClass.madt_cpu hook 5 d2238cb6781d acpi: cpuhp: implement hot-add parts of CPU hotplug
interface
6 8872c25a26cc acpi: cpuhp: implement hot-remove parts of CPU hotplug
interface
7 76623d00ae57 acpi: cpuhp: add cpu._OST handling
8 679dd1a957df pc: use new CPU hotplug interface since 2.7 machine type
Before patch#1, "docs/specs/acpi_cpu_hotplug.txt" only specified 1-byte accesses for the hotplug register block. Patch#1 preserved the same restriction for the legacy register block, but:
- it specified DWORD accesses for some of the modern registers,
- in particular, the switch from the legacy block to the modern block would require a DWORD write to the *legacy* block.
The latter functionality was then implemented in cpu_status_write() [hw/acpi/cpu_hotplug.c], in patch#8.
Unfortunately, all DWORD accesses depended on a dormant bug: the one introced in earlier commit a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid", 2013-05-29); first released in v1.6.0. Due to commit a014ed07bd5a, the DWORD accesses to the *legacy* CPU hotplug register block would work in spite of the above series *not* relaxing "valid.max_access_size = 1" in "hw/acpi/cpu_hotplug.c":
Quoted 9 lines
static const MemoryRegionOps AcpiCpuHotplug_ops = {
.read = cpu_status_read,
.write = cpu_status_write,
.endianness = DEVICE_LITTLE_ENDIAN,
.valid = {
.min_access_size = 1,
.max_access_size = 1,
},
};Later, in commits e6d0c3ce6895 ("acpi: cpuhp: introduce 'Command data 2' field", 2020-01-22) and ae340aa3d256 ("acpi: cpuhp: spec: add typical usecases", 2020-01-22), first released in v5.0.0, the modern CPU hotplug interface (including the documentation) was extended with another DWORD *read* access, namely to the "Command data 2" register, which would be important for the guest to confirm whether it managed to switch the register block from legacy to modern.
This functionality too silently depended on the bug from commit a014ed07bd5a.
In commit 5d971f9e6725 ('memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"', 2020-06-26), first released in v5.1.0, the bug from commit a014ed07bd5a was fixed (the commit was reverted). That swiftly exposed the bug in "AcpiCpuHotplug_ops", still present from the v2.7.0 series quoted at the top -- namely the fact that "valid.max_access_size = 1" didn't match what the guest was supposed to do, according to the spec ("docs/specs/acpi_cpu_hotplug.txt").
The symptom is that the "modern interface negotiation protocol" described in commit ae340aa3d256:
Review
Quoted 9 lines
(quoted diff) +9
-0+ Use following steps to detect and enable modern CPU hotplug interface: + 1. Store 0x0 to the 'CPU selector' register, + attempting to switch to modern mode + 2. Store 0x0 to the 'CPU selector' register, + to ensure valid selector value + 3. Store 0x0 to the 'Command field' register, + 4. Read the 'Command data 2' register. + If read value is 0x0, the modern interface is enabled. + Otherwise legacy or no CPU hotplug interface available
falls apart for the guest: steps 1 and 2 are lost, because they are DWORD writes; so no switching happens. Step 3 (a single-byte write) is not lost, but it has no effect; see the condition in cpu_status_write() in patch#8. And step 4 *misleads* the guest into thinking that the switch
worked: the DWORD read is lost again -- it returns zero to the guest without ever reaching the device model, so the guest never learns the switch didn't work.
This means that guest behavior centered on the "Command data 2" register worked *only* in the v5.0.0 release; it got effectively regressed in v5.1.0.
To make things *even more* complicated, the breakage was (and remains, as of today) visible with TCG acceleration only. Commit 5d971f9e6725 makes no difference with KVM acceleration -- the DWORD accesses still work, despite "valid.max_access_size = 1".
As commit 5d971f9e6725 suggests, fix the problem by raising "valid.max_access_size" to 4 -- the spec now clearly instructs the guest to perform DWORD accesses to the legacy register block too, for enabling (and verifying!) the modern block. In order to keep compatibility for the device model implementation though, set "impl.max_access_size = 1", so that wide accesses be split before they reach the legacy read/write handlers, like they always have been on KVM, and like they were on TCG before 5d971f9e6725 (v5.1.0).
Tested with:
- OVMF IA32 + qemu-system-i386, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test);
- OVMF IA32X64 + qemu-system-x86_64, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test);
- OVMF IA32 + qemu-system-i386, SMM enabled, using TCG accel; verified the register block switch and the present/possible CPU counting through the modern hotplug interface, during OVMF boot (bugfix test);
- I do not have any testcase (guest payload) for regression-testing CPU hotplug through the *legacy* CPU hotplug register block.
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Ani Sinha <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: [email protected]
Ref: "IO port write width clamping differs between TCG and KVM"
Message-Id: <[email protected]>
--- hw/acpi/cpu_hotplug.c | 3 +++ 1 file changed, 3 insertions(+)
hw/acpi/cpu_hotplug.c +3 -0
@@ -52,6 +52,9 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = { .endianness = DEVICE_LITTLE_ENDIAN, .valid = { .min_access_size = 1, + .max_access_size = 4, + }, + .impl = { .max_access_size = 1, }, };
Signature · 1 line
MST
[PULL 42/51] vdpa: commit all host notifier MRs in a single MR transaction
In reply to Michael S. TsirkinFrom: Longpeng <[email protected]>
This allows the vhost-vdpa device to batch the setup of all its MRs of host notifiers.
This significantly reduces the device starting time, e.g. the time spend on setup the host notifier MRs reduce from 423ms to 32ms for a VM with 64 vCPUs and 3 vhost-vDPA generic devices (vdpa_sim_blk, 64vq per device).
Message-Id: <[email protected]>
--- hw/virtio/vhost-vdpa.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
hw/virtio/vhost-vdpa.c +19 -6
@@ -519,9 +519,18 @@ static void vhost_vdpa_host_notifiers_uninit(struct vhost_dev *dev, int n) {int i; +/* +* Pack all the changes to the memory regions in a single +* transaction to avoid a few updating of the address space +* topology. +*/ +memory_region_transaction_begin (); +for (i = dev->vq_index; i < dev->vq_index + n; i++) {vhost_vdpa_host_notifier_uninit (dev, i); } + +memory_region_transaction_commit (); }static void vhost_vdpa_host_notifiers_init (struct vhost_dev *dev)
@@ -534,17 +543,21 @@ static void vhost_vdpa_host_notifiers_init(struct vhost_dev *dev)return ; } +/* +* Pack all the changes to the memory regions in a single +* transaction to avoid a few updating of the address space +* topology. +*/ +memory_region_transaction_begin (); +for (i = dev->vq_index; i < dev->vq_index + dev->nvqs; i++) {if (vhost_vdpa_host_notifier_init (dev, i)) { - goto err; +vhost_vdpa_host_notifiers_uninit (dev, i - dev->vq_index); +break ; } } -return ; - -err: -vhost_vdpa_host_notifiers_uninit (dev, i - dev->vq_index); -return ; +memory_region_transaction_commit (); }static void vhost_vdpa_svq_cleanup (struct vhost_dev *dev)
Signature · 1 line
MST
[PULL 25/51] hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device()
In reply to Michael S. TsirkinFrom: Philippe Mathieu-Daudé <[email protected]>
To emphasize this function is QMP related, rename it.
Message-Id: <[email protected]>
--- hw/virtio/virtio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
hw/virtio/virtio.c +5 -5
@@ -3855,7 +3855,7 @@ VirtioInfoList *qmp_x_query_virtio(Error **errp)return list; } -static VirtIODevice *virtio_device_find (const char *path) +static VirtIODevice *qmp_find_virtio_device (const char *path) {VirtIODevice *vdev;
@@ -3896,7 +3896,7 @@ VirtioStatus *qmp_x_query_virtio_status(const char *path, Error **errp)VirtIODevice *vdev;VirtioStatus *status; - vdev =virtio_device_find (path); + vdev =qmp_find_virtio_device (path);if (vdev ==NULL ) {error_setg (errp,"Path %s is not a VirtIODevice" , path);return NULL ;
@@ -3972,7 +3972,7 @@ VirtVhostQueueStatus *qmp_x_query_virtio_vhost_queue_status(const char *path,VirtIODevice *vdev;VirtVhostQueueStatus *status; - vdev =virtio_device_find (path); + vdev =qmp_find_virtio_device (path);if (vdev ==NULL ) {error_setg (errp,"Path %s is not a VirtIODevice" , path);return NULL ;
@@ -4016,7 +4016,7 @@ VirtQueueStatus *qmp_x_query_virtio_queue_status(const char *path,VirtIODevice *vdev;VirtQueueStatus *status; - vdev =virtio_device_find (path); + vdev =qmp_find_virtio_device (path);if (vdev ==NULL ) {error_setg (errp,"Path %s is not a VirtIODevice" , path);return NULL ;
@@ -4109,7 +4109,7 @@ VirtioQueueElement *qmp_x_query_virtio_queue_element(const char *path,VirtQueue *vq;VirtioQueueElement *element =NULL ; - vdev =virtio_device_find (path); + vdev =qmp_find_virtio_device (path);if (vdev ==NULL ) {error_setg (errp,"Path %s is not a VirtIO device" , path);return NULL ;
Signature · 1 line
MST
[PULL 24/51] virtio-pci: add support for configure interrupt
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
Add process to handle the configure interrupt, The function's logic is the same with vq interrupt.Add extra process to check the configure interrupt
Message-Id: <[email protected]>
--- include/hw/virtio/virtio-pci.h | 4 +- hw/virtio/virtio-pci.c | 118 +++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 20 deletions(-)
include/hw/virtio/virtio-pci.h +3 -1
@@ -261,5 +261,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t);* @fixed_queues. */ unsigned virtio_pci_optimal_num_queues (unsigned fixed_queues); - +void virtio_pci_set_guest_notifier_fd_handler (VirtIODevice *vdev,VirtQueue *vq, +int n,bool assign, +bool with_irqfd);#endif
hw/virtio/virtio-pci.c +99 -19
209 lines not on this page · raw message
Signature · 1 line
MST
[PULL 43/51] virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiers
In reply to Michael S. TsirkinFrom: leixiang <[email protected]>
proxy->vector_irqfd did not free when kvm_virtio_pci_vector_use or msix_set_vector_notifiers failed in virtio_pci_set_guest_notifiers.
Message-Id: <[email protected]>
--- hw/virtio/virtio-pci.c | 2 ++ 1 file changed, 2 insertions(+)
hw/virtio/virtio-pci.c +2 -0
@@ -1291,6 +1291,8 @@ assign_error:while (--n >=0 ) {virtio_pci_set_guest_notifier (d, n, !assign, with_irqfd); } +g_free (proxy->vector_irqfd); + proxy->vector_irqfd =NULL ;return r; }
Signature · 1 line
MST
[PULL 01/51] virtio_net: Modify virtio_net_get_config to early return
In reply to Michael S. TsirkinFrom: Eugenio Pérez <[email protected]>
Next patches introduce more code on vhost-vdpa branch, with already have too much indentation.
Message-Id: <[email protected]>
--- hw/net/virtio-net.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
hw/net/virtio-net.c +15 -13
@@ -168,20 +168,22 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)if (nc->peer && nc->peer->info->type ==NET_CLIENT_DRIVER_VHOST_VDPA ) { ret =vhost_net_get_config (get_vhost_net (nc->peer), (uint8_t *)&netcfg, n->config_size); -if (ret !=-1 ) { -/* -* Some NIC/kernel combinations present 0 as the mac address. As -* that is not a legal address, try to proceed with the -* address from the QEMU command line in the hope that the -* address has been configured correctly elsewhere - just not -* reported by the device. -*/ -if (memcmp (&netcfg.mac, &zero,sizeof (zero)) ==0 ) { -info_report ("Zero hardware mac address detected. Ignoring." ); -memcpy (netcfg.mac, n->mac,ETH_ALEN ); - } -memcpy (config, &netcfg, n->config_size); +if (ret ==-1 ) { +return ; } + +/* +* Some NIC/kernel combinations present 0 as the mac address. As that +* is not a legal address, try to proceed with the address from the +* QEMU command line in the hope that the address has been configured +* correctly elsewhere - just not reported by the device. +*/ +if (memcmp (&netcfg.mac, &zero,sizeof (zero)) ==0 ) { +info_report ("Zero hardware mac address detected. Ignoring." ); +memcpy (netcfg.mac, n->mac,ETH_ALEN ); + } + +memcpy (config, &netcfg, n->config_size); } }
Signature · 1 line
MST
[PULL 30/51] include/hw/pci: Clean up a few things checkpatch.pl would flag
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
Fix a few style violations so that checkpatch.pl won't complain when I move this code.
Message-Id: <[email protected]>
--- include/hw/pci/pci.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
include/hw/pci/pci.h +10 -7
@@ -284,8 +284,10 @@ struct PCIDevice {/* PCI config space */ uint8_t *config; -/* Used to enable config checks on load. Note that writable bits are -* never checked even if set in cmask. */ +/* +* Used to enable config checks on load. Note that writable bits are +* never checked even if set in cmask. +*/ uint8_t *cmask;/* Used to implement R/W bytes */
@@ -299,10 +301,11 @@ struct PCIDevice {/* the following fields are read only */ int32_t devfn; -/* Cached device to fetch requester ID from, to avoid the PCI -* tree walking every time we invoke PCI request (e.g., -* MSI). For conventional PCI root complex, this field is -* meaningless. */ +/* +* Cached device to fetch requester ID from, to avoid the PCI tree +* walking every time we invoke PCI request (e.g., MSI). For +* conventional PCI root complex, this field is meaningless. +*/ PCIReqIDCache requester_id_cache;char name[64 ];PCIIORegion io_regions[PCI_NUM_REGIONS ];
@@ -943,7 +946,7 @@ extern const VMStateDescription vmstate_pci_device; .name = (stringify(_field)), \ .size = sizeof(PCIDevice), \ .vmsd = &vmstate_pci_device, \ - .flags = VMS_STRUCT|VMS_POINTER, \ + .flags = VMS_STRUCT | VMS_POINTER, \ .offset = vmstate_offset_pointer(_state, _field, PCIDevice), \ }
Signature · 1 line
MST
[PULL 46/51] tests: virt: Update expected ACPI tables for virt test
In reply to Michael S. TsirkinFrom: Yicong Yang <[email protected]>
Update the ACPI tables according to the acpi aml_build change, also empty bios-tables-test-allowed-diff.h.
The disassembled differences between actual and expected PPTT:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20180105 (64-bit version)
* Copyright (c) 2000 - 2018 Intel Corporation
*
- * Disassembly of tests/data/acpi/virt/PPTT, Tue Nov 1 09:29:12 2022
+ * Disassembly of /tmp/aml-DIIGV1, Tue Nov 1 09:29:12 2022 *
* ACPI Data Table [PPTT]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */
[000h 0000 4] Signature : "PPTT" [Processor Properties Topology Table] -[004h 0004 4] Table Length : 00000060 +[004h 0004 4] Table Length : 0000004C [008h 0008 1] Revision : 02 -[009h 0009 1] Checksum : 48 +[009h 0009 1] Checksum : A8 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 1] Subtable Type : 00 [Processor Hierarchy Node]
[025h 0037 1] Length : 14
[026h 0038 2] Reserved : 0000
[028h 0040 4] Flags (decoded below) : 00000001
Physical package : 1
ACPI Processor ID valid : 0
[02Ch 0044 4] Parent : 00000000
[030h 0048 4] ACPI Processor ID : 00000000
[034h 0052 4] Private Resource Number : 00000000 [038h 0056 1] Subtable Type : 00 [Processor Hierarchy Node]
[039h 0057 1] Length : 14
[03Ah 0058 2] Reserved : 0000
-[03Ch 0060 4] Flags (decoded below) : 00000000
+[03Ch 0060 4] Flags (decoded below) : 0000000A
Physical package : 0
- ACPI Processor ID valid : 0
+ ACPI Processor ID valid : 1
[040h 0064 4] Parent : 00000024
[044h 0068 4] ACPI Processor ID : 00000000
[048h 0072 4] Private Resource Number : 00000000-[04Ch 0076 1] Subtable Type : 00 [Processor Hierarchy Node] -[04Dh 0077 1] Length : 14 -[04Eh 0078 2] Reserved : 0000 -[050h 0080 4] Flags (decoded below) : 0000000A - Physical package : 0 - ACPI Processor ID valid : 1 -[054h 0084 4] Parent : 00000038 -[058h 0088 4] ACPI Processor ID : 00000000 -[05Ch 0092 4] Private Resource Number : 00000000
-
-Raw Table Data: Length 96 (0x60)
+Raw Table Data: Length 76 (0x4C)
- 0000: 50 50 54 54 60 00 00 00 02 48 42 4F 43 48 53 20 // PPTT`....HBOCHS
+ 0000: 50 50 54 54 4C 00 00 00 02 A8 42 4F 43 48 53 20 // PPTTL.....BOCHS
0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC
0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // ................
- 0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // ................
- 0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $...............
- 0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8...........
+ 0030: 00 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // ................
+ 0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $...........PPTT.acpihmatvirt is also updated:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20180105 (64-bit version)
* Copyright (c) 2000 - 2018 Intel Corporation
*
- * Disassembly of tests/data/acpi/virt/PPTT.acpihmatvirt, Wed Dec 28 15:36:06 2022
+ * Disassembly of /tmp/aml-IPKJX1, Wed Dec 28 15:36:06 2022
*
* ACPI Data Table [PPTT]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */
[000h 0000 4] Signature : "PPTT" [Processor Properties Topology Table] -[004h 0004 4] Table Length : 000000C4 +[004h 0004 4] Table Length : 0000009C [008h 0008 1] Revision : 02 -[009h 0009 1] Checksum : 9E +[009h 0009 1] Checksum : FE [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 1] Subtable Type : 00 [Processor Hierarchy Node]
[025h 0037 1] Length : 14
[026h 0038 2] Reserved : 0000
[028h 0040 4] Flags (decoded below) : 00000001
Physical package : 1
ACPI Processor ID valid : 0
[02Ch 0044 4] Parent : 00000000
[030h 0048 4] ACPI Processor ID : 00000000
[034h 0052 4] Private Resource Number : 00000000 [038h 0056 1] Subtable Type : 00 [Processor Hierarchy Node]
[039h 0057 1] Length : 14
[03Ah 0058 2] Reserved : 0000
-[03Ch 0060 4] Flags (decoded below) : 00000000
+[03Ch 0060 4] Flags (decoded below) : 0000000A
Physical package : 0
- ACPI Processor ID valid : 0
+ ACPI Processor ID valid : 1
[040h 0064 4] Parent : 00000024
[044h 0068 4] ACPI Processor ID : 00000000
[048h 0072 4] Private Resource Number : 00000000 [04Ch 0076 1] Subtable Type : 00 [Processor Hierarchy Node]
[04Dh 0077 1] Length : 14
[04Eh 0078 2] Reserved : 0000
[050h 0080 4] Flags (decoded below) : 0000000A
Physical package : 0
ACPI Processor ID valid : 1
-[054h 0084 4] Parent : 00000038
-[058h 0088 4] ACPI Processor ID : 00000000
+[054h 0084 4] Parent : 00000024
+[058h 0088 4] ACPI Processor ID : 00000001
[05Ch 0092 4] Private Resource Number : 00000000[060h 0096 1] Subtable Type : 00 [Processor Hierarchy Node] [061h 0097 1] Length : 14 [062h 0098 2] Reserved : 0000 -[064h 0100 4] Flags (decoded below) : 0000000A - Physical package : 0 - ACPI Processor ID valid : 1 -[068h 0104 4] Parent : 00000038 +[064h 0100 4] Flags (decoded below) : 00000001 + Physical package : 1 + ACPI Processor ID valid : 0 +[068h 0104 4] Parent : 00000000 [06Ch 0108 4] ACPI Processor ID : 00000001 [070h 0112 4] Private Resource Number : 00000000
[074h 0116 1] Subtable Type : 00 [Processor Hierarchy Node] [075h 0117 1] Length : 14 [076h 0118 2] Reserved : 0000 -[078h 0120 4] Flags (decoded below) : 00000001 - Physical package : 1 - ACPI Processor ID valid : 0 -[07Ch 0124 4] Parent : 00000000 -[080h 0128 4] ACPI Processor ID : 00000001 +[078h 0120 4] Flags (decoded below) : 0000000A + Physical package : 0 + ACPI Processor ID valid : 1 +[07Ch 0124 4] Parent : 00000060 +[080h 0128 4] ACPI Processor ID : 00000002 [084h 0132 4] Private Resource Number : 00000000
[088h 0136 1] Subtable Type : 00 [Processor Hierarchy Node]
[089h 0137 1] Length : 14
[08Ah 0138 2] Reserved : 0000
-[08Ch 0140 4] Flags (decoded below) : 00000000
- Physical package : 0
- ACPI Processor ID valid : 0
-[090h 0144 4] Parent : 00000074
-[094h 0148 4] ACPI Processor ID : 00000000
-[098h 0152 4] Private Resource Number : 00000000
-
-[09Ch 0156 1] Subtable Type : 00 [Processor Hierarchy Node]
-[09Dh 0157 1] Length : 14
-[09Eh 0158 2] Reserved : 0000
-[0A0h 0160 4] Flags (decoded below) : 0000000A
- Physical package : 0
- ACPI Processor ID valid : 1
-[0A4h 0164 4] Parent : 00000088
-[0A8h 0168 4] ACPI Processor ID : 00000002
-[0ACh 0172 4] Private Resource Number : 00000000
-
-[0B0h 0176 1] Subtable Type : 00 [Processor Hierarchy Node]
-[0B1h 0177 1] Length : 14
-[0B2h 0178 2] Reserved : 0000
-[0B4h 0180 4] Flags (decoded below) : 0000000A
+[08Ch 0140 4] Flags (decoded below) : 0000000A
Physical package : 0
ACPI Processor ID valid : 1
-[0B8h 0184 4] Parent : 00000088
-[0BCh 0188 4] ACPI Processor ID : 00000003
-[0C0h 0192 4] Private Resource Number : 00000000
+[090h 0144 4] Parent : 00000060
+[094h 0148 4] ACPI Processor ID : 00000003
+[098h 0152 4] Private Resource Number : 00000000 -Raw Table Data: Length 196 (0xC4)
+Raw Table Data: Length 156 (0x9C)
- 0000: 50 50 54 54 C4 00 00 00 02 9E 42 4F 43 48 53 20 // PPTT......BOCHS
+ 0000: 50 50 54 54 9C 00 00 00 02 FE 42 4F 43 48 53 20 // PPTT......BOCHS
0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC
0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // ................
- 0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // ................
+ 0030: 00 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // ................
0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $...............
- 0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8...........
- 0060: 00 14 00 00 0A 00 00 00 38 00 00 00 01 00 00 00 // ........8.......
- 0070: 00 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // ................
- 0080: 01 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // ................
- 0090: 74 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // t...............
- 00A0: 0A 00 00 00 88 00 00 00 02 00 00 00 00 00 00 00 // ................
- 00B0: 00 14 00 00 0A 00 00 00 88 00 00 00 03 00 00 00 // ................
- 00C0: 00 00 00 00 // ....
+ 0050: 0A 00 00 00 24 00 00 00 01 00 00 00 00 00 00 00 // ....$...........
+ 0060: 00 14 00 00 01 00 00 00 00 00 00 00 01 00 00 00 // ................
+ 0070: 00 00 00 00 00 14 00 00 0A 00 00 00 60 00 00 00 // ............`...
+ 0080: 02 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // ................
+ 0090: 60 00 00 00 03 00 00 00 00 00 00 00 // `...........Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 2 -- tests/data/acpi/virt/PPTT | Bin 96 -> 76 bytes tests/data/acpi/virt/PPTT.acpihmatvirt | Bin 196 -> 156 bytes 3 files changed, 2 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -2
@@ -1,3 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/PPTT" , -"tests/data/acpi/virt/PPTT.acpihmatvirt",
tests/data/acpi/virt/PPTT binary +0 -0
tests/data/acpi/virt/PPTT.acpihmatvirt binary +0 -0
Signature · 1 line
MST
[PULL 28/51] include/hw/cxl: Move typedef PXBDev to cxl.h, and put it to use
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
hw/cxl/cxl.h uses the PXBDev structure tag instead of the typedef name. The typedef name is defined in hw/pci/pci_bridge.h. Its inclusion was dropped in the previous commit to break an inclusion loop.
Move the typedef to hw/cxl/cxl.h, and use it there. Delete an extra typedef in hw/pci-bridge/pci_expander_bridge.c.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl.h | 4 +++- include/hw/pci/pci_bridge.h | 1 - hw/pci-bridge/pci_expander_bridge.c | 1 - 3 files changed, 3 insertions(+), 3 deletions(-)
include/hw/cxl/cxl.h +3 -1
@@ -23,10 +23,12 @@#define CXL_WINDOW_MAX 10 +typedef struct PXBDev PXBDev ; + typedef struct CXLFixedWindow { uint64_t size; char **targets; - struct PXBDev *target_hbs[8]; + PXBDev *target_hbs[8]; uint8_t num_targets; uint8_t enc_int_ways; uint8_t enc_int_gran;
include/hw/pci/pci_bridge.h +0 -1
@@ -97,7 +97,6 @@ struct PXBDev { } cxl; }; -typedef struct PXBDev PXBDev ;#define TYPE_PXB_CXL_DEVICE "pxb-cxl"DECLARE_INSTANCE_CHECKER (PXBDev,PXB_CXL_DEV ,TYPE_PXB_CXL_DEVICE )
hw/pci-bridge/pci_expander_bridge.c +0 -1
@@ -50,7 +50,6 @@ struct PXBBus { };#define TYPE_PXB_DEVICE "pxb" -typedef struct PXBDev PXBDev ;DECLARE_INSTANCE_CHECKER (PXBDev,PXB_DEV ,TYPE_PXB_DEVICE )
Signature · 1 line
MST
[PULL 11/51] hw/ppc/Kconfig: Remove unused dependencies from PEGASOS2
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
Removes the following dependencies from ppc-softmmu:
- CONFIG_ACPI_CPU_HOTPLUG
- CONFIG_ACPI_CXL
- CONFIG_ACPI_HMAT
- CONFIG_ACPI_MEMORY_HOTPLUG
- CONFIG_ACPI_NVDIMM
- CONFIG_ACPI_PCIHP
- CONFIG_ACPI_X86
- CONFIG_MEM_DEVICE
Message-Id: <[email protected]>
--- hw/ppc/Kconfig | 2 -- 1 file changed, 2 deletions(-)
hw/ppc/Kconfig +0 -2
@@ -76,8 +76,6 @@ config PEGASOS2 select VT82C686 select SMBUS_EEPROM select VOF -# This should come with VT82C686 - select ACPI_X86 config PREP bool
Signature · 1 line
MST
[PULL 32/51] include/hw/pci: Include hw/pci/pci.h where needed
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
hw/pci/pcie_sriov.h needs PCI_NUM_REGIONS. Without the previous commit, this would close an inclusion loop: hw/pci/pci.h used to include hw/pci/pcie.h for PCIExpressDevice, which includes pcie_sriov.h for PCIESriovPF, which now includes hw/pci/pci.h for PCI_NUM_REGIONS.
Message-Id: <[email protected]>
--- include/hw/pci/pcie_sriov.h | 2 ++ 1 file changed, 2 insertions(+)
include/hw/pci/pcie_sriov.h +2 -0
@@ -13,6 +13,8 @@ #ifndef QEMU_PCIE_SRIOV_H #define QEMU_PCIE_SRIOV_H +#include "hw/pci/pci.h" + 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 */
Signature · 1 line
MST
[PULL 21/51] vhost: add support for configure interrupt
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
Add functions to support configure interrupt.
The configure interrupt process will start in vhost_dev_start and stop in vhost_dev_stop.
Also add the functions to support vhost_config_pending and vhost_config_mask.
Message-Id: <[email protected]>
--- include/hw/virtio/vhost.h | 4 ++ hw/virtio/vhost.c | 78 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-)
include/hw/virtio/vhost.h +4 -0
@@ -33,6 +33,7 @@ struct vhost_virtqueue {unsigned used_size;EventNotifier masked_notifier;EventNotifier error_notifier; +EventNotifier masked_config_notifier;struct vhost_dev *dev; };
@@ -41,6 +42,7 @@ typedef unsigned long vhost_log_chunk_t;#define VHOST_LOG_BITS (8 * sizeof(vhost_log_chunk_t))#define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS)#define VHOST_INVALID_FEATURE_BIT (0xff) +#define VHOST_QUEUE_NUM_CONFIG_INR 0struct vhost_log {unsigned long long size;
@@ -187,6 +189,8 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);* Disable direct notifications to vhost device. */ void vhost_dev_disable_notifiers (struct vhost_dev *hdev,VirtIODevice *vdev); +bool vhost_config_pending (struct vhost_dev *hdev); +void vhost_config_mask (struct vhost_dev *hdev,VirtIODevice *vdev,bool mask);/** * vhost_dev_is_started() - report status of vhost device
hw/virtio/vhost.c +77 -1
108 lines not on this page · raw message
Signature · 1 line
MST
[PULL 07/51] hw/acpi/Kconfig: Do not needlessly build TYPE_PIIX4_PM in non-PC/Malta machines
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
TYPE_PIIX4_PM is only used in machines where PIIX chipsets are used which is currently PC and Malta. There is no point building it for the other ACPI_X86 machines.
Note that this also removes unneeded ACPI_PIIX4 from PEGASOS2.
Message-Id: <[email protected]>
--- hw/acpi/Kconfig | 1 - hw/i386/Kconfig | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
hw/acpi/Kconfig +0 -1
@@ -9,7 +9,6 @@ config ACPI_X86 select ACPI_CPU_HOTPLUG select ACPI_MEMORY_HOTPLUG select ACPI_HMAT - select ACPI_PIIX4 select ACPI_PCIHP select ACPI_ERST
hw/i386/Kconfig +1 -0
@@ -69,6 +69,7 @@ config I440FX imply E1000_PCI imply VMPORT imply VMMOUSE + select ACPI_PIIX4 select PC_PCI select PC_ACPI select ACPI_SMBUS
Signature · 1 line
MST
The following changes since commit cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:
.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
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 6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
vhost-scsi: fix memleak of vsc->inflight (2023-01-05 04:07:39 -0500)
----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixes
mostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed ups
an acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Bernhard Beschow (7):
hw/acpi/Kconfig: Rename ACPI_X86_ICH to ACPI_ICH9 hw/acpi/Kconfig: Add missing dependencies to ACPI_ICH9 hw/acpi/Kconfig: Do not needlessly build TYPE_PIIX4_PM in non-PC/Malta machines hw/acpi/Kconfig: Add missing dependencies to ACPI_PIIX4 hw/isa/Kconfig: Add missing dependency to VT82C686
i386, mips: Resolve redundant ACPI and APM dependencies hw/ppc/Kconfig: Remove unused dependencies from PEGASOS2
Cindy Lu (10):
virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX
virtio-pci: decouple notifier from interrupt process
virtio-pci: decouple the single vector from the interrupt process
vhost: introduce new VhostOps vhost_set_config_call
vhost-vdpa: add support for config interrupt
virtio: add support for configure interrupt
vhost: add support for configure interrupt
virtio-net: add support for configure interrupt
virtio-mmio: add support for configure interrupt
virtio-pci: add support for configure interrupt
Dongli Zhang (1):
vhost-scsi: fix memleak of vsc->inflight
Eugenio Pérez (4):
virtio_net: Modify virtio_net_get_config to early return
virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it
vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail
vdpa: do not handle VIRTIO_NET_F_GUEST_ANNOUNCE in vhost-vdpa
Hyman Huang (3):
vhost-user: Refactor vhost acked features saving
vhost-user: Refactor the chr_closed_bh
vhost-user: Fix the virtio features negotiation flaw
Laszlo Ersek (1):
acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
Longpeng (Mike) (5):
vdpa-dev: get iova range explicitly
vdpa: harden the error path if get_iova_range failed
vhost: simplify vhost_dev_enable_notifiers
vhost: configure all host notifiers in a single MR transaction
vdpa: commit all host notifier MRs in a single MR transaction
Markus Armbruster (11):
include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h include/hw/cxl: Move typedef PXBDev to cxl.h, and put it to use include/hw/cxl: Include hw/cxl/*.h where needed include/hw/pci: Clean up a few things checkpatch.pl would flag include/hw/pci: Split pci_device.h off pci.h include/hw/pci: Include hw/pci/pci.h where needed include/hw/cxl: Break inclusion loop cxl_pci.h and cxl_cdat_h include/hw/virtio: Break inclusion loop
include: Include headers where needed
include: Don't include qemu/osdep.h
docs/devel: Rules on #include in headers
Philippe Mathieu-Daudé (2):
hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device() hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c
Yicong Yang (6):
tests: virt: Allow changes to PPTT test table hw/acpi/aml-build: Only generate cluster node in PPTT when specified
tests: virt: Update expected ACPI tables for virt test
tests: acpi: Add and whitelist *.topology blobs
tests: acpi: aarch64: Add topology test for aarch64
tests: acpi: aarch64: Add *.topology tables
leixiang (1):
virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiers
configs/devices/mips-softmmu/common.mak | 3 - bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - hw/alpha/alpha_sys.h | 1 - hw/display/ati_int.h | 2 +- hw/display/qxl.h | 3 +- hw/ide/ahci_internal.h | 2 +- hw/net/vmxnet3_defs.h | 2 +- hw/nvme/nvme.h | 2 +- hw/rdma/rdma_utils.h | 1 - hw/rdma/vmw/pvrdma.h | 2 +- hw/scsi/mptsas.h | 2 +- hw/usb/hcd-ehci.h | 3 +- hw/usb/hcd-uhci.h | 2 +- hw/usb/hcd-xhci-pci.h | 1 + hw/vfio/pci.h | 2 +- hw/virtio/virtio-qmp.h | 10 + hw/xen/xen_pt.h | 1 - include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h | 3 + include/hw/acpi/piix4.h | 2 +- include/hw/arm/allwinner-a10.h | 1 + include/hw/boards.h | 3 + include/hw/char/cmsdk-apb-uart.h | 1 + include/hw/char/goldfish_tty.h | 1 + include/hw/char/xilinx_uartlite.h | 1 + include/hw/cris/etraxfs.h | 1 + include/hw/cxl/cxl.h | 5 +- include/hw/cxl/cxl_cdat.h | 1 + include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h | 2 + include/hw/cxl/cxl_host.h | 1 - include/hw/cxl/cxl_pci.h | 3 - include/hw/display/macfb.h | 3 +- include/hw/dma/sifive_pdma.h | 2 + include/hw/i386/ich9.h | 4 - include/hw/i386/ioapic_internal.h | 1 + include/hw/i386/sgx-epc.h | 1 + include/hw/i386/x86-iommu.h | 1 - include/hw/ide/pci.h | 2 +- include/hw/input/pl050.h | 1 - include/hw/intc/goldfish_pic.h | 2 + include/hw/intc/loongarch_pch_msi.h | 2 + include/hw/intc/loongarch_pch_pic.h | 2 + include/hw/intc/nios2_vic.h | 2 + include/hw/isa/vt82c686.h | 1 - include/hw/misc/macio/macio.h | 2 +- include/hw/misc/mchp_pfsoc_dmc.h | 2 + include/hw/misc/mchp_pfsoc_ioscb.h | 2 + include/hw/misc/mchp_pfsoc_sysreg.h | 2 + include/hw/misc/pvpanic.h | 1 + include/hw/misc/sifive_e_prci.h | 3 +- include/hw/misc/sifive_u_otp.h | 3 +- include/hw/misc/sifive_u_prci.h | 3 +- include/hw/misc/virt_ctrl.h | 2 + include/hw/misc/xlnx-versal-pmc-iou-slcr.h | 1 + include/hw/net/lasi_82596.h | 2 +- include/hw/net/xlnx-zynqmp-can.h | 1 + include/hw/pci-host/designware.h | 3 - include/hw/pci-host/gpex.h | 2 +- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/ls7a.h | 2 - include/hw/pci-host/pnv_phb3.h | 2 - include/hw/pci-host/pnv_phb4.h | 3 +- include/hw/pci-host/q35.h | 2 +- include/hw/pci-host/sabre.h | 2 +- include/hw/pci-host/xilinx-pcie.h | 1 - include/hw/pci/msi.h | 2 +- include/hw/pci/pci.h | 341 --------------------------- include/hw/pci/pci_bridge.h | 3 +- include/hw/pci/pci_device.h | 350 ++++++++++++++++++++++++++++ include/hw/pci/pcie.h | 1 - include/hw/pci/pcie_port.h | 1 + include/hw/pci/pcie_sriov.h | 2 + include/hw/pci/shpc.h | 2 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/remote/iohub.h | 2 +- include/hw/remote/proxy.h | 2 +- include/hw/riscv/boot_opensbi.h | 2 + include/hw/riscv/microchip_pfsoc.h | 3 + include/hw/riscv/numa.h | 1 + include/hw/riscv/sifive_u.h | 2 + include/hw/riscv/spike.h | 2 +- include/hw/riscv/virt.h | 2 +- include/hw/sd/sdhci.h | 2 +- include/hw/southbridge/piix.h | 3 +- include/hw/ssi/sifive_spi.h | 3 + include/hw/timer/sse-timer.h | 1 + include/hw/tricore/triboard.h | 1 - include/hw/usb/hcd-dwc3.h | 1 + include/hw/usb/hcd-musb.h | 2 + include/hw/usb/xlnx-usb-subsystem.h | 2 + include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 3 + include/hw/virtio/vhost-backend.h | 3 + include/hw/virtio/vhost-vdpa.h | 2 + include/hw/virtio/vhost.h | 4 + include/hw/virtio/virtio-mmio.h | 2 +- include/hw/virtio/virtio-pci.h | 4 +- include/hw/virtio/virtio-scsi.h | 1 - include/hw/virtio/virtio.h | 8 +- include/hw/xen/xen_common.h | 2 +- include/net/vhost-user.h | 1 + include/net/vhost_net.h | 4 + include/qemu/plugin-memory.h | 3 + include/qemu/userfaultfd.h | 1 - include/sysemu/dirtyrate.h | 2 + include/sysemu/dump.h | 1 + include/user/syscall-trace.h | 1 + net/vmnet_int.h | 1 - qga/cutils.h | 1 - target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - hw/acpi/aml-build.c | 2 +- hw/acpi/cpu_hotplug.c | 3 + hw/acpi/erst.c | 2 +- hw/alpha/pci.c | 1 + hw/alpha/typhoon.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/char/serial-pci-multi.c | 2 +- hw/char/serial-pci.c | 2 +- hw/core/machine-smp.c | 2 + hw/core/qdev-properties-system.c | 1 + hw/display/bochs-display.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/sm501.c | 2 +- hw/display/vga-pci.c | 2 +- hw/display/vhost-user-gpu.c | 18 ++ hw/display/vmware_vga.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/pci_ipmi_bt.c | 2 +- hw/ipmi/pci_ipmi_kcs.c | 2 +- hw/isa/i82378.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/net/can/can_kvaser_pci.c | 2 +- hw/net/can/can_mioe3680_pci.c | 2 +- hw/net/can/can_pcm3680_pci.c | 2 +- hw/net/can/ctucan_pci.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000x_common.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/net_tx_pkt.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rocker/rocker_desc.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/vhost_net-stub.c | 14 ++ hw/net/vhost_net.c | 18 ++ hw/net/virtio-net.c | 60 +++-- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 1 - hw/pci-host/bonito.c | 2 +- hw/pci-host/dino.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/raven.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci-hmp-cmds.c | 1 + hw/pci/pcie_host.c | 2 +- hw/pci/pcie_sriov.c | 2 +- hw/pci/slotid_cap.c | 2 +- hw/ppc/ppc440_pcix.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 1 + hw/rdma/rdma_utils.c | 1 + hw/s390x/s390-pci-inst.c | 1 + hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/scsi/vhost-scsi-common.c | 1 + hw/scsi/virtio-scsi.c | 1 + hw/smbios/smbios.c | 1 + hw/usb/hcd-ohci-pci.c | 2 +- hw/virtio/vdpa-dev.c | 9 + hw/virtio/vhost-user-fs.c | 18 ++ hw/virtio/vhost-user-gpio.c | 10 + hw/virtio/vhost-vdpa.c | 40 +++- hw/virtio/vhost-vsock-common.c | 18 ++ hw/virtio/vhost.c | 122 ++++++++-- hw/virtio/virtio-crypto.c | 18 ++ hw/virtio/virtio-mmio.c | 27 +++ hw/virtio/virtio-pci.c | 305 ++++++++++++++++-------- hw/virtio/virtio-qmp.c | 192 ++++++++++++++- hw/virtio/virtio.c | 225 +++--------------- hw/watchdog/wdt_i6300esb.c | 2 +- net/vhost-user.c | 27 ++- net/vhost-vdpa.c | 32 +-- qga/cutils.c | 3 +- tests/qtest/bios-tables-test.c | 19 ++ tests/qtest/fuzz/generic_fuzz.c | 1 + ui/util.c | 2 +- docs/devel/style.rst | 7 + hw/acpi/Kconfig | 9 +- hw/acpi/meson.build | 2 +- hw/i2c/meson.build | 2 +- hw/i386/Kconfig | 3 +- hw/isa/Kconfig | 4 +- hw/ppc/Kconfig | 2 - hw/virtio/trace-events | 1 + qemu-options.hx | 3 + tests/data/acpi/virt/APIC.topology | Bin 0 -> 732 bytes tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes tests/data/acpi/virt/PPTT | Bin 96 -> 76 bytes tests/data/acpi/virt/PPTT.acpihmatvirt | Bin 196 -> 156 bytes tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes 217 files changed, 1418 insertions(+), 839 deletions(-) create mode 100644 include/hw/pci/pci_device.h create mode 100644 tests/data/acpi/virt/APIC.topology create mode 100644 tests/data/acpi/virt/DSDT.topology create mode 100644 tests/data/acpi/virt/PPTT.topology
[PULL 39/51] vdpa: harden the error path if get_iova_range failed
From: Longpeng <[email protected]>
We should stop if the GET_IOVA_RANGE ioctl failed.
Message-Id: <[email protected]>
--- net/vhost-vdpa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
net/vhost-vdpa.c +7 -1
@@ -805,7 +805,13 @@ int net_init_vhost_vdpa(const Netdev *netdev, const char *name,return queue_pairs; } -vhost_vdpa_get_iova_range (vdpa_device_fd, &iova_range); + r =vhost_vdpa_get_iova_range (vdpa_device_fd, &iova_range); +if (unlikely (r <0 )) { +error_setg (errp,"vhost-vdpa: get iova range failed: %s" , +strerror (-r)); + goto err; + } +if (opts->x_svq) {if (!vhost_vdpa_net_valid_svq_features (features, errp)) { goto err_svq;
Signature · 1 line
MST
[PULL 37/51] docs/devel: Rules on #include in headers
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
Rules for headers were proposed a long time ago, and generally liked:
Message-ID: <[email protected]> https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
Wortk them into docs/devel/style.rst.
Message-Id: <[email protected]>
--- docs/devel/style.rst | 7 +++++++ 1 file changed, 7 insertions(+)
docs/devel/style.rst +7 -0
@@ -293,6 +293,13 @@ that QEMU depends on. Do not include "qemu/osdep.h" from header files since the .c file will have already included it. +Headers should normally include everything they need beyond osdep.h. +If exceptions are needed for some reason, they must be documented in +the header. If all that's needed from a header is typedefs, consider +putting those into qemu/typedefs.h instead of including the header. + +Cyclic inclusion is forbidden. + C types =======
Signature · 1 line
MST
[PULL 18/51] vhost: introduce new VhostOps vhost_set_config_call
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
This patch introduces new VhostOps vhost_set_config_call. This function allows the qemu to set the config event fd to kernel driver.
Message-Id: <[email protected]>
--- include/hw/virtio/vhost-backend.h | 3 +++ 1 file changed, 3 insertions(+)
include/hw/virtio/vhost-backend.h +3 -0
@@ -128,6 +128,8 @@ typedef int (*vhost_get_device_id_op)(struct vhost_dev *dev, uint32_t *dev_id);typedef bool (*vhost_force_iommu_op )(struct vhost_dev *dev); +typedef int (*vhost_set_config_call_op )(struct vhost_dev *dev, +int fd); typedef struct VhostOps { VhostBackendType backend_type; vhost_backend_init vhost_backend_init;
@@ -174,6 +176,7 @@ typedef struct VhostOps {vhost_vq_get_addr_op vhost_vq_get_addr;vhost_get_device_id_op vhost_get_device_id;vhost_force_iommu_op vhost_force_iommu; +vhost_set_config_call_op vhost_set_config_call; } VhostOps; int vhost_backend_update_device_iotlb(struct vhost_dev *dev,
Signature · 1 line
MST
[PULL 38/51] vdpa-dev: get iova range explicitly
In reply to Michael S. TsirkinFrom: Longpeng <[email protected]>
In commit a585fad26b ("vdpa: request iova_range only once") we remove GET_IOVA_RANGE form vhost_vdpa_init, the generic vdpa device will start without iova_range populated, so the device won't work. Let's call GET_IOVA_RANGE ioctl explicitly.
Message-Id: <[email protected]>
--- include/hw/virtio/vhost-vdpa.h | 2 ++ hw/virtio/vdpa-dev.c | 9 +++++++++ hw/virtio/vhost-vdpa.c | 7 +++++++ net/vhost-vdpa.c | 8 -------- 4 files changed, 18 insertions(+), 8 deletions(-)
include/hw/virtio/vhost-vdpa.h +2 -0
@@ -51,6 +51,8 @@ typedef struct vhost_vdpa {VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX ]; } VhostVDPA; +int vhost_vdpa_get_iova_range (int fd,struct vhost_vdpa_iova_range *iova_range); +int vhost_vdpa_dma_map (struct vhost_vdpa *v,uint32_t asid,hwaddr iova,hwaddr size,void *vaddr,bool readonly); int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, uint32_t asid, hwaddr iova,
hw/virtio/vdpa-dev.c +9 -0
@@ -53,6 +53,7 @@ static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp) {VirtIODevice *vdev =VIRTIO_DEVICE (dev);VhostVdpaDevice *v =VHOST_VDPA_DEVICE (vdev); +struct vhost_vdpa_iova_range iova_range;uint16_t max_queue_size;struct vhost_virtqueue *vqs;int i, ret;
@@ -108,6 +109,14 @@ static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp) v->dev.backend_features =0 ; v->started = false; + ret =vhost_vdpa_get_iova_range (v->vhostfd, &iova_range); +if (ret <0 ) { +error_setg (errp,"vhost-vdpa-device: get iova range failed: %s" , +strerror (-ret)); + goto free_vqs; + } + v->vdpa.iova_range = iova_range; + ret =vhost_dev_init (&v->dev, &v->vdpa,VHOST_BACKEND_TYPE_VDPA ,0 ,NULL );if (ret <0 ) { error_setg(errp, "vhost-vdpa-device: vhost initialization failed: %s",
hw/virtio/vhost-vdpa.c +7 -0
@@ -378,6 +378,13 @@ static int vhost_vdpa_add_status(struct vhost_dev *dev, uint8_t status)return 0 ; } +int vhost_vdpa_get_iova_range (int fd,struct vhost_vdpa_iova_range *iova_range) +{ +int ret =ioctl (fd,VHOST_VDPA_GET_IOVA_RANGE , iova_range); + +return ret <0 ? -errno :0 ; +} +/* * The use of this function is for requests that only need to be * applied once. Typically such request occurs at the beginning
net/vhost-vdpa.c +0 -8
@@ -710,14 +710,6 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,return nc; } -static int vhost_vdpa_get_iova_range (int fd, -struct vhost_vdpa_iova_range *iova_range) -{ -int ret =ioctl (fd,VHOST_VDPA_GET_IOVA_RANGE , iova_range); - -return ret <0 ? -errno :0 ; -} -static int vhost_vdpa_get_features (int fd,uint64_t *features,Error **errp) {int ret =ioctl (fd,VHOST_GET_FEATURES , features);
Signature · 1 line
MST
[PULL 45/51] hw/acpi/aml-build: Only generate cluster node in PPTT when specified
In reply to Michael S. TsirkinFrom: Yicong Yang <[email protected]>
Currently we'll always generate a cluster node no matter user has specified '-smp clusters=X' or not. Cluster is an optional level and will participant the building of Linux scheduling domains and only appears on a few platforms. It's unncessary to always build it when it cannot reflect the real topology on platforms having no cluster implementation and to avoid affecting the linux scheduling domains in the VM. So only generate the cluster topology in ACPI PPTT when the user has specified it explicitly in -smp.
Tested qemu-system-aarch64 with -smp 8 and linux 6.1-rc1, without this patch:
estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 56 # cluster_id
with this patch:
estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 36 # cluster_id, with no cluster node kernel will make it to physical package id
Message-Id: <[email protected]>
--- include/hw/boards.h | 3 +++ hw/acpi/aml-build.c | 2 +- hw/core/machine-smp.c | 2 ++ qemu-options.hx | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-)
include/hw/boards.h +3 -0
@@ -130,11 +130,14 @@ typedef struct {* @prefer_sockets - whether sockets are preferred over cores in smp parsing * @dies_supported - whether dies are supported by the machine * @clusters_supported - whether clusters are supported by the machine +* @has_clusters - whether clusters are explicitly specified in the user +* provided SMP configuration */ typedef struct {bool prefer_sockets;bool dies_supported;bool clusters_supported; +bool has_clusters; }SMPCompatProps ;/**
hw/acpi/aml-build.c +1 -1
@@ -2030,7 +2030,7 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms, 0, socket_id, NULL, 0); } -if (mc->smp_props.clusters_supported) { +if (mc->smp_props.clusters_supported && mc->smp_props.has_clusters) {if (cpus->cpus[n].props.cluster_id != cluster_id) {assert (cpus->cpus[n].props.cluster_id > cluster_id); cluster_id = cpus->cpus[n].props.cluster_id;
hw/core/machine-smp.c +2 -0
@@ -158,6 +158,8 @@ void machine_parse_smp_config(MachineState *ms, ms->smp.threads = threads; ms->smp.max_cpus = maxcpus; + mc->smp_props.has_clusters = config->has_clusters; +/* sanity-check of the computed topology */ if (sockets * dies * clusters * cores * threads != maxcpus) { g_autofree char *topo_msg = cpu_hierarchy_to_string(ms);
qemu-options.hx +3 -0
@@ -343,6 +343,9 @@ SRST :: -smp 2 + + Note: The cluster topology will only be generated in ACPI and exposed + to guest if it's explicitly specified in -smp. ERST DEF("numa", HAS_ARG, QEMU_OPTION_numa,
Signature · 1 line
MST
[PULL 49/51] tests: acpi: aarch64: Add *.topology tables
In reply to Michael S. TsirkinFrom: Yicong Yang <[email protected]>
Add *.topology tables for the aarch64's topology test and empty bios-tables-test-allowed-diff.h
The disassembled differences between actual and expected PPTT (the table which we actually care about):
+/*
+ * Intel ACPI Component Architecture
+ * AML/ASL+ Disassembler version 20180105 (64-bit version)
+ * Copyright (c) 2000 - 2018 Intel Corporation
+ *
+ * Disassembly of /tmp/aml-WUN4U1, Tue Nov 1 09:51:52 2022
+ *
+ * ACPI Data Table [PPTT]
+ *
+ * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
+ */
+
+[000h 0000 4] Signature : "PPTT" [Processor Properties Topology Table] +[004h 0004 4] Table Length : 00000150 +[008h 0008 1] Revision : 02 +[009h 0009 1] Checksum : 7C +[00Ah 0010 6] Oem ID : "BOCHS " +[010h 0016 8] Oem Table ID : "BXPC " +[018h 0024 4] Oem Revision : 00000001 +[01Ch 0028 4] Asl Compiler ID : "BXPC" +[020h 0032 4] Asl Compiler Revision : 00000001 + + +[024h 0036 1] Subtable Type : 00 [Processor Hierarchy Node] +[025h 0037 1] Length : 14 +[026h 0038 2] Reserved : 0000 +[028h 0040 4] Flags (decoded below) : 00000001 + Physical package : 1 + ACPI Processor ID valid : 0 +[02Ch 0044 4] Parent : 00000000 +[030h 0048 4] ACPI Processor ID : 00000000 +[034h 0052 4] Private Resource Number : 00000000 + +[038h 0056 1] Subtable Type : 00 [Processor Hierarchy Node] +[039h 0057 1] Length : 14 +[03Ah 0058 2] Reserved : 0000 +[03Ch 0060 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[040h 0064 4] Parent : 00000024 +[044h 0068 4] ACPI Processor ID : 00000000 +[048h 0072 4] Private Resource Number : 00000000 + +[04Ch 0076 1] Subtable Type : 00 [Processor Hierarchy Node] +[04Dh 0077 1] Length : 14 +[04Eh 0078 2] Reserved : 0000 +[050h 0080 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[054h 0084 4] Parent : 00000038 +[058h 0088 4] ACPI Processor ID : 00000000 +[05Ch 0092 4] Private Resource Number : 00000000 + +[060h 0096 1] Subtable Type : 00 [Processor Hierarchy Node] +[061h 0097 1] Length : 14 +[062h 0098 2] Reserved : 0000 +[064h 0100 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[068h 0104 4] Parent : 0000004C +[06Ch 0108 4] ACPI Processor ID : 00000000 +[070h 0112 4] Private Resource Number : 00000000 + +[074h 0116 1] Subtable Type : 00 [Processor Hierarchy Node] +[075h 0117 1] Length : 14 +[076h 0118 2] Reserved : 0000 +[078h 0120 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[07Ch 0124 4] Parent : 0000004C +[080h 0128 4] ACPI Processor ID : 00000001 +[084h 0132 4] Private Resource Number : 00000000 + +[088h 0136 1] Subtable Type : 00 [Processor Hierarchy Node] +[089h 0137 1] Length : 14 +[08Ah 0138 2] Reserved : 0000 +[08Ch 0140 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[090h 0144 4] Parent : 00000038 +[094h 0148 4] ACPI Processor ID : 00000001 +[098h 0152 4] Private Resource Number : 00000000 + +[09Ch 0156 1] Subtable Type : 00 [Processor Hierarchy Node] +[09Dh 0157 1] Length : 14 +[09Eh 0158 2] Reserved : 0000 +[0A0h 0160 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[0A4h 0164 4] Parent : 00000088 +[0A8h 0168 4] ACPI Processor ID : 00000002 +[0ACh 0172 4] Private Resource Number : 00000000 + +[0B0h 0176 1] Subtable Type : 00 [Processor Hierarchy Node] +[0B1h 0177 1] Length : 14 +[0B2h 0178 2] Reserved : 0000 +[0B4h 0180 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[0B8h 0184 4] Parent : 00000088 +[0BCh 0188 4] ACPI Processor ID : 00000003 +[0C0h 0192 4] Private Resource Number : 00000000 + +[0C4h 0196 1] Subtable Type : 00 [Processor Hierarchy Node] +[0C5h 0197 1] Length : 14 +[0C6h 0198 2] Reserved : 0000 +[0C8h 0200 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[0CCh 0204 4] Parent : 00000024 +[0D0h 0208 4] ACPI Processor ID : 00000001 +[0D4h 0212 4] Private Resource Number : 00000000 + +[0D8h 0216 1] Subtable Type : 00 [Processor Hierarchy Node] +[0D9h 0217 1] Length : 14 +[0DAh 0218 2] Reserved : 0000 +[0DCh 0220 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[0E0h 0224 4] Parent : 000000C4 +[0E4h 0228 4] ACPI Processor ID : 00000000 +[0E8h 0232 4] Private Resource Number : 00000000 + +[0ECh 0236 1] Subtable Type : 00 [Processor Hierarchy Node] +[0EDh 0237 1] Length : 14 +[0EEh 0238 2] Reserved : 0000 +[0F0h 0240 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[0F4h 0244 4] Parent : 000000D8 +[0F8h 0248 4] ACPI Processor ID : 00000004 +[0FCh 0252 4] Private Resource Number : 00000000 + +[100h 0256 1] Subtable Type : 00 [Processor Hierarchy Node] +[101h 0257 1] Length : 14 +[102h 0258 2] Reserved : 0000 +[104h 0260 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[108h 0264 4] Parent : 000000D8 +[10Ch 0268 4] ACPI Processor ID : 00000005 +[110h 0272 4] Private Resource Number : 00000000 + +[114h 0276 1] Subtable Type : 00 [Processor Hierarchy Node] +[115h 0277 1] Length : 14 +[116h 0278 2] Reserved : 0000 +[118h 0280 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[11Ch 0284 4] Parent : 000000C4 +[120h 0288 4] ACPI Processor ID : 00000001 +[124h 0292 4] Private Resource Number : 00000000 + +[128h 0296 1] Subtable Type : 00 [Processor Hierarchy Node] +[129h 0297 1] Length : 14 +[12Ah 0298 2] Reserved : 0000 +[12Ch 0300 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[130h 0304 4] Parent : 00000114 +[134h 0308 4] ACPI Processor ID : 00000006 +[138h 0312 4] Private Resource Number : 00000000 + +[13Ch 0316 1] Subtable Type : 00 [Processor Hierarchy Node] +[13Dh 0317 1] Length : 14 +[13Eh 0318 2] Reserved : 0000 +[140h 0320 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[144h 0324 4] Parent : 00000114 +[148h 0328 4] ACPI Processor ID : 00000007 +[14Ch 0332 4] Private Resource Number : 00000000 + +Raw Table Data: Length 336 (0x150) + + 0000: 50 50 54 54 50 01 00 00 02 7C 42 4F 43 48 53 20 // PPTTP....|BOCHS + 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC + 0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // ................ + 0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // ................ + 0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $............... + 0050: 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8........... + 0060: 00 14 00 00 0E 00 00 00 4C 00 00 00 00 00 00 00 // ........L....... + 0070: 00 00 00 00 00 14 00 00 0E 00 00 00 4C 00 00 00 // ............L... + 0080: 01 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // ................ + 0090: 38 00 00 00 01 00 00 00 00 00 00 00 00 14 00 00 // 8............... + 00A0: 0E 00 00 00 88 00 00 00 02 00 00 00 00 00 00 00 // ................ + 00B0: 00 14 00 00 0E 00 00 00 88 00 00 00 03 00 00 00 // ................ + 00C0: 00 00 00 00 00 14 00 00 00 00 00 00 24 00 00 00 // ............$... + 00D0: 01 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // ................ + 00E0: C4 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // ................ + 00F0: 0E 00 00 00 D8 00 00 00 04 00 00 00 00 00 00 00 // ................ + 0100: 00 14 00 00 0E 00 00 00 D8 00 00 00 05 00 00 00 // ................ + 0110: 00 00 00 00 00 14 00 00 00 00 00 00 C4 00 00 00 // ................ + 0120: 01 00 00 00 00 00 00 00 00 14 00 00 0E 00 00 00 // ................ + 0130: 14 01 00 00 06 00 00 00 00 00 00 00 00 14 00 00 // ................ + 0140: 0E 00 00 00 14 01 00 00 07 00 00 00 00 00 00 00 // ................
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 3 --- tests/data/acpi/virt/APIC.topology | Bin 0 -> 732 bytes tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes 4 files changed, 3 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -3
@@ -1,4 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/APIC.topology" , -"tests/data/acpi/virt/DSDT.topology" , -"tests/data/acpi/virt/PPTT.topology",
tests/data/acpi/virt/APIC.topology binary +0 -0
tests/data/acpi/virt/DSDT.topology binary +0 -0
tests/data/acpi/virt/PPTT.topology binary +0 -0
Signature · 1 line
MST
[PULL 40/51] vhost: simplify vhost_dev_enable_notifiers
In reply to Michael S. TsirkinFrom: Longpeng <[email protected]>
Simplify the error path in vhost_dev_enable_notifiers by using vhost_dev_disable_notifiers directly.
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
hw/virtio/vhost.c +4 -16
@@ -1551,7 +1551,7 @@ void vhost_dev_cleanup(struct vhost_dev *hdev)int vhost_dev_enable_notifiers (struct vhost_dev *hdev,VirtIODevice *vdev) {BusState *qbus =BUS (qdev_get_parent_bus (DEVICE (vdev))); -int i, r, e; +int i, r;/* We will pass the notifiers to the kernel, make sure that QEMU * doesn't interfere.
@@ -1559,7 +1559,7 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) r =virtio_device_grab_ioeventfd (vdev);if (r <0 ) {error_report ("binding does not support host notifiers" ); - goto fail; +return r; }for (i =0 ; i < hdev->nvqs; ++i) {
@@ -1567,24 +1567,12 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) true);if (r <0 ) {error_report ("vhost VQ %d notifier binding failed: %d" , i, -r); - goto fail_vq; +vhost_dev_disable_notifiers (hdev, vdev); +return r; } }return 0 ; -fail_vq: -while (--i >=0 ) { - e =virtio_bus_set_host_notifier (VIRTIO_BUS (qbus), hdev->vq_index + i, - false); -if (e <0 ) { -error_report ("vhost VQ %d notifier cleanup error: %d" , i, -r); - } -assert (e >=0 ); -virtio_bus_cleanup_host_notifier (VIRTIO_BUS (qbus), hdev->vq_index + i); - } -virtio_device_release_ioeventfd (vdev); -fail: -return r; }/* Stop processing guest IO notifications in vhost.
Signature · 1 line
MST
[PULL 05/51] hw/acpi/Kconfig: Rename ACPI_X86_ICH to ACPI_ICH9
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
Although the ICH9 ACPI controller may currently be tied to x86 it doesn't have to. Furthermore, the source files this configuration switch manages contain a '9', so this name fits more.
Message-Id: <[email protected]>
--- hw/acpi/Kconfig | 2 +- hw/acpi/meson.build | 2 +- hw/i2c/meson.build | 2 +- hw/isa/Kconfig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
hw/acpi/Kconfig +1 -1
@@ -13,7 +13,7 @@ config ACPI_X86 select ACPI_PCIHP select ACPI_ERST -config ACPI_X86_ICH +config ACPI_ICH9 bool select ACPI_X86
hw/acpi/meson.build +1 -1
@@ -22,7 +22,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) -acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'ich9_tco.c')) +acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c'))
hw/i2c/meson.build +1 -1
@@ -2,7 +2,7 @@ i2c_ss = ss.source_set() i2c_ss.add(when: 'CONFIG_I2C', if_true: files('core.c')) i2c_ss.add(when: 'CONFIG_SMBUS', if_true: files('smbus_slave.c', 'smbus_master.c')) i2c_ss.add(when: 'CONFIG_ACPI_SMBUS', if_true: files('pm_smbus.c')) -i2c_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('smbus_ich9.c')) +i2c_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('smbus_ich9.c')) i2c_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_i2c.c')) i2c_ss.add(when: 'CONFIG_BITBANG_I2C', if_true: files('bitbang_i2c.c')) i2c_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_i2c.c'))
hw/isa/Kconfig +1 -1
@@ -78,4 +78,4 @@ config LPC_ICH9 select I8257 select ISA_BUS select ACPI_SMBUS - select ACPI_X86_ICH + select ACPI_ICH9
Signature · 1 line
MST
[PULL 48/51] tests: acpi: aarch64: Add topology test for aarch64
In reply to Michael S. TsirkinFrom: Yicong Yang <[email protected]>
Add test for aarch64's ACPI topology building for all the supported levels.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
tests/qtest/bios-tables-test.c +19 -0
@@ -1720,6 +1720,24 @@ static void test_acpi_virt_tcg(void)free_test_data (&data); } +static void test_acpi_virt_tcg_topology (void ) +{ +test_data data = { + .machine ="virt" , + .variant =".topology" , + .tcg_only = true, + .uefi_fl1 ="pc-bios/edk2-aarch64-code.fd" , + .uefi_fl2 ="pc-bios/edk2-arm-vars.fd" , + .cd ="tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2" , + .ram_start =0x40000000ULL , + .scan_len =128ULL *1024 *1024 , + }; + +test_acpi_one ("-cpu cortex-a57 " +"-smp sockets=1,clusters=2,cores=2,threads=2" , &data); +free_test_data (&data); +} +static void test_acpi_q35_viot (void ) {test_data data = {
@@ -2057,6 +2075,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/virt" , test_acpi_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);
Signature · 1 line
MST
[PULL 22/51] virtio-net: add support for configure interrupt
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
Add functions to support configure interrupt in virtio_net Add the functions to support vhost_net_config_pending and vhost_net_config_mask.
Message-Id: <[email protected]>
--- include/net/vhost_net.h | 2 ++ hw/net/vhost_net-stub.c | 9 +++++++++ hw/net/vhost_net.c | 9 +++++++++ hw/net/virtio-net.c | 4 ++-- 4 files changed, 22 insertions(+), 2 deletions(-)
include/net/vhost_net.h +2 -0
@@ -39,6 +39,8 @@ int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,bool vhost_net_virtqueue_pending (VHostNetState *net,int n);void vhost_net_virtqueue_mask (VHostNetState *net,VirtIODevice *dev,int idx,bool mask); +bool vhost_net_config_pending (VHostNetState *net); +void vhost_net_config_mask (VHostNetState *net,VirtIODevice *dev,bool mask);int vhost_net_notify_migration_done (VHostNetState *net,char * mac_addr);VHostNetState *get_vhost_net (NetClientState *nc);
hw/net/vhost_net-stub.c +9 -0
@@ -82,6 +82,15 @@ void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev, { } +bool vhost_net_config_pending (VHostNetState *net) +{ +return false; +} + +void vhost_net_config_mask (VHostNetState *net,VirtIODevice *dev,bool mask) +{ +} +int vhost_net_notify_migration_done (struct vhost_net *net,char * mac_addr) {return -1 ;
hw/net/vhost_net.c +9 -0
@@ -487,6 +487,15 @@ void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,vhost_virtqueue_mask (&net->dev, dev, idx, mask); } +bool vhost_net_config_pending (VHostNetState *net) +{ +return vhost_config_pending (&net->dev); +} + +void vhost_net_config_mask (VHostNetState *net,VirtIODevice *dev,bool mask) +{ +vhost_config_mask (&net->dev, dev, mask); +}VHostNetState *get_vhost_net (NetClientState *nc) {VHostNetState *vhost_net =0 ;
hw/net/virtio-net.c +2 -2
@@ -3332,7 +3332,7 @@ static bool virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx)*/ if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { -return false; +return vhost_net_config_pending (get_vhost_net (nc->peer)); }return vhost_net_virtqueue_pending (get_vhost_net (nc->peer), idx); }
@@ -3364,9 +3364,9 @@ static void virtio_net_guest_notifier_mask(VirtIODevice *vdev, int idx,*/ if (idx ==VIRTIO_CONFIG_IRQ_IDX ) { +vhost_net_config_mask (get_vhost_net (nc->peer), vdev, mask);return ; } -vhost_net_virtqueue_mask (get_vhost_net (nc->peer), vdev, idx, mask); }
Signature · 1 line
MST
[PULL 19/51] vhost-vdpa: add support for config interrupt
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
Add new call back function in vhost-vdpa, The function vhost_set_config_call can set the event fd to kernel. This function will be called in the vhost_dev_start and vhost_dev_stop
Message-Id: <[email protected]>
--- hw/virtio/vhost-vdpa.c | 8 ++++++++ hw/virtio/trace-events | 1 + 2 files changed, 9 insertions(+)
hw/virtio/vhost-vdpa.c +8 -0
@@ -716,6 +716,13 @@ static int vhost_vdpa_set_vring_ready(struct vhost_dev *dev)return 0 ; } +static int vhost_vdpa_set_config_call (struct vhost_dev *dev, +int fd) +{ +trace_vhost_vdpa_set_config_call (dev, fd); +return vhost_vdpa_call (dev,VHOST_VDPA_SET_CONFIG_CALL , &fd); +} +static void vhost_vdpa_dump_config (struct vhost_dev *dev,const uint8_t *config,uint32_t config_len) {
@@ -1298,4 +1305,5 @@ const VhostOps vdpa_ops = { .vhost_get_device_id = vhost_vdpa_get_device_id, .vhost_vq_get_addr = vhost_vdpa_vq_get_addr, .vhost_force_iommu = vhost_vdpa_force_iommu, + .vhost_set_config_call = vhost_vdpa_set_config_call, };
hw/virtio/trace-events +1 -0
@@ -62,6 +62,7 @@ vhost_vdpa_get_features(void *dev, uint64_t features) "dev: %p features: 0x%"PRI vhost_vdpa_set_owner(void *dev) "dev: %p" vhost_vdpa_vq_get_addr(void *dev, void *vq, uint64_t desc_user_addr, uint64_t avail_user_addr, uint64_t used_user_addr) "dev: %p vq: %p desc_user_addr: 0x%"PRIx64" avail_user_addr: 0x%"PRIx64" used_user_addr: 0x%"PRIx64 vhost_vdpa_get_iova_range(void *dev, uint64_t first, uint64_t last) "dev: %p first: 0x%"PRIx64" last: 0x%"PRIx64 +vhost_vdpa_set_config_call(void *dev, int fd)"dev: %p fd: %d" # virtio.c virtqueue_alloc_element(void *elem, size_t sz, unsigned in_num, unsigned out_num) "elem %p size %zd in_num %u out_num %u"
Signature · 1 line
MST
[PULL 23/51] virtio-mmio: add support for configure interrupt
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
Add configure interrupt support in virtio-mmio bus. add function to set configure guest notifier.
Message-Id: <[email protected]>
--- hw/virtio/virtio-mmio.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
hw/virtio/virtio-mmio.c +27 -0
@@ -670,7 +670,30 @@ static int virtio_mmio_set_guest_notifier(DeviceState *d, int n, bool assign,return 0 ; } +static int virtio_mmio_set_config_guest_notifier (DeviceState *d,bool assign, +bool with_irqfd) +{ +VirtIOMMIOProxy *proxy =VIRTIO_MMIO (d); +VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); +VirtioDeviceClass *vdc =VIRTIO_DEVICE_GET_CLASS (vdev); +EventNotifier *notifier =virtio_config_get_guest_notifier (vdev); +int r =0 ; +if (assign) { + r =event_notifier_init (notifier,0 ); +if (r <0 ) { +return r; + } +virtio_config_set_guest_notifier_fd_handler (vdev, assign, with_irqfd); + }else { +virtio_config_set_guest_notifier_fd_handler (vdev, assign, with_irqfd); +event_notifier_cleanup (notifier); + } +if (vdc->guest_notifier_mask && vdev->use_guest_notifier_mask) { + vdc->guest_notifier_mask (vdev,VIRTIO_CONFIG_IRQ_IDX , !assign); + } +return r; +}static int virtio_mmio_set_guest_notifiers (DeviceState *d,int nvqs,bool assign) {
@@ -692,6 +715,10 @@ static int virtio_mmio_set_guest_notifiers(DeviceState *d, int nvqs, goto assign_error; } } + r =virtio_mmio_set_config_guest_notifier (d, assign, with_irqfd); +if (r <0 ) { + goto assign_error; + }return 0 ;
Signature · 1 line
MST
[PULL 13/51] vhost-user: Refactor the chr_closed_bh
In reply to Michael S. TsirkinFrom: Hyman Huang(黄勇) <[email protected]>
Use vhost_user_save_acked_features to implemente acked features saving.
Message-Id: <6699ee88687b62fb8152fe021e576cd2f468d7ca.1671627406.git.huangy81@chinatelecom.cn>
--- net/vhost-user.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
net/vhost-user.c +1 -5
@@ -260,11 +260,7 @@ static void chr_closed_bh(void *opaque) s =DO_UPCAST (NetVhostUserState, nc, ncs[0 ]);for (i = queues -1 ; i >=0 ; i--) { - s =DO_UPCAST (NetVhostUserState, nc, ncs[i]); - -if (s->vhost_net) { - s->acked_features =vhost_net_get_acked_features (s->vhost_net); - } +vhost_user_save_acked_features (ncs[i]); }qmp_set_link (name, false, &err);
Signature · 1 line
MST
[PULL 08/51] hw/acpi/Kconfig: Add missing dependencies to ACPI_PIIX4
In reply to Michael S. TsirkinFrom: Bernhard Beschow <[email protected]>
piix4_pm_realize() uses apm_init() and pm_smbus_init(), so both APM and ACPI_SMBUS are provided by the device model managed by ACPI_PIIX4.
The ACPIREGS are also provided by ACPI_PIIX4, so needs to select ACPI.
Message-Id: <[email protected]>
--- hw/acpi/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/acpi/Kconfig +3 -1
@@ -31,7 +31,9 @@ config ACPI_NVDIMM config ACPI_PIIX4 bool - depends on ACPI + select ACPI + select ACPI_SMBUS + select APM config ACPI_PCIHP bool
Signature · 1 line
MST
[PULL 20/51] virtio: add support for configure interrupt
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
Add the functions to support the configure interrupt in virtio The function virtio_config_guest_notifier_read will notify the guest if there is an configure interrupt.
The function virtio_config_set_guest_notifier_fd_handler is to set the fd hander for the notifier
Message-Id: <[email protected]>
--- include/hw/virtio/virtio.h | 4 ++++ hw/virtio/virtio.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+)
include/hw/virtio/virtio.h +4 -0
@@ -155,6 +155,7 @@ struct VirtIODeviceAddressSpace *dma_as; QLIST_HEAD(, VirtQueue) *vector_queues;QTAILQ_ENTRY (VirtIODevice) next; +EventNotifier config_notifier; };struct VirtioDeviceClass {
@@ -377,6 +378,9 @@ void virtio_queue_aio_attach_host_notifier_no_poll(VirtQueue *vq, AioContext *ctvoid virtio_queue_aio_detach_host_notifier (VirtQueue *vq,AioContext *ctx);VirtQueue *virtio_vector_first_queue (VirtIODevice *vdev,uint16_t vector);VirtQueue *virtio_vector_next_queue (VirtQueue *vq); +EventNotifier *virtio_config_get_guest_notifier (VirtIODevice *vdev); +void virtio_config_set_guest_notifier_fd_handler (VirtIODevice *vdev, +bool assign,bool with_irqfd);static inline void virtio_add_feature (uint64_t *features,unsigned int fbit) {
hw/virtio/virtio.c +29 -0
@@ -3417,7 +3417,14 @@ static void virtio_queue_guest_notifier_read(EventNotifier *n)virtio_irq (vq); } } +static void virtio_config_guest_notifier_read (EventNotifier *n) +{ +VirtIODevice *vdev =container_of (n, VirtIODevice, config_notifier); +if (event_notifier_test_and_clear (n)) { +virtio_notify_config (vdev); + } +}void virtio_queue_set_guest_notifier_fd_handler (VirtQueue *vq,bool assign,bool with_irqfd) {
@@ -3434,6 +3441,23 @@ void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign, } } +void virtio_config_set_guest_notifier_fd_handler (VirtIODevice *vdev, +bool assign,bool with_irqfd) +{ +EventNotifier *n; + n = &vdev->config_notifier; +if (assign && !with_irqfd) { +event_notifier_set_handler (n, virtio_config_guest_notifier_read); + }else { +event_notifier_set_handler (n,NULL ); + } +if (!assign) { +/* Test and clear notifier before closing it,*/ +/* in case poll callback didn't have time to run. */ +virtio_config_guest_notifier_read (n); + } +} +EventNotifier *virtio_queue_get_guest_notifier (VirtQueue *vq) {return &vq->guest_notifier;
@@ -3514,6 +3538,11 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq)return &vq->host_notifier; } +EventNotifier *virtio_config_get_guest_notifier (VirtIODevice *vdev) +{ +return &vdev->config_notifier; +} +void virtio_queue_set_host_notifier_enabled (VirtQueue *vq,bool enabled) { vq->host_notifier_enabled = enabled;
Signature · 1 line
MST
[PULL 34/51] include/hw/virtio: Break inclusion loop
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
hw/virtio/virtio.h and hw/virtio/vhost.h include each other. The former doesn't actually need the latter, so drop that inclusion to break the loop.
Message-Id: <[email protected]>
--- hw/virtio/virtio-qmp.h | 1 + include/hw/virtio/virtio.h | 1 - hw/virtio/virtio.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)
hw/virtio/virtio-qmp.h +1 -0
@@ -13,6 +13,7 @@#include "qapi/qapi-types-virtio.h" #include "hw/virtio/virtio.h" +#include "hw/virtio/vhost.h" #include "qemu/queue.h"
include/hw/virtio/virtio.h +0 -1
@@ -22,7 +22,6 @@#include "standard-headers/linux/virtio_config.h" #include "standard-headers/linux/virtio_ring.h" #include "qom/object.h" -#include "hw/virtio/vhost.h" /* * A guest should never accept this. It implies negotiation is broken
hw/virtio/virtio.c +1 -0
@@ -22,6 +22,7 @@#include "qom/object_interfaces.h" #include "hw/core/cpu.h" #include "hw/virtio/virtio.h" +#include "hw/virtio/vhost.h" #include "migration/qemu-file-types.h" #include "qemu/atomic.h" #include "hw/virtio/virtio-bus.h"
Signature · 1 line
MST
[PULL 14/51] vhost-user: Fix the virtio features negotiation flaw
In reply to Michael S. TsirkinFrom: Hyman Huang(黄勇) <[email protected]>
This patch aims to fix unexpected negotiation features for vhost-user netdev interface.
When openvswitch reconnect Qemu after an unexpected disconnection and Qemu therefore start the vhost_dev, acked_features field in vhost_dev is initialized with value fetched from acked_features field in NetVhostUserState, which should be up-to-date at that moment but Qemu could not make it actually during the time window of virtio features negotiation.
So we save the acked_features right after being configured by guest virtio driver so it can be used to restore acked_features field in vhost_dev correctly.
Message-Id: <b9f8cf5561a79ea65ea38960e5a5e6d3707eef0a.1671627406.git.huangy81@chinatelecom.cn>
--- include/net/vhost_net.h | 2 ++ hw/net/vhost_net-stub.c | 5 +++++ hw/net/vhost_net.c | 9 +++++++++ hw/net/virtio-net.c | 6 ++++++ 4 files changed, 22 insertions(+)
include/net/vhost_net.h +2 -0
@@ -52,4 +52,6 @@ void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc, int vq_index);int vhost_net_virtqueue_restart (VirtIODevice *vdev,NetClientState *nc,int vq_index); + +void vhost_net_save_acked_features (NetClientState *nc);#endif
hw/net/vhost_net-stub.c +5 -0
@@ -113,3 +113,8 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc, {return 0 ; } + +void vhost_net_save_acked_features (NetClientState *nc) +{ + +}
hw/net/vhost_net.c +9 -0
@@ -144,6 +144,15 @@ uint64_t vhost_net_get_acked_features(VHostNetState *net)return net->dev.acked_features; } +void vhost_net_save_acked_features (NetClientState *nc) +{ +#ifdef CONFIG_VHOST_NET_USER +if (nc->info->type ==NET_CLIENT_DRIVER_VHOST_USER ) { +vhost_user_save_acked_features (nc); + } +#endif +} +static int vhost_net_get_fd (NetClientState *backend) {switch (backend->info->type) {
hw/net/virtio-net.c +6 -0
@@ -984,6 +984,12 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)continue ; }vhost_net_ack_features (get_vhost_net (nc->peer), features); + +/* +* keep acked_features in NetVhostUserState up-to-date so it +* can't miss any features configured by guest virtio driver. +*/ +vhost_net_save_acked_features (nc->peer); }if (virtio_has_feature (features,VIRTIO_NET_F_CTRL_VLAN )) {
Signature · 1 line
MST
[PULL 51/51] vhost-scsi: fix memleak of vsc->inflight
In reply to Michael S. TsirkinFrom: Dongli Zhang <[email protected]>
This is below memleak detected when to quit the qemu-system-x86_64 (with vhost-scsi-pci).
(qemu) quit
=================================================================
==15568==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f00aec57917 in __interceptor_calloc (/lib64/libasan.so.6+0xb4917)
#1 0x7f00ada0d7b5 in g_malloc0 (/lib64/libglib-2.0.so.0+0x517b5)
#2 0x5648ffd38bac in vhost_scsi_start ../hw/scsi/vhost-scsi.c:92
#3 0x5648ffd38d52 in vhost_scsi_set_status ../hw/scsi/vhost-scsi.c:131
#4 0x5648ffda340e in virtio_set_status ../hw/virtio/virtio.c:2036
#5 0x5648ff8de281 in virtio_ioport_write ../hw/virtio/virtio-pci.c:431
#6 0x5648ff8deb29 in virtio_pci_config_write ../hw/virtio/virtio-pci.c:576
#7 0x5648ffe5c0c2 in memory_region_write_accessor ../softmmu/memory.c:493
#8 0x5648ffe5c424 in access_with_adjusted_size ../softmmu/memory.c:555
#9 0x5648ffe6428f in memory_region_dispatch_write ../softmmu/memory.c:1515
#10 0x5648ffe8613d in flatview_write_continue ../softmmu/physmem.c:2825
#11 0x5648ffe86490 in flatview_write ../softmmu/physmem.c:2867
#12 0x5648ffe86d9f in address_space_write ../softmmu/physmem.c:2963
#13 0x5648ffe86e57 in address_space_rw ../softmmu/physmem.c:2973
#14 0x5648fffbfb3d in kvm_handle_io ../accel/kvm/kvm-all.c:2639
#15 0x5648fffc0e0d in kvm_cpu_exec ../accel/kvm/kvm-all.c:2890
#16 0x5648fffc90a7 in kvm_vcpu_thread_fn ../accel/kvm/kvm-accel-ops.c:51
#17 0x56490042400a in qemu_thread_start ../util/qemu-thread-posix.c:505
#18 0x7f00ac3b6ea4 in start_thread (/lib64/libpthread.so.0+0x7ea4)Free the vsc->inflight at the 'stop' path.
Message-Id: <[email protected]>
--- hw/scsi/vhost-scsi-common.c | 1 + 1 file changed, 1 insertion(+)
hw/scsi/vhost-scsi-common.c +1 -0
@@ -113,6 +113,7 @@ void vhost_scsi_common_stop(VHostSCSICommon *vsc)if (vsc->inflight) {vhost_dev_free_inflight (vsc->inflight); +g_free (vsc->inflight); vsc->inflight =NULL ; }
Signature · 1 line
MST
[PULL 16/51] virtio-pci: decouple notifier from interrupt process
In reply to Michael S. TsirkinFrom: Cindy Lu <[email protected]>
To reuse the notifier process. We add the virtio_pci_get_notifier to get the notifier and vector. The INPUT for this function is IDX, The OUTPUT is the notifier and the vector
Message-Id: <[email protected]>
--- hw/virtio/virtio-pci.c | 88 +++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 31 deletions(-)
hw/virtio/virtio-pci.c +57 -31
@@ -813,29 +813,41 @@ static void kvm_virtio_pci_vq_vector_release(VirtIOPCIProxy *proxy, }static int kvm_virtio_pci_irqfd_use (VirtIOPCIProxy *proxy, -unsigned int queue_no, +EventNotifier *n,unsigned int vector) {VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector]; -VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); -VirtQueue *vq =virtio_get_queue (vdev, queue_no); -EventNotifier *n =virtio_queue_get_guest_notifier (vq);return kvm_irqchip_add_irqfd_notifier_gsi (kvm_state, n,NULL , irqfd->virq); }static void kvm_virtio_pci_irqfd_release (VirtIOPCIProxy *proxy, -unsigned int queue_no, +EventNotifier *n ,unsigned int vector) { -VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); -VirtQueue *vq =virtio_get_queue (vdev, queue_no); -EventNotifier *n =virtio_queue_get_guest_notifier (vq);VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector];int ret; ret =kvm_irqchip_remove_irqfd_notifier_gsi (kvm_state, n, irqfd->virq);assert (ret ==0 ); } +static int virtio_pci_get_notifier (VirtIOPCIProxy *proxy,int queue_no, +EventNotifier **n,unsigned int *vector) +{ +VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus); +VirtQueue *vq; + +if (queue_no ==VIRTIO_CONFIG_IRQ_IDX ) { +return -1 ; + }else { +if (!virtio_queue_get_num (vdev, queue_no)) { +return -1 ; + } + *vector =virtio_queue_vector (vdev, queue_no); + vq =virtio_get_queue (vdev, queue_no); + *n =virtio_queue_get_guest_notifier (vq); + } +return 0 ; +}static int kvm_virtio_pci_vector_use (VirtIOPCIProxy *proxy,int nvqs) {
@@ -844,12 +856,15 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs)VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev);unsigned int vector;int ret, queue_no; - +EventNotifier *n;for (queue_no =0 ; queue_no < nvqs; queue_no++) {if (!virtio_queue_get_num (vdev, queue_no)) {break ; } - vector =virtio_queue_vector (vdev, queue_no); + ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); +if (ret <0 ) { +break ; + }if (vector >=msix_nr_vectors_allocated (dev)) {continue ; }
@@ -861,7 +876,7 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs)* Otherwise, delay until unmasked in the frontend. */ if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =kvm_virtio_pci_irqfd_use (proxy, queue_no, vector); + ret =kvm_virtio_pci_irqfd_use (proxy, n, vector);if (ret <0 ) {kvm_virtio_pci_vq_vector_release (proxy, vector); goto undo;
@@ -877,7 +892,11 @@ undo:continue ; }if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { -kvm_virtio_pci_irqfd_release (proxy, queue_no, vector); + ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); +if (ret <0 ) { +break ; + } +kvm_virtio_pci_irqfd_release (proxy, n, vector); }kvm_virtio_pci_vq_vector_release (proxy, vector); }
@@ -891,12 +910,16 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs)unsigned int vector;int queue_no;VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev); - +EventNotifier *n; +int ret ;for (queue_no =0 ; queue_no < nvqs; queue_no++) {if (!virtio_queue_get_num (vdev, queue_no)) {break ; } - vector =virtio_queue_vector (vdev, queue_no); + ret =virtio_pci_get_notifier (proxy, queue_no, &n, &vector); +if (ret <0 ) { +break ; + }if (vector >=msix_nr_vectors_allocated (dev)) {continue ; }
@@ -904,21 +927,20 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs)* Otherwise, it was cleaned when masked in the frontend. */ if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { -kvm_virtio_pci_irqfd_release (proxy, queue_no, vector); +kvm_virtio_pci_irqfd_release (proxy, n, vector); }kvm_virtio_pci_vq_vector_release (proxy, vector); } } -static int virtio_pci_vq_vector_unmask (VirtIOPCIProxy *proxy, +static int virtio_pci_one_vector_unmask (VirtIOPCIProxy *proxy,unsigned int queue_no,unsigned int vector, -MSIMessage msg) +MSIMessage msg, +EventNotifier *n) {VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus);VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev); -VirtQueue *vq =virtio_get_queue (vdev, queue_no); -EventNotifier *n =virtio_queue_get_guest_notifier (vq);VirtIOIRQFD *irqfd;int ret =0 ;
@@ -945,14 +967,15 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy,event_notifier_set (n); } }else { - ret =kvm_virtio_pci_irqfd_use (proxy, queue_no, vector); + ret =kvm_virtio_pci_irqfd_use (proxy, n, vector); }return ret; } -static void virtio_pci_vq_vector_mask (VirtIOPCIProxy *proxy, +static void virtio_pci_one_vector_mask (VirtIOPCIProxy *proxy,unsigned int queue_no, -unsigned int vector) +unsigned int vector, +EventNotifier *n) {VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus);VirtioDeviceClass *k =VIRTIO_DEVICE_GET_CLASS (vdev);
@@ -963,7 +986,7 @@ static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *proxy,if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { k->guest_notifier_mask (vdev, queue_no, true); }else { -kvm_virtio_pci_irqfd_release (proxy, queue_no, vector); +kvm_virtio_pci_irqfd_release (proxy, n, vector); } }
@@ -973,6 +996,7 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector,VirtIOPCIProxy *proxy =container_of (dev, VirtIOPCIProxy, pci_dev);VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus);VirtQueue *vq =virtio_vector_first_queue (vdev, vector); +EventNotifier *n;int ret, index, unmasked =0 ;while (vq) {
@@ -981,7 +1005,8 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector,break ; }if (index < proxy->nvqs_with_notifiers) { - ret =virtio_pci_vq_vector_unmask (proxy, index, vector, msg); + n =virtio_queue_get_guest_notifier (vq); + ret =virtio_pci_one_vector_unmask (proxy, index, vector, msg, n);if (ret <0 ) { goto undo; }
@@ -997,7 +1022,8 @@ undo:while (vq && unmasked >=0 ) { index =virtio_get_queue_index (vq);if (index < proxy->nvqs_with_notifiers) { -virtio_pci_vq_vector_mask (proxy, index, vector); + n =virtio_queue_get_guest_notifier (vq); +virtio_pci_one_vector_mask (proxy, index, vector, n); --unmasked; } vq =virtio_vector_next_queue (vq);
@@ -1010,15 +1036,17 @@ static void virtio_pci_vector_mask(PCIDevice *dev, unsigned vector)VirtIOPCIProxy *proxy =container_of (dev, VirtIOPCIProxy, pci_dev);VirtIODevice *vdev =virtio_bus_get_device (&proxy->bus);VirtQueue *vq =virtio_vector_first_queue (vdev, vector); +EventNotifier *n;int index;while (vq) { index =virtio_get_queue_index (vq); + n =virtio_queue_get_guest_notifier (vq);if (!virtio_queue_get_num (vdev, index)) {break ; }if (index < proxy->nvqs_with_notifiers) { -virtio_pci_vq_vector_mask (proxy, index, vector); +virtio_pci_one_vector_mask (proxy, index, vector, n); } vq =virtio_vector_next_queue (vq); }
@@ -1034,19 +1062,17 @@ static void virtio_pci_vector_poll(PCIDevice *dev,int queue_no;unsigned int vector;EventNotifier *notifier; -VirtQueue *vq; +int ret;for (queue_no =0 ; queue_no < proxy->nvqs_with_notifiers; queue_no++) { -if (!virtio_queue_get_num (vdev, queue_no)) { + ret =virtio_pci_get_notifier (proxy, queue_no, ¬ifier, &vector); +if (ret <0 ) {break ; } - vector =virtio_queue_vector (vdev, queue_no);if (vector < vector_start || vector >= vector_end || !msix_is_masked (dev, vector)) {continue ; } - vq =virtio_get_queue (vdev, queue_no); - notifier =virtio_queue_get_guest_notifier (vq);if (k->guest_notifier_pending) {if (k->guest_notifier_pending (vdev, queue_no)) {msix_set_pending (dev, vector);
Signature · 1 line
MST
[PULL 33/51] include/hw/cxl: Break inclusion loop cxl_pci.h and cxl_cdat_h
In reply to Michael S. TsirkinFrom: Markus Armbruster <[email protected]>
hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. The former doesn't actually need the latter, so drop that inclusion to break the loop.
Message-Id: <[email protected]>
--- include/hw/cxl/cxl_pci.h | 1 - 1 file changed, 1 deletion(-)
include/hw/cxl/cxl_pci.h +0 -1
@@ -11,7 +11,6 @@#define CXL_PCI_H #include "qemu/compiler.h" -#include "hw/cxl/cxl_cdat.h" #define CXL_VENDOR_ID 0x1e98
Signature · 1 line
MST
Re: [PULL 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
In reply to Michael S. TsirkinQuoted 1 line · Michael S. Tsirkin
From: Laszlo Ersek <[email protected]>
I noticed v2 is forthcoming. dropped now.
Quoted 9 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
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
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47 now - I dropped one patch as v2 is forthcoming.
Quoted 319 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Bernhard Beschow (7):
hw/acpi/Kconfig: RenameACPI_X86_ICHtoACPI_ICH9hw/acpi/Kconfig: Add missing dependencies toACPI_ICH9hw/acpi/Kconfig: Do not needlessly buildTYPE_PIIX4_PMin non-PC/Malta machines hw/acpi/Kconfig: Add missing dependencies toACPI_PIIX4hw/isa/Kconfig: Add missing dependency to VT82C686
i386, mips: Resolve redundant ACPI and APM dependencies hw/ppc/Kconfig: Remove unused dependencies from PEGASOS2Cindy Lu (10):
virtio: introduce macroVIRTIO_CONFIG_IRQ_IDX
virtio-pci: decouple notifier from interrupt process
virtio-pci: decouple the single vector from the interrupt process
vhost: introduce new VhostOpsvhost_set_config_call
vhost-vdpa: add support for config interrupt
virtio: add support for configure interrupt
vhost: add support for configure interrupt
virtio-net: add support for configure interrupt
virtio-mmio: add support for configure interrupt
virtio-pci: add support for configure interruptDongli Zhang (1):
vhost-scsi: fix memleak of vsc->inflightEugenio Pérez (4):
virtio_net: Modifyvirtio_net_get_configto early return
virtio_net: copyVIRTIO_NET_S_ANNOUNCEif device model has it
vdpa: handleVIRTIO_NET_CTRL_ANNOUNCEinvhost_vdpa_net_handle_ctrl_avail
vdpa: do not handleVIRTIO_NET_F_GUEST_ANNOUNCEin vhost-vdpaHyman Huang (3):
vhost-user: Refactor vhost acked features saving
vhost-user: Refactor thechr_closed_bh
vhost-user: Fix the virtio features negotiation flawLaszlo Ersek (1):
acpi: cpuhp: fix guest-visible maximum access size to the legacy reg blockLongpeng (Mike) (5):
vdpa-dev: get iova range explicitly
vdpa: harden the error path ifget_iova_rangefailed
vhost: simplifyvhost_dev_enable_notifiers
vhost: configure all host notifiers in a single MR transaction
vdpa: commit all host notifier MRs in a single MR transactionMarkus Armbruster (11):
include/hw/pci: Break inclusion looppci_bridge.handcxl.hinclude/hw/cxl: Move typedef PXBDev tocxl.h, and put it to useinclude/hw/cxl: Include hw/cxl/*.h where neededinclude/hw/pci: Clean up a few things checkpatch.pl would flaginclude/hw/pci: Splitpci_device.hoffpci.hinclude/hw/pci: Includehw/pci/pci.hwhere neededinclude/hw/cxl: Break inclusion loopcxl_pci.handcxl_cdat_hinclude/hw/virtio: Break inclusion loop
include: Include headers where needed
include: Don't includeqemu/osdep.h
docs/devel: Rules on #include in headersPhilippe Mathieu-Daudé (2):
hw/virtio: Renamevirtio_device_find()->qmp_find_virtio_device()hw/virtio: Extract QMP QOM-specific functions tovirtio-qmp.cYicong Yang (6):
tests: virt: Allow changes to PPTT test table hw/acpi/aml-build: Only generate cluster node in PPTT when specified
tests: virt: Update expected ACPI tables for virt test
tests: acpi: Add and whitelist *.topology blobs
tests: acpi: aarch64: Add topology test for aarch64
tests: acpi: aarch64: Add *.topology tablesleixiang (1):
virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiersconfigs/devices/mips-softmmu/common.mak | 3 - bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - hw/alpha/alpha_sys.h | 1 - hw/display/ati_int.h | 2 +- hw/display/qxl.h | 3 +- hw/ide/ahci_internal.h | 2 +- hw/net/vmxnet3_defs.h | 2 +- hw/nvme/nvme.h | 2 +- hw/rdma/rdma_utils.h | 1 - hw/rdma/vmw/pvrdma.h | 2 +- hw/scsi/mptsas.h | 2 +- hw/usb/hcd-ehci.h | 3 +- hw/usb/hcd-uhci.h | 2 +- hw/usb/hcd-xhci-pci.h | 1 + hw/vfio/pci.h | 2 +- hw/virtio/virtio-qmp.h | 10 + hw/xen/xen_pt.h | 1 - include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h | 3 + include/hw/acpi/piix4.h | 2 +- include/hw/arm/allwinner-a10.h | 1 + include/hw/boards.h | 3 + include/hw/char/cmsdk-apb-uart.h | 1 + include/hw/char/goldfish_tty.h | 1 + include/hw/char/xilinx_uartlite.h | 1 + include/hw/cris/etraxfs.h | 1 + include/hw/cxl/cxl.h | 5 +- include/hw/cxl/cxl_cdat.h | 1 + include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h | 2 + include/hw/cxl/cxl_host.h | 1 - include/hw/cxl/cxl_pci.h | 3 - include/hw/display/macfb.h | 3 +- include/hw/dma/sifive_pdma.h | 2 + include/hw/i386/ich9.h | 4 - include/hw/i386/ioapic_internal.h | 1 + include/hw/i386/sgx-epc.h | 1 + include/hw/i386/x86-iommu.h | 1 - include/hw/ide/pci.h | 2 +- include/hw/input/pl050.h | 1 - include/hw/intc/goldfish_pic.h | 2 + include/hw/intc/loongarch_pch_msi.h | 2 + include/hw/intc/loongarch_pch_pic.h | 2 + include/hw/intc/nios2_vic.h | 2 + include/hw/isa/vt82c686.h | 1 - include/hw/misc/macio/macio.h | 2 +- include/hw/misc/mchp_pfsoc_dmc.h | 2 + include/hw/misc/mchp_pfsoc_ioscb.h | 2 + include/hw/misc/mchp_pfsoc_sysreg.h | 2 + include/hw/misc/pvpanic.h | 1 + include/hw/misc/sifive_e_prci.h | 3 +- include/hw/misc/sifive_u_otp.h | 3 +- include/hw/misc/sifive_u_prci.h | 3 +- include/hw/misc/virt_ctrl.h | 2 + include/hw/misc/xlnx-versal-pmc-iou-slcr.h | 1 + include/hw/net/lasi_82596.h | 2 +- include/hw/net/xlnx-zynqmp-can.h | 1 + include/hw/pci-host/designware.h | 3 - include/hw/pci-host/gpex.h | 2 +- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/ls7a.h | 2 - include/hw/pci-host/pnv_phb3.h | 2 - include/hw/pci-host/pnv_phb4.h | 3 +- include/hw/pci-host/q35.h | 2 +- include/hw/pci-host/sabre.h | 2 +- include/hw/pci-host/xilinx-pcie.h | 1 - include/hw/pci/msi.h | 2 +- include/hw/pci/pci.h | 341 --------------------------- include/hw/pci/pci_bridge.h | 3 +- include/hw/pci/pci_device.h | 350 ++++++++++++++++++++++++++++ include/hw/pci/pcie.h | 1 - include/hw/pci/pcie_port.h | 1 + include/hw/pci/pcie_sriov.h | 2 + include/hw/pci/shpc.h | 2 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/remote/iohub.h | 2 +- include/hw/remote/proxy.h | 2 +- include/hw/riscv/boot_opensbi.h | 2 + include/hw/riscv/microchip_pfsoc.h | 3 + include/hw/riscv/numa.h | 1 + include/hw/riscv/sifive_u.h | 2 + include/hw/riscv/spike.h | 2 +- include/hw/riscv/virt.h | 2 +- include/hw/sd/sdhci.h | 2 +- include/hw/southbridge/piix.h | 3 +- include/hw/ssi/sifive_spi.h | 3 + include/hw/timer/sse-timer.h | 1 + include/hw/tricore/triboard.h | 1 - include/hw/usb/hcd-dwc3.h | 1 + include/hw/usb/hcd-musb.h | 2 + include/hw/usb/xlnx-usb-subsystem.h | 2 + include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 3 + include/hw/virtio/vhost-backend.h | 3 + include/hw/virtio/vhost-vdpa.h | 2 + include/hw/virtio/vhost.h | 4 + include/hw/virtio/virtio-mmio.h | 2 +- include/hw/virtio/virtio-pci.h | 4 +- include/hw/virtio/virtio-scsi.h | 1 - include/hw/virtio/virtio.h | 8 +- include/hw/xen/xen_common.h | 2 +- include/net/vhost-user.h | 1 + include/net/vhost_net.h | 4 + include/qemu/plugin-memory.h | 3 + include/qemu/userfaultfd.h | 1 - include/sysemu/dirtyrate.h | 2 + include/sysemu/dump.h | 1 + include/user/syscall-trace.h | 1 + net/vmnet_int.h | 1 - qga/cutils.h | 1 - target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - hw/acpi/aml-build.c | 2 +- hw/acpi/cpu_hotplug.c | 3 + hw/acpi/erst.c | 2 +- hw/alpha/pci.c | 1 + hw/alpha/typhoon.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/char/serial-pci-multi.c | 2 +- hw/char/serial-pci.c | 2 +- hw/core/machine-smp.c | 2 + hw/core/qdev-properties-system.c | 1 + hw/display/bochs-display.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/sm501.c | 2 +- hw/display/vga-pci.c | 2 +- hw/display/vhost-user-gpu.c | 18 ++ hw/display/vmware_vga.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/pci_ipmi_bt.c | 2 +- hw/ipmi/pci_ipmi_kcs.c | 2 +- hw/isa/i82378.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/net/can/can_kvaser_pci.c | 2 +- hw/net/can/can_mioe3680_pci.c | 2 +- hw/net/can/can_pcm3680_pci.c | 2 +- hw/net/can/ctucan_pci.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000x_common.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/net_tx_pkt.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rocker/rocker_desc.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/vhost_net-stub.c | 14 ++ hw/net/vhost_net.c | 18 ++ hw/net/virtio-net.c | 60 +++-- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 1 - hw/pci-host/bonito.c | 2 +- hw/pci-host/dino.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/raven.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci-hmp-cmds.c | 1 + hw/pci/pcie_host.c | 2 +- hw/pci/pcie_sriov.c | 2 +- hw/pci/slotid_cap.c | 2 +- hw/ppc/ppc440_pcix.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 1 + hw/rdma/rdma_utils.c | 1 + hw/s390x/s390-pci-inst.c | 1 + hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/scsi/vhost-scsi-common.c | 1 + hw/scsi/virtio-scsi.c | 1 + hw/smbios/smbios.c | 1 + hw/usb/hcd-ohci-pci.c | 2 +- hw/virtio/vdpa-dev.c | 9 + hw/virtio/vhost-user-fs.c | 18 ++ hw/virtio/vhost-user-gpio.c | 10 + hw/virtio/vhost-vdpa.c | 40 +++- hw/virtio/vhost-vsock-common.c | 18 ++ hw/virtio/vhost.c | 122 ++++++++-- hw/virtio/virtio-crypto.c | 18 ++ hw/virtio/virtio-mmio.c | 27 +++ hw/virtio/virtio-pci.c | 305 ++++++++++++++++-------- hw/virtio/virtio-qmp.c | 192 ++++++++++++++- hw/virtio/virtio.c | 225 +++--------------- hw/watchdog/wdt_i6300esb.c | 2 +- net/vhost-user.c | 27 ++- net/vhost-vdpa.c | 32 +-- qga/cutils.c | 3 +- tests/qtest/bios-tables-test.c | 19 ++ tests/qtest/fuzz/generic_fuzz.c | 1 + ui/util.c | 2 +- docs/devel/style.rst | 7 + hw/acpi/Kconfig | 9 +- hw/acpi/meson.build | 2 +- hw/i2c/meson.build | 2 +- hw/i386/Kconfig | 3 +- hw/isa/Kconfig | 4 +- hw/ppc/Kconfig | 2 - hw/virtio/trace-events | 1 + qemu-options.hx | 3 + tests/data/acpi/virt/APIC.topology | Bin 0 -> 732 bytes tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes tests/data/acpi/virt/PPTT | Bin 96 -> 76 bytes tests/data/acpi/virt/PPTT.acpihmatvirt | Bin 196 -> 156 bytes tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes 217 files changed, 1418 insertions(+), 839 deletions(-) create mode 100644 include/hw/pci/pci_device.h create mode 100644 tests/data/acpi/virt/APIC.topology create mode 100644 tests/data/acpi/virt/DSDT.topology create mode 100644 tests/data/acpi/virt/PPTT.topology
Re: [PULL 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
In reply to Michael S. TsirkinQuoted 5 lines · Michael S. Tsirkin
Quoted 1 line · Michael S. Tsirkin
From: Laszlo Ersek <[email protected]>
I noticed v2 is forthcoming. dropped now.
Yes, thanks.
I'm picking up the "Reviewed-by: Michael S. Tsirkin <[email protected]>" tag from your commit message. I'm not taking the "Fixes:" tag, originally suggested by Phil, because we've agreed that that was not correct. The other tags (from Igor, Phil and Ard) I've picked up already, and I've updated the commit message too. I'll post v2 soon.
Thanks!
Laszlo
Re: [PULL 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
Quoted 7 lines · Laszlo Ersek
Quoted 5 lines · Michael S. Tsirkin
Quoted 1 line · Michael S. Tsirkin
From: Laszlo Ersek <[email protected]>
I noticed v2 is forthcoming. dropped now.
Quoted 6 lines
Yes, thanks.
I'm picking up the "Reviewed-by: Michael S. Tsirkin <[email protected]>" tag from your commit message. I'm not taking the "Fixes:" tag, originally suggested by Phil, because we've agreed that that was not correct.
I suppose the tool MST is using automatically included the Fixes: tag.
Quoted 6 lines
The other tags (from Igor, Phil and Ard) I've picked up already, and I've updated the commit message too. I'll post v2 soon.
Thanks!
Laszlo
[PULL v2 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
In reply to Michael S. TsirkinFrom: Laszlo Ersek <[email protected]>
The modern ACPI CPU hotplug interface was introduced in the following series (aa1dd39ca307..679dd1a957df), released in v2.7.0:
1 abd49bc2ed2f docs: update ACPI CPU hotplug spec with new protocol 2 16bcab97eb9f pc: piix4/ich9: add 'cpu-hotplug-legacy' property 3 5e1b5d93887b acpi: cpuhp: add CPU devices AML with _STA method 4 ac35f13ba8f8 pc: acpi: introduce AcpiDeviceIfClass.madt_cpu hook 5 d2238cb6781d acpi: cpuhp: implement hot-add parts of CPU hotplug
interface
6 8872c25a26cc acpi: cpuhp: implement hot-remove parts of CPU hotplug
interface
7 76623d00ae57 acpi: cpuhp: add cpu._OST handling
8 679dd1a957df pc: use new CPU hotplug interface since 2.7 machine type
Before patch#1, "docs/specs/acpi_cpu_hotplug.txt" only specified 1-byte accesses for the hotplug register block. Patch#1 preserved the same restriction for the legacy register block, but:
- it specified DWORD accesses for some of the modern registers,
- in particular, the switch from the legacy block to the modern block would require a DWORD write to the *legacy* block.
The latter functionality was then implemented in cpu_status_write() [hw/acpi/cpu_hotplug.c], in patch#8.
Unfortunately, all DWORD accesses depended on a dormant bug: the one introduced in earlier commit a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid", 2013-05-29); first released in v1.6.0. Due to commit a014ed07bd5a, the DWORD accesses to the *legacy* CPU hotplug register block would work in spite of the above series *not* relaxing "valid.max_access_size = 1" in "hw/acpi/cpu_hotplug.c":
Quoted 9 lines
static const MemoryRegionOps AcpiCpuHotplug_ops = {
.read = cpu_status_read,
.write = cpu_status_write,
.endianness = DEVICE_LITTLE_ENDIAN,
.valid = {
.min_access_size = 1,
.max_access_size = 1,
},
};Later, in commits e6d0c3ce6895 ("acpi: cpuhp: introduce 'Command data 2' field", 2020-01-22) and ae340aa3d256 ("acpi: cpuhp: spec: add typical usecases", 2020-01-22), first released in v5.0.0, the modern CPU hotplug interface (including the documentation) was extended with another DWORD *read* access, namely to the "Command data 2" register, which would be important for the guest to confirm whether it managed to switch the register block from legacy to modern.
This functionality too silently depended on the bug from commit a014ed07bd5a.
In commit 5d971f9e6725 ('memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"', 2020-06-26), first released in v5.1.0, the bug from commit a014ed07bd5a was fixed (the commit was reverted). That swiftly exposed the bug in "AcpiCpuHotplug_ops", still present from the v2.7.0 series quoted at the top -- namely the fact that "valid.max_access_size = 1" didn't match what the guest was supposed to do, according to the spec ("docs/specs/acpi_cpu_hotplug.txt").
The symptom is that the "modern interface negotiation protocol" described in commit ae340aa3d256:
Review
Quoted 9 lines
(quoted diff) +9
-0+ Use following steps to detect and enable modern CPU hotplug interface: + 1. Store 0x0 to the 'CPU selector' register, + attempting to switch to modern mode + 2. Store 0x0 to the 'CPU selector' register, + to ensure valid selector value + 3. Store 0x0 to the 'Command field' register, + 4. Read the 'Command data 2' register. + If read value is 0x0, the modern interface is enabled. + Otherwise legacy or no CPU hotplug interface available
falls apart for the guest: steps 1 and 2 are lost, because they are DWORD writes; so no switching happens. Step 3 (a single-byte write) is not lost, but it has no effect; see the condition in cpu_status_write() in patch#8. And step 4 *misleads* the guest into thinking that the switch
worked: the DWORD read is lost again -- it returns zero to the guest without ever reaching the device model, so the guest never learns the switch didn't work.
This means that guest behavior centered on the "Command data 2" register worked *only* in the v5.0.0 release; it got effectively regressed in v5.1.0.
To make things *even more* complicated, the breakage was (and remains, as of today) visible with TCG acceleration only. Commit 5d971f9e6725 makes no difference with KVM acceleration -- the DWORD accesses still work, despite "valid.max_access_size = 1".
As commit 5d971f9e6725 suggests, fix the problem by raising "valid.max_access_size" to 4 -- the spec now clearly instructs the guest to perform DWORD accesses to the legacy register block too, for enabling (and verifying!) the modern block. In order to keep compatibility for the device model implementation though, set "impl.max_access_size = 1", so that wide accesses be split before they reach the legacy read/write handlers, like they always have been on KVM, and like they were on TCG before 5d971f9e6725 (v5.1.0).
Tested with:
- OVMF IA32 + qemu-system-i386, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test);
- OVMF IA32X64 + qemu-system-x86_64, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test);
- OVMF IA32 + qemu-system-i386, SMM enabled, using TCG accel; verified the register block switch and the present/possible CPU counting through the modern hotplug interface, during OVMF boot (bugfix test);
- I do not have any testcase (guest payload) for regression-testing CPU hotplug through the *legacy* CPU hotplug register block.
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Ani Sinha <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: [email protected]
Ref: "IO port write width clamping differs between TCG and KVM"
Message-Id: <[email protected]>
--- hw/acpi/cpu_hotplug.c | 3 +++ 1 file changed, 3 insertions(+)
hw/acpi/cpu_hotplug.c +3 -0
@@ -52,6 +52,9 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = { .endianness = DEVICE_LITTLE_ENDIAN, .valid = { .min_access_size = 1, + .max_access_size = 4, + }, + .impl = { .max_access_size = 1, }, };
Signature · 1 line
MST
Quoted 5 lines · Michael S. Tsirkin
Quoted 4 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
Quoted 8 lines
Quoted 5 lines
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
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.
And now it's c46dcec9f699508e811cb6a140250d07486b0e41 as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(
Quoted 320 lines
Quoted 320 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Bernhard Beschow (7):
hw/acpi/Kconfig: RenameACPI_X86_ICHtoACPI_ICH9hw/acpi/Kconfig: Add missing dependencies toACPI_ICH9hw/acpi/Kconfig: Do not needlessly buildTYPE_PIIX4_PMin non-PC/Malta machines hw/acpi/Kconfig: Add missing dependencies toACPI_PIIX4hw/isa/Kconfig: Add missing dependency to VT82C686
i386, mips: Resolve redundant ACPI and APM dependencies hw/ppc/Kconfig: Remove unused dependencies from PEGASOS2Cindy Lu (10):
virtio: introduce macroVIRTIO_CONFIG_IRQ_IDX
virtio-pci: decouple notifier from interrupt process
virtio-pci: decouple the single vector from the interrupt process
vhost: introduce new VhostOpsvhost_set_config_call
vhost-vdpa: add support for config interrupt
virtio: add support for configure interrupt
vhost: add support for configure interrupt
virtio-net: add support for configure interrupt
virtio-mmio: add support for configure interrupt
virtio-pci: add support for configure interruptDongli Zhang (1):
vhost-scsi: fix memleak of vsc->inflightEugenio Pérez (4):
virtio_net: Modifyvirtio_net_get_configto early return
virtio_net: copyVIRTIO_NET_S_ANNOUNCEif device model has it
vdpa: handleVIRTIO_NET_CTRL_ANNOUNCEinvhost_vdpa_net_handle_ctrl_avail
vdpa: do not handleVIRTIO_NET_F_GUEST_ANNOUNCEin vhost-vdpaHyman Huang (3):
vhost-user: Refactor vhost acked features saving
vhost-user: Refactor thechr_closed_bh
vhost-user: Fix the virtio features negotiation flawLaszlo Ersek (1):
acpi: cpuhp: fix guest-visible maximum access size to the legacy reg blockLongpeng (Mike) (5):
vdpa-dev: get iova range explicitly
vdpa: harden the error path ifget_iova_rangefailed
vhost: simplifyvhost_dev_enable_notifiers
vhost: configure all host notifiers in a single MR transaction
vdpa: commit all host notifier MRs in a single MR transactionMarkus Armbruster (11):
include/hw/pci: Break inclusion looppci_bridge.handcxl.hinclude/hw/cxl: Move typedef PXBDev tocxl.h, and put it to useinclude/hw/cxl: Include hw/cxl/*.h where neededinclude/hw/pci: Clean up a few things checkpatch.pl would flaginclude/hw/pci: Splitpci_device.hoffpci.hinclude/hw/pci: Includehw/pci/pci.hwhere neededinclude/hw/cxl: Break inclusion loopcxl_pci.handcxl_cdat_hinclude/hw/virtio: Break inclusion loop
include: Include headers where needed
include: Don't includeqemu/osdep.h
docs/devel: Rules on #include in headersPhilippe Mathieu-Daudé (2):
hw/virtio: Renamevirtio_device_find()->qmp_find_virtio_device()hw/virtio: Extract QMP QOM-specific functions tovirtio-qmp.cYicong Yang (6):
tests: virt: Allow changes to PPTT test table hw/acpi/aml-build: Only generate cluster node in PPTT when specified
tests: virt: Update expected ACPI tables for virt test
tests: acpi: Add and whitelist *.topology blobs
tests: acpi: aarch64: Add topology test for aarch64
tests: acpi: aarch64: Add *.topology tablesleixiang (1):
virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiersconfigs/devices/mips-softmmu/common.mak | 3 - bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - hw/alpha/alpha_sys.h | 1 - hw/display/ati_int.h | 2 +- hw/display/qxl.h | 3 +- hw/ide/ahci_internal.h | 2 +- hw/net/vmxnet3_defs.h | 2 +- hw/nvme/nvme.h | 2 +- hw/rdma/rdma_utils.h | 1 - hw/rdma/vmw/pvrdma.h | 2 +- hw/scsi/mptsas.h | 2 +- hw/usb/hcd-ehci.h | 3 +- hw/usb/hcd-uhci.h | 2 +- hw/usb/hcd-xhci-pci.h | 1 + hw/vfio/pci.h | 2 +- hw/virtio/virtio-qmp.h | 10 + hw/xen/xen_pt.h | 1 - include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h | 3 + include/hw/acpi/piix4.h | 2 +- include/hw/arm/allwinner-a10.h | 1 + include/hw/boards.h | 3 + include/hw/char/cmsdk-apb-uart.h | 1 + include/hw/char/goldfish_tty.h | 1 + include/hw/char/xilinx_uartlite.h | 1 + include/hw/cris/etraxfs.h | 1 + include/hw/cxl/cxl.h | 5 +- include/hw/cxl/cxl_cdat.h | 1 + include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h | 2 + include/hw/cxl/cxl_host.h | 1 - include/hw/cxl/cxl_pci.h | 3 - include/hw/display/macfb.h | 3 +- include/hw/dma/sifive_pdma.h | 2 + include/hw/i386/ich9.h | 4 - include/hw/i386/ioapic_internal.h | 1 + include/hw/i386/sgx-epc.h | 1 + include/hw/i386/x86-iommu.h | 1 - include/hw/ide/pci.h | 2 +- include/hw/input/pl050.h | 1 - include/hw/intc/goldfish_pic.h | 2 + include/hw/intc/loongarch_pch_msi.h | 2 + include/hw/intc/loongarch_pch_pic.h | 2 + include/hw/intc/nios2_vic.h | 2 + include/hw/isa/vt82c686.h | 1 - include/hw/misc/macio/macio.h | 2 +- include/hw/misc/mchp_pfsoc_dmc.h | 2 + include/hw/misc/mchp_pfsoc_ioscb.h | 2 + include/hw/misc/mchp_pfsoc_sysreg.h | 2 + include/hw/misc/pvpanic.h | 1 + include/hw/misc/sifive_e_prci.h | 3 +- include/hw/misc/sifive_u_otp.h | 3 +- include/hw/misc/sifive_u_prci.h | 3 +- include/hw/misc/virt_ctrl.h | 2 + include/hw/misc/xlnx-versal-pmc-iou-slcr.h | 1 + include/hw/net/lasi_82596.h | 2 +- include/hw/net/xlnx-zynqmp-can.h | 1 + include/hw/pci-host/designware.h | 3 - include/hw/pci-host/gpex.h | 2 +- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/ls7a.h | 2 - include/hw/pci-host/pnv_phb3.h | 2 - include/hw/pci-host/pnv_phb4.h | 3 +- include/hw/pci-host/q35.h | 2 +- include/hw/pci-host/sabre.h | 2 +- include/hw/pci-host/xilinx-pcie.h | 1 - include/hw/pci/msi.h | 2 +- include/hw/pci/pci.h | 341 --------------------------- include/hw/pci/pci_bridge.h | 3 +- include/hw/pci/pci_device.h | 350 ++++++++++++++++++++++++++++ include/hw/pci/pcie.h | 1 - include/hw/pci/pcie_port.h | 1 + include/hw/pci/pcie_sriov.h | 2 + include/hw/pci/shpc.h | 2 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/remote/iohub.h | 2 +- include/hw/remote/proxy.h | 2 +- include/hw/riscv/boot_opensbi.h | 2 + include/hw/riscv/microchip_pfsoc.h | 3 + include/hw/riscv/numa.h | 1 + include/hw/riscv/sifive_u.h | 2 + include/hw/riscv/spike.h | 2 +- include/hw/riscv/virt.h | 2 +- include/hw/sd/sdhci.h | 2 +- include/hw/southbridge/piix.h | 3 +- include/hw/ssi/sifive_spi.h | 3 + include/hw/timer/sse-timer.h | 1 + include/hw/tricore/triboard.h | 1 - include/hw/usb/hcd-dwc3.h | 1 + include/hw/usb/hcd-musb.h | 2 + include/hw/usb/xlnx-usb-subsystem.h | 2 + include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 3 + include/hw/virtio/vhost-backend.h | 3 + include/hw/virtio/vhost-vdpa.h | 2 + include/hw/virtio/vhost.h | 4 + include/hw/virtio/virtio-mmio.h | 2 +- include/hw/virtio/virtio-pci.h | 4 +- include/hw/virtio/virtio-scsi.h | 1 - include/hw/virtio/virtio.h | 8 +- include/hw/xen/xen_common.h | 2 +- include/net/vhost-user.h | 1 + include/net/vhost_net.h | 4 + include/qemu/plugin-memory.h | 3 + include/qemu/userfaultfd.h | 1 - include/sysemu/dirtyrate.h | 2 + include/sysemu/dump.h | 1 + include/user/syscall-trace.h | 1 + net/vmnet_int.h | 1 - qga/cutils.h | 1 - target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - hw/acpi/aml-build.c | 2 +- hw/acpi/cpu_hotplug.c | 3 + hw/acpi/erst.c | 2 +- hw/alpha/pci.c | 1 + hw/alpha/typhoon.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/char/serial-pci-multi.c | 2 +- hw/char/serial-pci.c | 2 +- hw/core/machine-smp.c | 2 + hw/core/qdev-properties-system.c | 1 + hw/display/bochs-display.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/sm501.c | 2 +- hw/display/vga-pci.c | 2 +- hw/display/vhost-user-gpu.c | 18 ++ hw/display/vmware_vga.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/pci_ipmi_bt.c | 2 +- hw/ipmi/pci_ipmi_kcs.c | 2 +- hw/isa/i82378.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/net/can/can_kvaser_pci.c | 2 +- hw/net/can/can_mioe3680_pci.c | 2 +- hw/net/can/can_pcm3680_pci.c | 2 +- hw/net/can/ctucan_pci.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000x_common.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/net_tx_pkt.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rocker/rocker_desc.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/vhost_net-stub.c | 14 ++ hw/net/vhost_net.c | 18 ++ hw/net/virtio-net.c | 60 +++-- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 1 - hw/pci-host/bonito.c | 2 +- hw/pci-host/dino.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/raven.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci-hmp-cmds.c | 1 + hw/pci/pcie_host.c | 2 +- hw/pci/pcie_sriov.c | 2 +- hw/pci/slotid_cap.c | 2 +- hw/ppc/ppc440_pcix.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 1 + hw/rdma/rdma_utils.c | 1 + hw/s390x/s390-pci-inst.c | 1 + hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/scsi/vhost-scsi-common.c | 1 + hw/scsi/virtio-scsi.c | 1 + hw/smbios/smbios.c | 1 + hw/usb/hcd-ohci-pci.c | 2 +- hw/virtio/vdpa-dev.c | 9 + hw/virtio/vhost-user-fs.c | 18 ++ hw/virtio/vhost-user-gpio.c | 10 + hw/virtio/vhost-vdpa.c | 40 +++- hw/virtio/vhost-vsock-common.c | 18 ++ hw/virtio/vhost.c | 122 ++++++++-- hw/virtio/virtio-crypto.c | 18 ++ hw/virtio/virtio-mmio.c | 27 +++ hw/virtio/virtio-pci.c | 305 ++++++++++++++++-------- hw/virtio/virtio-qmp.c | 192 ++++++++++++++- hw/virtio/virtio.c | 225 +++--------------- hw/watchdog/wdt_i6300esb.c | 2 +- net/vhost-user.c | 27 ++- net/vhost-vdpa.c | 32 +-- qga/cutils.c | 3 +- tests/qtest/bios-tables-test.c | 19 ++ tests/qtest/fuzz/generic_fuzz.c | 1 + ui/util.c | 2 +- docs/devel/style.rst | 7 + hw/acpi/Kconfig | 9 +- hw/acpi/meson.build | 2 +- hw/i2c/meson.build | 2 +- hw/i386/Kconfig | 3 +- hw/isa/Kconfig | 4 +- hw/ppc/Kconfig | 2 - hw/virtio/trace-events | 1 + qemu-options.hx | 3 + tests/data/acpi/virt/APIC.topology | Bin 0 -> 732 bytes tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes tests/data/acpi/virt/PPTT | Bin 96 -> 76 bytes tests/data/acpi/virt/PPTT.acpihmatvirt | Bin 196 -> 156 bytes tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes 217 files changed, 1418 insertions(+), 839 deletions(-) create mode 100644 include/hw/pci/pci_device.h create mode 100644 tests/data/acpi/virt/APIC.topology create mode 100644 tests/data/acpi/virt/DSDT.topology create mode 100644 tests/data/acpi/virt/PPTT.topology
Re: [PULL 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
In reply to Philippe Mathieu-DaudéQuoted 8 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Laszlo Ersek
Quoted 5 lines · Michael S. Tsirkin
Quoted 1 line · Michael S. Tsirkin
From: Laszlo Ersek <[email protected]>
I noticed v2 is forthcoming. dropped now.
Quoted 8 lines
Quoted 6 lines
Yes, thanks.
I'm picking up the "Reviewed-by: Michael S. Tsirkin <[email protected]>" tag from your commit message. I'm not taking the "Fixes:" tag, originally suggested by Phil, because we've agreed that that was not correct.
I suppose the tool MST is using automatically included the Fixes: tag.
Yes it tends to pick all tags. Anyway, it's replaced by v2 now.
Quoted 6 lines
Quoted 6 lines
The other tags (from Igor, Phil and Ard) I've picked up already, and I've updated the commit message too. I'll post v2 soon.
Thanks!
Laszlo
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
Quoted 31 lines
Quoted 4 lines
Quoted 1 line
for you to fetch changes up to
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.And now it's
c46dcec9f699508e811cb6a140250d07486b0e41as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(Quoted 22 lines
Quoted 22 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Compile failures on freebsd in the bsd-user build:
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071
Probably something in Markus' include-file cleanup, I suspect some file is missing its osdep.h include.
thanks
-- PMM
Quoted 40 lines · Peter Maydell
Quoted 39 lines · Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin
Quoted 4 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
Quoted 8 lines
Quoted 5 lines
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
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.And now it's
c46dcec9f699508e811cb6a140250d07486b0e41as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(Quoted 19 lines
Quoted 19 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Compile failures on freebsd in the bsd-user build:
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071
yes - bsd-user/i386/signal.c
Quoted 6 lines
Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.thanks
-- PMM
Quoted 46 lines · Peter Maydell
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
Quoted 31 lines
Quoted 4 lines
Quoted 1 line
for you to fetch changes up to
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.And now it's
c46dcec9f699508e811cb6a140250d07486b0e41as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(Quoted 22 lines
Quoted 22 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Compile failures on freebsd in the bsd-user build:
Quoted 8 lines
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.thanks
-- PMM
Pushed a fixup, commit 1df76fab679e9a673b71531925fe12ceb89eaecb now. Pls let me know, thanks!
Signature · 1 line
MST
Quoted 54 lines · Michael S. Tsirkin
Quoted 52 lines · Peter Maydell
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
Quoted 31 lines
Quoted 4 lines
Quoted 1 line
for you to fetch changes up to
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.And now it's
c46dcec9f699508e811cb6a140250d07486b0e41as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(Quoted 22 lines
Quoted 22 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Compile failures on freebsd in the bsd-user build:
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.
Quoted 6 lines
Quoted 2 lines
thanks
-- PMMPushed a fixup, commit
1df76fab679e9a673b71531925fe12ceb89eaecbnow. Pls let me know, thanks!
Still failing on FreeBSD, for a different reason:
https://gitlab.com/qemu-project/qemu/-/jobs/3565200188
thanks
-- PMM
Quoted 59 lines · Peter Maydell
Quoted 58 lines · Michael S. Tsirkin
Quoted 54 lines · Peter Maydell
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
Quoted 31 lines
Quoted 4 lines
Quoted 1 line
for you to fetch changes up to
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.And now it's
c46dcec9f699508e811cb6a140250d07486b0e41as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(Quoted 22 lines
Quoted 22 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Compile failures on freebsd in the bsd-user build:
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.thanks
-- PMM
Quoted 8 lines
Quoted 2 lines
Pushed a fixup, commit
1df76fab679e9a673b71531925fe12ceb89eaecbnow. Pls let me know, thanks!Still failing on FreeBSD, for a different reason:
https://gitlab.com/qemu-project/qemu/-/jobs/3565200188thanks
-- PMM
Dropped the offending patch, commit aba0d042b1c1be38818cec16af3f34e9e9e2aed2 now. Pls let me know, thanks!
Signature · 1 line
MST
Re: [PULL 37/51] docs/devel: Rules on #include in headers
In reply to Michael S. TsirkinQuoted 8 lines · Michael S. Tsirkin
From: Markus Armbruster <[email protected]>
Rules for headers were proposed a long time ago, and generally liked:
Message-ID: <[email protected]> https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.htmlWortk them into
docs/devel/style.rst.
Alex spotted my typo "Wortk". Perhaps you can still fix it.
Quoted 7 lines
Suggested-by Bernhard Beschow <[email protected]>Signed-off-by Markus Armbruster <[email protected]>Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Reviewed-by Alex Bennée <[email protected]>Reviewed-by Bernhard Beschow <[email protected]>
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Peter Maydell
Quoted 2 lines · Michael S. Tsirkin
On Thu, Jan 05, 2023 at 09:04:37PM +0000, Peter Maydell wrote:
[...]
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 10 lines
Compile failures on freebsd in the bsd-user build:
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.thanks
-- PMMPushed a fixup, commit
1df76fab679e9a673b71531925fe12ceb89eaecbnow. Pls let me know, thanks!
Quoted 8 lines
Quoted 5 lines
Still failing on FreeBSD, for a different reason:
https://gitlab.com/qemu-project/qemu/-/jobs/3565200188thanks
-- PMMDropped the offending patch, commit
aba0d042b1c1be38818cec16af3f34e9e9e2aed2now. Pls let me know, thanks!
Appreciate the CI links. I'll respin.
Peter Maydell
AppliedQuoted 64 lines · Michael S. Tsirkin
Quoted 62 lines · Peter Maydell
Quoted 60 lines · Michael S. Tsirkin
Quoted 46 lines · Peter Maydell
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
The following changes since commit
cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:.gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
Quoted 31 lines
Quoted 4 lines
Quoted 1 line
for you to fetch changes up to
6529cb46fa76bb4b4f217d6fcc68b61b543062c4:
7c77271205339d3b161bdf925f5ead799b582e47now - I dropped one patch as v2 is forthcoming.And now it's
c46dcec9f699508e811cb6a140250d07486b0e41as I replaced that patch with it's v2. Sorry about the back and forth, but it seemed important :(Quoted 22 lines
Quoted 22 lines
vhost-scsi: fix memleak of
vsc->inflight(2023-01-05 04:07:39 -0500)----------------------------------------------------------------
virtio,pc,pci: features, cleanups, fixesmostly vhost-vdpa:
guest announce feature emulation when using shadow virtqueue support for configure interrupt
startup speed upsan acpi change to only generate cluster node in PPTT when specified for arm
misc fixes, cleanups
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Note: linux-user build is failing for me on master, I just disabled it for now as nothing I'm doing should affect linux-user. Didn't debug yet.
Compile failures on freebsd in the bsd-user build:
Quoted 8 lines
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.thanks
-- PMMPushed a fixup, commit
1df76fab679e9a673b71531925fe12ceb89eaecbnow. Pls let me know, thanks!
Quoted 9 lines
Quoted 5 lines
Still failing on FreeBSD, for a different reason:
https://gitlab.com/qemu-project/qemu/-/jobs/3565200188thanks
-- PMMDropped the offending patch, commit
aba0d042b1c1be38818cec16af3f34e9e9e2aed2now. Pls let me know, thanks!
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.
-- PMM
Quoted 27 lines · Markus Armbruster
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Peter Maydell
Quoted 2 lines · Michael S. Tsirkin
On Thu, Jan 05, 2023 at 09:04:37PM +0000, Peter Maydell wrote:
[...]
Quoted 18 lines
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines
Compile failures on freebsd in the bsd-user build:
https://gitlab.com/qemu-project/qemu/-/jobs/3561556072
https://gitlab.com/qemu-project/qemu/-/jobs/3561556071Probably something in Markus' include-file cleanup, I suspect some file is missing its
osdep.hinclude.Quoted 6 lines
Quoted 2 lines
thanks
-- PMMPushed a fixup, commit
1df76fab679e9a673b71531925fe12ceb89eaecbnow. Pls let me know, thanks!Still failing on FreeBSD, for a different reason:
https://gitlab.com/qemu-project/qemu/-/jobs/3565200188
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
thanks
-- PMMDropped the offending patch, commit
aba0d042b1c1be38818cec16af3f34e9e9e2aed2now. Pls let me know, thanks!Appreciate the CI links. I'll respin.
I'd like to reproduce locally, and tried "make vm-build-freebsd". No luck. Any other ideas?
Re: [PULL 45/51] hw/acpi/aml-build: Only generate cluster node in PPTT when specified
In reply to Michael S. TsirkinHi Yang,
Quoted 58 lines · Michael S. Tsirkin
From: Yicong Yang <[email protected]>
Currently we'll always generate a cluster node no matter user has specified '-smp clusters=X' or not. Cluster is an optional level and will participant the building of Linux scheduling domains and only appears on a few platforms. It's unncessary to always build it when it cannot reflect the real topology on platforms having no cluster implementation and to avoid affecting the linux scheduling domains in the VM. So only generate the cluster topology in ACPI PPTT when the user has specified it explicitly in -smp.
Tested qemu-system-aarch64 with
-smp 8and linux 6.1-rc1, without this patch:estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 56 # cluster_idwith this patch:
estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 36 # cluster_id, with no cluster node kernel will make it to physical package idReviewed-by Yanan Wang <[email protected]>Tested-by Yanan Wang <[email protected]>Signed-off-by Yicong Yang <[email protected]>Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- include/hw/boards.h | 3 +++ hw/acpi/aml-build.c | 2 +- hw/core/machine-smp.c | 2 ++ qemu-options.hx | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-)hw/acpi/aml-build.c +1
-1@@ -2030,7 +2030,7 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms, 0, socket_id, NULL, 0); } -if (mc->smp_props.clusters_supported) { +if (mc->smp_props.clusters_supported && mc->smp_props.has_clusters) {if (cpus->cpus[n].props.cluster_id != cluster_id) {assert (cpus->cpus[n].props.cluster_id > cluster_id); cluster_id = cpus->cpus[n].props.cluster_id;hw/core/machine-smp.c +0
-0
hw/core/machine-smp.c void machine_parse_smp_config(MachineState *ms, · line 161
Quoted 4 lines
hw/core/machine-smp.c +1
-0@@ -158,6 +158,8 @@ void machine_parse_smp_config(MachineState *ms, ms->smp.threads = threads; ms->smp.max_cpus = maxcpus; + mc->smp_props.has_clusters = config->has_clusters;
In another patch Bernhard noticed a QOM class field updated from a QOM object, which is an anti-OOP pattern:
https://lore.kernel.org/qemu-devel/[email protected]/
Looking at the codebase I noticed this is what you are doing here. By doing so, updating the class field from this particular instance results in all other instances being affected.
Currently this isn't really an issue because there are at most 2 MachineState instances (in a migration case, where we want the same machine). However it would be nice to have this bad code example cleaned. (Also eventually this could become an issue with heterogeneous machines, but I'm not sure yet).
Do you mind sending a patch?
Thanks,
Phil.
Quoted 17 lines
hw/core/machine-smp.c +0
-0/* sanity-check of the computed topology */ if (sockets * dies * clusters * cores * threads != maxcpus) { g_autofree char *topo_msg = cpu_hierarchy_to_string(ms);qemu-options.hx +3
-0@@ -343,6 +343,9 @@ SRST :: -smp 2 + + Note: The cluster topology will only be generated in ACPI and exposed + to guest if it's explicitly specified in -smp. ERST DEF("numa", HAS_ARG, QEMU_OPTION_numa,
Re: [PULL 45/51] hw/acpi/aml-build: Only generate cluster node in PPTT when specified
Hi Philippe,
Quoted 68 lines · Philippe Mathieu-Daudé
Hi Yang,
Quoted 57 lines · Michael S. Tsirkin
From: Yicong Yang <[email protected]>
Currently we'll always generate a cluster node no matter user has specified '-smp clusters=X' or not. Cluster is an optional level and will participant the building of Linux scheduling domains and only appears on a few platforms. It's unncessary to always build it when it cannot reflect the real topology on platforms having no cluster implementation and to avoid affecting the linux scheduling domains in the VM. So only generate the cluster topology in ACPI PPTT when the user has specified it explicitly in -smp.
Tested qemu-system-aarch64 with
-smp 8and linux 6.1-rc1, without this patch:estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 56 # cluster_idwith this patch:
estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 36 # cluster_id, with no cluster node kernel will make it to physical package idReviewed-by Yanan Wang <[email protected]>Tested-by Yanan Wang <[email protected]>Signed-off-by Yicong Yang <[email protected]>Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
include/hw/boards.h | 3 +++
hw/acpi/aml-build.c | 2 +-
hw/core/machine-smp.c| 2 ++
qemu-options.hx | 3 +++4 files changed, 9 insertions(+), 1 deletion(-)hw/acpi/aml-build.c +1
-0@@ -2030,7 +2030,7 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms, 0, socket_id, NULL, 0); } - if (mc->smp_props.clusters_supported) { + if (mc->smp_props.clusters_supported && mc->smp_props.has_clusters) { if (cpus->cpus[n].props.cluster_id != cluster_id) { assert(cpus->cpus[n].props.cluster_id > cluster_id); cluster_id = cpus->cpus[n].props.cluster_id;hw/core/machine-smp.c +0
-0hw/core/machine-smp.c void machine_parse_smp_config(MachineState *ms, · line 160
Quoted 3 lines
hw/core/machine-smp.c +0
-0@@ -158,6 +158,8 @@ void machine_parse_smp_config(MachineState *ms, ms->smp.threads = threads; ms->smp.max_cpus = maxcpus; + mc->smp_props.has_clusters = config->has_clusters;In another patch Bernhard noticed a QOM class field updated from a QOM object, which is an anti-OOP pattern:
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 4 lines
Looking at the codebase I noticed this is what you are doing here. By doing so, updating the class field from this particular instance results in all other instances being affected.
Is it suggested to move this to machinestat so we won't touch the machineclass members in the initialization here? In the initial version the has_clusters is placed in the ms->smp structure but it's suggested that's not a good place, see the discussion [1]
[1] https://lore.kernel.org/qemu-devel/[email protected]/
Thanks.
Quoted 29 lines
Currently this isn't really an issue because there are at most 2 MachineState instances (in a migration case, where we want the same machine). However it would be nice to have this bad code example cleaned. (Also eventually this could become an issue with heterogeneous machines, but I'm not sure yet).
Do you mind sending a patch?
Thanks,
Phil.
Quoted 8 lines
hw/core/machine-smp.c +0
-0/* sanity-check of the computed topology */ if (sockets * dies * clusters * cores * threads != maxcpus) { g_autofree char *topo_msg = cpu_hierarchy_to_string(ms);qemu-options.hx +0
-0@@ -343,6 +343,9 @@ SRSTQuoted 7 lines
::
-smp 2
+
+ Note: The cluster topology will only be generated in ACPI and exposed + to guest if it's explicitly specified in -smp.
ERST
DEF("numa",HAS_ARG,QEMU_OPTION_numa,.