From nobody Sun Nov 06 15:18:30 2022 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 4N4ygB2g8sz4hPXx; Sun, 6 Nov 2022 15:18:30 +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 4N4ygB2BB7z3bJp; Sun, 6 Nov 2022 15:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667747910; 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=CFAhsjECx8hQ5IeL/xvK2cRoCWPk7FzindTqMHC9Pek=; b=q8YlEXexbBfQ+/pKnjcp+o/FgpoOsgLkEpykmh/5RO0A/88rtS9sS/WpDqdPNx3ppfH5j/ Cw2cOxDIAgdmCIKKith545/PF1CRiGM6mxPTgS+rocooC202BX/FQweLBI99OgQ4S5SuW6 GkXzyhy1/pQL9fOcTh6s+bVKE7rFZackALxobiuoKgwXY14yJzVezjBLKbveYI7h+4FlTr Om1Kxc5WlaUUBXsosTFS0N8Lsmi9YEvZAR4LyeirXs7iX+MnzLJ7DV2Jh+qhb6SP3GFlop v0fUBBFkJM4PhDDcSmDb8f4eDues12gFvRspbE6ukXgkps37WuiTV5nHXvHTZw== 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 4N4ygB1Bc4zQph; Sun, 6 Nov 2022 15:18:30 +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 2A6FIUe4055083; Sun, 6 Nov 2022 15:18:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A6FIUIp055082; Sun, 6 Nov 2022 15:18:30 GMT (envelope-from git) Date: Sun, 6 Nov 2022 15:18:30 GMT Message-Id: <202211061518.2A6FIUIp055082@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: e52aaa644ce1 - stable/13 - bhyve: Handle snapshots of unconfigured virtio-net devices 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: e52aaa644ce186b6f0f38302ad432ddbdf38620a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667747910; 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=CFAhsjECx8hQ5IeL/xvK2cRoCWPk7FzindTqMHC9Pek=; b=GRh2NyipLFp0dzZ6UEyFL4ResYVk2KFCNFXuIBmeUPYsbxBpkF0Lk1DXi/msRsgTPdDIso z4al8521TpZtAoJGJZbVBKLJXoWfH/ARKle9S0h7+V3Tt1p0p7m2a136xuKOA/UanCl0Gx nbTww4R0GxfiEDcotbUhMrQ8x1YvDK67xycijn49cYEU7ZdcnxdUery5w6uZLJi6B0lTAw OtSXWfHANE4yUn7WuRYjR7W2MMBIHWD5o1Xj2/YGUvAlD8wp1zo2LF4zE+I3HdzXXaQLIf TIta0Lxv5lIsS1uYTf/CgQBYGs9e4M0d+SdZiOJrDbtoudRj2bWDncI+atvzlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667747910; a=rsa-sha256; cv=none; b=F3og857y9DgSjaYyMLpsFlqWim2UHBm5WQyD2OJ61SfIgTYjV7f6zE4yE8ICX1g/BgFsi6 wI8Oce+lrco5ktp6Nt6GBt75EPC9+N8bFYDz7yv7L+G9cwLuvujm99zBC7TmQPtqxPAhNl CEuJLFYnvlrOOPwAkBdRbBqpwpo7IkOiRP/83VeHzEie5jKK+oBle/oApZdGzSpQXdKMtw KDX5yqxIwWMlT5I+9CwzuMV7FN34yZ4V9NkbliRGriKthscJ1UnA3hm1kgiEUwnJg1dHLY AjoecdEB31HTFZ/zX5nHdZIpfpM98P2Y6rFusAQjGr79f0geOONI2U+mqJQ1WA== 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=e52aaa644ce186b6f0f38302ad432ddbdf38620a commit e52aaa644ce186b6f0f38302ad432ddbdf38620a Author: Vitaliy Gusev AuthorDate: 2022-10-23 18:47:56 +0000 Commit: Mark Johnston CommitDate: 2022-11-06 15:18:05 +0000 bhyve: Handle snapshots of unconfigured virtio-net devices In case of device reset or not configured - features_negotiated is not set, calling calling pci_vtnet_neg_features is wrong and resume gets "Segmentation fault". Reviewed by: markj Sponsored by: vStack MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D36244 (cherry picked from commit 3b5e5ce87bc885f35100d77b31ac81d3f98342bf) --- usr.sbin/bhyve/pci_virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c index 5c3f885fc5ae..3714b34c5066 100644 --- a/usr.sbin/bhyve/pci_virtio_net.c +++ b/usr.sbin/bhyve/pci_virtio_net.c @@ -786,9 +786,11 @@ pci_vtnet_snapshot(void *vsc, struct vm_snapshot_meta *meta) */ SNAPSHOT_VAR_OR_LEAVE(sc->vsc_features, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(sc->features_negotiated, meta, ret, done); /* Force reapply negociated features at restore time */ - if (meta->op == VM_SNAPSHOT_RESTORE) { + if (meta->op == VM_SNAPSHOT_RESTORE && + sc->features_negotiated) { pci_vtnet_neg_features(sc, sc->vsc_features); netbe_rx_enable(sc->vsc_be); }