Upgrade less(1). 1/2
[dragonfly.git] / lib / libc / sys / vmm.2
1 .\"
2 .\" Copyright (c) 2015
3 .\"     The DragonFly Project.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in
13 .\"    the documentation and/or other materials provided with the
14 .\"    distribution.
15 .\" 3. Neither the name of The DragonFly Project nor the names of its
16 .\"    contributors may be used to endorse or promote products derived
17 .\"    from this software without specific, prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .Dd September 1, 2015
33 .Dt VMM 2
34 .Os
35 .Sh NAME
36 .Nm vmm_guest_ctl ,
37 .Nm vmm_guest_sync_addr
38 .Nd enter VMM mode / sync VMM threads
39 .Sh LIBRARY
40 .Lb libc
41 .Sh SYNOPSIS
42 .In sys/vmm.h
43 .Ft int
44 .Fn vmm_guest_ctl "int op" "struct vmm_guest_options *options"
45 .Ft int
46 .Fn vmm_guest_sync_addr "long *dstaddr" "long *srcaddr"
47 .Sh DESCRIPTION
48 In order to run a virtual machine on top of the host operating system, two
49 sets of page tables are needed (one each for the host and guest).
50 Older CPUs supports only one level of page tables and the second level had
51 to be emulated in software.
52 Modern CPUs have support for a second level of page table translations,
53 such as
54 .Tn Intel Ap s
55 EPT
56 or
57 .Tn AMD Ap s
58 RVI.
59 The
60 .Fn vmm_*
61 functions bring the guest virtual machine into a state in which
62 the hardware is able to walk two levels of page tables.
63 .Pp
64 The only
65 .Fa op
66 currently supported by
67 .Fn vmm_guest_ctl
68 is
69 .Dv VMM_GUEST_RUN ,
70 which bootstraps the calling process as a VMM process running with
71 extended/nested page table support (two layers of page tables).
72 The
73 .Ft vmm_guest_options
74 struct is defined in
75 .In sys/vmm.h .
76 .Pp
77 The
78 .Fn vmm_guest_sync_addr
79 function copies the content of
80 .Fa srcaddr
81 to
82 .Fa dstaddr ,
83 synchronizing with all CPUs which are in VMM mode (i.e., all CPUs will see
84 .Fa srcaddr Ap s
85 value at
86 .Fa dstaddr ) .
87 .Sh HISTORY
88 The
89 .Fn vmm_guest_ctl
90 and
91 .Fn vmm_guest_sync_addr
92 system calls were added in
93 .Dx 3.5 .
94 .Sh AUTHORS
95 .An Mihai Carabas