Diff for /wikisrc/ports/xen/howto.mdwn between versions 1.145 and 1.149

version 1.145, 2018/07/26 10:36:26 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 88  hardware architecture on which it runs.  Line 86  hardware architecture on which it runs. 
 both Intel and AMD, and in 2016 a normal PC has this CPU  both Intel and AMD, and in 2016 a normal PC has this CPU
 architecture.)  architecture.)
   
 Xen  Xen versions
 ---  ------------
   
 In NetBSD, Xen is provided in pkgsrc, via matching pairs of packages  In NetBSD, Xen is provided in pkgsrc, via matching pairs of packages
 xenkernel and xentools.  We will refer only to the kernel versions,  xenkernel and xentools.  We will refer only to the kernel versions,
Line 111  See also the [Xen Security Advisory page Line 109  See also the [Xen Security Advisory page
   
 Note: Xen 4.2 was the last version to support 32bit CPUs.  Note: Xen 4.2 was the last version to support 32bit CPUs.
   
 Note that NetBSD support is called XEN3.  It works with Xen 3 and Xen  
 4 because the hypercall interface has been stable.  
   
 Xen command program  Xen command program
 -------------------  -------------------
   
Line 125  xm and xl work fine.  4.4 is the last ve Line 120  xm and xl work fine.  4.4 is the last ve
 You must make a global choice to use xm or xl, because it affects not  You must make a global choice to use xm or xl, because it affects not
 only which command you use, but the command used by rc.d scripts  only which command you use, but the command used by rc.d scripts
 (specifically xendomains) and which daemons should be run.  The  (specifically xendomains) and which daemons should be run.  The
 xentools packages provide xm for 3.1, 3.3 and 4.1 and xl for 4.2 and up.  xentools packages provide xl for 4.2 and up.
   
 In 4.2, you can choose to use xm by simply changing the ctl_command  In 4.2, you can choose to use xm by simply changing the ctl_command
 variable and setting xend=YES in rc.conf.  variable and setting xend=YES in rc.conf.
Line 138  xbd, where a vnd must be allocated).  Bu Line 133  xbd, where a vnd must be allocated).  Bu
 been adequately tested for a complex custom setup with a large number  been adequately tested for a complex custom setup with a large number
 of interfaces.  of interfaces.
   
 NetBSD  NetBSD versions
 ------  ---------------
   
 The netbsd-7, netbsd-8, and -current branches are all reasonable  The netbsd-7, netbsd-8, and -current branches are all reasonable
 choices, with more or less the same considerations for non-Xen use.  choices, with more or less the same considerations for non-Xen use.
 Therefore, netbsd-7 is recommended as the stable version of the most  NetBSD 8 is recommended as the stable version of the most recent
 recent release for production use.  (Note that netbsd-7 (and therefore  release for production use.
 8/current) have a important scheduler fix (in November of 2015)  
 affecting contention between dom0 and domUs; see  For developing Xen, netbsd-current may be appropriate.
 https://releng.netbsd.org/cgi-bin/req-7.cgi?show=1040 for a  
 description.)  For production, netbsd-7 is appropriate.  For learning,  
 netbsd-8 is appropriate.  For developing Xen, netbsd-current may be  
 appropriate.  
   
 As of NetBSD 6, a NetBSD domU will support multiple vcpus.  There is  As of NetBSD 6, a NetBSD domU will support multiple vcpus.  There is
 no SMP support for NetBSD as dom0.  (The dom0 itself doesn't really  no SMP support for NetBSD as dom0.  (The dom0 itself doesn't really
 need SMP for dom0 functions; the lack of support is really a problem  need SMP for dom0 functions; the lack of support is really a problem
 when using a dom0 as a normal computer.)  when using a dom0 as a normal computer.)
   
   Note: NetBSD support is called XEN3. However, it does support Xen 4,
   because the hypercall interface has remained identical.
   
 Architecture  Architecture
 ------------  ------------
   
Line 198  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
 --------------  --------------
   

Removed from v.1.145  
changed lines
  Added in v.1.149


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb