NVMM

Created:08-09-2018
Updated:30-05-2020

NVMM


NVMM is a Type-2 hypervisor, and hypervisor platform, that provides support for hardware-accelerated virtualization. A virtualization API is shipped in libnvmm, and allows existing emulators such as Qemu to easily create and manage virtual machines via NVMM.

Resources


Article: From Zero to NVMM.

The kernel code: browse.
The libnvmm API: browse.
The man page: open.
The regression tests: browse.

Qemu+NVMM


Load the NVMM kernel driver: # modload nvmm
You may want to run the NVMM tests to confirm that your setup is correct: # cd /usr/tests/lib/libnvmm/
# atf-run | atf-report
Install the qemu package from pkgsrc. Configure the permissions: # chown root:nvmm /usr/pkg/bin/qemu-system-x86_64
# chmod g+s /usr/pkg/bin/qemu-system-x86_64
Once this is done, you can finally launch Qemu with NVMM acceleration, by adding "-accel nvmm" to your usual Qemu command line. For example: $ qemu-system-x86_64 -smp 4 -m 8G -cdrom Win10_2004_English_x64.iso -accel nvmm
Tested guest OSes:
Guest OS Status Notes
NetBSD 32bit Works
NetBSD 64bit Works
OpenBSD 32bit Works
OpenBSD 64bit Works
FreeBSD 32bit Works
FreeBSD 64bit Works
DragonFlyBSD 64bit Works
Win95 32bit Doesn't work
Win98 32bit Doesn't work
WinXP 32bit Works
Win7 32bit Works
Win8 32bit Works
Win8 64bit Works
Win10 32bit Works
Win10 64bit Works
Fedora 64bit Works Pass "no_timer_check" in grub
ArchLinux 64bit Works Pass "no_timer_check" in grub
Ubuntu 64bit Works
HaikuOS 64bit Works
OmniOS 64bit Works
The other existing OSes have not been tested.

Notes:

Linux performs timer checks at boot time which fail under hypervisors. To work around this, on certain distributions, you must pass "no_timer_check" in the guest's grub.


NetBSD on Qemu+NVMM Fedora on Qemu+NVMM
WindowsXP on Qemu+NVMM Windows10 on Qemu+NVMM
NetBSD 8 (top left), Fedora 29 (top right), Windows XP (bottom left), Windows 10 (bottom right),
all running via Qemu+NVMM on NetBSD.

Technical details


NVMM can support up to 128 virtual machines, each having a maximum of 128 VCPUs and 128GB of RAM. It works with both x86 AMD CPUs and x86 Intel CPUs.

NVMM has unique design properties, not currently found in other hypervisor solutions. A detailed analysis is available in this blog post.

NVMM Design
Design overview