From nobody Thu Nov 07 20:38:55 2024 X-Original-To: dev-commits-src-main@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 4Xkv7341YQz5cZGv; Thu, 07 Nov 2024 20:38:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xkv733Lnjz3x1k; Thu, 7 Nov 2024 20:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731011935; 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=3Xk7Wz6ZNtmQssVIlV/dvtEy0h5ViFu532PIrJuPEJk=; b=D93VijtmT6Kpv0RR6LeROYkXFtKlYh0BMMK2Qu5r2iSVE/T/BGc7+nhao+MwQiZs8kg+DP PtzPgugmOE3XtjIr8np183kAbKDrEFu7eqsm2hnc9MOXysY8XJtyTadvM+M5rCt7SAsFdG dvrMavsqfdvGzb8oFoH6uSgpNyfp8q6v9fJjNTt2Swqf02fLbTNoDAHaLiOdmKoNpvvLdF XB1ev2r1+gAwFrs9uTblEfNptq9TO4X9tvKDOJ1fabIq4r4z/JNwAiKWbaXXnxrcLE2lP7 Q+3C04daa9n8xTsGdbYCtzYJPUpK2ClFx5GFbwhgwCQw1iTNajzFYn7lJqLQvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731011935; 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=3Xk7Wz6ZNtmQssVIlV/dvtEy0h5ViFu532PIrJuPEJk=; b=Tjlz9g4C+oIMvsozx6KQEXk/Ff4Yom1UYdIX0f3huRViuHoNndeUBMyZEMicAIiBzC2O1U JYMKx4DV8AowxbD5Xvsl+puO99Eq6kxC77EAdWykRyWUoTHadvVom79iSy4KOQkVZ5nVze 8A+FeY+6DoQqx/All40Mu9ZVDyxj1agGuejSt8KVtRhUsMzyRhXKNGYIxDdIA5G/jRJYk3 K7lyFTweuror07Aau1y6klzQKToEohkWCnlgGY8u3YRWgsAvtazysicEAQQ4oJfYIJG0VO xI1uf62cBV0gzcTrrdTdfzH+v+cNYtJlgCBw4UCv4GLTKefYR5aItJHgWZpxsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731011935; a=rsa-sha256; cv=none; b=j60lQX9Jsw3Pbj4JWYWirrSJULWe0M2yVRt8k3Vcg6q5bb6BXgWOeG8I1iTtpv6/kYSihG ZBx5g62CeXxIUES+b96it3PlrcEiqvvx33cRB0d4xBjP3Iej+Kyv2fwLvxJSnyKGdmm1RI yp1o8D3Cx4qxfmzOou/Q5hR/8tzbm/gXUtV3KHyp2YI2h+DpRZFUMqBFmpAf2QwVfD75g5 0o4+90wzMnnYEVZfJ0RLPQ+bYNaHmNQHplF45CTuWUSFVx/+boQg/EcFznoGJpSe4/0M3p 6Nh5z502+YnzMDAeu8GKeofk8B0cP1VkischaDHt3yKGSJ8jgSUKVaLfh1thnA== 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 4Xkv732pDRz10JK; Thu, 7 Nov 2024 20:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7KctC3019958; Thu, 7 Nov 2024 20:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7KctUv019955; Thu, 7 Nov 2024 20:38:55 GMT (envelope-from git) Date: Thu, 7 Nov 2024 20:38:55 GMT Message-Id: <202411072038.4A7KctUv019955@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: d70230783ae2 - main - vmm: Postpone vmm module initialization to after SI_SUB_DEVFS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d70230783ae27594a77560582093dd86426d3360 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d70230783ae27594a77560582093dd86426d3360 commit d70230783ae27594a77560582093dd86426d3360 Author: Mark Johnston AuthorDate: 2024-11-07 20:07:39 +0000 Commit: Mark Johnston CommitDate: 2024-11-07 20:38:38 +0000 vmm: Postpone vmm module initialization to after SI_SUB_DEVFS vmmops_modinit() needs to create a device file, and this must happen after SI_SUB_DEVFS. On non-EARLY_AP_STARTUP platforms (i.e., !x86) this happens already by accident, but we shouldn't rely on it. On riscv, remove the current SI_SUB_SMP ordering since that was copied from arm64 and isn't needed. In particular, riscv's vmmops_modinit() does not call smp_rendezvous(). Reported by: Oleksandr Kryvulia Fixes: a97f683fe3c4 ("vmm: Add a device file interface for creating and destroying VMs") --- sys/amd64/vmm/vmm.c | 3 ++- sys/arm64/vmm/vmm.c | 3 ++- sys/riscv/vmm/vmm.c | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 77e0adda86f5..9569f8ace909 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -513,8 +513,9 @@ static moduledata_t vmm_kmod = { * * - VT-x initialization requires smp_rendezvous() and therefore must happen * after SMP is fully functional (after SI_SUB_SMP). + * - vmm device initialization requires an initialized devfs. */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, MAX(SI_SUB_SMP, SI_SUB_DEVFS) + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); static void diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 2f4f3a2b59ea..808df5e599ac 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -396,8 +396,9 @@ static moduledata_t vmm_kmod = { * * - HYP initialization requires smp_rendezvous() and therefore must happen * after SMP is fully functional (after SI_SUB_SMP). + * - vmm device initialization requires an initialized devfs. */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, MAX(SI_SUB_SMP, SI_SUB_DEVFS) + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); static void diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c index 1c0290ace570..f8be363b6170 100644 --- a/sys/riscv/vmm/vmm.c +++ b/sys/riscv/vmm/vmm.c @@ -287,10 +287,9 @@ static moduledata_t vmm_kmod = { /* * vmm initialization has the following dependencies: * - * - HYP initialization requires smp_rendezvous() and therefore must happen - * after SMP is fully functional (after SI_SUB_SMP). + * - vmm device initialization requires an initialized devfs. */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_DEVFS + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); static void