--- wikisrc/users/kamil/qemu.mdwn 2019/01/30 02:07:44 1.4 +++ wikisrc/users/kamil/qemu.mdwn 2019/09/02 20:48:39 1.9 @@ -91,7 +91,7 @@ membarrier | membarrier system call fdt | fdt device tree | unknown, should work bluez | bluez stack connectivity | unknown kvm | KVM acceleration support | N/A , Linux specific kernel APIs required in userland -hax | HAX acceleration support | mostly works, patches pending +hax | HAX acceleration support | mostly works hvf | Hypervisor.framework acceleration support | not ported, Darwin specific whpx | Windows Hypervisor Platform acceleration support | N/A rdma | Enable RDMA-based migration and PVRDMA support | unknown, probably not supported @@ -141,19 +141,19 @@ 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 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/) + 2. DPDK > DPDK is a set of libraries and drivers for fast packet processing. -[https://dpdk.org/](https://dpdk.org/) + 3. The ultimate CPU emulator > Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework. -[https://www.unicorn-engine.org/](https://www.unicorn-engine.org/) + ## Prioritized tasks @@ -162,3 +162,57 @@ capstone | capstone disassembler s 2. Make QEMU PaX MPROTECT safe. 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. + +## HAXM + +> 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. + +> 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. + + +More information on the porting process is available on The NetBSD blog: + + + +A tutorial (outdated) by an early user of the support: + + + +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. + +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. + +There is no longer need to keep a patched host kernel. + +There is need to keep at least a copy of syssrc in /usr/src(/sys). + +Guests known to work: + + * 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}