Page MenuHomeFreeBSD

vmm: add VM_BIND_MEMSEG for userspace-backed devmem
Needs ReviewPublic

Authored by zishun.yi.dev_gmail.com on Aug 3 2026, 11:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 6, 10:24 AM
Unknown Object (File)
Sun, Sep 6, 7:38 AM
Unknown Object (File)
Sat, Sep 5, 12:50 PM
Unknown Object (File)
Sat, Sep 5, 2:57 AM
Unknown Object (File)
Fri, Sep 4, 9:28 PM
Unknown Object (File)
Fri, Sep 4, 3:13 PM
Unknown Object (File)
Thu, Sep 3, 1:41 AM
Unknown Object (File)
Wed, Sep 2, 11:31 AM

Details

Reviewers
andrew
manu
Group Reviewers
bhyve
Summary

Add VM_BIND_MEMSEG, allowing userspace to bind an existing sealed shared-memory
object to a VMM memory segment. Expose the operation through libvmmapi as
vm_bind_devmem(). The current implementation accepts sealed shm objects only,
but the interface can be extended to other backing-object types.

By decoupling devmem allocation from the VMM, this lets bhyve use userspace
memory-sharing and acceleration mechanisms. For example, bhyve can create a
framebuffer from a memfd, bind it as devmem, and export it as a dmabuf through
udmabuf for zero-copy display.

This is the first step toward using my GSoC udmabuf work to improve bhyve's
local display path. I intend to follow it with a D-Bus backend for fbuf, and
later investigate vhost-user-gpu with D-Bus display, bringing newer virtual
graphics paths to bhyve without GPL code in base.

This revision can hang until the D-Bus backend is implemented, since the API
currently has no users.

Diff Detail

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