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
F146405495: D53421.id165258.diff
Mon, Mar 2, 10:51 AM
F146376751: D53421.id165258.diff
Mon, Mar 2, 5:09 AM
Unknown Object (File)
Sun, Mar 1, 4:01 AM
Unknown Object (File)
Fri, Feb 27, 5:08 PM
Unknown Object (File)
Fri, Feb 27, 6:44 AM
Unknown Object (File)
Mon, Feb 23, 9:56 PM
Unknown Object (File)
Mon, Feb 23, 9:55 PM
Unknown Object (File)
Wed, Feb 18, 1:40 AM

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.