xref: /freebsd/share/man/man4/xen.4 (revision 61e21613)
1.\" Copyright (c) 2010 Robert N. M. Watson
2.\" All rights reserved.
3.\"
4.\" This software was developed by SRI International and the University of
5.\" Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
6.\" ("CTSRD"), as part of the DARPA CRASH research program.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.Dd April 30, 2015
30.Dt XEN 4
31.Os
32.Sh NAME
33.Nm xen
34.Nd Xen Hypervisor Guest (DomU) Support
35.Sh SYNOPSIS
36To compile hardware-assisted virtualization (HVM) Xen guest support with
37para-virtualized drivers into an amd64 or i386 kernel,
38place the following lines in your kernel configuration file:
39.Bd -ragged -offset indent
40.Cd "options XENHVM"
41.Cd "device xenpci"
42.Ed
43.Sh DESCRIPTION
44The Xen Hypervisor allows multiple virtual machines to be run on a single
45computer system.
46When first released, Xen required that i386 kernels be compiled
47"para-virtualized" as the x86 instruction set was not fully virtualizable.
48Primarily, para-virtualization modifies the virtual memory system to use
49hypervisor calls (hypercalls) rather than direct hardware instructions to
50modify the TLB, although para-virtualized device drivers were also required
51to access resources such as virtual network interfaces and disk devices.
52.Pp
53With later instruction set extensions from AMD and Intel to support fully
54virtualizable instructions, unmodified virtual memory systems can also be
55supported; this is referred to as hardware-assisted virtualization (HVM).
56HVM configurations may either rely on transparently emulated hardware
57peripherals, or para-virtualized drivers, which are aware of virtualization,
58and hence able to optimize certain behaviors to improve performance or
59semantics.
60.Pp
61.Fx
62supports hardware-assisted virtualization (HVM) on both i386 and amd64
63kernels.
64.Pp
65Para-virtualized device drivers are required in order to support certain
66functionality, such as processing management requests, returning idle
67physical memory pages to the hypervisor, etc.
68.Ss Xen DomU device drivers
69These para-virtualized drivers are supported:
70.Bl -hang -offset indent -width blkfront
71.It Nm balloon
72Allow physical memory pages to be returned to the hypervisor as a result of
73manual tuning or automatic policy.
74.It Nm blkback
75Exports local block devices or files to other Xen domains where they can
76then be imported via
77.Nm blkfront .
78.It Nm blkfront
79Import block devices from other Xen domains as local block devices, to be
80used for file systems, swap, etc.
81.It Nm console
82Export the low-level system console via the Xen console service.
83.It Nm control
84Process management operations from Domain 0, including power off, reboot,
85suspend, crash, and halt requests.
86.It Nm evtchn
87Expose Xen events via the
88.Pa /dev/xen/evtchn
89special device.
90.It Nm netback
91Export local network interfaces to other Xen domains where they can be
92imported via
93.Nm netfront .
94.It Nm netfront
95Import network interfaces from other Xen domains as local network interfaces,
96which may be used for IPv4, IPv6, etc.
97.It Nm pcifront
98Allow physical PCI devices to be passed through into a PV domain.
99.It Nm xenpci
100Represents the Xen PCI device, an emulated PCI device that is exposed to
101HVM domains.
102This device allows detection of the Xen hypervisor, and provides interrupt
103and shared memory services required to interact with the hypervisor.
104.El
105.Ss Performance considerations
106In general, PV drivers will perform better than emulated hardware, and are
107the recommended configuration for HVM installations.
108.Pp
109Using a hypervisor introduces a second layer of scheduling that may limit the
110effectiveness of certain
111.Fx
112scheduling optimisations.
113Among these is adaptive locking, which is no longer able to determine whether
114a thread holding a lock is in execution.
115It is recommended that adaptive locking be disabled when using Xen:
116.Bd -unfilled -offset indent
117.Cd "options NO_ADAPTIVE_MUTEXES"
118.Cd "options NO_ADAPTIVE_RWLOCKS"
119.Cd "options NO_ADAPTIVE_SX"
120.Ed
121.Sh HISTORY
122Support for
123.Nm
124first appeared in
125.Fx 8.1 .
126.Sh AUTHORS
127.An -nosplit
128.Fx
129support for Xen was first added by
130.An Kip Macy Aq Mt kmacy@FreeBSD.org
131and
132.An Doug Rabson Aq Mt dfr@FreeBSD.org .
133Further refinements were made by
134.An Justin Gibbs Aq Mt gibbs@FreeBSD.org ,
135.An Adrian Chadd Aq Mt adrian@FreeBSD.org ,
136and
137.An Colin Percival Aq Mt cperciva@FreeBSD.org .
138This manual page was written by
139.An Robert Watson Aq Mt rwatson@FreeBSD.org .
140.Sh BUGS
141.Fx
142is only able to run as a Xen guest (DomU) and not as a Xen host (Dom0).
143.Pp
144As of this release, Xen PV DomU support is not heavily tested; instability
145has been reported during VM migration of PV kernels.
146.Pp
147Certain PV driver features, such as the balloon driver, are under-exercised.
148