--- wikisrc/ports/xen/howto.mdwn 2018/07/26 10:49:59 1.148 +++ wikisrc/ports/xen/howto.mdwn 2018/07/26 11:00:10 1.149 @@ -6,42 +6,40 @@ Introduction [![[Xen 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 -(i686-class or higher), which supports running multiple guest +Xen is a hypervisor for x86 hardware, which supports running multiple guest 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, memory and console, a dom0 operating system which mediates access to other hardware (e.g., disks, network, USB), and one or more domU operating systems which operate in an unprivileged virtualized 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 -(PV) which means that the guest OS does not attempt to access hardware -directly, but instead makes hypercalls to the hypervisor. This is -analogous to a user-space program making system calls. (The dom0 -operating system uses PV calls for some functions, such as updating -memory mapping page tables, but has direct hardware access for disk -and network.) PV guests must be specifically coded for Xen. - -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 -style is less efficient but can run unmodified guests. +Xen supports different styles of guest: + +[[!table data=""" +Style of guest |Supported by NetBSD +PV |Yes +HVM |Yes +PVHVM |No +PVH |No +"""]] + +In Para-Virtualized (PV) mode, the guest OS does not attempt to access +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 AMD's AMD-Vi. TODO: Explain whether Xen on NetBSD makes use of these features. TODO: Review by someone who really understands this. -Note that a FreeBSD dom0 requires VT-x and VT-d (or equivalent); this -is because the FreeBSD dom0 does not run in PV mode. +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. 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