Skip to contentSkip to conversation

pc,pci,virtio: bugfixes, improvements

GIT PULL Applied Michael S. Tsirkin 3 participants 18 messages Jul 7, 2021 – Jul 9, 2021

lore
Share & tools
lore
#0 lore raw

The following changes since commit 9c2647f75004c4f7d64c9c0ec55f8c6f0739a8b1:

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2021-07-02 11:46:32 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to e3e01466bff42b5ea977340d8d7d90df482b0c97:

MAINTAINERS: Add maintainer for vhost-user RNG implementation (2021-07-07 06:11:22 -0400)

----------------------------------------------------------------
pc,pci,virtio: bugfixes, improvements

vhost-user-rng support.
Fixes all over the place.

----------------------------------------------------------------
Andrew Melnychenko (3):
virtio-pci: Added check for virtio device presence in mm callbacks.
virtio-pci: Added check for virtio device in PCI config cbs.
virtio-pci: Changed return values for "notify", "device" and "isr" read.

Gerd Hoffmann (1):
acpi/ged: fix reset cause

Greg Kurz (1):
virtio: Clarify MR transaction optimization

Igor Mammedov (3):
tests: acpi: prepare for changing DSDT tables
acpi: pc: revert back to v5.2 PCI slot enumeration
tests: acpi: pc: update expected DSDT blobs

Laurent Vivier (1):
migration: failover: reset partially_hotplugged

Mathieu Poirier (1):
MAINTAINERS: Add maintainer for vhost-user RNG implementation

Pavel Dovgalyuk (1):
virtio: disable ioeventfd for record/replay

Philippe Mathieu-Daudé (1):
hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field

Vincent Bernat (1):
docs: add slot when adding new PCIe root port

 docs/pcie_pci_bridge.txt         |   6 +++---
 hw/acpi/generic_event_device.c   |   2 +-
 hw/block/dataplane/virtio-blk.c  |  16 ++++++++++++++++
 hw/i386/acpi-build.c             |   9 +++++++--
 hw/net/virtio-net.c              |   1 +
 hw/pci-host/q35.c                |   3 +++
 hw/s390x/virtio-ccw.c            |   6 ++++++
 hw/scsi/virtio-scsi-dataplane.c  |  16 ++++++++++++++++
 hw/virtio/virtio-mmio.c          |   6 ++++++
 hw/virtio/virtio-pci.c           |  33 +++++++++++++++++++++++++++++++--
 hw/virtio/virtio.c               |  16 ++++++++++++++++
 MAINTAINERS                      |   9 +++++++++
 tests/data/acpi/pc/DSDT          | Bin 6002 -> 6002 bytes
 tests/data/acpi/pc/DSDT.acpihmat | Bin 7327 -> 7327 bytes
 tests/data/acpi/pc/DSDT.bridge   | Bin 8668 -> 8668 bytes
 tests/data/acpi/pc/DSDT.cphp     | Bin 6466 -> 6466 bytes
 tests/data/acpi/pc/DSDT.dimmpxm  | Bin 7656 -> 7656 bytes
 tests/data/acpi/pc/DSDT.hpbridge | Bin 5969 -> 5969 bytes
 tests/data/acpi/pc/DSDT.ipmikcs  | Bin 6074 -> 6074 bytes
 tests/data/acpi/pc/DSDT.memhp    | Bin 7361 -> 7361 bytes
 tests/data/acpi/pc/DSDT.nohpet   | Bin 5860 -> 5860 bytes
 tests/data/acpi/pc/DSDT.numamem  | Bin 6008 -> 6008 bytes
 22 files changed, 115 insertions(+), 8 deletions(-)
#1 lore raw

[PULL 03/13] hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field

From: Philippe Mathieu-Daudé <[email protected]>

libFuzzer triggered the following assertion:

  cat << EOF | qemu-system-i386 -M pc-q35-5.0 \
    -nographic -monitor none -serial none \
    -qtest stdio -d guest_errors -trace pci\*
  outl 0xcf8 0xf2000060
  outl 0xcfc 0x8400056e
  EOF
  pci_cfg_write mch 00:0 @0x60 <- 0x8400056e
  Aborted (core dumped)

This is because guest wrote MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD (reserved value) to the PCIE XBAR register.

There is no indication on the datasheet about what occurs when this value is written. Simply ignore it on QEMU (and report an guest error):

pci_cfg_write mch 00:0 @0x60 <- 0x8400056e
Q35: Reserved PCIEXBAR LENGTH
pci_cfg_read mch 00:0 @0x0 -> 0x8086
pci_cfg_read mch 00:0 @0x0 -> 0x29c08086
...

Message-Id: <[email protected]>

---
 hw/pci-host/q35.c | 3 +++
 1 file changed, 3 insertions(+)
hw/pci-host/q35.c +3 -0
index 2eb729dff5..0f37cf056a 100644
@@ -29,6 +29,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "hw/i386/pc.h"
 #include "hw/pci-host/q35.h"
 #include "hw/qdev-properties.h"
@@ -318,6 +319,8 @@ static void mch_update_pciexbar(MCHPCIState *mch)
         addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK;
         break;
     case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD:
+        qemu_log_mask(LOG_GUEST_ERROR, "Q35: Reserved PCIEXBAR LENGTH\n");
+        return;
     default:
         abort();
     }
Signature · 1 line
MST
#2 lore raw

[PULL 09/13] acpi: pc: revert back to v5.2 PCI slot enumeration

In reply to Michael S. Tsirkin

From: Igor Mammedov <[email protected]>

Commit [1] moved _SUN variable from only hot-pluggable to all devices. This made linux kernel enumerate extra slots that weren't present before. If extra slot happens to be be enumerated first and there is a device in th same slot but on other bridge, linux kernel will add -N suffix to slot name of the later, thus changing NIC name compared to QEMU 5.2. This in some case confuses systemd, if it is using SLOT NIC naming scheme and interface name becomes not the same as it was under QEMU-5.2.

Reproducer QEMU CLI:
-M pc-i440fx-5.2 -nodefaults \
-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \
-device virtio-net-pci,id=nic1,bus=pci.1,addr=0x1 \
-device virtio-net-pci,id=nic2,bus=pci.1,addr=0x2 \
-device virtio-net-pci,id=nic3,bus=pci.1,addr=0x3

with RHEL8 guest produces following results:
v5.2:
kernel: virtio_net virtio0 ens1: renamed from eth0
kernel: virtio_net virtio2 ens3: renamed from eth2
kernel: virtio_net virtio1 enp1s2: renamed from eth1
(slot 2 is assigned to empty bus 0 slot and virtio1
is assigned to 2-2 slot, and renaming falls back, for some reason, to path based naming scheme)

v6.0:
kernel: virtio_net virtio0 ens1: renamed from eth0
kernel: virtio_net virtio2 ens3: renamed from eth2
systemd-udevd[299]: Error changing net interface name 'eth1' to 'ens3': File exists systemd-udevd[299]: could not rename interface '3' from 'eth1' to 'ens3': File exists
(with commit [1] kernel assigns virtio2 to 3-2 slot
since bridge advertises _SUN=0x3 and kernel assigns
slot 3 to bridge. Still it manages to rename virtio2
correctly to ens3, however systemd gets confused with virtio1
where slot allocation exactly the same (2-2) as in 5.2 case
and tries to rename it to ens3 which is rightfully taken by
virtio2)

I'm not sure what breaks in systemd interface renaming (it probably should be investigated), but on QEMU side we can safely revert _SUN to 5.2 behavior (i.e. avoid cold-plugged bridges and non hot-pluggable device classes), without breaking acpi-index, which uses slot numbers but it doesn't have to use _SUN, it could use an arbitrary variable name that has the same slot value).
It will help existing VMs to keep networking with non trivial configs in working order since systemd will do its interface renaming magic as it used to do.

1)

Fixes b7f23f62e40 (pci: acpi: add _DSM method to PCI devices)

Message-Id: <[email protected]>

---
 hw/i386/acpi-build.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
hw/i386/acpi-build.c +7 -2
index 796ffc6f5c..357437ff1d 100644
@@ -435,11 +435,15 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
         aml_append(dev, aml_name_decl("_ADR", aml_int(slot << 16)));
 
         if (bsel) {
-            aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
+            /*
+             * Can't declare _SUN here for every device as it changes 'slot'
+             * enumeration order in linux kernel, so use another variable for it
+             */
+            aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
             method = aml_method("_DSM", 4, AML_SERIALIZED);
             aml_append(method, aml_return(
                 aml_call6("PDSM", aml_arg(0), aml_arg(1), aml_arg(2),
-                          aml_arg(3), aml_name("BSEL"), aml_name("_SUN"))
+                          aml_arg(3), aml_name("BSEL"), aml_name("ASUN"))
             ));
             aml_append(dev, method);
         }
@@ -466,6 +470,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
             aml_append(method, aml_return(aml_int(s3d)));
             aml_append(dev, method);
         } else if (hotplug_enabled_dev) {
+            aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
             /* add _EJ0 to make slot hotpluggable  */
             method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
             aml_append(method,
Signature · 1 line
MST
#3 lore raw

[PULL 04/13] virtio-pci: Added check for virtio device presence in mm callbacks.

In reply to Michael S. Tsirkin

From: Andrew Melnychenko <[email protected]>

During unplug the virtio device is unplugged from virtio-bus on pci. In some cases, requests to virtio-pci mm may acquire during/after unplug. Added check that virtio device is on the bus, for "common" memory region.

Message-Id: <[email protected]>

---
 hw/virtio/virtio-pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)
hw/virtio/virtio-pci.c +8 -0
index f1e105fa52..1bef7a2be8 100644
@@ -1147,6 +1147,10 @@ static uint64_t virtio_pci_common_read(void *opaque, hwaddr addr,
     uint32_t val = 0;
     int i;
 
+    if (vdev == NULL) {
+        return UINT64_MAX;
+    }
+
     switch (addr) {
     case VIRTIO_PCI_COMMON_DFSELECT:
         val = proxy->dfselect;
@@ -1230,6 +1234,10 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
     VirtIOPCIProxy *proxy = opaque;
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
 
+    if (vdev == NULL) {
+        return;
+    }
+
     switch (addr) {
     case VIRTIO_PCI_COMMON_DFSELECT:
         proxy->dfselect = val;
Signature · 1 line
MST
#4 lore raw

[PULL 05/13] virtio-pci: Added check for virtio device in PCI config cbs.

In reply to Michael S. Tsirkin

From: Andrew Melnychenko <[email protected]>

Now, if virtio device is not present on virtio-bus - pci config callbacks will not lead to possible crush. The read will return "-1" which should be interpreted by a driver that pci device may be unplugged.

Message-Id: <[email protected]>

---
 hw/virtio/virtio-pci.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
hw/virtio/virtio-pci.c +10 -0
index 1bef7a2be8..c0d9c47df7 100644
@@ -424,6 +424,11 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr,
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
     uint32_t config = VIRTIO_PCI_CONFIG_SIZE(&proxy->pci_dev);
     uint64_t val = 0;
+
+    if (vdev == NULL) {
+        return UINT64_MAX;
+    }
+
     if (addr < config) {
         return virtio_ioport_read(proxy, addr);
     }
@@ -455,6 +460,11 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr,
     VirtIOPCIProxy *proxy = opaque;
     uint32_t config = VIRTIO_PCI_CONFIG_SIZE(&proxy->pci_dev);
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
+    if (vdev == NULL) {
+        return;
+    }
+
     if (addr < config) {
         virtio_ioport_write(proxy, addr, val);
         return;
Signature · 1 line
MST
#5 lore raw

[PULL 01/13] virtio: disable ioeventfd for record/replay

In reply to Michael S. Tsirkin

From: Pavel Dovgalyuk <[email protected]>

virtio devices support separate iothreads waiting for events from file descriptors. These are asynchronous events that can't be recorded and replayed, therefore this patch disables ioeventfd for all devices when record or replay is enabled.

Message-Id: <162125678869.1252810.4317416444097392406.stgit@pasha-ThinkPad-X280>

---
 hw/s390x/virtio-ccw.c   | 6 ++++++
 hw/virtio/virtio-mmio.c | 6 ++++++
 hw/virtio/virtio-pci.c  | 6 ++++++
 3 files changed, 18 insertions(+)
hw/s390x/virtio-ccw.c +6 -0
index d68888fccd..6a2df1c1e9 100644
@@ -31,6 +31,7 @@
 #include "trace.h"
 #include "hw/s390x/css-bridge.h"
 #include "hw/s390x/s390-virtio-ccw.h"
+#include "sysemu/replay.h"
 
 #define NR_CLASSIC_INDICATOR_BITS 64
 
@@ -770,6 +771,11 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *dev, Error **errp)
         dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD;
     }
 
+    /* fd-based ioevents can't be synchronized in record/replay */
+    if (replay_mode != REPLAY_MODE_NONE) {
+        dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD;
+    }
+
     if (k->realize) {
         k->realize(dev, &err);
         if (err) {
hw/virtio/virtio-mmio.c +6 -0
index 5952471b38..1af48a1b04 100644
@@ -29,6 +29,7 @@
 #include "qemu/host-utils.h"
 #include "qemu/module.h"
 #include "sysemu/kvm.h"
+#include "sysemu/replay.h"
 #include "hw/virtio/virtio-mmio.h"
 #include "qemu/error-report.h"
 #include "qemu/log.h"
@@ -740,6 +741,11 @@ static void virtio_mmio_realizefn(DeviceState *d, Error **errp)
         proxy->flags &= ~VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD;
     }
 
+    /* fd-based ioevents can't be synchronized in record/replay */
+    if (replay_mode != REPLAY_MODE_NONE) {
+        proxy->flags &= ~VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD;
+    }
+
     if (proxy->legacy) {
         memory_region_init_io(&proxy->iomem, OBJECT(d),
                               &virtio_legacy_mem_ops, proxy,
hw/virtio/virtio-pci.c +6 -0
index b321604d9b..f1e105fa52 100644
@@ -37,6 +37,7 @@
 #include "qemu/range.h"
 #include "hw/virtio/virtio-bus.h"
 #include "qapi/visitor.h"
+#include "sysemu/replay.h"
 
 #define VIRTIO_PCI_REGION_SIZE(dev)     VIRTIO_PCI_CONFIG_OFF(msix_present(dev))
 
@@ -1760,6 +1761,11 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)
         proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
     }
 
+    /* fd-based ioevents can't be synchronized in record/replay */
+    if (replay_mode != REPLAY_MODE_NONE) {
+        proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
+    }
+
     /*
      * virtio pci bar layout used by default.
      * subclasses can re-arrange things if needed.
Signature · 1 line
MST
#6 lore raw

[PULL 11/13] acpi/ged: fix reset cause

In reply to Michael S. Tsirkin

From: Gerd Hoffmann <[email protected]>

Reset requests should use SHUTDOWN_CAUSE_GUEST_RESET not SHUTDOWN_CAUSE_GUEST_SHUTDOWN.

Message-Id: <[email protected]>

---
 hw/acpi/generic_event_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/acpi/generic_event_device.c +1 -1
index 39c825763a..e28457a7d1 100644
@@ -207,7 +207,7 @@ static void ged_regs_write(void *opaque, hwaddr addr, uint64_t data,
         return;
     case ACPI_GED_REG_RESET:
         if (data == ACPI_GED_RESET_VALUE) {
-            qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
+            qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
         }
         return;
     }
Signature · 1 line
MST
#7 lore raw

[PULL 02/13] virtio: Clarify MR transaction optimization

In reply to Michael S. Tsirkin

From: Greg Kurz <[email protected]>

The device model batching its ioeventfds in a single MR transaction is an optimization. Clarify this in virtio-scsi, virtio-blk and generic virtio code. Also clarify that the transaction must commit before closing ioeventfds so that no one is tempted to merge the loops in the start functions error path and in the stop functions.

Message-Id: <[email protected]>

---
 hw/block/dataplane/virtio-blk.c | 16 ++++++++++++++++
 hw/scsi/virtio-scsi-dataplane.c | 16 ++++++++++++++++
 hw/virtio/virtio.c              | 16 ++++++++++++++++
 3 files changed, 48 insertions(+)
hw/block/dataplane/virtio-blk.c +16 -0
index cd81893d1d..252c3a7a23 100644
@@ -198,6 +198,10 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev)
         goto fail_guest_notifiers;
     }
 
+    /*
+     * Batch all the host notifiers in a single transaction to avoid
+     * quadratic time complexity in address_space_update_ioeventfds().
+     */
     memory_region_transaction_begin();
 
     /* Set up virtqueue notify */
@@ -211,6 +215,10 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev)
                 virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false);
             }
 
+            /*
+             * The transaction expects the ioeventfds to be open when it
+             * commits. Do it now, before the cleanup loop.
+             */
             memory_region_transaction_commit();
 
             while (j--) {
@@ -330,12 +338,20 @@ void virtio_blk_data_plane_stop(VirtIODevice *vdev)
 
     aio_context_release(s->ctx);
 
+    /*
+     * 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 < nvqs; i++) {
         virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false);
     }
 
+    /*
+     * 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 < nvqs; i++) {
hw/scsi/virtio-scsi-dataplane.c +16 -0
index 28e003250a..18eb824c97 100644
@@ -152,6 +152,10 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev)
         goto fail_guest_notifiers;
     }
 
+    /*
+     * Batch all the host notifiers in a single transaction to avoid
+     * quadratic time complexity in address_space_update_ioeventfds().
+     */
     memory_region_transaction_begin();
 
     rc = virtio_scsi_set_host_notifier(s, vs->ctrl_vq, 0);
@@ -198,6 +202,10 @@ fail_host_notifiers:
         virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false);
     }
 
+    /*
+     * 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 < vq_init_count; i++) {
@@ -238,12 +246,20 @@ void virtio_scsi_dataplane_stop(VirtIODevice *vdev)
 
     blk_drain_all(); /* ensure there are no in-flight requests */
 
+    /*
+     * 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 < vs->conf.num_queues + 2; i++) {
         virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false);
     }
 
+    /*
+     * 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 < vs->conf.num_queues + 2; i++) {
hw/virtio/virtio.c +16 -0
index ab516ac614..6dcf3baf56 100644
@@ -3728,6 +3728,10 @@ static int virtio_device_start_ioeventfd_impl(VirtIODevice *vdev)
     VirtioBusState *qbus = VIRTIO_BUS(qdev_get_parent_bus(DEVICE(vdev)));
     int i, n, r, err;
 
+    /*
+     * Batch all the host notifiers in a single transaction to avoid
+     * quadratic time complexity in address_space_update_ioeventfds().
+     */
     memory_region_transaction_begin();
     for (n = 0; n < VIRTIO_QUEUE_MAX; n++) {
         VirtQueue *vq = &vdev->vq[n];
@@ -3766,6 +3770,10 @@ assign_error:
         r = virtio_bus_set_host_notifier(qbus, n, false);
         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();
 
     while (--i >= 0) {
@@ -3790,6 +3798,10 @@ static void virtio_device_stop_ioeventfd_impl(VirtIODevice *vdev)
     VirtioBusState *qbus = VIRTIO_BUS(qdev_get_parent_bus(DEVICE(vdev)));
     int n, 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 (n = 0; n < VIRTIO_QUEUE_MAX; n++) {
         VirtQueue *vq = &vdev->vq[n];
@@ -3801,6 +3813,10 @@ static void virtio_device_stop_ioeventfd_impl(VirtIODevice *vdev)
         r = virtio_bus_set_host_notifier(qbus, n, false);
         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 (n = 0; n < VIRTIO_QUEUE_MAX; n++) {
Signature · 1 line
MST
#8 lore raw

[PULL 07/13] migration: failover: reset partially_hotplugged

In reply to Michael S. Tsirkin

From: Laurent Vivier <[email protected]>

When the card is plugged back, reset the partially_hotplugged flag to false

Message-Id: <[email protected]>

---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)
hw/net/virtio-net.c +1 -0
index bd7958b9f0..16d20cdee5 100644
@@ -3234,6 +3234,7 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,
         }
         hotplug_handler_plug(hotplug_ctrl, dev, &err);
     }
+    pdev->partially_hotplugged = false;
 
 out:
     error_propagate(errp, err);
Signature · 1 line
MST
#9 lore raw

[PULL 10/13] tests: acpi: pc: update expected DSDT blobs

In reply to Michael S. Tsirkin

From: Igor Mammedov <[email protected]>

@@ -930,20 +930,20 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)

             Device (S00)
             {
                 Name (_ADR, Zero)  // _ADR: Address

- Name (_SUN, Zero) // _SUN: Slot User Number
+ Name (ASUN, Zero)
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
- Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+ Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))

                 }
             }

             Device (S10)
             {
                 Name (_ADR, 0x00020000)  // _ADR: Address

- Name (_SUN, 0x02) // _SUN: Slot User Number
+ Name (ASUN, 0x02)
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
- Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+ Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))
}

Method (_S1D, 0, NotSerialized) // _S1D: S1 Device State

with a hank per bridge:

@@ -965,10 +965,10 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)

             Device (S18)
             {
                 Name (_ADR, 0x00030000)  // _ADR: Address

- Name (_SUN, 0x03) // _SUN: Slot User Number
+ Name (ASUN, 0x03)
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
- Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+ Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))

                 }
             }

Message-Id: <[email protected]>

---
 tests/qtest/bios-tables-test-allowed-diff.h |  10 ----------
 tests/data/acpi/pc/DSDT                     | Bin 6002 -> 6002 bytes
 tests/data/acpi/pc/DSDT.acpihmat            | Bin 7327 -> 7327 bytes
 tests/data/acpi/pc/DSDT.bridge              | Bin 8668 -> 8668 bytes
 tests/data/acpi/pc/DSDT.cphp                | Bin 6466 -> 6466 bytes
 tests/data/acpi/pc/DSDT.dimmpxm             | Bin 7656 -> 7656 bytes
 tests/data/acpi/pc/DSDT.hpbridge            | Bin 5969 -> 5969 bytes
 tests/data/acpi/pc/DSDT.ipmikcs             | Bin 6074 -> 6074 bytes
 tests/data/acpi/pc/DSDT.memhp               | Bin 7361 -> 7361 bytes
 tests/data/acpi/pc/DSDT.nohpet              | Bin 5860 -> 5860 bytes
 tests/data/acpi/pc/DSDT.numamem             | Bin 6008 -> 6008 bytes
 11 files changed, 10 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -10
index 6c83a3ef76..dfb8523c8b 100644
@@ -1,11 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT",
-"tests/data/acpi/pc/DSDT.bridge",
-"tests/data/acpi/pc/DSDT.ipmikcs",
-"tests/data/acpi/pc/DSDT.cphp",
-"tests/data/acpi/pc/DSDT.memhp",
-"tests/data/acpi/pc/DSDT.numamem",
-"tests/data/acpi/pc/DSDT.nohpet",
-"tests/data/acpi/pc/DSDT.dimmpxm",
-"tests/data/acpi/pc/DSDT.acpihmat",
-"tests/data/acpi/pc/DSDT.hpbridge",
tests/data/acpi/pc/DSDT binary +0 -0
index b9dd9b38e4ef720636ba19ccbdf262de8a6439d5..cc1223773e9c459a8d2f20666c051a74338d40b7 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index cba5a1dcb0464e56753bc0b931a4dd2e3b209787..2d0678eb83277088b156d386067429b0f29f9338 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index a9b4d5659457f6de30b993962bce673c9413d81d..77778c3a69946efd501e7eff0a73af309b553f13 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 8d86155e275aa688f8767dd92c4b9df08b4a18ad..af046b40b0a150b4ab1e113bd9d77912c707074f 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index e00a447f92b27f9a91be802eb11fe89dc0457e20..b56b2e089017f933f8a3089c4fd2389fb8ef1e40 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
index 5d8ba195055f2eda74223323baeb88390ea36739..bb0593eeb8730d51a6f0fe51a00a00df9c83c419 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 01e53bd436698db6f6adfff584ec56cb99074a5f..2e618e49d357ae1d0ac20d822f71d676ea90f2fc 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index b8103799b45224c08344369931b87cf3b7797d7e..c32d28575b967aff40afb9138822ecd3186dd4ce 100644
GIT binary patch
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
index d4f0050533f970128774f825274177096a46c3b8..623f06a900d12500d2197d101f76f6875e92ed64 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index 8632dfe8a8bdd991871a1e633162eb9a2e1497ea..f0a3fa92de94f55d5406f0fafce331776dbb0317 100644
GIT binary patch
Signature · 1 line
MST
#10 lore raw

[PULL 12/13] docs: add slot when adding new PCIe root port

In reply to Michael S. Tsirkin

From: Vincent Bernat <[email protected]>

Without providing a specific slot, QEMU won't be able to create the second additional PCIe root port with the following error:

    $ qemu-system-x86_64 [...] -machine q35 \
Quoted 2 lines
   -device pcie-root-port,bus=pcie.0,id=rp1 \
   -device pcie-root-port,bus=pcie.0,id=rp2

qemu-system-x86_64: -device pcie-root-port,bus=pcie.0,id=rp2:
Can't add chassis slot, error -16

This is due to the fact they both try to use slot 0. Update the documentation to specify a slot for each new PCIe root port.

Message-Id: <[email protected]>

---
 docs/pcie_pci_bridge.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
docs/pcie_pci_bridge.txt +3 -3
index ab35ebf3ca..1aa08fc5f0 100644
@@ -70,9 +70,9 @@ A detailed command line would be:
 
 [qemu-bin + storage options] \
 -m 2G \
--device pcie-root-port,bus=pcie.0,id=rp1 \
--device pcie-root-port,bus=pcie.0,id=rp2 \
--device pcie-root-port,bus=pcie.0,id=rp3,bus-reserve=1 \
+-device pcie-root-port,bus=pcie.0,id=rp1,slot=1 \
+-device pcie-root-port,bus=pcie.0,id=rp2,slot=2 \
+-device pcie-root-port,bus=pcie.0,id=rp3,slot=3,bus-reserve=1 \
 -device pcie-pci-bridge,id=br1,bus=rp1 \
 -device pcie-pci-bridge,id=br2,bus=rp2 \
 -device e1000,bus=br1,addr=8
Signature · 1 line
MST
#11 lore raw

[PULL 06/13] virtio-pci: Changed return values for "notify", "device" and "isr" read.

In reply to Michael S. Tsirkin

From: Andrew Melnychenko <[email protected]>

At some point, after unplugging virtio-pci the virtio device may be unrealised, but the memory regions may be present in flatview. So, it's a possible situation when memory region's callbacks are called for "unplugged" device.

Previous two patches made sure this case does not cause QEMU to crash. This patch adds check for "notify" memory region. Now reads will return "-1" if a virtio device is not present on a virtio bus.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1938042
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1743098

Message-Id: <[email protected]>

---
 hw/virtio/virtio-pci.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
hw/virtio/virtio-pci.c +7 -2
index c0d9c47df7..433060ac02 100644
@@ -1349,6 +1349,11 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
 static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr,
                                        unsigned size)
 {
+    VirtIOPCIProxy *proxy = opaque;
+    if (virtio_bus_get_device(&proxy->bus) == NULL) {
+        return UINT64_MAX;
+    }
+
     return 0;
 }
 
@@ -1386,7 +1391,7 @@ static uint64_t virtio_pci_isr_read(void *opaque, hwaddr addr,
     uint64_t val;
 
     if (vdev == NULL) {
-        return 0;
+        return UINT64_MAX;
     }
 
     val = qatomic_xchg(&vdev->isr, 0);
@@ -1407,7 +1412,7 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
     uint64_t val;
 
     if (vdev == NULL) {
-        return 0;
+        return UINT64_MAX;
     }
 
     switch (size) {
Signature · 1 line
MST
#12 lore raw

[PULL 08/13] tests: acpi: prepare for changing DSDT tables

In reply to Michael S. Tsirkin

From: Igor Mammedov <[email protected]>

Message-Id: <[email protected]>

---
 tests/qtest/bios-tables-test-allowed-diff.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +10 -0
index dfb8523c8b..6c83a3ef76 100644
@@ -1 +1,11 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT",
+"tests/data/acpi/pc/DSDT.bridge",
+"tests/data/acpi/pc/DSDT.ipmikcs",
+"tests/data/acpi/pc/DSDT.cphp",
+"tests/data/acpi/pc/DSDT.memhp",
+"tests/data/acpi/pc/DSDT.numamem",
+"tests/data/acpi/pc/DSDT.nohpet",
+"tests/data/acpi/pc/DSDT.dimmpxm",
+"tests/data/acpi/pc/DSDT.acpihmat",
+"tests/data/acpi/pc/DSDT.hpbridge",
Signature · 1 line
MST
#13 lore raw

[PULL 13/13] MAINTAINERS: Add maintainer for vhost-user RNG implementation

In reply to Michael S. Tsirkin

From: Mathieu Poirier <[email protected]>

This patch adds entry for the vhost-user-rng related files.

Message-Id: <[email protected]>

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
index cfbf7ef79b..517f22b2e7 100644
@@ -1949,6 +1949,15 @@ F: include/sysemu/rng*.h
 F: backends/rng*.c
 F: tests/qtest/virtio-rng-test.c
 
+vhost-user-rng
+M: Mathieu Poirier <[email protected]>
+S: Supported
+F: docs/tools/vhost-user-rng.rst
+F: hw/virtio/vhost-user-rng.c
+F: hw/virtio/vhost-user-rng-pci.c
+F: include/hw/virtio/vhost-user-rng.h
+F: tools/vhost-user-rng/*
+
 virtio-crypto
 M: Gonglei <[email protected]>
 S: Supported
Signature · 1 line
MST
#14 lore raw

Re: [PULL 13/13] MAINTAINERS: Add maintainer for vhost-user RNG implementation

Hi Michael,

Quoted 9 lines · Michael S. Tsirkin

From: Mathieu Poirier <[email protected]>

This patch adds entry for the vhost-user-rng related files.

Message-Id: <[email protected]>

The pull request's changelog [1] mentions the addition of the vhost-user-rng feature and patch 13/13 [2] of that same pull request adds an entry in MAINTAINERS. On the flip side the files for the feature [3] are absent from the pull request. As such I see two possibilities:

1) The files for the vhost-user-rng feature should have been part of the pull request but fell through the cracks.
2) The vhost-user-rng feature was added to the pull request by mistake.

Please let me know.

Thanks,
Mathieu

[1]. https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01530.html
[2]. https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01543.html
[3]. https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg03560.html

Quoted 27 lines
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -1
index cfbf7ef79b..517f22b2e7 100644
@@ -1949,6 +1949,15 @@ F: include/sysemu/rng*.h
 F: backends/rng*.c
 F: tests/qtest/virtio-rng-test.c
 
+vhost-user-rng
+M: Mathieu Poirier <[email protected]>
+S: Supported
+F: docs/tools/vhost-user-rng.rst
+F: hw/virtio/vhost-user-rng.c
+F: hw/virtio/vhost-user-rng-pci.c
+F: include/hw/virtio/vhost-user-rng.h
+F: tools/vhost-user-rng/*
+
 virtio-crypto
 M: Gonglei <[email protected]>
 S: Supported
--

MST

#15 lore raw

Re: [PULL 13/13] MAINTAINERS: Add maintainer for vhost-user RNG implementation

Quoted 23 lines · Mathieu Poirier

Hi Michael,

Quoted 9 lines · Michael S. Tsirkin

From: Mathieu Poirier <[email protected]>

This patch adds entry for the vhost-user-rng related files.

Message-Id: <[email protected]>

The pull request's changelog [1] mentions the addition of the vhost-user-rng feature and patch 13/13 [2] of that same pull request adds an entry in MAINTAINERS. On the flip side the files for the feature [3] are absent from the pull request. As such I see two possibilities:

1) The files for the vhost-user-rng feature should have been part of the pull request but fell through the cracks.
2) The vhost-user-rng feature was added to the pull request by mistake.

Quoted 8 lines

Please let me know.

Thanks,
Mathieu

[1]. https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01530.html
[2]. https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01543.html
[3]. https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg03560.html

The files fell through the cracks. Will pick for the next pull. Thanks for reporting this!

Quoted 27 lines
Quoted 27 lines
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -1
index cfbf7ef79b..517f22b2e7 100644
@@ -1949,6 +1949,15 @@ F: include/sysemu/rng*.h
 F: backends/rng*.c
 F: tests/qtest/virtio-rng-test.c
 
+vhost-user-rng
+M: Mathieu Poirier <[email protected]>
+S: Supported
+F: docs/tools/vhost-user-rng.rst
+F: hw/virtio/vhost-user-rng.c
+F: hw/virtio/vhost-user-rng-pci.c
+F: include/hw/virtio/vhost-user-rng.h
+F: tools/vhost-user-rng/*
+
 virtio-crypto
 M: Gonglei <[email protected]>
 S: Supported
--

MST

#16 lore raw

Re: [PULL 13/13] MAINTAINERS: Add maintainer for vhost-user RNG implementation

Quoted 29 lines · Michael S. Tsirkin
Quoted 28 lines · Mathieu Poirier

Hi Michael,

Quoted 9 lines · Michael S. Tsirkin

From: Mathieu Poirier <[email protected]>

This patch adds entry for the vhost-user-rng related files.

Message-Id: <[email protected]>

The pull request's changelog [1] mentions the addition of the vhost-user-rng feature and patch 13/13 [2] of that same pull request adds an entry in MAINTAINERS. On the flip side the files for the feature [3] are absent from the pull request. As such I see two possibilities:

1) The files for the vhost-user-rng feature should have been part of the pull request but fell through the cracks.
2) The vhost-user-rng feature was added to the pull request by mistake.

Please let me know.

Thanks,
Mathieu

Quoted 8 lines
Quoted 3 lines

[1]. https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01530.html
[2]. https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01543.html
[3]. https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg03560.html

The files fell through the cracks. Will pick for the next pull. Thanks for reporting this!

Oh no I was too hasty. I dropped vhost-user-rng because of the build issue I reported but kept the maintainers entry by mistake and then saw it and included in the commit log.
So it's 2. It's harmless so I guess I won't redo the pull request but please send a new version addressing the doc build issue asap so I can include the files themselves.

Thanks!

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -1
index cfbf7ef79b..517f22b2e7 100644
@@ -1949,6 +1949,15 @@ F: include/sysemu/rng*.h
 F: backends/rng*.c
 F: tests/qtest/virtio-rng-test.c
 
+vhost-user-rng
+M: Mathieu Poirier <[email protected]>
+S: Supported
+F: docs/tools/vhost-user-rng.rst
+F: hw/virtio/vhost-user-rng.c
+F: hw/virtio/vhost-user-rng-pci.c
+F: include/hw/virtio/vhost-user-rng.h
+F: tools/vhost-user-rng/*
+
 virtio-crypto
 M: Gonglei <[email protected]>
 S: Supported
--

MST

#17 lore raw
In reply to Michael S. Tsirkin
Quoted 13 lines · Michael S. Tsirkin

The following changes since commit 9c2647f75004c4f7d64c9c0ec55f8c6f0739a8b1:

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2021-07-02 11:46:32 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to e3e01466bff42b5ea977340d8d7d90df482b0c97:

MAINTAINERS: Add maintainer for vhost-user RNG implementation (2021-07-07 06:11:22 -0400)

Quoted 8 lines

----------------------------------------------------------------
pc,pci,virtio: bugfixes, improvements

vhost-user-rng support.
Fixes all over the place.

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM