From nobody Mon Feb 9 09:00:42 2026 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=1654771600; cv=none; d=zohomail.com; s=zohoarc; b=fNk/SYPwBIgj+vJNaXMZNbVRRpuvZrp7T85E+HiXoxfgCznzLmHBoe/3JsFVlKsaYRSCjXIq7Hs26G2IbyHGTbgEon4h5T8fRmK5XoRAW6diO75sZYsm/ZRwbV46NewesRfYtfhwdT0fuaeN5dP//O23x92Po+2Nx0MgsxJ66FI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654771600; h=Content-Type:Content-Transfer-Encoding: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=eXJ0/cLEQnTW9mvlDJ25ozxlPwQBkigpFPaXrqS8/ec=; b=h6nzRPSgTKxdHCLXzhrliAaT6cGKQGc96Z/+p9Z4b55Vvm+PQIQ2wHJWIfEwkfp3HYVPpZqBwCEyKCmnY3RUrVFElWX2bg8Q1aCynErfRmuFIjyez7M59UPmWZe2iPUEik+SAgIJwFeB0l7JZsO+Jg7S0xeD+bBZ+5SjUqqaIMg= 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 1654771600121350.29275437902334; Thu, 9 Jun 2022 03:46:40 -0700 (PDT) Received: from localhost ([::1]:37138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzFgU-0006Li-V7 for importer@patchew.org; Thu, 09 Jun 2022 06:46:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGZ-0006Hd-7C for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGT-0007Nk-UC for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:46 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-_cOhTVGwMW6uTA2ewQiVEw-1; Thu, 09 Jun 2022 05:15:39 -0400 Received: by mail-ej1-f70.google.com with SMTP id hy20-20020a1709068a7400b00703779e6f2fso10735408ejc.1 for ; Thu, 09 Jun 2022 02:15:39 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id y12-20020a170906470c00b00711d0b41bcfsm5212190ejq.0.2022.06.09.02.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 02:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654766141; 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=eXJ0/cLEQnTW9mvlDJ25ozxlPwQBkigpFPaXrqS8/ec=; b=VP2apdMIgYkzTEv1NecQa86ORnj2fMRgUsbdQgHpFeSbHIm7wJ+WicDoXiFRVC4ISSEzho 5DcLZZCy2GdASwXbmR5joNIDxLgG5fqWcexiBHICE8J9NSJu6a/w9JX2NzTUt0BMT+sa9y 6i7yzTdtd1GAu6Q8EVniIleONKcmHhQ= X-MC-Unique: _cOhTVGwMW6uTA2ewQiVEw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eXJ0/cLEQnTW9mvlDJ25ozxlPwQBkigpFPaXrqS8/ec=; b=jLtpDJMAmSC4zX5BjHsMdD/pRAgb6uHjBgozEF1+BSvokY9pRfArT54ghMX9B5A3v0 CV9StBO+2CAC0NMIIbRcQBESovp1en4b6Pb7x+Dclxt8NspSRp+N6YEXTeCqfcnywYYS kv3JYPDlZgGidUfwZE9ivtOIne5JUHIxd3ibkKBCblVSACJ6wrHwMmeu4EgMKtcJdfUL dBaF/6By0TE3Bh0mh0651uBOq/IDICqCnHI87KhY+3YjzA7z/MxR3HEbo1KXAvhVI7tA xkJhY7b77VjYKLvG5XQsUWlWB2eFHmDKGfJ97eF+CUpCpHAdxA+4alTgjoshMUuZ20Bn QNcQ== X-Gm-Message-State: AOAM530uMMKDofQmb32DNcK5MT64m88uIu909q9mfpIdZAGMo1BX42PF C4V2MtFe1fL3UWGRGQT1XHdF+kByKIzkZj4IDWHeMRc/QHa/pwpSeLU9eMG0TeX7u70/RFeCs+Q C+iQzmhGbFYXCC0H3YhrsC4J3/yJE8QZFwbEgWQYkL5O5+fSXZAH56jOKW6mmghWvCWM= X-Received: by 2002:a50:ed12:0:b0:42d:d1d3:493c with SMTP id j18-20020a50ed12000000b0042dd1d3493cmr43122084eds.174.1654766138554; Thu, 09 Jun 2022 02:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoF7/3lz2RNhyTkJ8Y2rTnlpEFGEIbS5xRaalLNOFYZamXu+29esOdLG+czVZ9+jnumF2b3g== X-Received: by 2002:a50:ed12:0:b0:42d:d1d3:493c with SMTP id j18-20020a50ed12000000b0042dd1d3493cmr43122060eds.174.1654766138308; Thu, 09 Jun 2022 02:15:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: mst@redhat.com, thuth@redhat.com Subject: [PATCH 1/4] s390x: simplify virtio_ccw_reset_virtio Date: Thu, 9 Jun 2022 11:15:31 +0200 Message-Id: <20220609091534.1416909-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220609091534.1416909-1-pbonzini@redhat.com> References: <20220609091534.1416909-1-pbonzini@redhat.com> MIME-Version: 1.0 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654771602048100001 Content-Type: text/plain; charset="utf-8" Call virtio_bus_reset instead of virtio_reset, so that the function need not receive the VirtIODevice. Signed-off-by: Paolo Bonzini Reviewed-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 15b458527e..066a387802 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -249,12 +249,12 @@ static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBl= ock *info, return 0; } =20 -static void virtio_ccw_reset_virtio(VirtioCcwDevice *dev, VirtIODevice *vd= ev) +static void virtio_ccw_reset_virtio(VirtioCcwDevice *dev) { CcwDevice *ccw_dev =3D CCW_DEVICE(dev); =20 virtio_ccw_stop_ioeventfd(dev); - virtio_reset(vdev); + virtio_bus_reset(&dev->bus); if (dev->indicators) { release_indicator(&dev->routes.adapter, dev->indicators); dev->indicators =3D NULL; @@ -359,7 +359,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret =3D virtio_ccw_handle_set_vq(sch, ccw, check_len, dev->revisio= n < 1); break; case CCW_CMD_VDEV_RESET: - virtio_ccw_reset_virtio(dev, vdev); + virtio_ccw_reset_virtio(dev); ret =3D 0; break; case CCW_CMD_READ_FEAT: @@ -536,7 +536,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) } if (virtio_set_status(vdev, status) =3D=3D 0) { if (vdev->status =3D=3D 0) { - virtio_ccw_reset_virtio(dev, vdev); + virtio_ccw_reset_virtio(dev); } if (status & VIRTIO_CONFIG_S_DRIVER_OK) { virtio_ccw_start_ioeventfd(dev); @@ -921,10 +921,9 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t= vector) static void virtio_ccw_reset(DeviceState *d) { VirtioCcwDevice *dev =3D VIRTIO_CCW_DEVICE(d); - VirtIODevice *vdev =3D virtio_bus_get_device(&dev->bus); VirtIOCCWDeviceClass *vdc =3D VIRTIO_CCW_DEVICE_GET_CLASS(dev); =20 - virtio_ccw_reset_virtio(dev, vdev); + virtio_ccw_reset_virtio(dev); if (vdc->parent_reset) { vdc->parent_reset(d); } --=20 2.36.1 From nobody Mon Feb 9 09:00:42 2026 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=1654772839; cv=none; d=zohomail.com; s=zohoarc; b=JsIGUGZXuWgBerus8peSEZ8RaDQNFOg9mkYMDCOZ6FjPlhnZ74pJWDMAqfiVxBUAEE5LC8/rNccRh9WiO18f7CM/zkpmNn+bxNVlQ7MTBe2+vri1UosVp2DNBA7KCrDjXJvkKijXO/D5P/foPMA27aqd7EIcmbARKnUlTBaQ+ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654772839; h=Content-Type:Content-Transfer-Encoding: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=orF3KM0omWlWJzl4+7wtwgGFsa07cv/TcVHHvRE/e/c=; b=OM9rvaFVMpvaDcSNmKjbLvz3+N2DYgnPqcbdAcMDgenFwt+8uvgQLCUP7bttUbTEX+0WS+7DpHSHgld1jrIhY5Z/Izzu14B0+FqfzftmImiJBzaVzueaeR+ysh82wddS9vAyN+PLZC8jMXI2kXD1TIgkSI38N5ZPkYGlTdlOkqc= 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 1654772839684429.70807518549304; Thu, 9 Jun 2022 04:07:19 -0700 (PDT) Received: from localhost ([::1]:59620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzG0T-00070o-G6 for importer@patchew.org; Thu, 09 Jun 2022 07:07:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGY-0006Em-D3 for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGW-0007O6-4Z for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:45 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-663-6poY1KRlNOWhs6Njgd4oQQ-1; Thu, 09 Jun 2022 05:15:41 -0400 Received: by mail-ej1-f71.google.com with SMTP id l2-20020a170906078200b006fed42bfeacso10677053ejc.16 for ; Thu, 09 Jun 2022 02:15:41 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id r7-20020aa7d147000000b0042dd792b3e8sm14023219edo.50.2022.06.09.02.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 02:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654766143; 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=orF3KM0omWlWJzl4+7wtwgGFsa07cv/TcVHHvRE/e/c=; b=B+6kpnDDOVLvNwBuNGDvEHTN1AGnmre/0mEZMR+cFAayngRxwshh2xd4Ua2vEbJ/pXJrhQ YIGwRi6BR3RrV8g8ohEZYXC/CeGUGRhupzhlb2WivOz7sc8ntDonUa9DW5DENrlzsOU+mD R9LkAAE/TlAGHCUW1V9yNERWiPYR56E= X-MC-Unique: 6poY1KRlNOWhs6Njgd4oQQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=orF3KM0omWlWJzl4+7wtwgGFsa07cv/TcVHHvRE/e/c=; b=orkDEZeDKcPc2WIppOlRgZZZ+QtpSBDPuvXEFL/kjlgYtqTbvR4hlNXeupJk2uBx+v HnPYl4i1vnpMgLmD52q+JCot/GM+c9Dr3XHOocFdGMDofz2OlIOAbSVTGUX6WtLnzx1Z qqp+4I2gQ+onY3o2Xr0OSGPJU+sI5FdVCJWJQRQHnxzapWqaG/heP+HeZafhnIoQuKhA si1RYTYid5iHWKPCr2G9MsN3F//SLjUlafUJI8fLpUgbfUTvfV8Njb/JnQlpScT75u8c HomoUmyEozaLV9FRC1/QbDuajhQXQXMmflWCwbO9qH4jvCyB+pR+mhLag/kz6UCM92or Y6vA== X-Gm-Message-State: AOAM531bh06wp09JJpcj/UOwozh26wR6FKmub1uBBmtE/YbCyOlQtago b12uRUzND+tHuGxgEyhpo1LNy7+/S0j7FHbkvXgeooL79plVFlwRv0vAiBYlc33Qph59HQ91qA5 LCD8KUayp1yQvIBcbtexyiUbQSDuWgrqZbYWCukdY/d+yq0LnubpQleFebHMzaljmlOw= X-Received: by 2002:a05:6402:56:b0:431:6f7b:533 with SMTP id f22-20020a056402005600b004316f7b0533mr19201399edu.333.1654766140195; Thu, 09 Jun 2022 02:15:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+DvukQnT1gb1SuO3TABJU2qqmabGzCgSrJWJp6Xr6efK7izbTL7K5+QLzGjAI4Vb5EOTGvw== X-Received: by 2002:a05:6402:56:b0:431:6f7b:533 with SMTP id f22-20020a056402005600b004316f7b0533mr19201375edu.333.1654766139875; Thu, 09 Jun 2022 02:15:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: mst@redhat.com, thuth@redhat.com Subject: [PATCH 2/4] virtio-mmio: stop ioeventfd on legacy reset Date: Thu, 9 Jun 2022 11:15:32 +0200 Message-Id: <20220609091534.1416909-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220609091534.1416909-1-pbonzini@redhat.com> References: <20220609091534.1416909-1-pbonzini@redhat.com> MIME-Version: 1.0 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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654772840705100001 Content-Type: text/plain; charset="utf-8" If the queue PFN is set to zero on a virtio-mmio device, the device is rese= t. In that case however the virtio_bus_stop_ioeventfd function was not called; add it so that the behavior is similar to when status is set to 0. Signed-off-by: Paolo Bonzini Reviewed-by: Cornelia Huck --- hw/virtio/virtio-mmio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 688eccda94..41a35d31c8 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -376,6 +376,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offs= et, uint64_t value, return; } if (value =3D=3D 0) { + virtio_mmio_stop_ioeventfd(proxy); virtio_reset(vdev); } else { virtio_queue_set_addr(vdev, vdev->queue_sel, --=20 2.36.1 From nobody Mon Feb 9 09:00:42 2026 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=1654773289; cv=none; d=zohomail.com; s=zohoarc; b=HHICejFJ8OzUCOoRMMdl0ndsJq4JLRz983RP91zMQAlbagUm50o9oZ0dLyEQ3GXazAYRzi7SHlli7twUMfpZEvBGvKJyobyJvb0efWFO3aSktXIXU28pAu8MqWoLyg1SG0RAufyEHJJACZZJTZLJabQP1b7E/qUY3N1M0P21HJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654773289; h=Content-Type:Content-Transfer-Encoding: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=tjGLYUErTNz1MM7O5eV2IFFELJREBPkgmtjcjCmnkhk=; b=fynGdAJjDw9DwZsShpDKql3exeJ2mhbEkJd8P13TYoIqJrPiFQvjYLVtOYrAFJhziVe838irIdVjMSDFi5Pz3kVHtXuLMlZxVk2hm0PjwJgaCJC2epQdWxROgQIT9lxCKlXHGAbtpCmzK3QwxIQlrFP0BwiM6G90dtKcMVBQGA4= 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 1654773289679540.743766146092; Thu, 9 Jun 2022 04:14:49 -0700 (PDT) Received: from localhost ([::1]:39796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzG7k-0005gx-KK for importer@patchew.org; Thu, 09 Jun 2022 07:14:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGb-0006Li-AN for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGZ-0007OO-DV for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:48 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-164-Qz6F3tIeNKOLXCpN_Ofkiw-1; Thu, 09 Jun 2022 05:15:45 -0400 Received: by mail-ej1-f69.google.com with SMTP id s4-20020a170906500400b006feaccb3a0eso10715206ejj.11 for ; Thu, 09 Jun 2022 02:15:45 -0700 (PDT) Received: from goa-sendmail ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id gj12-20020a170906e10c00b006fed8dfcf78sm10283173ejb.225.2022.06.09.02.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 02:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654766146; 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=tjGLYUErTNz1MM7O5eV2IFFELJREBPkgmtjcjCmnkhk=; b=SAo/r/W/Q0zepk0wxP84u84waNFk0w80vCnDGWtRcEhTiFpjRr1/w74UkTJ99y0KvGG+Fq amhd80fjsbI4HhiN6yWIsmeIUomGZRPD4AfklzZyjQ5w4mKIwPYuGM5UdoHtV6pyiaqw6b huzPmyjIymtbXdokrD7IiXGmSF1OajY= X-MC-Unique: Qz6F3tIeNKOLXCpN_Ofkiw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tjGLYUErTNz1MM7O5eV2IFFELJREBPkgmtjcjCmnkhk=; b=VeOr+MnTFXMeBDYxHYwxetug0GYAt9ljyYBUDfG2j9Cf3zOd+elO33tW0d9kGawofT tftnQm5U4ksbZsYckYlTB+ORL0fElmDcyyvXWOaDAQWaKm+bH0Ff4soz+9s0MgAXp0Ha KybdAD2oqKf/O6ipozB+8cNV/qKf3K9BcHdTkysSuwbWvl6WqLSFtAQqqGtAYL7NtuJS AEn/vtes0IEodf4oOBrbz5MZL92dFPPndGXKvGyaD6nFkavUf76i6m70Lr2W6+w6KUTH DZDK1wPKHIbxV1JF+4eVK+wvjtW4Cib6eeBzTtV/gTyS9nI9ajV8qwJUNLVXtusjFViw ugGQ== X-Gm-Message-State: AOAM530yfc+dUOZpzE7BLBfX/PQLkiLUmmJPxRuk6Pcq9sgiJ+ivBzDx xHwScUFiDkSNWir2UtRdmomJsESmPcSQigq8ceUDmMwZMKN3NmNAc0D8FbSCwPBJh1q0UlivpbS FUOxDP+cpyQke+8pDrhpsd4f5XtNN1rXV9jytJa6jZLI/rgJltNfJrt8lfu2yi1DP9g8= X-Received: by 2002:a05:6402:4246:b0:42f:3a4b:cc71 with SMTP id g6-20020a056402424600b0042f3a4bcc71mr34782545edb.107.1654766144359; Thu, 09 Jun 2022 02:15:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7Kiu+0D60H4FFXSn8A+tPzBpzAI/lJaoMtx5MkncFl9kthJbR45SeYIGorRqaBhbiteSqjg== X-Received: by 2002:a05:6402:4246:b0:42f:3a4b:cc71 with SMTP id g6-20020a056402424600b0042f3a4bcc71mr34782522edb.107.1654766144075; Thu, 09 Jun 2022 02:15:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: mst@redhat.com, thuth@redhat.com Subject: [PATCH 3/4] virtio: stop ioeventfd on reset Date: Thu, 9 Jun 2022 11:15:33 +0200 Message-Id: <20220609091534.1416909-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220609091534.1416909-1-pbonzini@redhat.com> References: <20220609091534.1416909-1-pbonzini@redhat.com> MIME-Version: 1.0 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654773290564100001 Content-Type: text/plain; charset="utf-8" All calls to virtio_bus_reset are preceded by virtio_bus_stop_ioeventfd, move the call in virtio_bus_reset: that makes sense and clarifies that the vdc->reset function is called with ioeventfd already stopped. Signed-off-by: Paolo Bonzini Reviewed-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 1 - hw/virtio/virtio-bus.c | 1 + hw/virtio/virtio-mmio.c | 4 +--- hw/virtio/virtio-pci.c | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 066a387802..e33e5207ab 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -253,7 +253,6 @@ static void virtio_ccw_reset_virtio(VirtioCcwDevice *de= v) { CcwDevice *ccw_dev =3D CCW_DEVICE(dev); =20 - virtio_ccw_stop_ioeventfd(dev); virtio_bus_reset(&dev->bus); if (dev->indicators) { release_indicator(&dev->routes.adapter, dev->indicators); diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index d7ec023adf..896feb37a1 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -104,6 +104,7 @@ void virtio_bus_reset(VirtioBusState *bus) VirtIODevice *vdev =3D virtio_bus_get_device(bus); =20 DPRINTF("%s: reset device.\n", BUS(bus)->name); + virtio_bus_stop_ioeventfd(bus); if (vdev !=3D NULL) { virtio_reset(vdev); } diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 41a35d31c8..6d81a26473 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -376,8 +376,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offs= et, uint64_t value, return; } if (value =3D=3D 0) { - virtio_mmio_stop_ioeventfd(proxy); - virtio_reset(vdev); + virtio_bus_reset(&vdev->bus); } else { virtio_queue_set_addr(vdev, vdev->queue_sel, value << proxy->guest_page_shift); @@ -628,7 +627,6 @@ static void virtio_mmio_reset(DeviceState *d) VirtIOMMIOProxy *proxy =3D VIRTIO_MMIO(d); int i; =20 - virtio_mmio_stop_ioeventfd(proxy); virtio_bus_reset(&proxy->bus); proxy->host_features_sel =3D 0; proxy->guest_features_sel =3D 0; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 0566ad7d00..45327f0b31 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1945,7 +1945,6 @@ static void virtio_pci_reset(DeviceState *qdev) PCIDevice *dev =3D PCI_DEVICE(qdev); int i; =20 - virtio_pci_stop_ioeventfd(proxy); virtio_bus_reset(bus); msix_unuse_all_vectors(&proxy->pci_dev); =20 --=20 2.36.1 From nobody Mon Feb 9 09:00:42 2026 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=1654774077; cv=none; d=zohomail.com; s=zohoarc; b=dXK8rJ341DWAcPVas6/1Cys3jIDHzNCIjhT2inBBix0SsFVpex3oLX/1uLwRVtG820vm4IlzYdS8ns81xRR6YHR5ZHOgcxfJGDdxAQKysy+QS7DjdKEfEQTuK03Tht+Lf6/+q7ldQb0iAgfVtrLAQGpIhVM82OA6TOVOtfVwj7k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654774077; h=Content-Type:Content-Transfer-Encoding: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=UhU5hIpnBhngBCDdQdspoAO2R7ca5GkL0HNZN9gkK3Q=; b=XLse3RNIF8z0zrKyLOYCZLtYffTrjznePVs724uHggKnlFU1UGK+ksTp4ZuINIl2ri4kYSAWWQ/ebuXRxYG+5GyzvrMQ/hPdq5A+OxGa1oPf5r/4kKM1OhvOphsyt/+T4Y3AjAT3aea0o+C+R95FzpGs+7lzpsCyVFEeaKg+Jlw= 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 1654774077287435.58435413602444; Thu, 9 Jun 2022 04:27:57 -0700 (PDT) Received: from localhost ([::1]:48404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzGKR-0003bo-T0 for importer@patchew.org; Thu, 09 Jun 2022 07:27:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGe-0006Qm-Sh for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzEGd-0007Op-5p for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:15:52 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-255-Fw6QhQTHM8SNdBYdTYO-mA-1; Thu, 09 Jun 2022 05:15:49 -0400 Received: by mail-ej1-f70.google.com with SMTP id mb1-20020a170906eb0100b00710c3b46a9aso6080392ejb.22 for ; Thu, 09 Jun 2022 02:15:48 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id t20-20020a1709066bd400b006fea3702e56sm10354475ejs.79.2022.06.09.02.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 02:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654766150; 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=UhU5hIpnBhngBCDdQdspoAO2R7ca5GkL0HNZN9gkK3Q=; b=f1X8ihw8GUwWWLLtWvzHEkwVv+nex6tohGvLyoVBgHMvy0Supjmhzeay0mVW+1s4aun2Y6 u4MYoW+1SzVM7qX6Wk9rZmgfocGlJWJUaKYkDBXUO9LeZC7KTzH3LgwotvSuSDJkKulTT7 9PZHnjYflOd5F1DwfxYKCSh/feTkVnM= X-MC-Unique: Fw6QhQTHM8SNdBYdTYO-mA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UhU5hIpnBhngBCDdQdspoAO2R7ca5GkL0HNZN9gkK3Q=; b=0F5mhwQQV4JDEQQ3WMz0ubPSMWXJ5B0uc52kKFb4R9RhbEuy3JZ+IotlYakJnuvH7Q 5audH59+9KocfQGCQnO1BjJ0MABCSV84iAupbN3Ejr4WM2Ju4KVxiQwTyhg2RVnyFUla NFYzaJ8QE7K6UaPJPXULBe+ku8K0hpqDTSqtZtxfmkdene/Zj3jVvh4COckbJxglQ7bk GCBJb10Nfjwe+AWcljTlamWznrla4dgSKWWKOiyhx4QCuUvrZZrOCvGd2zYJvuCW1Ihi 91XcL53aeLwCIxRNgnQV0mz/F8esi9/VPNtOHbZcsAewLxDmutIpewFGApBeTKrrmCcB Kp3A== X-Gm-Message-State: AOAM530mUhbH/Q3n+bVKFR+I/Zxcdoto/JZdQIqqDYefGrAhv3kztV5D BiA8eZVa70/fS15HGzYH++LN4c2gFMGqzfhsie/WBskLskQtOvOWgUCZ4BtY+BNTCzDx9Qgdj+4 YhPzsasv8GSEhNqA6er1hOqOmXf/hZT1oIN1ZhMiLpF9dZDDn14AZd/3/7NIMb8r7Z9w= X-Received: by 2002:aa7:d052:0:b0:42d:d114:43f7 with SMTP id n18-20020aa7d052000000b0042dd11443f7mr43039891edo.320.1654766147593; Thu, 09 Jun 2022 02:15:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzhQuKSreGYv6KIB82qXVJMF3aB2ilOx1meG0B6RYHi5p8rNxRS1kT/+Tc8Puwzy0jg0WEZg== X-Received: by 2002:aa7:d052:0:b0:42d:d114:43f7 with SMTP id n18-20020aa7d052000000b0042dd11443f7mr43039866edo.320.1654766147324; Thu, 09 Jun 2022 02:15:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: mst@redhat.com, thuth@redhat.com Subject: [PATCH 4/4] virtio-mmio: cleanup reset Date: Thu, 9 Jun 2022 11:15:34 +0200 Message-Id: <20220609091534.1416909-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220609091534.1416909-1-pbonzini@redhat.com> References: <20220609091534.1416909-1-pbonzini@redhat.com> MIME-Version: 1.0 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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654774078095100001 Content-Type: text/plain; charset="utf-8" Make virtio_mmio_soft_reset reset the virtio device, which is performed by both the "soft" and the "hard" reset; and then call virtio_mmio_soft_reset from virtio_mmio_reset to emphasize that the latter is a superset of the former. Signed-off-by: Paolo Bonzini --- hw/virtio/virtio-mmio.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 6d81a26473..d240efef97 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -72,12 +72,12 @@ static void virtio_mmio_soft_reset(VirtIOMMIOProxy *pro= xy) { int i; =20 - if (proxy->legacy) { - return; - } + virtio_bus_reset(&proxy->bus); =20 - for (i =3D 0; i < VIRTIO_QUEUE_MAX; i++) { - proxy->vqs[i].enabled =3D 0; + if (!proxy->legacy) { + for (i =3D 0; i < VIRTIO_QUEUE_MAX; i++) { + proxy->vqs[i].enabled =3D 0; + } } } =20 @@ -376,7 +376,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offs= et, uint64_t value, return; } if (value =3D=3D 0) { - virtio_bus_reset(&vdev->bus); + virtio_mmio_soft_reset(proxy); } else { virtio_queue_set_addr(vdev, vdev->queue_sel, value << proxy->guest_page_shift); @@ -432,7 +432,6 @@ static void virtio_mmio_write(void *opaque, hwaddr offs= et, uint64_t value, } =20 if (vdev->status =3D=3D 0) { - virtio_reset(vdev); virtio_mmio_soft_reset(proxy); } break; @@ -627,7 +626,8 @@ static void virtio_mmio_reset(DeviceState *d) VirtIOMMIOProxy *proxy =3D VIRTIO_MMIO(d); int i; =20 - virtio_bus_reset(&proxy->bus); + virtio_mmio_soft_reset(proxy); + proxy->host_features_sel =3D 0; proxy->guest_features_sel =3D 0; proxy->guest_page_shift =3D 0; @@ -636,7 +636,6 @@ static void virtio_mmio_reset(DeviceState *d) proxy->guest_features[0] =3D proxy->guest_features[1] =3D 0; =20 for (i =3D 0; i < VIRTIO_QUEUE_MAX; i++) { - proxy->vqs[i].enabled =3D 0; proxy->vqs[i].num =3D 0; proxy->vqs[i].desc[0] =3D proxy->vqs[i].desc[1] =3D 0; proxy->vqs[i].avail[0] =3D proxy->vqs[i].avail[1] =3D 0; --=20 2.36.1