From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670385786108.25744401499082; Wed, 7 Jul 2021 08:06:25 -0700 (PDT) Received: from localhost ([::1]:33810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1984-0000Xh-Nl for importer@patchew.org; Wed, 07 Jul 2021 11:06:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m194q-0008DK-6R for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m194o-0006Xz-Gh for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:03 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-kMYLvm36MbSjsmhNEVVHXg-1; Wed, 07 Jul 2021 11:03:00 -0400 Received: by mail-wm1-f72.google.com with SMTP id n5-20020a05600c3b85b02902152e9caa1dso929563wms.3 for ; Wed, 07 Jul 2021 08:03:00 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id o35sm859428wms.29.2021.07.07.08.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QReaygTvgIPiu+t7rp1+oUfbV4YTyblPRgcOq0uWDBw=; b=H32e0jPcN3teaIaPzP0XkMXWSQb/MOcZgDwLgZYIyDSowMwcs6RWRVvBdzF2ZvC8yRCPHf 3/E3byQoctdARfeIigXn6eQfGmi1uJBaj9cRNvu5bwfZxjE6eB2VnPGcyiueo8+uQlTQ+v sv98/SBvnyH/SoujoYCGKhYcgDdhSQI= X-MC-Unique: kMYLvm36MbSjsmhNEVVHXg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QReaygTvgIPiu+t7rp1+oUfbV4YTyblPRgcOq0uWDBw=; b=mrMIuc//PsLVkGYCYDjOpRohK4e/Svoab3sbkm25gf2JEb7+uLe9MhpPsPoLV7DMQR IQtPfSZ2ubMB388suinEkbsYXV9srbZGT1NWV4C/AQHe9sie8yGGfi8AUjlHLoa1N2AX uwWNc9t/f+18KtDLL/9zwCTsGp+euc75yI90KunEnsEL7/YebPBbDmzzV+rwGCZS+3AP hzITCsh6xMpFrZrJjV2MvmwxDkBYockoEHxgZkw4aJNyVlc3je8l14mdfefs5Y61u/3j NXqLsY4WYyfibo1A7qqPx/0zrxJJ3qt3LPY4LZsGpqWMMeoIkCquVrJYCMsCQzN7ulQR K2qA== X-Gm-Message-State: AOAM533zYeCXaiNzyfRFAu6Q4exxrraTUCr1tlB3A6Iy/Eh/5x77G/NS QjXHrrirXCk+NXn0Rte4pvVIXGz15WHXvhQc0XnOyVqvfQFbIT81Rqnk3ETg1dgxgwQD3neo2TK wAxBCVMKHe052pfqDpubAieEHhcm5p9QSo0HrjGuwupfuBcKMGd+NxEWclm/w X-Received: by 2002:a1c:1bc3:: with SMTP id b186mr52390wmb.27.1625670179168; Wed, 07 Jul 2021 08:02:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4Q8XrrpGrdQaAIPd7jvyUNXvz1y0/jXVMo8yTwl0oacs31GgeqeuCun9qePvejWxFX5g0wg== X-Received: by 2002:a1c:1bc3:: with SMTP id b186mr52341wmb.27.1625670178903; Wed, 07 Jul 2021 08:02:58 -0700 (PDT) Date: Wed, 7 Jul 2021 11:02:55 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 01/13] virtio: disable ioeventfd for record/replay Message-ID: <20210707150157.52328-2-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Pavel Dovgalyuk , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670387292100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk 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. Signed-off-by: Pavel Dovgalyuk Message-Id: <162125678869.1252810.4317416444097392406.stgit@pasha-ThinkPad-= X280> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/s390x/virtio-ccw.c | 6 ++++++ hw/virtio/virtio-mmio.c | 6 ++++++ hw/virtio/virtio-pci.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index d68888fccd..6a2df1c1e9 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -31,6 +31,7 @@ #include "trace.h" #include "hw/s390x/css-bridge.h" #include "hw/s390x/s390-virtio-ccw.h" +#include "sysemu/replay.h" =20 #define NR_CLASSIC_INDICATOR_BITS 64 =20 @@ -770,6 +771,11 @@ static void virtio_ccw_device_realize(VirtioCcwDevice = *dev, Error **errp) dev->flags &=3D ~VIRTIO_CCW_FLAG_USE_IOEVENTFD; } =20 + /* fd-based ioevents can't be synchronized in record/replay */ + if (replay_mode !=3D REPLAY_MODE_NONE) { + dev->flags &=3D ~VIRTIO_CCW_FLAG_USE_IOEVENTFD; + } + if (k->realize) { k->realize(dev, &err); if (err) { diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 5952471b38..1af48a1b04 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -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, Erro= r **errp) proxy->flags &=3D ~VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD; } =20 + /* fd-based ioevents can't be synchronized in record/replay */ + if (replay_mode !=3D REPLAY_MODE_NONE) { + proxy->flags &=3D ~VIRTIO_IOMMIO_FLAG_USE_IOEVENTFD; + } + if (proxy->legacy) { memory_region_init_io(&proxy->iomem, OBJECT(d), &virtio_legacy_mem_ops, proxy, diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index b321604d9b..f1e105fa52 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -37,6 +37,7 @@ #include "qemu/range.h" #include "hw/virtio/virtio-bus.h" #include "qapi/visitor.h" +#include "sysemu/replay.h" =20 #define VIRTIO_PCI_REGION_SIZE(dev) VIRTIO_PCI_CONFIG_OFF(msix_present= (dev)) =20 @@ -1760,6 +1761,11 @@ static void virtio_pci_realize(PCIDevice *pci_dev, E= rror **errp) proxy->flags &=3D ~VIRTIO_PCI_FLAG_USE_IOEVENTFD; } =20 + /* fd-based ioevents can't be synchronized in record/replay */ + if (replay_mode !=3D REPLAY_MODE_NONE) { + proxy->flags &=3D ~VIRTIO_PCI_FLAG_USE_IOEVENTFD; + } + /* * virtio pci bar layout used by default. * subclasses can re-arrange things if needed. --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670518475777.8910258335941; Wed, 7 Jul 2021 08:08:38 -0700 (PDT) Received: from localhost ([::1]:40736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19AD-000568-Fc for importer@patchew.org; Wed, 07 Jul 2021 11:08:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1955-0000lT-EE for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1953-0006bz-HQ for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:19 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-45--bpzJqiNNKm7CGnNe5SkhQ-1; Wed, 07 Jul 2021 11:03:04 -0400 Received: by mail-wm1-f70.google.com with SMTP id z127-20020a1c7e850000b02901e46e4d52c0so2560059wmc.6 for ; Wed, 07 Jul 2021 08:03:04 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id v2sm20186590wru.16.2021.07.07.08.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A3MGUCJtgBhwKzEbRcOjG3DpxML933D/5Xe7a2aplEo=; b=TbDiiP8U2pcHhKKbdLY2wbXIH+7PVJrwn6IT6VIv6JPuxlb1IvaLDUFMg67AYSJDeU/iuS YCl8J5vLMhCEAzuBnJ2Jv+brKn+oEzn6gKdej7vsmFuqeAHb49jO+us0OZRzs+eCO2u+Gy HsVbJdhFk4Qv0phiqOcoWDInwaooCcc= X-MC-Unique: -bpzJqiNNKm7CGnNe5SkhQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A3MGUCJtgBhwKzEbRcOjG3DpxML933D/5Xe7a2aplEo=; b=O8N0xY/CMKeQtZLHn3LdtxyDzgTBiy0kdYY2fci4KC76L8oXD2wE8TbMVmLw2rvP+p VNE2h+vwirD5lAWBfmeR2GT9hxLjkdWPGwzplpmPgaGWKEKbZ9Ce9ySAiIxecVCzD9NZ 1Tuvk3lD2Ex9O8wy0FaMozEtekaYG75mX6sz04lW+Yxf8GwijXnH8fHVjjObZQx28P2o ZlbEVL/uawy5gsHnUCw2wv/JGv4MvQ6qKp1FuxOqiYhRpwO9Yn2PiE6j8ApHCMPaGAIB 4uJJuYnkTczOdWO7ROcw5Mz+q6fbFijO71JtgPxp1RTG3vOV+VuAePSDp5I7eHwRN5bC X8+g== X-Gm-Message-State: AOAM531j93qZtgrvJJbl6LYXk08Rd7wMFzhDtPgFezx2+rL6JOpGSOrh 5dzYaqa69vOPz5N3DcdO3qDAafCX7BuPps1TsATy383UkzjvTALtrj4kTeMjujmMYcsaBt08tgW Ut+PL0uf4yv9kMGk5ZuHaKAzQmwjCNrwPXH5WKJ7dnWDD72OmL0fzkFs+txvh X-Received: by 2002:a5d:5102:: with SMTP id s2mr3466683wrt.214.1625670183087; Wed, 07 Jul 2021 08:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy04joxzZk06KKOZB9XvnV5GZGW/yZswUGhV0Oz2Ap/YEQZDRiy8OyBImG977M/NehwWKn7Cw== X-Received: by 2002:a5d:5102:: with SMTP id s2mr3466640wrt.214.1625670182803; Wed, 07 Jul 2021 08:03:02 -0700 (PDT) Date: Wed, 7 Jul 2021 11:02:59 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 02/13] virtio: Clarify MR transaction optimization Message-ID: <20210707150157.52328-3-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-block@nongnu.org, Greg Kurz , Max Reitz , Stefan Hajnoczi , Paolo Bonzini , Fam Zheng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670519001100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Greg Kurz 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. Signed-off-by: Greg Kurz Message-Id: <162125799728.1394228.339855768563326832.stgit@bahia.lan> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/block/dataplane/virtio-blk.c | 16 ++++++++++++++++ hw/scsi/virtio-scsi-dataplane.c | 16 ++++++++++++++++ hw/virtio/virtio.c | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-bl= k.c index cd81893d1d..252c3a7a23 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -198,6 +198,10 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) goto fail_guest_notifiers; } =20 + /* + * Batch all the host notifiers in a single transaction to avoid + * quadratic time complexity in address_space_update_ioeventfds(). + */ memory_region_transaction_begin(); =20 /* 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); } =20 + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ memory_region_transaction_commit(); =20 while (j--) { @@ -330,12 +338,20 @@ void virtio_blk_data_plane_stop(VirtIODevice *vdev) =20 aio_context_release(s->ctx); =20 + /* + * Batch all the host notifiers in a single transaction to avoid + * quadratic time complexity in address_space_update_ioeventfds(). + */ memory_region_transaction_begin(); =20 for (i =3D 0; i < nvqs; i++) { virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); } =20 + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ memory_region_transaction_commit(); =20 for (i =3D 0; i < nvqs; i++) { diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplan= e.c index 28e003250a..18eb824c97 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -152,6 +152,10 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) goto fail_guest_notifiers; } =20 + /* + * Batch all the host notifiers in a single transaction to avoid + * quadratic time complexity in address_space_update_ioeventfds(). + */ memory_region_transaction_begin(); =20 rc =3D 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); } =20 + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ memory_region_transaction_commit(); =20 for (i =3D 0; i < vq_init_count; i++) { @@ -238,12 +246,20 @@ void virtio_scsi_dataplane_stop(VirtIODevice *vdev) =20 blk_drain_all(); /* ensure there are no in-flight requests */ =20 + /* + * Batch all the host notifiers in a single transaction to avoid + * quadratic time complexity in address_space_update_ioeventfds(). + */ memory_region_transaction_begin(); =20 for (i =3D 0; i < vs->conf.num_queues + 2; i++) { virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); } =20 + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ memory_region_transaction_commit(); =20 for (i =3D 0; i < vs->conf.num_queues + 2; i++) { diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index ab516ac614..6dcf3baf56 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3728,6 +3728,10 @@ static int virtio_device_start_ioeventfd_impl(VirtIO= Device *vdev) VirtioBusState *qbus =3D VIRTIO_BUS(qdev_get_parent_bus(DEVICE(vdev))); int i, n, r, err; =20 + /* + * 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 =3D 0; n < VIRTIO_QUEUE_MAX; n++) { VirtQueue *vq =3D &vdev->vq[n]; @@ -3766,6 +3770,10 @@ assign_error: r =3D virtio_bus_set_host_notifier(qbus, n, false); assert(r >=3D 0); } + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ memory_region_transaction_commit(); =20 while (--i >=3D 0) { @@ -3790,6 +3798,10 @@ static void virtio_device_stop_ioeventfd_impl(VirtIO= Device *vdev) VirtioBusState *qbus =3D VIRTIO_BUS(qdev_get_parent_bus(DEVICE(vdev))); int n, r; =20 + /* + * 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 =3D 0; n < VIRTIO_QUEUE_MAX; n++) { VirtQueue *vq =3D &vdev->vq[n]; @@ -3801,6 +3813,10 @@ static void virtio_device_stop_ioeventfd_impl(VirtIO= Device *vdev) r =3D virtio_bus_set_host_notifier(qbus, n, false); assert(r >=3D 0); } + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ memory_region_transaction_commit(); =20 for (n =3D 0; n < VIRTIO_QUEUE_MAX; n++) { --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670270555208.53844122213104; Wed, 7 Jul 2021 08:04:30 -0700 (PDT) Received: from localhost ([::1]:53128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m196D-0003AK-In for importer@patchew.org; Wed, 07 Jul 2021 11:04:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m194z-0000L4-83 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m194x-0006Zl-Hc for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:12 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-58-K2jC-_djOx2K1tLLL4fXjA-1; Wed, 07 Jul 2021 11:03:08 -0400 Received: by mail-wr1-f71.google.com with SMTP id m9-20020a0560000089b02901362e1cd6a3so865179wrx.13 for ; Wed, 07 Jul 2021 08:03:07 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id b12sm16490808wrx.60.2021.07.07.08.03.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tpd63PvLoqwccvwknyW++wOSUAmq/kcYqjMFvtaZ5Qc=; b=iRPAipiOcCt3uQBEN5pRH7oCbUKrUd2gi6xkOjftj9V+ekaO8VR58lHuLjP8naVAhmsSiW uciK2UO+3GiVozkBCdTvYLmd3Fun/nzvlVWQiKsAEqL1aG0ivjN5cGLRhv9z624tXnlRF8 AqCssPCcepu/xvv3tY/N4AtDxvVz+nc= X-MC-Unique: K2jC-_djOx2K1tLLL4fXjA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=tpd63PvLoqwccvwknyW++wOSUAmq/kcYqjMFvtaZ5Qc=; b=QddQF28LfdBDsSVS2mbebJEfHHTpHVvv9j0OvflbEhPU3bkDAxX3dLn9UljTuBjc4R u7Isv6TsmQvWpA8MVydKYYlzPSfeE8bt5HFF8dSwpOPKFXPbgUyjbnBszET4QpLvS+fV y+bQIZYNIQE6XuPObfNDMHUd3xs+fmrt6ZuxsqCGhKZ8qZblliJYru0aPGBmqM/K0MC5 q5MByYLafKk0KRjZxTvclKBxR7ZUXvs/lWHwFmtiLZyYDXk1cKxm/Ltcc0hAQgZbRNcQ 7bsDkuxa1bYHtiFq1bpWBil1WoAjgkoOCHc19r2qGm2DgdHGR8fLn2ugG4eKsEXff/5/ 4XXw== X-Gm-Message-State: AOAM530vJmM7ueJMCoh7xjMyHcpAZWmgwOa2r63D60y7HK0TeVIRJFz8 rNhJi5zB5loxTmJh7d9Tw4vBJZRdzKBNNNNtEoknfIV9KA1s/g1GBt9NPwbyek57zXe+Z9PFGQr BfZ+jRPbB8fczKAAJIYJvNvLBFbAr1B9njB7ED9VAK6nOhQKSWlvNXsOqmWY5 X-Received: by 2002:a7b:ce82:: with SMTP id q2mr82003wmj.60.1625670186605; Wed, 07 Jul 2021 08:03:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2Y+fayBkFoiRPjaelqhejk/9LLCyIsrDCL11/9ePdCyoyK1H2vC6jZTzp89glMt30NxuX7w== X-Received: by 2002:a7b:ce82:: with SMTP id q2mr81973wmj.60.1625670186415; Wed, 07 Jul 2021 08:03:06 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 03/13] hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field Message-ID: <20210707150157.52328-4-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Alexander Bulekov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670280139100001 From: Philippe Mathieu-Daud=C3=A9 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 ... Cc: qemu-stable@nongnu.org Reported-by: Alexander Bulekov BugLink: https://bugs.launchpad.net/qemu/+bug/1878641 Fixes: df2d8b3ed4 ("q35: Introduce q35 pc based chipset emulator") Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210526142438.281477-1-f4bug@amsat.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Alexander Bulekov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci-host/q35.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 2eb729dff5..0f37cf056a 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -29,6 +29,7 @@ */ =20 #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 |=3D 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(); } --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1625670365; cv=none; d=zohomail.com; s=zohoarc; b=UJlO3PsZITwX0QsIRFRMOkNGJutLV4axtKWLBZ6tqKjJpQHmAinM9+IC76tPo35aprFmzap54vu9L8LBivpCuMiADN4kBrzbe/HOX3hWvhhCPS4apBgc109wsYMznDNGaQ75d0A8Cr//0PcUrLSy9UvLyE52kKC2NJ495IB/RDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625670365; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VfGQ0+aix5AhLvVJQJkbLlqWh4uMrGYeT1y/Vk/0x84=; b=LUmdv4DBFN8AyzhHKyUe/7MuR+dY/WUJIyMH9TYehbw/ReOYIuzSZ9kU/iURqQDSrvKvcoLikEjlRNQD/Eqvw6rYvynXYubjOKerNuHgA+/YTr2jeVDeBd3SSV+QdG5JqhsNF52BuJEIZYggcQBdswJWU1aqwT21OuVG6DVmjSo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670365712266.5034618125728; Wed, 7 Jul 2021 08:06:05 -0700 (PDT) Received: from localhost ([::1]:60276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m197k-0007pY-Ib for importer@patchew.org; Wed, 07 Jul 2021 11:06:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1952-0000ao-U4 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1951-0006bS-BE for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:16 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-JeyikNbiNcOwvrlhq9LElg-1; Wed, 07 Jul 2021 11:03:11 -0400 Received: by mail-wr1-f72.google.com with SMTP id h11-20020adffa8b0000b029013a357d7bdcso495664wrr.18 for ; Wed, 07 Jul 2021 08:03:11 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id x19sm2060540wmi.10.2021.07.07.08.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VfGQ0+aix5AhLvVJQJkbLlqWh4uMrGYeT1y/Vk/0x84=; b=Zf6fnTa/G1zQzn0gCgtRk9HAHM3XOkQO0G0F1GSvKuKXvUuAQ8iddwHvtIFPL2TDkzFB6y UM8mkf1fUWMtDmghMMve25IlG1F9sbPFTQO8/3SkMKRnpuF4gwdWivYiYervVob9Y8yGV1 ujyqupgF6nSsVuG2X8k69dEg1JfBjL4= X-MC-Unique: JeyikNbiNcOwvrlhq9LElg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VfGQ0+aix5AhLvVJQJkbLlqWh4uMrGYeT1y/Vk/0x84=; b=cfemNxWbPPcaM/J3o9zYI1PuyvJceFkd5X8dM7Q5/MxbKV3e9S/9KLroB7mqZKBJ3w r33hDWv0zxOqRBl+xbnYsW2/u0xuq6paaJEzKNaKpOTUK2oO7YMdjkmqBbmvaZl5Hc/5 mNVNbC82w6ApXk8cabU72eOLuLE0/CTAqrPVF6CqK7hVHLuEJf8Mxy3NMVyuxziI5eSU OlF0zj9gprNeF9A5eTiwvff7EdG6V0UJmzmTCtBJkeV/66HrEO4vZG7DllizYLNpxJNj IS+LDJRC4yAIgUT6fYeXmNLozs4d8y/O8pBZaM+q4/I2Cl/Ctg1yJo3BaNuk/VPRCahS /vwQ== X-Gm-Message-State: AOAM530tDYTYY4k9S1e4agb2QabZIbMvAVLchtdFaG20o6FUFYmjjyo4 SKcFKqBOfTmUdnc5PYopCA1yIdlx3AQtjPcaOgglFfC/IFjTf9VLMv1xnDaEVydMHBRjI8Fhvh4 vfgj3yKFQ6yZwEwhmAJL57D6ZtPfBzjEYNaPnRCBXudrYz+ifSXhi2zGAHlRh X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr27509657wmh.151.1625670189719; Wed, 07 Jul 2021 08:03:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7iAQxWLhlmeAwmnGY8gbb9Ad34SMFfuVOhaiA8QY1H1rSfVjdJc2IIDdBMPxTJ+7GgUpvQw== X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr27509616wmh.151.1625670189441; Wed, 07 Jul 2021 08:03:09 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:06 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 04/13] virtio-pci: Added check for virtio device presence in mm callbacks. Message-ID: <20210707150157.52328-5-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Melnychenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1625670366985100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andrew Melnychenko During unplug the virtio device is unplugged from virtio-bus on pci. In som= e cases, requests to virtio-pci mm may acquire during/after unplug. Added check that= virtio device is on the bus, for "common" memory region. Signed-off-by: Andrew Melnychenko Message-Id: <20210609095843.141378-2-andrew@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index f1e105fa52..1bef7a2be8 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1147,6 +1147,10 @@ static uint64_t virtio_pci_common_read(void *opaque,= hwaddr addr, uint32_t val =3D 0; int i; =20 + if (vdev =3D=3D NULL) { + return UINT64_MAX; + } + switch (addr) { case VIRTIO_PCI_COMMON_DFSELECT: val =3D proxy->dfselect; @@ -1230,6 +1234,10 @@ static void virtio_pci_common_write(void *opaque, hw= addr addr, VirtIOPCIProxy *proxy =3D opaque; VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); =20 + if (vdev =3D=3D NULL) { + return; + } + switch (addr) { case VIRTIO_PCI_COMMON_DFSELECT: proxy->dfselect =3D val; --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1625670382; cv=none; d=zohomail.com; s=zohoarc; b=Ld8S56q1i37eWqo82fGb9r69C0n4fqGrZcaFsKlRK1IGBTWqrTczMDK+FT1My1ZlmUR9Qdb8wckVwdAQg6xk2zz31/xyXBx2DzaL+PrizXXRtIcFUHkom0s6QPCTy4/+d71q6DYZ/9OV58qekNhEfF8ASdmbSOG2XeIe7GoIpx0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625670382; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r8YtJo3PAzaP/cJrC4HQaYAbQLl82vsk2k1/IS5JPV8=; b=kUdQ7NwYki7aNzEmMq5qyzL3NUti2XRYHrtF3qp64kKUitguM2vVS3J0LkywzIcQJf3tMhijHZzdRaRIenBc4zBNkuShVQIW8fwPPuL84vvAPwVbkLre4MeLGJqEWC04AYo/FlyKVqUThCFsDpdlJIb6/eN1TZRLwfsMlmCC6i0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670382593951.5702120713985; Wed, 7 Jul 2021 08:06:22 -0700 (PDT) Received: from localhost ([::1]:33532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1981-0000Mb-Fq for importer@patchew.org; Wed, 07 Jul 2021 11:06:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1954-0000iz-R2 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1953-0006bq-81 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:18 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-6rZL2uGyOTOetLOfy6tB1w-1; Wed, 07 Jul 2021 11:03:15 -0400 Received: by mail-wr1-f71.google.com with SMTP id h104-20020adf90710000b029010de8455a3aso874446wrh.12 for ; Wed, 07 Jul 2021 08:03:15 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id h15sm19984573wrq.88.2021.07.07.08.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r8YtJo3PAzaP/cJrC4HQaYAbQLl82vsk2k1/IS5JPV8=; b=M4zCMrBwpYXonMN3yrsVgiy7VzUzgS9ggcRLBnMC2ao+MQOBEk5h7l1/HmC0IQyCEookZv bHjtfYjmtdYNW/QRf8gPocNcN7Ia8XPc/6yN6O4QQoPJR44wt4cYKxKiPVKI1ufFOkNe6O jq+p00iHBNFn4fVGk5GLXR3OK+lQlbg= X-MC-Unique: 6rZL2uGyOTOetLOfy6tB1w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=r8YtJo3PAzaP/cJrC4HQaYAbQLl82vsk2k1/IS5JPV8=; b=VGyMmQAH7M6GjPaEFqIRqeDf0w9r3dP1ZR7+EDSPea/RqUBR0cvZ2LfWDYzRswtfTA OHWmjqku6iDqnDF/r5aIhdMaE+YPvaSjnkAOt855+WmAKHXn6WBVbmwKvl5G7GPx8Xk4 Z5v6/jKL68vr4zuwOTFX2SIyRiLfIQhMKvOCmVroyMO1ld1GLrbf5HYHbefCw473z+2R vtlB7olv+4Lk2GXXbeYWNl1nGYKz+YmTUhSfBT9qunuFJih2CcP551a78rjw3TQQ/OSt jHnpgsIKw2zHTTWPAU3I5380E74QKzh99tYDnvJoc1FChh0mwXphjCahonVVahnRSd9A Xz9g== X-Gm-Message-State: AOAM532c69yVSw237FiZD2M8jvSLcmZ0WzVD1YXlx4IYk+a3ZEzkvyFv Cg0ZMuN64ekdsiyWg5Othjq3q9swpf1o2KZmdrEQhuh8wRuaVLlTaOZdx4vhCoIx+ETzWbKOUkE hYgyTJp9mLi+HoCpelzgi7eL/H+CQC2W9b/bWQYmHe0/1I2l8B+T5K2dDdeZo X-Received: by 2002:adf:eb82:: with SMTP id t2mr28360113wrn.337.1625670193964; Wed, 07 Jul 2021 08:03:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3YbU1uyMgKlXwm1wvne+ZvzCa8rn8EYiuLKM7Ph+PG2lZE7ckG9xkeuKVwmoMf1uy0/qHuQ== X-Received: by 2002:adf:eb82:: with SMTP id t2mr28360091wrn.337.1625670193767; Wed, 07 Jul 2021 08:03:13 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 05/13] virtio-pci: Added check for virtio device in PCI config cbs. Message-ID: <20210707150157.52328-6-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Melnychenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1625670383547100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andrew Melnychenko 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. Signed-off-by: Andrew Melnychenko Message-Id: <20210609095843.141378-3-andrew@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 1bef7a2be8..c0d9c47df7 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -424,6 +424,11 @@ static uint64_t virtio_pci_config_read(void *opaque, h= waddr addr, VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); uint32_t config =3D VIRTIO_PCI_CONFIG_SIZE(&proxy->pci_dev); uint64_t val =3D 0; + + if (vdev =3D=3D 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, hwad= dr addr, VirtIOPCIProxy *proxy =3D opaque; uint32_t config =3D VIRTIO_PCI_CONFIG_SIZE(&proxy->pci_dev); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + + if (vdev =3D=3D NULL) { + return; + } + if (addr < config) { virtio_ioport_write(proxy, addr, val); return; --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670644222525.4182907304407; Wed, 7 Jul 2021 08:10:44 -0700 (PDT) Received: from localhost ([::1]:48622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19CF-0001um-8c for importer@patchew.org; Wed, 07 Jul 2021 11:10:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195A-0000tB-HG for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1957-0006dC-Ba for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:24 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-316-uAsuWbSMPeWOqFye_tXw_Q-1; Wed, 07 Jul 2021 11:03:19 -0400 Received: by mail-wm1-f70.google.com with SMTP id j141-20020a1c23930000b0290212502cb19aso1110584wmj.0 for ; Wed, 07 Jul 2021 08:03:18 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id o14sm1318292wmq.31.2021.07.07.08.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PjAi9rnzMN7LIiVgFWQPrUw5J76tkcgx1USiXKE9mXs=; b=HzB1jCy0ERdVD4euOUAYOEdrucPVFZwUJMN1PVafiEGBzMA/E7XXnunLfKl4UxWLI+7HhU TKYQGR6B5z9YFGn0sCaAeHumaR6w+IFAyYsknTpuKirVnjI4/1PGWQSvbTFUscq4FVrz7C JBB/R/twueuUSIJu4SJTNwN8TdZjRp0= X-MC-Unique: uAsuWbSMPeWOqFye_tXw_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PjAi9rnzMN7LIiVgFWQPrUw5J76tkcgx1USiXKE9mXs=; b=VD1OPU0E6g9PWcs7w62kimNnOvQDif5r8k4eG0hpTIltNtlgwFm4oBAfTvUyVP3p5E quyRztXUIFsXPNp1dObceo/OxrfcnY9BCYczmEjBHOmfzeC3W/oVwEs4FdyKDitlPt8T V3K7vpFrEIhxRSRhCRcjBoxIqkPnUQ3/NHusAOjwjj9n4qkMRTI0om1LdbSlh2ZQi4au hiB7ZP+AGNTjavpZj2WneXUMJ9Nbdhuyu4KBh9jh55iriLXgUv069CfiM0nWRxbHIHQ4 rLCBQ/ewtglFS8uqAzxQp98phDGQX7wiZgWBjen/k6lUaiMQZ+Mx9aLWpS3+GrNumHUR YnXw== X-Gm-Message-State: AOAM530nHd1C1aV7lJ2ftpIimWgVoJ/+LynEYiKzDFij9chesAVqPc1T RTS2JSHoy5gQ4JwXHP8wjB0p+xuk/uQO/taEGvnvcDN8cDPIQx5GO08dRwaGHQaQyiRBTWyNwk6 2PjlY0a9V52e+MyEOWEZAQtB6vn8Hji5zBbOR2CY0rEHoyP2DN5KGVRgbeB+N X-Received: by 2002:a7b:c5d8:: with SMTP id n24mr27641002wmk.51.1625670197424; Wed, 07 Jul 2021 08:03:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3tT1Zem7yI48HYY/Zst6l1sF8WT7ZtArqHlGRndkQ6Qb4yOqHZhrYHuvbupDJZL66u4OKeA== X-Received: by 2002:a7b:c5d8:: with SMTP id n24mr27640969wmk.51.1625670197232; Wed, 07 Jul 2021 08:03:17 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:14 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 06/13] virtio-pci: Changed return values for "notify", "device" and "isr" read. Message-ID: <20210707150157.52328-7-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Melnychenko , Raphael Norwitz , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670645465100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andrew Melnychenko At some point, after unplugging virtio-pci the virtio device may be unreali= sed, but the memory regions may be present in flatview. So, it's a possible situ= ation 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=3D1938042 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=3D1743098 Signed-off-by: Andrew Melnychenko Message-Id: <20210609095843.141378-4-andrew@daynix.com> Reviewed-by: Stefano Garzarella Reviewed-by: Raphael Norwitz Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c0d9c47df7..433060ac02 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1349,6 +1349,11 @@ static void virtio_pci_common_write(void *opaque, hw= addr addr, static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr, unsigned size) { + VirtIOPCIProxy *proxy =3D opaque; + if (virtio_bus_get_device(&proxy->bus) =3D=3D NULL) { + return UINT64_MAX; + } + return 0; } =20 @@ -1386,7 +1391,7 @@ static uint64_t virtio_pci_isr_read(void *opaque, hwa= ddr addr, uint64_t val; =20 if (vdev =3D=3D NULL) { - return 0; + return UINT64_MAX; } =20 val =3D qatomic_xchg(&vdev->isr, 0); @@ -1407,7 +1412,7 @@ static uint64_t virtio_pci_device_read(void *opaque, = hwaddr addr, uint64_t val; =20 if (vdev =3D=3D NULL) { - return 0; + return UINT64_MAX; } =20 switch (size) { --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670545029506.65561941774354; Wed, 7 Jul 2021 08:09:05 -0700 (PDT) Received: from localhost ([::1]:42032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19Ad-0005xs-Uf for importer@patchew.org; Wed, 07 Jul 2021 11:09:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195E-0000yJ-BV for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53201) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195B-0006dS-AY for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:28 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-g4Akphf7P6uGbxxXZ9ceOA-1; Wed, 07 Jul 2021 11:03:22 -0400 Received: by mail-wr1-f72.google.com with SMTP id j2-20020a0560001242b029012c82df4dbbso861202wrx.23 for ; Wed, 07 Jul 2021 08:03:21 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id e8sm20813490wrq.10.2021.07.07.08.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zmpRm6Bp0OUCMLI+CGNHcboqes++B9pawrnMEvKwPBY=; b=Nw62eRnsN0mLCZykNTkb1GYCGCKNCzg4Ug+TugzanTkws4q7x+ealT/0zCg2Q9wSbeQ9TM znrBGgb0BOXlTaXqm10xGlYtXfwZdcFwNoI/lEf9W1p04d5jEW7skm/ZYHZdymL1tuVtcs rDERTU+AFkM+vZYjcdqur7ARv48Hg2o= X-MC-Unique: g4Akphf7P6uGbxxXZ9ceOA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zmpRm6Bp0OUCMLI+CGNHcboqes++B9pawrnMEvKwPBY=; b=mIGQ3MYpt8KOPaboDsxdUdpSQISc19sGAFeBISGreIzutDdZanyunIZKQGcYF/Ia+p 7LqtlkEIzUoRPKESNA8f37AMyeYrBYu86IIyjQ9DqvZDy13cQJjRjCa2eGjEnKlDletj 73dK1/DYLJS1TaCT62Birr/7X3L4DK6BpHvhlekIHHXMmmiQ7atNfkfHv43HHMuSpCEs pyks7HEZwWGPMJS3jmJFpllZWY9RO72VU9Af/228SwyBYGr2AS/IeV0Jx0yDhBXw9yQ/ rKLk1DcUaPokaWykPIsJoZVP9CDBU+RUfbZhR9snFBvSHLS3CnkNdTMA6PKpi90/O1Wl Cgog== X-Gm-Message-State: AOAM533/Dt2FEogWVNViMtZP8fkjVxiprXpYwKpTEOqS4uD6Fq/Rg0zi 2Eseu9ZLdiMZ4jUpkyGMRxaHHzps+AZr/2xpOZ/iqcMqBYKcd+lXO4nNX05uJGSo9Bykq01l16C F+DePeaB0Rymsth6FlM1ValZbamLhovAeIbByHylVFgq1a3MWUBWtUtKgEoF8 X-Received: by 2002:a5d:4a4c:: with SMTP id v12mr2915963wrs.256.1625670200804; Wed, 07 Jul 2021 08:03:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBstri0nh/6cyE1UkYCO4YBAfNeSuFiIVeyC9EWIVZ0R84BSzAIl+cxB7pMxhUJ2bEOG/Lpw== X-Received: by 2002:a5d:4a4c:: with SMTP id v12mr2915924wrs.256.1625670200612; Wed, 07 Jul 2021 08:03:20 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:17 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 07/13] migration: failover: reset partially_hotplugged Message-ID: <20210707150157.52328-8-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Jason Wang , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670545665100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Laurent Vivier When the card is plugged back, reset the partially_hotplugged flag to false Bug: https://bugzilla.redhat.com/show_bug.cgi?id=3D1787194 Signed-off-by: Laurent Vivier Message-Id: <20210629152937.619193-1-lvivier@redhat.com> Reviewed-by: Juan Quintela Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index bd7958b9f0..16d20cdee5 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3234,6 +3234,7 @@ static bool failover_replug_primary(VirtIONet *n, Dev= iceState *dev, } hotplug_handler_plug(hotplug_ctrl, dev, &err); } + pdev->partially_hotplugged =3D false; =20 out: error_propagate(errp, err); --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670715354968.0858323317832; Wed, 7 Jul 2021 08:11:55 -0700 (PDT) Received: from localhost ([::1]:53676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19DO-0005Hv-CE for importer@patchew.org; Wed, 07 Jul 2021 11:11:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195G-00010Y-5K for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195E-0006dd-29 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:29 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-8u-rkQmxNe-YJMPtE2tIJg-1; Wed, 07 Jul 2021 11:03:25 -0400 Received: by mail-wr1-f69.google.com with SMTP id g4-20020a5d64e40000b029013398ce8904so872389wri.16 for ; Wed, 07 Jul 2021 08:03:25 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id p18sm18874739wrt.18.2021.07.07.08.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WWeA2pIPO0IzUBt1/L/ZYIXmbfW8GvdQP3WWUiJJGag=; b=fzgeuwSoYooOGSjg2WKO8um81ud7N7zn6cCYsVsOJGotYxryttPbozLSnKYI1m8EEQ4KDA 471aHwyV4D+uKzREAISq8frkQmYwXeLYETs3F1f1x1f+1ZLQRo13e5g7KshWZ7iR0hicRz RwG/tmahCTlNuGOU9sKGzTkqfp4UmRU= X-MC-Unique: 8u-rkQmxNe-YJMPtE2tIJg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WWeA2pIPO0IzUBt1/L/ZYIXmbfW8GvdQP3WWUiJJGag=; b=M+lCL4XeYW2h2ftIuiAWJgkU0P4GSG+dxqG3fUcCzz3S4KrR8dsyHAcq09m2OPe00x 3zDOgZ02ox8exDtzTwlp57S4JWKOvvYNOGA++Vji8g4u5ZyJVjiisolXe/WpN5zrFwNL HBsEmy50ppKzSMv6VMlSatVEFcGddWo95qDuAH+nWsjPPN61yOP5/pa/UWt8q2XXa3ZM NchnTBT7XdJjq64RIDLKSsJ8Joy4pev+YkT5p8/F30rFqP1cAfeqDV1p1/bPFJdPue+j fct6uCIoadX9rR65TCkCWdIaJbr+RpGk4LA1MCerY9N+O4zCXjvoIplXjjaKqGAKL/Zk b7zw== X-Gm-Message-State: AOAM530Rl8TdSCDe1My7t4zR8Yhpqjhetv8lBGq4aa+gjngf3cjYgBEm ozMYVuInFxfOgo8krsEmFCcppA3y2pM9RZKoPx70WN3mmdecjxnVa+8f9i2oC+92g7ZXaitAFxP dnJ/MEFdDM2q2k3ycMw74/1n17eC/oy+T6QcW8fIyL8KN40YYz7p+Kg7lJNFQ X-Received: by 2002:a05:6000:1867:: with SMTP id d7mr21558826wri.263.1625670204072; Wed, 07 Jul 2021 08:03:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaFAnUIZgI4vkVVyngx6WjflrFHqUq8rwmqpW/BMuUyIGvmJE/+8ccWLurU05AOquLbWt+Ug== X-Received: by 2002:a05:6000:1867:: with SMTP id d7mr21558804wri.263.1625670203914; Wed, 07 Jul 2021 08:03:23 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:20 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 08/13] tests: acpi: prepare for changing DSDT tables Message-ID: <20210707150157.52328-9-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Sucaet , Stefan Hajnoczi , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670717703100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20210624204229.998824-2-imammedo@redhat.com> Reviewed-by: Stefan Hajnoczi Tested-by: John Sucaet Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..6c83a3ef76 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -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", --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670354628910.9328499063233; Wed, 7 Jul 2021 08:05:54 -0700 (PDT) Received: from localhost ([::1]:59064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m197Z-00073v-8c for importer@patchew.org; Wed, 07 Jul 2021 11:05:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195P-0001Cu-Kn for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195N-0006j1-EC for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:39 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-7VUDQJm6Mz-bNnVNkGRRRg-1; Wed, 07 Jul 2021 11:03:35 -0400 Received: by mail-wr1-f72.google.com with SMTP id h15-20020adffd4f0000b0290137e68ed637so859993wrs.22 for ; Wed, 07 Jul 2021 08:03:34 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id f9sm21334891wrm.48.2021.07.07.08.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kygCYc/xTO46JNFLXdnXe2JmZoZzEtwl+GsjRYnanPU=; b=CiZu+yhtv080nQzBF6ScerlY807uZFGcMDTUGMSWmdrvdC4OqXuRrPqYQxP5aUVh2STdxV 6cLVyKmerYQ2bOdmyK26PsvuAJS6HU5+M0VLQBQ7/6TvKZWEQhjyaZAh+CyDKHLOuWVib6 Y9qr9+yYrtXUccSw7vfnIuXCaGUiQp4= X-MC-Unique: 7VUDQJm6Mz-bNnVNkGRRRg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kygCYc/xTO46JNFLXdnXe2JmZoZzEtwl+GsjRYnanPU=; b=rD8IzzDPYBnFY4NVjqJPWnDErmF2AL7wyrICSNkzHiMQ52JwlOSdU+YA8bmjgnC/4E 9PgV/y17vN0IOD/9VrFoqYqBHiSBJlBX1lPnxeVdXR3akJh+7jSQi8am9lY5bhMcjZyi bCYr+a8NefxmSldUErjZ56hLSvk1t7xYyu55NntXcTjjsUdcffTubi7N5y51yRLt5OTp WF91t9llZiNnMZao+ULbghBql5jsHxxlheV1y8pwTGMjWR9Y4M4b7z+ENdlxwPMzQb0Y t8HYZD1edms4KqjSwR7j4XfZquGZyO+SssrzgGeMjIMmxXfvVhEAjV5AQwUUshu0Txu9 dB4w== X-Gm-Message-State: AOAM531IEP8zF8BlklSu+9+U19w8ZWU48iP4tQw/BLECk0KR5GVDZVvE ZSaeBvRthqeb1ozVNHGecgjh/0Kh/g0mf0N7FCxT8jYoX4BsRkbAyT27gxgcOFJEHqmAN77JnWG KFqluI4/vrFgNtPJOWERO0bSBnLstKYSXO+91MC3pUYOSlqSQ8Fx34Gl88e/5 X-Received: by 2002:a1c:e485:: with SMTP id b127mr42089wmh.91.1625670213760; Wed, 07 Jul 2021 08:03:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlnx3jL2IxlGvqagTUowEl+dYVC4lN/vcxLT+QAhWB6gAztMEZ/GJ6J0yvqxDHxlcUTwS5yA== X-Received: by 2002:a1c:e485:: with SMTP id b127mr42040wmh.91.1625670213456; Wed, 07 Jul 2021 08:03:33 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:24 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 09/13] acpi: pc: revert back to v5.2 PCI slot enumeration Message-ID: <20210707150157.52328-10-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Sucaet , Richard Henderson , Stefan Hajnoczi , Igor Mammedov , Paolo Bonzini , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670356507100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Igor Mammedov 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=3D1,id=3Dpci.1,bus=3Dpci.0,addr=3D0x3 \ -device virtio-net-pci,id=3Dnic1,bus=3Dpci.1,addr=3D0x1 \ -device virtio-net-pci,id=3Dnic2,bus=3Dpci.1,addr=3D0x2 \ -device virtio-net-pci,id=3Dnic3,bus=3Dpci.1,addr=3D0x3 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 'ens= 3': File exists (with commit [1] kernel assigns virtio2 to 3-2 slot since bridge advertises _SUN=3D0x3 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) Signed-off-by: Igor Mammedov Message-Id: <20210624204229.998824-3-imammedo@redhat.com> Reviewed-by: Stefan Hajnoczi Tested-by: John Sucaet Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 796ffc6f5c..357437ff1d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -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))); =20 if (bsel) { - aml_append(dev, aml_name_decl("_SUN", aml_int(slot))); + /* + * Can't declare _SUN here for every device as it changes 'slo= t' + * enumeration order in linux kernel, so use another variable = for it + */ + aml_append(dev, aml_name_decl("ASUN", aml_int(slot))); method =3D 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_sc= ope, 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 =3D aml_method("_EJ0", 1, AML_NOTSERIALIZED); aml_append(method, --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670588725498.3838544796515; Wed, 7 Jul 2021 08:09:48 -0700 (PDT) Received: from localhost ([::1]:46596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19BL-0000aY-NJ for importer@patchew.org; Wed, 07 Jul 2021 11:09:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195S-0001OG-H8 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195Q-0006jE-5j for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:42 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-184-L2rw_o_UNkSxnJq1MNaTaw-1; Wed, 07 Jul 2021 11:03:38 -0400 Received: by mail-wr1-f70.google.com with SMTP id x8-20020a5d54c80000b029012583535285so879923wrv.8 for ; Wed, 07 Jul 2021 08:03:38 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id w1sm19535476wmi.13.2021.07.07.08.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pFTVTujNQpdEdgDou9qsJXXUf6vIKP2GI2FiHwKr+24=; b=bAu5N5SAB92DYAZiA+6GlYbSdyeAIEXzUIa4ipJVypH+91FlihazxWX0syr3DOfTRrIHvK 5ZIcJcN9bgITyxGFYjwvznSGkw5m+TvdX2pYTINS291ycLfkVicOcH7L2dsWH3SlfeAzrH 0G4XSRbz7oShTu9nwXYvuBK5pWG8ooQ= X-MC-Unique: L2rw_o_UNkSxnJq1MNaTaw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pFTVTujNQpdEdgDou9qsJXXUf6vIKP2GI2FiHwKr+24=; b=Vm2oGefHqr3hBFnwzkDVjRQ7ON0aUP0DAhI7jqvabLdXXzOX+qs9vCfHF10zLhrv76 o8DJ+bextUJsmNDmeqKI2jfkdUCq+8y95Hgk26VccG5Q5CNqgmGiKHJhfhnONboT8yf0 LKy7UEyV93zG4HGt2ZJovQQE0fhkc77/z8TnrkKrQDiIT+HGTw7+hHdtzkSLSk0XtxUq 62bRuNa4QDaDtyyrjPnT/7RVO63BtnuNTMXkeDj+cOXMFa07ndf1jGKM9nYbZhFCOruf +oRfAo9Znq0V3V+3ADZT3/kMPRIvrEbEHsuaAIql+L5rfS0FJzaoGt3jHOK8rt66Ghhc /3rg== X-Gm-Message-State: AOAM5315GOBzWSxRHvBIOmMMZKzz5BNhxMUKxMT4w8PocEYJSBxphacz q3WMMpL4YEK1Sv8ksbSVy5H0R3EXeso9zuWVeJtUG/Tk0ixRKix66pgoFSgICS3B4lMXf6pwy6v ic/eR6V46Wj63soAgN1i2mAjnWYyiA8+aOSK0uCunbWDT21mYRzb6Wzg8upwk X-Received: by 2002:a05:600c:4f11:: with SMTP id l17mr36003wmq.121.1625670216618; Wed, 07 Jul 2021 08:03:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3jU9Jlm+H5v4S978CI4HD496z/uKhW3V5K0tLSx9QXDHaRFmlRfkZWCmkv9B0JipteRwkkg== X-Received: by 2002:a05:600c:4f11:: with SMTP id l17mr35973wmq.121.1625670216401; Wed, 07 Jul 2021 08:03:36 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:33 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 10/13] tests: acpi: pc: update expected DSDT blobs Message-ID: <20210707150157.52328-11-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Sucaet , Stefan Hajnoczi , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670589430100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Igor Mammedov @@ -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 Met= hod { - 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 Met= hod { - 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 Met= hod { - Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN)) + Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN)) } } Signed-off-by: Igor Mammedov Message-Id: <20210624204229.998824-4-imammedo@redhat.com> Reviewed-by: Stefan Hajnoczi Tested-by: John Sucaet Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 6c83a3ef76..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -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", diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index b9dd9b38e4ef720636ba19ccbdf262de8a6439d5..cc1223773e9c459a8d2f20666c0= 51a74338d40b7 100644 GIT binary patch delta 61 zcmeyQ_eqb-CD&USu&WP9BD%?o fCD_m)o+IATC5VTCfr)_wB+SKxRm0{lLaR9eXLTFp delta 62 zcmbPlIp31YCDgG8yduO#5=3DkK@h~tjF>rvS QxR@rdlak#0LuffC015RFTL1t6 diff --git a/tests/data/acpi/pc/DSDT.bridge b/tests/data/acpi/pc/DSDT.bridge index a9b4d5659457f6de30b993962bce673c9413d81d..77778c3a69946efd501e7eff0a7= 3af309b553f13 100644 GIT binary patch delta 73 zcmccPe8-u~CD3CG}2zvw0}mS97Jc#e2SmmnSn1||j$ R$H}$)l8la3>@*3 PYxyM^<2O&|U(E>s%3KcC diff --git a/tests/data/acpi/pc/DSDT.dimmpxm b/tests/data/acpi/pc/DSDT.dimm= pxm index e00a447f92b27f9a91be802eb11fe89dc0457e20..b56b2e089017f933f8a3089c4fd= 2389fb8ef1e40 100644 GIT binary patch delta 100 zcmaE1{lc2dCDwlr;t!7i diff --git a/tests/data/acpi/pc/DSDT.hpbridge b/tests/data/acpi/pc/DSDT.hpb= ridge index 5d8ba195055f2eda74223323baeb88390ea36739..bb0593eeb8730d51a6f0fe51a00= a00df9c83c419 100644 GIT binary patch delta 78 zcmcbpcTtbaCD@v8 delta 74 zcmcbpcTtbaCD|UB3{<`;7~t?$&P$dLS8Jvh6eE*@s2J*JPZs>3>@*3 b*YZj-#!o)ZYrqCl#>EU&C%0Le&x{iQ&x;Zm diff --git a/tests/data/acpi/pc/DSDT.ipmikcs b/tests/data/acpi/pc/DSDT.ipmi= kcs index 01e53bd436698db6f6adfff584ec56cb99074a5f..2e618e49d357ae1d0ac20d822f7= 1d676ea90f2fc 100644 GIT binary patch delta 53 zcmdm`ze}IXCDYt>y#( Dp7{>n delta 49 zcmdm`ze}IXCD T3>=3DP=3D{|HGkI&KydUd;&rQ4bK$ delta 65 zcmX?TdC-!}CDwF!J&Q(lNp6YCOe3*33;&u8yduO#5=3DkK@h~tj UF>u6B{v#v_lw#Q|DZGLc04$Uc4*&oF diff --git a/tests/data/acpi/pc/DSDT.nohpet b/tests/data/acpi/pc/DSDT.nohpet index d4f0050533f970128774f825274177096a46c3b8..623f06a900d12500d2197d101f7= 6f6875e92ed64 100644 GIT binary patch delta 61 zcmaE&`$U(^CD>0$#B;Y{|Qt696|m5IX<> delta 59 zcmaE&`$U(^CDnU(Dn?CJxOh;H&? f2{tr{=3DZJT73F2X3U}E3^33D-F)v)<2?`lo}e)Jpa delta 62 zcmeyN_d}1%CD Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670491986510.91297047854744; Wed, 7 Jul 2021 08:08:11 -0700 (PDT) Received: from localhost ([::1]:39418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m199m-0004Da-V1 for importer@patchew.org; Wed, 07 Jul 2021 11:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195V-0001a6-BH for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195T-0006k1-MP for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:45 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-F156PYsnNmqC5eyi-YSP1Q-1; Wed, 07 Jul 2021 11:03:41 -0400 Received: by mail-wm1-f69.google.com with SMTP id a13-20020a7bc1cd0000b02902104c012aa3so2284653wmj.9 for ; Wed, 07 Jul 2021 08:03:41 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id n5sm11915816wri.31.2021.07.07.08.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ExGsrL38bjUmSaoa46g8sxCNtwJtiJBNsT4OQX6wU7s=; b=Ru/+JqRuk3XdaAm+pxfPi71pt435E7xlKxvJ5Fk0aHrSiUB4lEI2ki58jd/C+SD8gZzDBs Qb25pRRtI02pUipjKmEQGlgovg2w/OaAaRnSG8CXBIjN0220uqYOf4x/wyzT2lXFSWJUfJ 5TxrrmpvgaXes5Ov7DzMsYj6SCLTYdo= X-MC-Unique: F156PYsnNmqC5eyi-YSP1Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ExGsrL38bjUmSaoa46g8sxCNtwJtiJBNsT4OQX6wU7s=; b=n+PyLP7J38Eqk86r7cUYFEfJeDTpVzt5/epGZNdlZvKqkyahfIpQyza7dPT5gIcuxq +31XNk65HN7gtKeBRkWsuqOg3iXrj4cm1zlw8sihd2ubKZBvYlLgj5cx4zNvvJgUMRqr oGvHDw8A1Nv0FbPW9zmz03n6G3Ecp6QJEcFFhZevmkov4iCpcNv6ukK+SEMh8zzrnl0L 13YSsKvNzXdI73zcUcnnAw3Gd/uY9274XlN92qKx8Awvmh1qXGim4ajautpNCCesp9Tn dvmO4LvPfdaBgJNoudJrcTE5Pxd9KowTA46dCTAvgEbuklAc6EcTPexog9ENt9dASTFI iOSQ== X-Gm-Message-State: AOAM532+k6Nwb/QuSwH0OFFE+RCwkuqx3M6zWMrEbb88K1gaDEs4QrKX b4x0rF7XQzX3LYcA1fFiwrPlvumymHF6BOIwx1/2id4Wg85Tx0GyO1q5fUGnEDHR8CxnuyqKuaQ hN5lsSF52jl3VvKnCDOMr4faN7habyBOlBEiVrY5b68gfol8zlUjmBCCrUDT7 X-Received: by 2002:adf:ce84:: with SMTP id r4mr15802457wrn.397.1625670220276; Wed, 07 Jul 2021 08:03:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsDk2D7rkSPifYjmxH65ZogYfI5r8XuqBLpuZQ+VOetLkKvaqEiFaKMG5CsQ+ZjkBYLsrd3g== X-Received: by 2002:adf:ce84:: with SMTP id r4mr15802427wrn.397.1625670220074; Wed, 07 Jul 2021 08:03:40 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:37 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 11/13] acpi/ged: fix reset cause Message-ID: <20210707150157.52328-12-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670492988100001 From: Gerd Hoffmann Reset requests should use SHUTDOWN_CAUSE_GUEST_RESET not SHUTDOWN_CAUSE_GUEST_SHUTDOWN. Reported-by: Peter Maydell Signed-off-by: Gerd Hoffmann Message-Id: <20210624110057.2398779-1-kraxel@redhat.com> Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/generic_event_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 39c825763a..e28457a7d1 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -207,7 +207,7 @@ static void ged_regs_write(void *opaque, hwaddr addr, u= int64_t data, return; case ACPI_GED_REG_RESET: if (data =3D=3D ACPI_GED_RESET_VALUE) { - qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } return; } --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670603561902.3085280050692; Wed, 7 Jul 2021 08:10:03 -0700 (PDT) Received: from localhost ([::1]:47630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19Ba-0001GZ-KC for importer@patchew.org; Wed, 07 Jul 2021 11:10:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195Y-0001qD-WB for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195X-0006my-5Z for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:48 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-GRiR_d94MUm7QqLLhFNM9g-1; Wed, 07 Jul 2021 11:03:45 -0400 Received: by mail-wm1-f72.google.com with SMTP id n11-20020a05600c3b8bb02901ec5ef98aa0so612810wms.0 for ; Wed, 07 Jul 2021 08:03:45 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id l20sm19537178wmq.3.2021.07.07.08.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rlOjOiVbbAonidOYbIgJ5XNMANyIS28wLAUEMBTpCng=; b=OKD+cPbfuclzHa0Ew83pvWg9e8nyllh9HE2UfGRd3CC9QId+wy7piSqweBaklPIj/9K/OE 4ljnQeoQPlsaC5RGV4NZtjVNnuL6VX1hdsuR6foYCtMHuYHrM1XOr6ev9+EPcgmfJ2V9vR 1pJtTBobActxox1OwJK1r7hZkgop628= X-MC-Unique: GRiR_d94MUm7QqLLhFNM9g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rlOjOiVbbAonidOYbIgJ5XNMANyIS28wLAUEMBTpCng=; b=OjdmI9BMWcXsq5hyygD+QJ+5JdmkhFSZNI1bI5F5x/XcuP2wM++AANeFpz7ZBHTFGD iqALvd2DuBIKG7qSQYIl6NbsmZEN17312N19CzVHEeIxQ2VImf5/lpnK0H2mO0xGlJwC NuOkNnwL+gTB/9ifW0m6Uw7ECdDQeXA1yytKeqo7Vb9U716qztVcuGyHa6kB2isH03VL kh09MwrkY5ZNRaPzfo4FVpyXrT/iCXfILujP4NEi+6SzU2S8fEz5bHZi0ZzeMAE8tDBj l+gnncg542wDKfkWQ74GTj0cV3YOGB7MBV5+0AcEig1xeL9kNsduzsmslXmIY9mr8EdQ 0ssg== X-Gm-Message-State: AOAM530Hr6WaIV77X1VZj1o+w7X3/+BozZ7x86skYyEjrJlkIAQjfuBy f6S5LyfDOYYH+aPWIgklb6/OdtknBQPs3Q92VhI8n+J3rdAKKREpwaerHIrut7WF6awXQ7u+1uK IxOJFC2UROPRuZILqL9vxKryh8qDv9D2jz98dKsz/yuX3zGlhTY7mEjrExG27 X-Received: by 2002:a1c:f70d:: with SMTP id v13mr26363350wmh.183.1625670224040; Wed, 07 Jul 2021 08:03:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv/+spCHzrDfA7qH6wvY1DQaa7vvzA90m11twXLw5HhyDltLLA5VAnv1KDGzfV0V5xoTJ4ng== X-Received: by 2002:a1c:f70d:: with SMTP id v13mr26363326wmh.183.1625670223892; Wed, 07 Jul 2021 08:03:43 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:40 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 12/13] docs: add slot when adding new PCIe root port Message-ID: <20210707150157.52328-13-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vincent Bernat Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670605377100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Vincent Bernat 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 \ > -device pcie-root-port,bus=3Dpcie.0,id=3Drp1 \ > -device pcie-root-port,bus=3Dpcie.0,id=3Drp2 qemu-system-x86_64: -device pcie-root-port,bus=3Dpcie.0,id=3Drp2: 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. Signed-off-by: Vincent Bernat Message-Id: <20210614114357.1146725-1-vincent@bernat.ch> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/pcie_pci_bridge.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pcie_pci_bridge.txt b/docs/pcie_pci_bridge.txt index ab35ebf3ca..1aa08fc5f0 100644 --- a/docs/pcie_pci_bridge.txt +++ b/docs/pcie_pci_bridge.txt @@ -70,9 +70,9 @@ A detailed command line would be: =20 [qemu-bin + storage options] \ -m 2G \ --device pcie-root-port,bus=3Dpcie.0,id=3Drp1 \ --device pcie-root-port,bus=3Dpcie.0,id=3Drp2 \ --device pcie-root-port,bus=3Dpcie.0,id=3Drp3,bus-reserve=3D1 \ +-device pcie-root-port,bus=3Dpcie.0,id=3Drp1,slot=3D1 \ +-device pcie-root-port,bus=3Dpcie.0,id=3Drp2,slot=3D2 \ +-device pcie-root-port,bus=3Dpcie.0,id=3Drp3,slot=3D3,bus-reserve=3D1 \ -device pcie-pci-bridge,id=3Dbr1,bus=3Drp1 \ -device pcie-pci-bridge,id=3Dbr2,bus=3Drp2 \ -device e1000,bus=3Dbr1,addr=3D8 --=20 MST From nobody Sun May 12 09:53:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1625670788325705.6330840417198; Wed, 7 Jul 2021 08:13:08 -0700 (PDT) Received: from localhost ([::1]:56848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m19EY-0007Pu-LU for importer@patchew.org; Wed, 07 Jul 2021 11:13:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195d-00028v-6F for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m195b-0006oo-M7 for qemu-devel@nongnu.org; Wed, 07 Jul 2021 11:03:52 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-517-O3dzKCYQOje-337HJYRAtg-1; Wed, 07 Jul 2021 11:03:49 -0400 Received: by mail-wr1-f69.google.com with SMTP id y5-20020adfe6c50000b02901258bf1d760so873479wrm.14 for ; Wed, 07 Jul 2021 08:03:49 -0700 (PDT) Received: from redhat.com ([2.55.150.102]) by smtp.gmail.com with ESMTPSA id i11sm7297835wmg.18.2021.07.07.08.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 08:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625670231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5H0fdYuijAXulte1JclETA5lCUTHsEIrRVNFxTZaj64=; b=YNT6A5cemUj2uDdcoJCEH/AWJaSE0FhfUxAFXfV+Oxpwl0YpeSN96FbXLfunPbQnFImUGa 2RX1eatBT7woMJAXiSLx6XTF7wGAXbAiECPjqh2Yp+WeH/hcIZBCJQOLHYGTqvXU0UanDR MKvWoe6PHYf+e2o63d2nKgBD4twSsOs= X-MC-Unique: O3dzKCYQOje-337HJYRAtg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5H0fdYuijAXulte1JclETA5lCUTHsEIrRVNFxTZaj64=; b=YnXhuO94b92G2uidWR2Y1kEfAhV3m5DCC1TySFH1IEYN2goJWZtoMqX7aFRwn5wQLo /KM5uR/vrD6BG8t0CTdWE6r1W0kfyEEjFvLBN+EYMyBnX97HZ5eMi84PhX6/vEl3Cp2V FP+Z7jEoDyD+TL+PwzUSEx94/QJOglcpXE39RdyXyPCfvy4khdUtbKeIBhIdlBuDrILh B+XS0oL/OJ0HfIGshU/4Cie3g0GvwJJIdokA+RKqDc5qCO1+Azi8j66WcKAoioj0EA3Q GAlThK7UzTUsYWpros5dIYg3JIqT/TtJ09RzGT2Fk7s3XP/W+ROZL6nIjBT/rMHaIr/B BsPw== X-Gm-Message-State: AOAM531ksg8cCQijRwaXWlJwTUL27RlJN0QfP/GU6xijHfiNrGaJQTeS wl2jWMwi6HDUimtILMPV641Q2VXAgkNsIUKDjQ8wtitjFNtLPymPZ9+GwHCZ5lCCwUPVXSKdtJI JfeQ0U+uH+XYVbwPnlFh0+w0OmoxuVJEs0yNChmltuS1odNwnVbV62MYSnLnc X-Received: by 2002:a1c:1f8a:: with SMTP id f132mr26241270wmf.56.1625670228272; Wed, 07 Jul 2021 08:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhKhMXnsL89iDqH8LqEATh5mz29gfWeZ5jKuvOgLuZ2Ny05r9QCvOjlcu7VdPkxtah1SoaUQ== X-Received: by 2002:a1c:1f8a:: with SMTP id f132mr26241240wmf.56.1625670228075; Wed, 07 Jul 2021 08:03:48 -0700 (PDT) Date: Wed, 7 Jul 2021 11:03:44 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 13/13] MAINTAINERS: Add maintainer for vhost-user RNG implementation Message-ID: <20210707150157.52328-14-mst@redhat.com> References: <20210707150157.52328-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210707150157.52328-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.439, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Mathieu Poirier , Richard Henderson , Paolo Bonzini , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1625670789641100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mathieu Poirier This patch adds entry for the vhost-user-rng related files. Signed-off-by: Mathieu Poirier Message-Id: <20210614202842.581640-6-mathieu.poirier@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index cfbf7ef79b..517f22b2e7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1949,6 +1949,15 @@ F: include/sysemu/rng*.h F: backends/rng*.c F: tests/qtest/virtio-rng-test.c =20 +vhost-user-rng +M: Mathieu Poirier +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 S: Supported --=20 MST