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 January 8, 2024 30.Dt XEN 4 31.Os 32.Sh NAME 33.Nm xen 34.Nd Xen Hypervisor Support 35.Sh SYNOPSIS 36FreeBSD supports running both as a Xen guest and host on amd64 hardware. 37Guest support is limited to HVM and PVH modes, while host support is limited to 38PVH mode only. 39.Pp 40Xen support is built by default in the i386 and amd64 GENERIC kernels; note 41however that host mode is only available on amd64. 42.Sh DESCRIPTION 43The Xen Hypervisor allows multiple virtual machines to be run on a single 44computer system. 45When first released, Xen required that i386 kernels be compiled 46"para-virtualized" as the x86 instruction set was not fully virtualizable. 47Primarily, para-virtualization modifies the virtual memory system to use 48hypervisor calls (hypercalls) rather than direct hardware instructions to 49modify the TLB, although para-virtualized device drivers were also required 50to access resources such as virtual network interfaces and disk devices. 51.Pp 52With later instruction set extensions from AMD and Intel to support fully 53virtualizable instructions, unmodified virtual memory systems can also be 54supported; this is referred to as hardware-assisted virtualization (HVM and PVH). 55HVM configurations may either rely on transparently emulated hardware 56peripherals, or para-virtualized drivers, which are aware of virtualization, 57and hence able to optimize certain behaviors to improve performance or 58semantics. 59PVH configurations rely on para-virtualized drivers exclusively for IO. 60.Pp 61.Fx 62Para-virtualized device drivers are required in order to support certain 63functionality, such as processing management requests, returning idle 64physical memory pages to the hypervisor, etc. 65.Ss Xen device drivers 66These para-virtualized drivers are supported: 67.Bl -hang -offset indent -width blkfront 68.It Nm balloon 69Allow physical memory pages to be returned to the hypervisor as a result of 70manual tuning or automatic policy. 71.It Nm blkback 72Exports local block devices or files to other Xen domains where they can 73then be imported via 74.Nm blkfront . 75.It Nm blkfront 76Import block devices from other Xen domains as local block devices, to be 77used for file systems, swap, etc. 78.It Nm console 79Export the low-level system console via the Xen console service. 80.It Nm control 81Process management operations from Domain 0, including power off, reboot, 82suspend, crash, and halt requests. 83.It Nm evtchn 84Expose Xen events via the 85.Pa /dev/xen/evtchn 86special device. 87.It Nm gntdev 88Allow access to the grant table interface via the 89.Pa /dev/xen/gntdev 90special device. 91.It Nm netback 92Export local network interfaces to other Xen domains where they can be 93imported via 94.Nm netfront . 95.It Nm netfront 96Import network interfaces from other Xen domains as local network interfaces, 97which may be used for IPv4, IPv6, etc. 98.It Nm privcmd 99Allow issuing hypercalls via the 100.Pa /dev/xen/privcmd 101special device. 102.It Nm timer 103Implementation of a one-shot high resolution per-CPU timer using the hypercall 104interface. 105.It Nm acpi cpu 106When running as a host forwards power management related information from ACPI 107to the hypervisor for better performance management. 108.It Nm xenpci 109Represents the Xen PCI device, an emulated PCI device that is exposed to 110HVM domains. 111This device allows detection of the Xen hypervisor, and provides interrupt 112and shared memory services required to interact with the hypervisor. 113.It Nm xenstore 114Information storage space shared between domains. 115.El 116.Sh HISTORY 117Support for 118.Nm 119first appeared in 120.Fx 8.1 . 121Support for host mode was added in 11.0 . 122.Sh AUTHORS 123.An -nosplit 124.Fx 125support for Xen was first added by 126.An Kip Macy Aq Mt kmacy@FreeBSD.org 127and 128.An Doug Rabson Aq Mt dfr@FreeBSD.org . 129Further refinements were made by 130.An Justin Gibbs Aq Mt gibbs@FreeBSD.org , 131.An Adrian Chadd Aq Mt adrian@FreeBSD.org , 132.An Colin Percival Aq Mt cperciva@FreeBSD.org , 133and 134.An Roger Pau Monné Aq Mt royger@FreeBSD.org . 135This manual page was written by 136.An Robert Watson Aq Mt rwatson@FreeBSD.org , 137and 138.An Roger Pau Monné Aq Mt royger@FreeBSD.org . 139