17c472105SRobert Watson.\" Copyright (c) 2010 Robert N. M. Watson 27c472105SRobert Watson.\" All rights reserved. 37c472105SRobert Watson.\" 47c472105SRobert Watson.\" This software was developed by SRI International and the University of 57c472105SRobert Watson.\" Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 67c472105SRobert Watson.\" ("CTSRD"), as part of the DARPA CRASH research program. 77c472105SRobert Watson.\" 87c472105SRobert Watson.\" Redistribution and use in source and binary forms, with or without 97c472105SRobert Watson.\" modification, are permitted provided that the following conditions 107c472105SRobert Watson.\" are met: 117c472105SRobert Watson.\" 1. Redistributions of source code must retain the above copyright 127c472105SRobert Watson.\" notice, this list of conditions and the following disclaimer. 137c472105SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 147c472105SRobert Watson.\" notice, this list of conditions and the following disclaimer in the 157c472105SRobert Watson.\" documentation and/or other materials provided with the distribution. 167c472105SRobert Watson.\" 177c472105SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 187c472105SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 197c472105SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 207c472105SRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 217c472105SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 227c472105SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 237c472105SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 247c472105SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 257c472105SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 267c472105SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 277c472105SRobert Watson.\" SUCH DAMAGE. 287c472105SRobert Watson.\" 297c472105SRobert Watson.\" $FreeBSD$ 307c472105SRobert Watson.\" 31902945c7SJohn Baldwin.Dd April 30, 2015 327c472105SRobert Watson.Dt XEN 4 337c472105SRobert Watson.Os 347c472105SRobert Watson.Sh NAME 357c472105SRobert Watson.Nm xen 367c472105SRobert Watson.Nd Xen Hypervisor Guest (DomU) Support 377c472105SRobert Watson.Sh SYNOPSIS 3863f34ca0SRobert WatsonTo compile hardware-assisted virtualization (HVM) Xen guest support with 39902945c7SJohn Baldwinpara-virtualized drivers into an amd64 or i386 kernel, 40902945c7SJohn Baldwinplace the following lines in your kernel configuration file: 417c472105SRobert Watson.Bd -ragged -offset indent 427c472105SRobert Watson.Cd "options XENHVM" 437c472105SRobert Watson.Cd "device xenpci" 447c472105SRobert Watson.Ed 457c472105SRobert Watson.Sh DESCRIPTION 467c472105SRobert WatsonThe Xen Hypervisor allows multiple virtual machines to be run on a single 477c472105SRobert Watsoncomputer system. 487c472105SRobert WatsonWhen first released, Xen required that i386 kernels be compiled 497c472105SRobert Watson"para-virtualized" as the x86 instruction set was not fully virtualizable. 503b56015bSRobert WatsonPrimarily, para-virtualization modifies the virtual memory system to use 513b56015bSRobert Watsonhypervisor calls (hypercalls) rather than direct hardware instructions to 523b56015bSRobert Watsonmodify the TLB, although para-virtualized device drivers were also required 533b56015bSRobert Watsonto access resources such as virtual network interfaces and disk devices. 543b56015bSRobert Watson.Pp 557c472105SRobert WatsonWith later instruction set extensions from AMD and Intel to support fully 563b56015bSRobert Watsonvirtualizable instructions, unmodified virtual memory systems can also be 573b56015bSRobert Watsonsupported; this is referred to as hardware-assisted virtualization (HVM). 583b56015bSRobert WatsonHVM configurations may either rely on transparently emulated hardware 593b56015bSRobert Watsonperipherals, or para-virtualized drivers, which are aware of virtualization, 603b56015bSRobert Watsonand hence able to optimize certain behaviors to improve performance or 613b56015bSRobert Watsonsemantics. 627c472105SRobert Watson.Pp 637c472105SRobert Watson.Fx 64*ed95805eSJohn Baldwinsupports hardware-assisted virtualization (HVM) on both i386 and amd64 65*ed95805eSJohn Baldwinkernels. 667c472105SRobert Watson.Pp 677c472105SRobert WatsonPara-virtualized device drivers are required in order to support certain 683b56015bSRobert Watsonfunctionality, such as processing management requests, returning idle 69055dac5cSRobert Watsonphysical memory pages to the hypervisor, etc. 70cd66b53aSRobert Watson.Ss Xen DomU device drivers 71*ed95805eSJohn BaldwinThese para-virtualized drivers are supported: 723b56015bSRobert Watson.Bl -hang -offset indent -width blkfront 733b56015bSRobert Watson.It Nm balloon 743b56015bSRobert WatsonAllow physical memory pages to be returned to the hypervisor as a result of 753b56015bSRobert Watsonmanual tuning or automatic policy. 763b56015bSRobert Watson.It Nm blkback 77cd66b53aSRobert WatsonExports local block devices or files to other Xen domains where they can 78cd66b53aSRobert Watsonthen be imported via 793b56015bSRobert Watson.Nm blkfront . 803b56015bSRobert Watson.It Nm blkfront 813b56015bSRobert WatsonImport block devices from other Xen domains as local block devices, to be 823b56015bSRobert Watsonused for file systems, swap, etc. 833b56015bSRobert Watson.It Nm console 843b56015bSRobert WatsonExport the low-level system console via the Xen console service. 853b56015bSRobert Watson.It Nm control 863b56015bSRobert WatsonProcess management operations from Domain 0, including power off, reboot, 873b56015bSRobert Watsonsuspend, crash, and halt requests. 883b56015bSRobert Watson.It Nm evtchn 893b56015bSRobert WatsonExpose Xen events via the 903b56015bSRobert Watson.Pa /dev/xen/evtchn 913b56015bSRobert Watsonspecial device. 923b56015bSRobert Watson.It Nm netback 93055dac5cSRobert WatsonExport local network interfaces to other Xen domains where they can be 943b56015bSRobert Watsonimported via 953b56015bSRobert Watson.Nm netfront . 963b56015bSRobert Watson.It Nm netfront 973b56015bSRobert WatsonImport network interfaces from other Xen domains as local network interfaces, 983b56015bSRobert Watsonwhich may be used for IPv4, IPv6, etc. 993b56015bSRobert Watson.It Nm pcifront 100cd66b53aSRobert WatsonAllow physical PCI devices to be passed through into a PV domain. 1013b56015bSRobert Watson.It Nm xenpci 102cd66b53aSRobert WatsonRepresents the Xen PCI device, an emulated PCI device that is exposed to 103cd66b53aSRobert WatsonHVM domains. 104cd66b53aSRobert WatsonThis device allows detection of the Xen hypervisor, and provides interrupt 105cd66b53aSRobert Watsonand shared memory services required to interact with the hypervisor. 1063b56015bSRobert Watson.El 107cd66b53aSRobert Watson.Ss Performance considerations 1083b56015bSRobert WatsonIn general, PV drivers will perform better than emulated hardware, and are 109cd66b53aSRobert Watsonthe recommended configuration for HVM installations. 1103b56015bSRobert Watson.Pp 1113b56015bSRobert WatsonUsing a hypervisor introduces a second layer of scheduling that may limit the 1123b56015bSRobert Watsoneffectiveness of certain 1133b56015bSRobert Watson.Fx 1143b56015bSRobert Watsonscheduling optimisations. 1153b56015bSRobert WatsonAmong these is adaptive locking, which is no longer able to determine whether 1163b56015bSRobert Watsona thread holding a lock is in execution. 1173b56015bSRobert WatsonIt is recommended that adaptive locking be disabled when using Xen: 1180b484c69SRobert Watson.Bd -unfilled -offset indent 1193b56015bSRobert Watson.Cd "options NO_ADAPTIVE_MUTEXES" 1203b56015bSRobert Watson.Cd "options NO_ADAPTIVE_RWLOCKS" 1213b56015bSRobert Watson.Cd "options NO_ADAPTIVE_SX" 1223b56015bSRobert Watson.Ed 1237c472105SRobert Watson.Sh HISTORY 1247c472105SRobert WatsonSupport for 1257c472105SRobert Watson.Nm 1267c472105SRobert Watsonfirst appeared in 1277c472105SRobert Watson.Fx 8.1 . 1287c472105SRobert Watson.Sh AUTHORS 1297c472105SRobert Watson.An -nosplit 1307c472105SRobert Watson.Fx 1317c472105SRobert Watsonsupport for Xen was first added by 1326c899950SBaptiste Daroussin.An Kip Macy Aq Mt kmacy@FreeBSD.org 1337c472105SRobert Watsonand 1346c899950SBaptiste Daroussin.An Doug Rabson Aq Mt dfr@FreeBSD.org . 1357c472105SRobert WatsonFurther refinements were made by 1366c899950SBaptiste Daroussin.An Justin Gibbs Aq Mt gibbs@FreeBSD.org , 1376c899950SBaptiste Daroussin.An Adrian Chadd Aq Mt adrian@FreeBSD.org , 1387c472105SRobert Watsonand 1396c899950SBaptiste Daroussin.An Colin Percival Aq Mt cperciva@FreeBSD.org . 1407c472105SRobert WatsonThis manual page was written by 1416c899950SBaptiste Daroussin.An Robert Watson Aq Mt rwatson@FreeBSD.org . 1427c472105SRobert Watson.Sh BUGS 1437c472105SRobert Watson.Fx 1447c472105SRobert Watsonis only able to run as a Xen guest (DomU) and not as a Xen host (Dom0). 1457c472105SRobert Watson.Pp 146cd66b53aSRobert WatsonAs of this release, Xen PV DomU support is not heavily tested; instability 147cd66b53aSRobert Watsonhas been reported during VM migration of PV kernels. 148cd66b53aSRobert Watson.Pp 149cd66b53aSRobert WatsonCertain PV driver features, such as the balloon driver, are under-exercised. 150