Step 1: Prepare host system

Your host needs to be an AArch64 machine booted from the EL2 level. With KVM compiled into kernel, you would see the following in dmesg:

kvm [1]: Hyp mode initialized successfully

I haven't checked the minimum kernel version needed, but at least 4.0-rc3 works for me.

Step 2: Getting QEMU

The first step in running a QEMU ARM guest is to obtain the latest QEMU binary. v2.3 qemu should support this feature when released.

git clone git://git.qemu.org/qemu.git && cd qemu
sudo apt-get build-dep qemu
mkdir build && cd build
../configure --target-list=aarch64-softmmu
make -j <n>

This will place your QEMU binary in build/aarch64-softmmu/qemu-system-aarch64 within the qemu directory.

Step 3: Download guest rootfs and kernel

Here we download images from Linaro, but any typical modern kernel with dtb support and virtio drivers built-in should work.

This particular kernel is built with multi_v7_defconfig with a kvm config fragment setting kvm host and guest related config options.

Step 4: Run KVM

You now have all the required components.

qemu-system-aarch64 -m 1024 -cpu host,aarch64=off -M virt \
 -kernel ./zImage-armv7 -append 'root=/dev/vda2 rw rootwait mem=1024M console=ttyAMA0,38400n8' \
 -drive if=none,id=image,file=kvm-armhf.qcow2  -device virtio-blk-device,drive=image \
 -netdev user,id=user0 -device virtio-net-device,netdev=user0 -nographic -enable-kvm

This will boot you up in a few seconds

Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Linux version 3.19.0-rc3-linaro-flavour ([email protected]) (gcc version 4.9.2 20140811 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.08 - Linaro GCC 4.9-2014.08) ) #1 SMP Thu Feb 26 12:58:38 UTC 2015
CPU: ARMv7 Processor [500f0000] revision 0 (ARMv7), cr=30c5383d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine model: linux,dummy-virt
Forcing write-allocate cache policy for SMP
Memory policy: Data cache writealloc
psci: probing for conduit method from DT.
psci: PSCIv0.2 detected in firmware.
psci: Using standard PSCI v0.2 function IDs
PERCPU: Embedded 9 pages/cpu @eefe6000 s7680 r8192 d20992 u36864
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624
Kernel command line: root=/dev/vda2 rw rootwait mem=1024M console=ttyAMA0,38400n8
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1032936K/1048576K available (4619K kernel code, 185K rwdata, 1256K rodata, 248K init, 166K bss, 15640K reserved, 0K cma-reserved, 270336K highmem)
...
Welcome to Linaro 14.04 (GNU/Linux 3.19.0-rc3-linaro-flavour armv7l)

 * Documentation:  https://wiki.linaro.org/

The programs included with the Linaro system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Linaro comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

[email protected]:~# uname -a
Linux linaro-nano 3.19.0-rc3-linaro-flavour #1 SMP Thu Feb 26 12:58:38 UTC 2015 armv7l armv7l armv7l GNU/Linux
[email protected]:~# cat /proc/cpuinfo 
processor       : 0
model name      : ARMv7 Processor rev 0 (v7l)
BogoMIPS        : 100.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x50
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0x000
CPU revision    : 0

Hardware        : Generic DT based system
Revision        : 0000
Serial          : 0000000000000000
[email protected]:~# 

Core/Virtualization/HowTo/Arm32GuestOnAarch64 (last modified 2015-04-08 06:51:50)