--- wikisrc/ports/xen/howto.mdwn 2021/03/09 13:57:53 1.202 +++ wikisrc/ports/xen/howto.mdwn 2021/03/15 00:11:52 1.203 @@ -1,4 +1,4 @@ -[[!meta title="Xen HowTo and Status"]] +[[!meta title="Xen Status and HowTo"]] Xen is a Type 1 hypervisor which supports running multiple guest operating systems on a single physical machine. One uses the Xen kernel to control the @@ -8,15 +8,19 @@ systems which operate in an unprivileged from the domU systems are forwarded by the Xen hypervisor to the dom0 to be fulfilled. -This HOWTO presumes a basic familiarity with the Xen system -architecture, with installing NetBSD on amd64 hardware, and with -installing software from pkgsrc. See also the [Xen -website](http://www.xenproject.org/). - -This document also provides status on what Xen things work on NetBSD +This document provides status on what Xen things work on NetBSD (upstream documentation might say something works if it works on some particular Linux system). +This document is also a HOWTO that presumes a basic familiarity with +the Xen system architecture, with installing NetBSD on amd64 hardware, +and with installing software from pkgsrc. See also the [Xen +website](http://www.xenproject.org/). + +If this document says that something works, and you find that it does +not, it is best to ask on port-xen and if you are correct to file a +PR. + [[!toc]] # Overview @@ -39,11 +43,11 @@ approach and limits discussion of altern Xen supports different styles of guests. [[!table data=""" -Style of guest |Supported by NetBSD -PV |Yes (dom0, domU) -HVM |Yes (domU) -PVHVM |current-only (domU) -PVH |current-only (domU, dom0 not yet) +Style of guest |description |NetBSD dom0? |NetBSD domU? +PV |Paravirtualization (hypercalls) |yes |yes +HVM |unmodified guest - domU perceives HW |N/A |yes +PVHVM |Like HVM but also PV drivers |N/A |current only +PVH | |not yet |current only """]] In Para-Virtualized (PV) mode, the guest OS does not attempt to access @@ -61,12 +65,13 @@ drivers for efficiency. Therefore it is PVHVM dom0. See [PV on HVM](https://wiki.xen.org/wiki/PV_on_HVM). There have been two PVH modes: original PVH and PVHv2. Original PVH -was based on PV mode and is no longer relevant at all. PVHv2 is -basically lightweight HVM with PV drivers. A critical feature of it -is that qemu is not needed; the hypervisor can do the emulation that -is required. Thus, a dom0 can be PVHv2. -The source code uses PVH and config files use pvh; this refers to PVHv2. -See [PVH(v2)](https://wiki.xenproject.org/wiki/PVH_(v2\)_Domu). +was based on PV mode and is no longer relevant at all. Therefore +PVHv2 is abreviated PVH. PVHv2 is basically lightweight HVM with PV +drivers. A critical feature of it is that qemu is not needed; the +hypervisor can do the emulation that is required. Thus, a dom0 can be +PVHv2. The source code uses PVH and config files use pvh, but NB that +this refers to PVHv2. See +[PVH(v2)](https://wiki.xenproject.org/wiki/PVH_(v2\)_Domu). At system 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 @@ -108,15 +113,25 @@ by xl. Xen has been supported in NetBSD for a long time, at least since 2005. Initially Xen was PV only. -NetBSD 8 and up support PV and HVM modes. - -Support for PVHVM and PVH is available only in NetBSD-current. - -NetBSD up to and including NetBSD 9 as a dom0 does not run SMP, -because some drivers are not yet safe for this. NetBSD-current -supports SMP in dom0. - -NetBSD, when run as a domU, can and does typically run SMP. +NetBSD has supported PV for a very long time, in both dom0 and domU. +NetBSD >=8 supports HVM mode as a domU (HVM as a dom0 does not make +sense). + +Support for PVHVM and PVH is available only in NetBSD-current; this is +currently somewhat experimental, although PVHVM appears reasonably +solid. + +NetBSD up to and including NetBSD 9 as a dom0 cannot safely run SMP. +Even if one added "options MULTIPROCESSOR" and configured multiple +vcpus, the kernel is likely to crash because of drivers without +adequate locking. + +NetBSD-current supports SMP in dom0, and XEN3_DOM0 includes "options +MULTIPROCESSOR". + +NetBSD (since NetBSD 6), when run as a domU, can run SMP, using +multiple CPUs if provided. The XEN3_DOMU kernel is built +with "options MULITPROCESSOR". Note that while Xen 4.13 is current, the kernel support is still called XEN3, because the hypercall interface has not changed