Diff for /wikisrc/users/kamil/qemu.mdwn between versions 1.1 and 1.8

version 1.1, 2018/05/27 09:32:14 version 1.8, 2019/02/13 05:56:28
Line 63  docs           | build documentation     Line 63  docs           | build documentation    
 guest-agent    | build the QEMU Guest Agent                         | unknown, probably broken  guest-agent    | build the QEMU Guest Agent                         | unknown, probably broken
 guest-agent-msi| build guest agent Windows MSI installation package | unknown, probably broken  guest-agent-msi| build guest agent Windows MSI installation package | unknown, probably broken
 pie            | Position Independent Executables                   | should work  pie            | Position Independent Executables                   | should work
 modules        | modules support                                    | unknown, should work  modules        | QEMU modules support (not kernel modules)          | unknown, should work
 debug-tcg      | TCG debugging (default is disabled)                | should work  debug-tcg      | TCG debugging (default is disabled)                | should work
 debug-info     | debugging information                              | should work  debug-info     | debugging information                              | should work
 sparse         | sparse checker                                     | should work  sparse         | sparse checker                                     | should work
Line 91  membarrier     | membarrier system call  Line 91  membarrier     | membarrier system call 
 fdt            | fdt device tree                                    | unknown, should work  fdt            | fdt device tree                                    | unknown, should work
 bluez          | bluez stack connectivity                           | unknown  bluez          | bluez stack connectivity                           | unknown
 kvm            | KVM acceleration support                           | N/A , Linux specific kernel APIs required in userland  kvm            | KVM acceleration support                           | N/A , Linux specific kernel APIs required in userland
 hax            | HAX acceleration support                           | not ported, Windows/Darwin specific as of today  hax            | HAX acceleration support                           | mostly works
 hvf            | Hypervisor.framework acceleration support          | not ported, Darwin specific  hvf            | Hypervisor.framework acceleration support          | not ported, Darwin specific
 whpx           | Windows Hypervisor Platform acceleration support   | N/A  whpx           | Windows Hypervisor Platform acceleration support   | N/A
 rdma           | Enable RDMA-based migration and PVRDMA support     | unknown, probably not supported  rdma           | Enable RDMA-based migration and PVRDMA support     | unknown, probably not supported
Line 141  capstone       | capstone disassembler s Line 141  capstone       | capstone disassembler s
 > HQEMU is a retargetable and multi-threaded dynamic binary translator on multicores. It integrates QEMU and LLVM as its building blocks. The translator in the enhanced QEMU acts as a fast translator with low translation overhead. The optimization-intensive LLVM optimizer running on separate threads dynamically improves code for higher performance. With the hybrid QEMU+LLVM approach, HQEMU can achieve low translation overhead and good translated code quality.  > HQEMU is a retargetable and multi-threaded dynamic binary translator on multicores. It integrates QEMU and LLVM as its building blocks. The translator in the enhanced QEMU acts as a fast translator with low translation overhead. The optimization-intensive LLVM optimizer running on separate threads dynamically improves code for higher performance. With the hybrid QEMU+LLVM approach, HQEMU can achieve low translation overhead and good translated code quality.
 > HQEMU supports process-level emulation and full-system virtualization. It provides translation modes of running the QEMU translator and LLVM optimizer in one process, or running the LLVM optimizer as a stand-alone optimization server (version 0.13.0).  > HQEMU supports process-level emulation and full-system virtualization. It provides translation modes of running the QEMU translator and LLVM optimizer in one process, or running the LLVM optimizer as a stand-alone optimization server (version 0.13.0).
   
 http://itanium.iis.sinica.edu.tw/hqemu/  [http://itanium.iis.sinica.edu.tw/hqemu/](http://itanium.iis.sinica.edu.tw/hqemu/)
   
 2. DPDK  2. DPDK
   
 > DPDK is a set of libraries and drivers for fast packet processing.  > DPDK is a set of libraries and drivers for fast packet processing.
   
 https://dpdk.org/  [https://dpdk.org/](https://dpdk.org/)
   
 3. The ultimate CPU emulator  3. The ultimate CPU emulator
   
 > Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework.   > Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework. 
   
 https://www.unicorn-engine.org/  [https://www.unicorn-engine.org/](https://www.unicorn-engine.org/)
   
 ## Prioritized tasks  ## Prioritized tasks
   
Line 163  https://www.unicorn-engine.org/ Line 163  https://www.unicorn-engine.org/
   
 3. Develop NetBSD USER emulation, attempt to either share the code with FreeBSD (bsd-user, old broken, downstream patches) or with Linux (linux-user, recent, actively maintained). Preferred approach is to share as much code with linux-user as possible, regardless of the state of bsd-user.  3. Develop NetBSD USER emulation, attempt to either share the code with FreeBSD (bsd-user, old broken, downstream patches) or with Linux (linux-user, recent, actively maintained). Preferred approach is to share as much code with linux-user as possible, regardless of the state of bsd-user.
   
 4. Develop HAXM backend support for the NetBSD kernel.  ## HAXM
   
 ## HAXM hardware assisted virtualization  > HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor), widely used as an accelerator for Android Emulator and QEMU. It has always supported running on Windows and macOS, and has been ported to other host operating systems as well, such as Linux and NetBSD.
   
 Features:  > HAXM runs as a kernel-mode driver on the host operating system, and provides a KVM-like interface to user space, thereby enabling applications like QEMU to utilize the hardware virtualization capabilities built into modern Intel CPUs, namely Intel Virtualization Technology.
   
  - Open Source  
  - HAXM is an Intel hardware assisted virtualization.  
  - HAXM supports up to 8 active VMs.  
  - HAXM supports up to 16 active VCPUs per VM.  
  - ioctl(2) based API with statically created devices (/dev/HAX, /dev/haxm_vm/vmXX, /dev/haxm_vm/haxm_vmXX_vcpuYY)  
   
 HAXM porting for NetBSD rationale:  More information on the porting process is available on The NetBSD blog:
   
  - Relatively low cost (compared to alternatives) to get it aboard to the NetBSD kernel.  [http://blog.netbsd.org/tnf/entry/the_hardware_assisted_virtualization_challenge](http://blog.netbsd.org/tnf/entry/the_hardware_assisted_virtualization_challenge)
  - Relatively non-intrusive (compared to alternatives like bhyve and KVM)  
  - Scratch but non-functional port for NetBSD is ready.  
  - Active (paid developers) upstream to maintain this  
  - Clean separation between kernel specific and independent parts (there are at least 2 backends: Darwin and Windows)  
  - QEMU frontend already exists, API is ioctl(2) based  
  - Good license (BSD-3-clause) for the kernel driver  
  - Tailored down for desktop users, initially prepared for Android developers  
   
 HAXM shortcomings:  A tutorial (outdated) by an early user of the support:
   
  - No AMD support  [http://polprog.net/blog/netbsd-hax/](http://polprog.net/blog/netbsd-hax/)
  - Required relatively recent Intel CPU  
  - Not as flexible as KVM-like solutions for embedded or server usage  
  - Not necessarily ready (not tested) to run every OS in existence, there are known failures to execute some versions of the Linux kernel  
   
 Current HAXM/NetBSD status:  NetBSD/amd64 is the only supported host of the package, but it shouldn't be difficult to expand it to Darwin, Windows and Linux if there would be users and maintainers for these OSes.
   
  - The module builds and loads into the kernel (triggering a panic)  NetBSD as host version 8.0 and HEAD (8.99.3x) tested. The minimal version that could work in theory is 6.x, but everything prior 8.0 is untested.
  - Revisit the UVM APIs to ship all the needed features of sharing memory between user and kernel that is used by HAXM  
   
 ```  There is no longer need to keep a patched host kernel.
 https://github.com/krytarowski/haxm/tree/netbsd-1  
   
 $ cd netbsd && make  There is need to keep at least a copy of syssrc in /usr/src(/sys).
 ```  
   
 https://www.qemu.org/2017/11/22/haxm-usage-windows/  Guests known to work:
 https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm  
 https://github.com/intel/haxm   * NetBSD/amd64 8.99.3x (other variations untested)
    * Windows 7 32-bit
    * FreeBSD 12 32-bit
    * Linux (noapic boot)
    * Minix3 i386
    * Plan9 (i386?)
    * FREEDOS
   
   Other OSes are either broken or untested.
   
   Usage:
   
   1. Install emulators/haxm from pkgsrc
   2. Install emulators/qemu 3.1.0nb5 or newer from pkgsrc
   3. Use auxiliary scripts for HAXM (superuser privileges needed)
   4. Append HAXM option to qemu (qemu --accel hax)
   
   Auxiliary scripts in the HAXM package:
   
    * haxm-mknod     # creates /dev entries
    * haxm-modload   # insert the HAXM kernel module
    * haxm-modunload # remove the HAXM module from kernel
   
   Optionally grant access to the HAXM device nodes to user(s):
   
    * /dev/HAX
    * /dev/hax_vm/vm{00-07}
    * /dev/hax_vm{00-07}/vcpu{00-16}

Removed from v.1.1  
changed lines
  Added in v.1.8


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