Page MenuHomeFreeBSD

vmm: Move the module load handler to vmm_dev.c
ClosedPublic

Authored by markj on Oct 28 2025, 8:30 PM.
Tags
None
Referenced Files
F171466807: D53421.id165818.diff
Fri, Sep 11, 6:49 AM
Unknown Object (File)
Mon, Sep 7, 9:30 AM
Unknown Object (File)
Tue, Sep 1, 4:18 PM
Unknown Object (File)
Fri, Aug 28, 12:12 PM
Unknown Object (File)
Fri, Aug 28, 10:14 AM
Unknown Object (File)
Wed, Aug 26, 10:07 AM
Unknown Object (File)
Tue, Aug 25, 1:38 AM
Unknown Object (File)
Mon, Aug 24, 7:02 PM

Details

Summary

Move the vmm_initialized check out of vm_create() and into the legacy
sysctl handler. If vmm_initialized is false, /dev/vmmctl will not be
available and so cannot be used to create VMs.

Introduce new MD vmm_init() and vmm_cleanup() routines which handle MD
(de)initialization.

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68287
Build 65170: arc lint + arc unit

Event Timeline

markj requested review of this revision.Oct 28 2025, 8:30 PM

In the commit message do you want to vmm_init -> vmm_modinit, etc.? Generally looks fine to me though.

sys/arm64/include/vmm.h
177 ↗(On Diff #165258)

Can these prototypes go in a single place (<dev/vmm/vmm_dev.h>?)?

corvink added a subscriber: corvink.
corvink added inline comments.
sys/amd64/vmm/vmm.c
257

vmm_ipinum is already defined here.

This revision is now accepted and ready to land.Oct 30 2025, 7:45 AM
In D53421#1220311, @jhb wrote:

In the commit message do you want to vmm_init -> vmm_modinit, etc.? Generally looks fine to me though.

Fixed, thanks.

Handle review feedback:

  • Move vmm_modinit()/modcleanup() prototypes to vmm_dev.h.
  • Remove a stray definition for vmm_ipinum.
This revision now requires review to proceed.Oct 30 2025, 4:31 PM
This revision is now accepted and ready to land.Nov 3 2025, 7:15 AM
This revision was automatically updated to reflect the committed changes.