1324b2298SPaolo Bonzini.. _ARM-System-emulator: 2324b2298SPaolo Bonzini 3*d3149c59SPeter MaydellArm System emulator 4324b2298SPaolo Bonzini------------------- 5324b2298SPaolo Bonzini 6*d3149c59SPeter MaydellQEMU can emulate both 32-bit and 64-bit Arm CPUs. Use the 7*d3149c59SPeter Maydell``qemu-system-aarch64`` executable to simulate a 64-bit Arm machine. 8*d3149c59SPeter MaydellYou can use either ``qemu-system-arm`` or ``qemu-system-aarch64`` 9*d3149c59SPeter Maydellto simulate a 32-bit Arm machine: in general, command lines that 10*d3149c59SPeter Maydellwork for ``qemu-system-arm`` will behave the same when used with 11*d3149c59SPeter Maydell``qemu-system-aarch64``. 12*d3149c59SPeter Maydell 13*d3149c59SPeter MaydellQEMU has generally good support for Arm guests. It has support for 14*d3149c59SPeter Maydellnearly fifty different machines. The reason we support so many is that 15*d3149c59SPeter MaydellArm hardware is much more widely varying than x86 hardware. Arm CPUs 16*d3149c59SPeter Maydellare generally built into "system-on-chip" (SoC) designs created by 17*d3149c59SPeter Maydellmany different companies with different devices, and these SoCs are 18*d3149c59SPeter Maydellthen built into machines which can vary still further even if they use 19*d3149c59SPeter Maydellthe same SoC. Even with fifty boards QEMU does not cover more than a 20*d3149c59SPeter Maydellsmall fraction of the Arm hardware ecosystem. 21*d3149c59SPeter Maydell 22*d3149c59SPeter MaydellThe situation for 64-bit Arm is fairly similar, except that we don't 23*d3149c59SPeter Maydellimplement so many different machines. 24*d3149c59SPeter Maydell 25*d3149c59SPeter MaydellAs well as the more common "A-profile" CPUs (which have MMUs and will 26*d3149c59SPeter Maydellrun Linux) QEMU also supports "M-profile" CPUs such as the Cortex-M0, 27*d3149c59SPeter MaydellCortex-M4 and Cortex-M33 (which are microcontrollers used in very 28*d3149c59SPeter Maydellembedded boards). For most boards the CPU type is fixed (matching what 29*d3149c59SPeter Maydellthe hardware has), so typically you don't need to specify the CPU type 30*d3149c59SPeter Maydellby hand, except for special cases like the ``virt`` board. 31*d3149c59SPeter Maydell 32*d3149c59SPeter MaydellChoosing a board model 33*d3149c59SPeter Maydell====================== 34*d3149c59SPeter Maydell 35*d3149c59SPeter MaydellFor QEMU's Arm system emulation, you must specify which board 36*d3149c59SPeter Maydellmodel you want to use with the ``-M`` or ``--machine`` option; 37*d3149c59SPeter Maydellthere is no default. 38*d3149c59SPeter Maydell 39*d3149c59SPeter MaydellBecause Arm systems differ so much and in fundamental ways, typically 40*d3149c59SPeter Maydelloperating system or firmware images intended to run on one machine 41*d3149c59SPeter Maydellwill not run at all on any other. This is often surprising for new 42*d3149c59SPeter Maydellusers who are used to the x86 world where every system looks like a 43*d3149c59SPeter Maydellstandard PC. (Once the kernel has booted, most userspace software 44*d3149c59SPeter Maydellcares much less about the detail of the hardware.) 45*d3149c59SPeter Maydell 46*d3149c59SPeter MaydellIf you already have a system image or a kernel that works on hardware 47*d3149c59SPeter Maydelland you want to boot with QEMU, check whether QEMU lists that machine 48*d3149c59SPeter Maydellin its ``-machine help`` output. If it is listed, then you can probably 49*d3149c59SPeter Maydelluse that board model. If it is not listed, then unfortunately your image 50*d3149c59SPeter Maydellwill almost certainly not boot on QEMU. (You might be able to 51*d3149c59SPeter Maydellextract the filesystem and use that with a different kernel which 52*d3149c59SPeter Maydellboots on a system that QEMU does emulate.) 53*d3149c59SPeter Maydell 54*d3149c59SPeter MaydellIf you don't care about reproducing the idiosyncrasies of a particular 55*d3149c59SPeter Maydellbit of hardware, such as small amount of RAM, no PCI or other hard 56*d3149c59SPeter Maydelldisk, etc., and just want to run Linux, the best option is to use the 57*d3149c59SPeter Maydell``virt`` board. This is a platform which doesn't correspond to any 58*d3149c59SPeter Maydellreal hardware and is designed for use in virtual machines. You'll 59*d3149c59SPeter Maydellneed to compile Linux with a suitable configuration for running on 60*d3149c59SPeter Maydellthe ``virt`` board. ``virt`` supports PCI, virtio, recent CPUs and 61*d3149c59SPeter Maydelllarge amounts of RAM. It also supports 64-bit CPUs. 62*d3149c59SPeter Maydell 63*d3149c59SPeter MaydellBoard-specific documentation 64*d3149c59SPeter Maydell============================ 65*d3149c59SPeter Maydell 66*d3149c59SPeter MaydellUnfortunately many of the Arm boards QEMU supports are currently 67*d3149c59SPeter Maydellundocumented; you can get a complete list by running 68*d3149c59SPeter Maydell``qemu-system-aarch64 --machine help``. 69324b2298SPaolo Bonzini 70c11a8e89SPeter Maydell.. toctree:: 71324b2298SPaolo Bonzini 72c11a8e89SPeter Maydell arm/integratorcp 73c11a8e89SPeter Maydell arm/versatile 74c11a8e89SPeter Maydell arm/realview 75c11a8e89SPeter Maydell arm/xscale 76c11a8e89SPeter Maydell arm/palm 77c11a8e89SPeter Maydell arm/nseries 78c11a8e89SPeter Maydell arm/stellaris 79c11a8e89SPeter Maydell arm/musicpal 80c11a8e89SPeter Maydell arm/sx1 81