From nobody Mon Dec 27 00:15:35 2021 X-Original-To: dev-commits-src-branches@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 8101B1908084; Mon, 27 Dec 2021 00:15:36 +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 4JMdVJ1qDpz50MP; Mon, 27 Dec 2021 00:15:36 +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 17FA1144A2; Mon, 27 Dec 2021 00:15:36 +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 1BR0Faai016765; Mon, 27 Dec 2021 00:15:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BR0FZmd016764; Mon, 27 Dec 2021 00:15:35 GMT (envelope-from git) Date: Mon, 27 Dec 2021 00:15:35 GMT Message-Id: <202112270015.1BR0FZmd016764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6d4d4e531d74 - stable/13 - bhyve: Only snapshot initialized VirtIO queues List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d4d4e531d74493634135988c9eaaeffd393ff53 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640564136; 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=OrBBZFTwSTy956JlvMoS5VCPIId7wlQdeNw0iT9vFog=; b=ffV2F6Np2pqX0TWandctJPbJXvcdcgfsAijHJl1h/xIF113AQCrx6zcEJEWooW0nLPoaGh VncGwCdKe+pjtNItWOqE6Cjrh0ceDp7geaYVKCWGdvvmR/9wmk9Pqk28P+3tZNkDhKI4vT fjiT5pTFI9Lesc6I3USyn35zUCtoA8AdRuNGl+/JQu4NxflOUqnf6ti0brVypF+Y3DKIxu c6FbyUahS7tUrEQeOkXU6K6gz90LHUxKIXfkPS6GjqWjWaJwg2AgBZeTUNhdoOpQx1Ny9W KBq7+wPBUEzF2NjwJ6v/bl1QzxB2pdH99+hAN4W7+LLntQOeR6jYaoaXCLnVaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640564136; a=rsa-sha256; cv=none; b=gxRLnmtd+YTu0Esvqd1sC3wq9PB3OpRGdkwAWZ+D6/qfWrVbl0grOywbJJVRYOI7RgJJ8/ y5KCN/tVRiqDxv3NL8BfrTMa+Cc1+t37DeZAX9FXlWab9Zj44HlbIMuCOS6eSplbV6Wf/m yDjMDIyhySzojlQxQoDhRC+jAAEzVfIzv08RNZwxsCbY0aJi35LfjoT+t+NUyR/UQk30uo yZaC9MgD1W+8kxqBbjzraViKxWRgUnAwWDjbsfp5ILmBO0AaCL7nUMnfRQnUyrgPS0zgg0 HDC3CwRiUOOKD/zQW5gH6PFyuLy1WrrgSyVC0D10RPRQa9BMOonUo+xbzphZvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6d4d4e531d74493634135988c9eaaeffd393ff53 commit 6d4d4e531d74493634135988c9eaaeffd393ff53 Author: Vitaliy Gusev AuthorDate: 2021-12-16 16:06:08 +0000 Commit: Mark Johnston CommitDate: 2021-12-27 00:15:00 +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 Reviewed by: jhb (cherry picked from commit d079fc197aca951c7918276922038852167dd39f) --- 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 7f0485cbb826..13a274a03c0c 100644 --- a/usr.sbin/bhyve/virtio.c +++ b/usr.sbin/bhyve/virtio.c @@ -895,6 +895,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);