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.\" $FreeBSD$ 30.\" 31.Dd April 30, 2015 32.Dt XEN 4 33.Os 34.Sh NAME 35.Nm xen 36.Nd Xen Hypervisor Guest (DomU) Support 37.Sh SYNOPSIS 38To compile hardware-assisted virtualization (HVM) Xen guest support with 39para-virtualized drivers into an amd64 or i386 kernel, 40place the following lines in your kernel configuration file: 41.Bd -ragged -offset indent 42.Cd "options XENHVM" 43.Cd "device xenpci" 44.Ed 45.Sh DESCRIPTION 46The Xen Hypervisor allows multiple virtual machines to be run on a single 47computer system. 48When first released, Xen required that i386 kernels be compiled 49"para-virtualized" as the x86 instruction set was not fully virtualizable. 50Primarily, para-virtualization modifies the virtual memory system to use 51hypervisor calls (hypercalls) rather than direct hardware instructions to 52modify the TLB, although para-virtualized device drivers were also required 53to access resources such as virtual network interfaces and disk devices. 54.Pp 55With later instruction set extensions from AMD and Intel to support fully 56virtualizable instructions, unmodified virtual memory systems can also be 57supported; this is referred to as hardware-assisted virtualization (HVM). 58HVM configurations may either rely on transparently emulated hardware 59peripherals, or para-virtualized drivers, which are aware of virtualization, 60and hence able to optimize certain behaviors to improve performance or 61semantics. 62.Pp 63.Fx 64supports hardware-assisted virtualization (HVM) on both i386 and amd64 65kernels. 66.Pp 67Para-virtualized device drivers are required in order to support certain 68functionality, such as processing management requests, returning idle 69physical memory pages to the hypervisor, etc. 70.Ss Xen DomU device drivers 71These para-virtualized drivers are supported: 72.Bl -hang -offset indent -width blkfront 73.It Nm balloon 74Allow physical memory pages to be returned to the hypervisor as a result of 75manual tuning or automatic policy. 76.It Nm blkback 77Exports local block devices or files to other Xen domains where they can 78then be imported via 79.Nm blkfront . 80.It Nm blkfront 81Import block devices from other Xen domains as local block devices, to be 82used for file systems, swap, etc. 83.It Nm console 84Export the low-level system console via the Xen console service. 85.It Nm control 86Process management operations from Domain 0, including power off, reboot, 87suspend, crash, and halt requests. 88.It Nm evtchn 89Expose Xen events via the 90.Pa /dev/xen/evtchn 91special device. 92.It Nm netback 93Export local network interfaces to other Xen domains where they can be 94imported via 95.Nm netfront . 96.It Nm netfront 97Import network interfaces from other Xen domains as local network interfaces, 98which may be used for IPv4, IPv6, etc. 99.It Nm pcifront 100Allow physical PCI devices to be passed through into a PV domain. 101.It Nm xenpci 102Represents the Xen PCI device, an emulated PCI device that is exposed to 103HVM domains. 104This device allows detection of the Xen hypervisor, and provides interrupt 105and shared memory services required to interact with the hypervisor. 106.El 107.Ss Performance considerations 108In general, PV drivers will perform better than emulated hardware, and are 109the recommended configuration for HVM installations. 110.Pp 111Using a hypervisor introduces a second layer of scheduling that may limit the 112effectiveness of certain 113.Fx 114scheduling optimisations. 115Among these is adaptive locking, which is no longer able to determine whether 116a thread holding a lock is in execution. 117It is recommended that adaptive locking be disabled when using Xen: 118.Bd -unfilled -offset indent 119.Cd "options NO_ADAPTIVE_MUTEXES" 120.Cd "options NO_ADAPTIVE_RWLOCKS" 121.Cd "options NO_ADAPTIVE_SX" 122.Ed 123.Sh HISTORY 124Support for 125.Nm 126first appeared in 127.Fx 8.1 . 128.Sh AUTHORS 129.An -nosplit 130.Fx 131support for Xen was first added by 132.An Kip Macy Aq Mt kmacy@FreeBSD.org 133and 134.An Doug Rabson Aq Mt dfr@FreeBSD.org . 135Further refinements were made by 136.An Justin Gibbs Aq Mt gibbs@FreeBSD.org , 137.An Adrian Chadd Aq Mt adrian@FreeBSD.org , 138and 139.An Colin Percival Aq Mt cperciva@FreeBSD.org . 140This manual page was written by 141.An Robert Watson Aq Mt rwatson@FreeBSD.org . 142.Sh BUGS 143.Fx 144is only able to run as a Xen guest (DomU) and not as a Xen host (Dom0). 145.Pp 146As of this release, Xen PV DomU support is not heavily tested; instability 147has been reported during VM migration of PV kernels. 148.Pp 149Certain PV driver features, such as the balloon driver, are under-exercised. 150