1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

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 <shuriku@shurik.kiev.ua>
Fixes:	a97f683fe3 ("vmm: Add a device file interface for creating and destroying VMs")
This commit is contained in:
Mark Johnston 2024-11-07 20:07:39 +00:00
parent 541e7a98b7
commit d70230783a
3 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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