LCU14 106- QEMU for ARMv8 and the 64-bit android emulator
---------------------------------------------------
Speaker: A. Bennée, C. Dall & P. Maydell
Date: September 15, 2014
---------------------------------------------------
★ Session Summary ★
QEMU ARMv8-A system emulation was completed shortly after LCA14 and has been fully upstreamed in QEMU. During this session we will briefly cover the level of support and functionality, and we will introduce developers to using QEMU for running 64-bit ARM kernels and distributions using QEMU. We also developed a small set of patches on top of upstream QEMU which allows us to run a 64-bit build of AOSP. We will explain the status and efforts coordinated between Google and Linaro, demo the working system, and show how developers can start playing with this.
---------------------------------------------------
★ Resources ★
Zerista: http://lcu14.zerista.com/event/member/137709
Google Event: https://plus.google.com/u/0/events/cp14ietrgoh99mrm0cg1hibroj0
Video: https://www.youtube.com/watch?v=e6IjNpCKmT4&list=UUIVqQKxCyQLJS6xvSmfndLA
Etherpad: http://pad.linaro.org/p/lcu14-106
---------------------------------------------------
★ Event Details ★
Linaro Connect USA - #LCU14
September 15-19th, 2014
Hyatt Regency San Francisco Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Precise and Complete Requirements? An Elusive Goal
LCU14 106- QEMU for ARMv8 and the 64-bit android emulator
1. LCU14-106: QEMU for ARMv8 and the 64-bit
Android Emulator
A. Bennée, C. Dall & P. Maydell, LCU14
LCU14 BURLINGAME
2. QEMU ARMv8 State of the union
● ARMv8-A Instruction Set Support - Upstream January 2014
● Provides User Mode Emulation
● Includes ARMv8 AArch32 extensions, AArch32 crypto instructions, and ARMv8 NEON
support
● System Mode Emulation - Upstream March 2014
● ARMv8 Debug Architecture - in the works
● TCG PSCI Support - patches from Ard Biesheuvel on list (originally
from Rob Herring)
3. The Android Emulator
● Really old fork of QEMU
● Heavily modified by Google
● Backporting ARMv8-A support is a
huge pain
● Defines a “Goldfish” board:
● ADB Pipe (a.k.a. QEMU Pipe)
● GPU Emulation
● Skinning
● Emulated battery
● Emulated sensors
● Android Console
● ADB backend
4. Ranchu - 64-bit Android on QEMU
● A new Goldfish
● Based on -M virt
● Uses Virtio where it can (block, net)
● ADB Pipe
● ADB backend
● Android Console based on QEMU
Monitor
5. Ranchu - Future Plans
● Working with Google on basing new Android Emulator on
upstream QEMU, using Ranchu as base
● Working on Ranchu-based 32-bit Android support as well
● Benefit from future additions to QEMU (like TrustZone)
● Linaro to complete the initial prototype (screen rotation,
full Android console, …)
● Plans to send RFC patch set upstream
● Google is working on GPU support and skinning
7. QEMU ARMv8: A practical guide
● ARMv8 Models
● Virt I/O based (block, net, fs, char), Serial UART, RTC, Flash
● Very Simple Example
● You can use modern mainline kernel, no patches required
● ARCH=arm64 make defconfig + aarch64 initrd userspace
qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic -smp 1 -m 2048 -kernel ../linux.
git/arch/arm64/boot/Image --append "console=ttyAMA0"
● Adding VIRT-IO features
● CONFIG_VIRT_DRIVERS, CONFIG_VIRTIO_*, CONFIG_NET_9P_VIRTIO
● Together with a rootfs on a block device (any standard FS)
qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 2048 -kernel ..
/linux.git/arch/arm64/boot/Image --append "console=ttyAMA0 root=/dev/vda debug=vc" -drive file=..
/rootfs/ubuntu-trusty.img,id=myblock,index=0 -device virtio-blk-device,drive=myblock -netdev user,id=unet -
device virtio-net-device,netdev=unet
8. 64 Bit Android Emulator
● Not upstream, you will need
● Custom kernel
● Patched AOSP tree
● Beta branch of the QEMU git tree
● See the fine blog post:
● http://www.linaro.org/blog/core-dump/running-64bit-android-l-qemu/
9. More about Linaro Connect: connect.linaro.org
Linaro members: www.linaro.org/members
More about Linaro: www.linaro.org/about/