From nobody Fri Mar 17 10:29:34 2023 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 4PdL3L73RDz3yBV9; Fri, 17 Mar 2023 10:29:34 +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 4PdL3L6GBJz3HHq; Fri, 17 Mar 2023 10:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048974; 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=GNNeFJSuc5hCIfoEYbFvl7fckekEIzq4OT9cs9rkGqI=; b=xYIaSus6UoNHjkCaw545tQBoWIYnfM0TspF8JRvwuLnEj9OzJG1Nhe9V/30djTQcFbMq78 ScO1B3VGPI4tEFHDrMXcKNbjBDtCpIWg4124Dpi6zI8tGbDGnlNejDj15Q+bRLdAxKtvUS EmCPJi/H7l4x4Xig2ZBOExugZrHrOwApp1BX+s3CGU3BA668yTvjJR5C8GY1EDnEE7M/RF AoqefrkFdkh4H3pSiCMFiTguyLec9I2NSf7mqG8m2ptsFA5G21xDzlC/DQDdgATTDox57e boupOtdn/hvoULbnR8fbAKSz3siVg9i1sbpYkbqUMejBXkt+PsbX7O66sYtq6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048974; 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=GNNeFJSuc5hCIfoEYbFvl7fckekEIzq4OT9cs9rkGqI=; b=giooklYibxnASmDeTJcq+A5SdZ+2IAaKrWI6XaLT3Ik26wQiTMMfVxlEmwEclgd8wd3whM ZgcPH1qHcGa7Qz66R45P6iDQMOWjM89CWI9upUYLtRny2TQJEai9vXON360tgC4qSAwh43 Ne33Ge1KjDq+9qVL+WJk33Y/I6B7MUoopCIwzASyMKv0G4LGwB0pMxPfMQWvoFhp4SQ44H ziuJ8tmdQqZr0GjXwF+7A99cy8maUyfV3HBjDy9qerzUBg9EXl5puV59Vt7WHNLdtyKsjb XNhBiXZv9YWSZrImhZGJjnsZirdXDjGdnLheyDeHrdZndw9bRlE73OkRpyHhig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048974; a=rsa-sha256; cv=none; b=sF3DDZ+cWn+HE5L8CN+Ht/zMqTcw8CqgLzaRlr6177TsHWgDytvpbHYO1UdVI7gfuDMfFv 5jOtuPLHy0A/fJpiSbNXYvm74MqkGMjsYwLJO3Ps4/BJv4sJhmd2Z4ZyfFI1bASoGKlfi8 7weAL9kVjVJ3VND1RJFn2pmTiSSn0ZMqUG3YFA2GI/r4ESVKJDTz7l36+zQY8NW9rRa4dp x4kW0g3evbtv33PF85tTbDbeE6SZis4Vcdsy/Ue+ZEIeDUAlsQUsN5ABmsL32lqZxfHVnb rX0V4i6WwEbk8N907I/W6oUg80iAA2MLPWU8WKpWIiL45MGkCsP3MRpSM157AA== 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 4PdL3L5DZ7zMM0; Fri, 17 Mar 2023 10:29:34 +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 32HATYK3067564; Fri, 17 Mar 2023 10:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATYxm067563; Fri, 17 Mar 2023 10:29:34 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:34 GMT Message-Id: <202303171029.32HATYxm067563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: c8ec366fd73e - stable/13 - bhyve: init checkput before caph_enter 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8ec366fd73ecf80348e2a7b019d56aeac0a9f00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=c8ec366fd73ecf80348e2a7b019d56aeac0a9f00 commit c8ec366fd73ecf80348e2a7b019d56aeac0a9f00 Author: Vitaliy Gusev AuthorDate: 2023-03-06 12:35:21 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:35 +0000 bhyve: init checkput before caph_enter init_checkpoint_thread binds to a socket. Bhyve isn't allowed to do that after caph_enter. Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38857 (cherry picked from commit 9a9a248964696f45260ea026aa5f9174cc86b137) --- usr.sbin/bhyve/bhyverun.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index bf7b4856a2b4..702ef0e12690 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1562,6 +1562,17 @@ main(int argc, char *argv[]) */ setproctitle("%s", vmname); +#ifdef BHYVE_SNAPSHOT + /* initialize mutex/cond variables */ + init_snapshot(); + + /* + * checkpointing thread for communication with bhyvectl + */ + if (init_checkpoint_thread(ctx) != 0) + errx(EX_OSERR, "Failed to start checkpoint thread"); +#endif + #ifndef WITHOUT_CAPSICUM caph_cache_catpages(); @@ -1573,15 +1584,6 @@ main(int argc, char *argv[]) #endif #ifdef BHYVE_SNAPSHOT - /* initialize mutex/cond variables */ - init_snapshot(); - - /* - * checkpointing thread for communication with bhyvectl - */ - if (init_checkpoint_thread(ctx) != 0) - errx(EX_OSERR, "Failed to start checkpoint thread"); - if (restore_file != NULL) { destroy_restore_state(&rstate); if (vm_restore_time(ctx) < 0)