version 1.147, 2018/07/26 10:47:25
|
version 1.149, 2018/07/26 11:00:10
|
Line 6 Introduction
|
Line 6 Introduction
|
[![[Xen |
[![[Xen |
screenshot]](https://www.netbsd.org/gallery/in-Action/hubertf-xens.png)](https://www.netbsd.org/gallery/in-Action/hubertf-xen.png) |
screenshot]](https://www.netbsd.org/gallery/in-Action/hubertf-xens.png)](https://www.netbsd.org/gallery/in-Action/hubertf-xen.png) |
|
|
Xen is a hypervisor (or virtual machine monitor) for x86 hardware |
Xen is a hypervisor for x86 hardware, which supports running multiple guest |
(i686-class or higher), which supports running multiple guest |
|
operating systems on a single physical machine. Xen is a Type 1 or |
operating systems on a single physical machine. Xen is a Type 1 or |
bare-metal hypervisor; one uses the Xen kernel to control the CPU, |
bare-metal hypervisor; one uses the Xen kernel to control the CPU, |
memory and console, a dom0 operating system which mediates access to |
memory and console, a dom0 operating system which mediates access to |
other hardware (e.g., disks, network, USB), and one or more domU |
other hardware (e.g., disks, network, USB), and one or more domU |
operating systems which operate in an unprivileged virtualized |
operating systems which operate in an unprivileged virtualized |
environment. IO requests from the domU systems are forwarded by the |
environment. IO requests from the domU systems are forwarded by the |
hypervisor (Xen) to the dom0 to be fulfilled. |
Xen hypervisor to the dom0 to be fulfilled. |
|
|
Xen supports two styles of guests. The original is Para-Virtualized |
Xen supports different styles of guest: |
(PV) which means that the guest OS does not attempt to access hardware |
|
directly, but instead makes hypercalls to the hypervisor. This is |
[[!table data=""" |
analogous to a user-space program making system calls. (The dom0 |
Style of guest |Supported by NetBSD |
operating system uses PV calls for some functions, such as updating |
PV |Yes |
memory mapping page tables, but has direct hardware access for disk |
HVM |Yes |
and network.) PV guests must be specifically coded for Xen. |
PVHVM |No |
|
PVH |No |
The more recent style is HVM, which means that the guest does not have |
"""]] |
code for Xen and need not be aware that it is running under Xen. |
|
Attempts to access hardware registers are trapped and emulated. This |
In Para-Virtualized (PV) mode, the guest OS does not attempt to access |
style is less efficient but can run unmodified guests. |
hardware directly, but instead makes hypercalls to the hypervisor; PV |
|
guests must be specifically coded for Xen. In HVM mode, no guest |
|
modification is required; however, hardware support is required, such |
|
as VT-x on Intel CPUs and SVM on AMD CPUs. |
|
|
Generally any machine that runs NetBSD/amd64 will work with Xen and PV |
|
guests. In theory i386 computers (without x86_64/amd64 support) can |
|
be used for Xen <= 4.2, but we have no recent reports of this working |
|
(this is a hint). For HVM guests, hardware support is needed, but it |
|
is common on recent machines. For Intel CPUs, one needs the VT-x |
|
extension, shown in "cpuctl identify 0" as VMX. For AMD CPUs, one |
|
needs the AMD-V extensions, shown in "cpuctl identify 0" as SVM. |
|
There are further features for IOMMU virtualization, Intel's VT-d and |
There are further features for IOMMU virtualization, Intel's VT-d and |
AMD's AMD-Vi. TODO: Explain whether Xen on NetBSD makes use of these |
AMD's AMD-Vi. TODO: Explain whether Xen on NetBSD makes use of these |
features. TODO: Review by someone who really understands this. |
features. TODO: Review by someone who really understands this. |
|
|
Note that a FreeBSD dom0 requires VT-x and VT-d (or equivalent); this |
Generally any machine that runs NetBSD/amd64 will work with Xen and PV |
is because the FreeBSD dom0 does not run in PV mode. |
guests. In theory i386 computers (without x86_64/amd64 support) can |
|
be used for Xen <= 4.2, but we have no recent reports of this working |
|
(this is a hint). For HVM guests, hardware support is needed, but it |
|
is common on recent machines. |
|
|
At boot, the dom0 kernel is loaded as a module with Xen as the kernel. |
At boot, the dom0 kernel is loaded as a module with Xen as the kernel. |
The dom0 can start one or more domUs. (Booting is explained in detail |
The dom0 can start one or more domUs. (Booting is explained in detail |
Line 194 caution that the total situation is comp
|
Line 192 caution that the total situation is comp
|
understood. On top of that caution, the post is about Linux, not |
understood. On top of that caution, the post is about Linux, not |
NetBSD. TODO: Include link to benchmarks, if someone posts them. |
NetBSD. TODO: Include link to benchmarks, if someone posts them. |
|
|
Stability |
|
--------- |
|
|
|
Mostly, NetBSD as a dom0 or domU is quite stable. However, just like every |
|
other architecture, there are some open PRs indicating problems. |
|
|
|
Note also that there are issues with sparse vnd(4) instances, but |
|
these are not about Xen -- they just are noticed with sparse vnd(4) |
|
instances in support of virtual disks in a dom0. |
|
|
|
Recommendation |
Recommendation |
-------------- |
-------------- |
|
|