.\" .\" Copyright (c) 2015 .\" The DragonFly Project. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd September 1, 2015 .Dt VMM 2 .Os .Sh NAME .Nm vmm_guest_ctl , .Nm vmm_guest_sync_addr .Nd enter VMM mode / sync VMM threads .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In sys/vmm.h .Ft int .Fn vmm_guest_ctl "int op" "struct vmm_guest_options *options" .Ft int .Fn vmm_guest_sync_addr "long *dstaddr" "long *srcaddr" .Sh DESCRIPTION In order to run a virtual machine on top of the host operating system, two sets of page tables are needed (one each for the host and guest). Older CPUs supports only one level of page tables and the second level had to be emulated in software. Modern CPUs have support for a second level of page table translations, such as .Tn Intel Ap s EPT or .Tn AMD Ap s RVI. The .Fn vmm_* functions bring the guest virtual machine into a state in which the hardware is able to walk two levels of page tables. .Pp The only .Fa op currently supported by .Fn vmm_guest_ctl is .Dv VMM_GUEST_RUN , which bootstraps the calling process as a VMM process running with extended/nested page table support (two layers of page tables). The .Ft vmm_guest_options struct is defined in .In sys/vmm.h . .Pp The .Fn vmm_guest_sync_addr function copies the content of .Fa srcaddr to .Fa dstaddr , synchronizing with all CPUs which are in VMM mode (i.e., all CPUs will see .Fa srcaddr Ap s value at .Fa dstaddr ) . .Sh HISTORY The .Fn vmm_guest_ctl and .Fn vmm_guest_sync_addr system calls were added in .Dx 3.5 . .Sh AUTHORS .An Mihai Carabas