From nobody Fri Dec 17 18:11:44 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5D06818EF832; Fri, 17 Dec 2021 18:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JFxrd0r8Sz4hyB; Fri, 17 Dec 2021 18:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F26F0209C1; Fri, 17 Dec 2021 18:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BHIBiO2004929; Fri, 17 Dec 2021 18:11:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHIBiDP004928; Fri, 17 Dec 2021 18:11:44 GMT (envelope-from git) Date: Fri, 17 Dec 2021 18:11:44 GMT Message-Id: <202112171811.1BHIBiDP004928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d079fc197aca - main - bhyve: Only snapshot initialized VirtIO queues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d079fc197aca951c7918276922038852167dd39f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639764705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7bNFBV4imWRWkzVsFMxpxj+tynoskz+uoEGPoONgZXM=; b=F9q8LP2D1GdlBzjMMqvXXfvN0I49KUEfNDSbOLUKQYNrC1Qwu4CKqLHLsayyw+j+kB4wfu okQRTgN/N4kOhbLh0NLFI7EsthuxkXiY+zbh8cb+8tCsA1OYaYI4l51bdXFPtbXdPAA8/x fIoqiBCODvwE3KhEwaDFSlNB+u+BCtroWYDeG2OylN3tWHDOEjoPeFsMfWb55jWnxn+06n LXnGkNOswjotZtS4tPtCYoEQptdp/nHNfbnDSjSHeMbsUmft1RcyZzlNy7qWhdzaVtohq1 bICuf9fBMtZfN5zuFvJSiwrSbLU+SGFcA2vAh6JcVMrAwG/28nwXpLAyKuSTDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639764705; a=rsa-sha256; cv=none; b=QxMUelhpoluq3TUjWgXNF6gjW1+Tadxmh6ML+UoVo/ydnlB9Jnz4iK7wVNG/+kMprNG/JK P+/WOvAo3rRXrVkA0kz8lQnuaEm/uBeVFkhhVbKd9vlHAfudNamhK0rKvbY3MIZ4ZbGrJb Vupw0ojzxNkAatbaHKjt/8TN6v057T6VJRuCJmIBe3GLwBudGqZN8zuz3uE6y99Bvk+l3z IqBNHAkExqO5oWUKorjRytJWfSiyUPw3A3j/F97DdZPYw3l9JY10P3jwDVZkNCXwQVvkar lTAqlr6kwvqY38jOUuTvYCpbVHF4X4CedpmDRhn7qwQI5A+aA7aJbBHLM/bs+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d079fc197aca951c7918276922038852167dd39f commit d079fc197aca951c7918276922038852167dd39f Author: Vitaliy Gusev AuthorDate: 2021-12-16 16:06:08 +0000 Commit: Mark Johnston CommitDate: 2021-12-17 18:06:53 +0000 bhyve: Only snapshot initialized VirtIO queues If the virtio device is not fully initialized, then suspend fails with: vi_pci_snapshot_queues: invalid address: vq->vq_desc Failed to snapshot virtio-rnd; ret=14 MFC after: 1 week Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D26268 --- usr.sbin/bhyve/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c index a08964e28563..ec7ddfe38f2e 100644 --- a/usr.sbin/bhyve/virtio.c +++ b/usr.sbin/bhyve/virtio.c @@ -901,6 +901,9 @@ vi_pci_snapshot_queues(struct virtio_softc *vs, struct vm_snapshot_meta *meta) SNAPSHOT_VAR_OR_LEAVE(vq->vq_pfn, meta, ret, done); + if (!vq_ring_ready(vq)) + continue; + addr_size = vq->vq_qsize * sizeof(struct vring_desc); SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(vq->vq_desc, addr_size, false, meta, ret, done);