HKG15-202: UMEQ (User Mode Emulation Quest)
---------------------------------------------------
Speaker: Remi Durafort
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
UMEQ (user-mode emulation quest) and has been developed to eliminate the functional deficiencies of qemu in user mode (multi-threaded applications, signal handling, etc). Umeq primarily targets ARM 64-bit. The presentation will focus on the architecture principles of umeq and on its implementation.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250782
Video: https://www.youtube.com/watch?v=2-mU0mXHxJg
Etherpad: http://pad.linaro.org/p/hkg15-202
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
3. Who am I?
● Rémi Duraffort (aka ivoire)
● STMicroelectronics assignee
○ working on LAVA
● Open source dev
○ VLC media player (core dev)
○ dvblast, PRoot, v8, …
● … not the umeq developer
4. CEC team @ST
● Compilation Expertise Center
○ Team of compiler writers
● Writing
○ compilers
○ engineering tools
● CI@ST
○ building CI systems for ST
5. What do we need?
● Compiling/testing ARM software
○ ./configure
○ make -j16
○ make test
● Requirements:
1. Reliable
2. Parallelizable
3. Fast
6. Parallelizable
● AArch64 boards are expensive
● x86-64 servers are not
● User mode emulation
○ Run foreign binaries seamlessly on the host
○ Can be multi-threaded
○ No virtual-kernel overhead
○ Use available hardware (OpenGL, …)
● User mode on big servers
○ Massively-parallel validations/tests
7. What’s wrong with QEMU?
● Two modes:
○ system mode: It rocks
○ user mode: “It’s complicated”
● User mode
○ using signal or threads: crashes/hangs/works
○ “QEMU threading support is known to be broken”
■ http://wiki.qemu.org/Testing/LTP
18. Why does it work?
● Simple principles
○ all functions should be reentrant
○ data on stack (IR, JITed code) & thread private
○ no lock in signal handlers
■ one reason why qemu hangs
● Transparent regarding
○ signals (as much as possible)
○ syscalls
19. PTrace emulation
● Debugging
○ with gdb aarch64
○ under umeq
○ thanks to PRoot PTrace emulation
■ UMEQ and PRoot cooperation
21. Play with UMEQ ...
● PTrace bug (kernel)
○ http://bugzilla.kernel.org/show_bug.cgi?id=91791
● jemalloc (firefox, thunderbird, …)
○ http://bugzilla.mozilla.org/show_bug.cgi?id=1124580
● binutils (libpython/blender)
○ https://sourceware.org/ml/binutils/2015-
01/msg00144.html
○ was already found (and fixed) by someone else
22. … it’s reliable
● Complex programs
○ vlc, firefox, thunderbird, wesnoth, okular
○ Not working under QEMU
● gcc test suite
○ better results than QEMU
○ threading tests fragile under QEMU
● Debugging
○ strace, gdb, ...
23. Why not inside QEMU?
● Easier to experiment in UMEQ
○ smaller code base
○ written from scratch (second iteration)
● Difficult to do the same in QEMU
○ requires good knowledge of QEMU
○ a lot of time
● But this is feasible ! (will be huge)