These 2 tickets represent an implementation for the live migration feature https://reviews.freebsd.org/D30954, as specified in the first ticket.
This feature sends the guest's memory while it is still running. To do this, it uses migration rounds. In the first round, all the memory is sent over. In subsequent rounds, because the guest is still running and its memory can be modified anytime, only the modified pages since the last round are sent over in order to update the destination's memory. Currently, it uses a fixed number of rounds, 4 (this may be changed in the future). After these rounds finish, the source guest is stopped and the remaining modified memory pages are sent over, alongside the kernel structures' and emulated devices' states. Once this is completed, the guest can be resumed at the destination.
For detecting the pages that were modified between rounds, we use a flag (VPO_VMM_DIRTY) for each vm_page. This flag is set each time vm_page->dirty field is updated but can only be reset when the page is migrated.
The features transfers only through IPv4. The migration procedure works only between identical workstations.
More information regarding the implementation can be found here:
The usage of the feature is detailed here: Virtual Machine Migration using bhyve.
This first part adds the VPO_VMM_DIRTY bit and related functions in the virtual memory system, as well as an ioctl to search for such dirty pages.