Copyright (c) 2010 Robert N. M. Watson All rights reserved. This software was developed by SRI International and the University of Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research program. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of co...
NAMExen - Xen Hypervisor Guest (DomU) Support
SYNOPSISTo compile hardware-assisted virtualization (HVM) Xen guest support with para-virtualized drivers into an amd64 or i386 kernel, place the following lines in your kernel configuration file:
options XENHVM device xenpci
DESCRIPTIONThe Xen Hypervisor allows multiple virtual machines to be run on a single computer system. When first released, Xen required that i386 kernels be compiled "para-virtualized" as the x86 instruction set was not fully virtualizable. Primarily, para-virtualization modifies the virtual memory system to use hypervisor calls (hypercalls) rather than direct hardware instructions to modify the TLB, although para-virtualized device drivers were also required to access resources such as virtual network interfaces and disk devices.
With later instruction set extensions from AMD and Intel to support fully virtualizable instructions, unmodified virtual memory systems can also be supported; this is referred to as hardware-assisted virtualization (HVM). HVM configurations may either rely on transparently emulated hardware peripherals, or para-virtualized drivers, which are aware of virtualization, and hence able to optimize certain behaviors to improve performance or semantics.
Fx supports hardware-assisted virtualization (HVM) on both i386 and amd64 kernels.
Para-virtualized device drivers are required in order to support certain functionality, such as processing management requests, returning idle physical memory pages to the hypervisor, etc.
Xen DomU device driversThese para-virtualized drivers are supported:
- Allow physical memory pages to be returned to the hypervisor as a result of manual tuning or automatic policy.
- Exports local block devices or files to other Xen domains where they can then be imported via blkfront
- Import block devices from other Xen domains as local block devices, to be used for file systems, swap, etc.
- Export the low-level system console via the Xen console service.
- Process management operations from Domain 0, including power off, reboot, suspend, crash, and halt requests.
- Expose Xen events via the /dev/xen/evtchn special device.
- Export local network interfaces to other Xen domains where they can be imported via netfront
- Import network interfaces from other Xen domains as local network interfaces, which may be used for IPv4, IPv6, etc.
- Allow physical PCI devices to be passed through into a PV domain.
- Represents the Xen PCI device, an emulated PCI device that is exposed to HVM domains. This device allows detection of the Xen hypervisor, and provides interrupt and shared memory services required to interact with the hypervisor.
Performance considerationsIn general, PV drivers will perform better than emulated hardware, and are the recommended configuration for HVM installations.
Using a hypervisor introduces a second layer of scheduling that may limit the effectiveness of certain Fx scheduling optimisations. Among these is adaptive locking, which is no longer able to determine whether a thread holding a lock is in execution. It is recommended that adaptive locking be disabled when using Xen:
options NO_ADAPTIVE_MUTEXES options NO_ADAPTIVE_RWLOCKS options NO_ADAPTIVE_SX
HISTORYSupport for sysctl Cm net.inet.tcp.syncookies first appeared in Fx 8.1 .
AUTHORSAn -nosplit Fx support for Xen was first added by An Kip Macy Aq Mt kmacy@FreeBSD.org and An Doug Rabson Aq Mt dfr@FreeBSD.org . Further refinements were made by An Justin Gibbs Aq Mt gibbs@FreeBSD.org , An Adrian Chadd Aq Mt adrian@FreeBSD.org , and An Colin Percival Aq Mt cperciva@FreeBSD.org . This manual page was written by An Robert Watson Aq Mt rwatson@FreeBSD.org .
BUGSFx is only able to run as a Xen guest (DomU) and not as a Xen host (Dom0).
As of this release, Xen PV DomU support is not heavily tested; instability has been reported during VM migration of PV kernels.
Certain PV driver features, such as the balloon driver, are under-exercised.