Re: Bhyve finally got nested virtualization.
Date: Wed, 18 Nov 2026 10:46:01 UTC
On Wed, 18 Nov 2026 07:17:16 UTC, Michael Dexter wrote: > None the less, people want this functionality. > > Please post a review! Here are two: https://www.google.com/url?q=https://reviews.freebsd.org/D61708&source=gmail&ust=1795085160684000&sa=E vmm: Add nested virtualization for Intel CPUs https://www.google.com/url?q=https://reviews.freebsd.org/D61709&source=gmail&ust=1795085160684000&sa=E vmm: Emulate VMREAD and VMWRITE without leaving vmx_run() This is a different piece of work from the one that started this thread. What it is: the smallest nested VMX that runs a guest of a guest. Intel only, off unless the hw.vmm.vmx.nested tunable is set. The guest (L1) gets plain VMX without EPT, so it runs its own guests on shadow page tables. That is enough for Linux/KVM as L1; bhyve and Hyper-V as L1 need EPT and do not work yet. The first review is about 1700 lines, most of them in one new file. Where it comes from: keelOS, a hypervisor appliance that I build on FreeBSD and bhyve, has had nested VMX since October, with EPT for L1, VMCS shadowing and Hyper-V as L1. Its vmm.ko sits on top of a small hypervisor of its own, so that code cannot be moved to FreeBSD as it is. The review is a new implementation of the first stage for stock vmm.ko. If this is wanted, the later stages can follow as separate reviews of the same kind. Since it was asked in this thread: yes, it was written with an AI assistant (Claude), under my direction, and the review says so. It was compared with the SDM section by section, and the comments name the sections. Tests: on bare metal (Xeon Silver 4110), Debian 13 with KVM as L1 boots Linux guests with one and two vCPUs to userland, two of them at the same time, and runs a fork+exec load in them. The test plan in D61708 has the details and a "How to try it" section with the commands. It also says what has not been tested: the vmx tests of kvm-unit-tests do not run as a bhyve guest without work, and I have not done that work yet. I would like to hear what tests you want to see before this could go in, and from anyone who tries it on other hardware. Wanpeng Qian On Wed, Nov 18, 2026 04:17 PM, Michael Dexter <editor@callfortesting.org> wrote: > None the less, people want this functionality. > > Please post a review! > > Michael > > On Tue, Nov 17, 2026 at 10:54 PM Michael Dexter <editor@callfortesting.org> > wrote: > >> On 11/17/26 3:01 PM, Aryeh Friedman wrote: >> > That has been doable for years (see the site in my signature) >> >> I tried to, but your SSL certificate appears to be expired. >> >> Issued On Monday, March 23, 2026 at 12:48:43 PM >> Expires On Sunday, June 21, 2026 at 12:48:42 PM >> >> This makes for four, sorry fifth possibly-LLM-generated nested bhyve >> projects to date and if I recall correctly, none of them have been >> proposed as reviewable reviews. bhyve already operates in delicate >> territory on delicate hardware, and a workable nested bhvye project >> needs to be extremely concise and include a comprehensive test suite. >> One of the five efforts purports to have many tests but even then the >> author is not confident in it. Share your code, share your tests, and >> above all collaborate. >> >> Point of order: bhyve is a part of FreeBSD and is upstream to many >> projects such as yours. This is a FreeBSD mailing list. May I humbly >> suggest that you discuss upstream FreeBSD virtualization on it? >> >> Michael >> >