Arm System emulator — QEMU documentation

# Arm System emulator

QEMU can emulate both 32-bit and 64-bit Arm CPUs. Use the `qemu-system-aarch64` executable to simulate a 64-bit Arm machine. You can use either `qemu-system-arm` or `qemu-system-aarch64` to simulate a 32-bit Arm machine: in general, command lines that work for `qemu-system-arm` will behave the same when used with `qemu-system-aarch64`.

QEMU has generally good support for Arm guests. It has support for nearly fifty different machines. The reason we support so many is that Arm hardware is much more widely varying than x86 hardware. Arm CPUs are generally built into “system-on-chip” (SoC) designs created by many different companies with different devices, and these SoCs are then built into machines which can vary still further even if they use the same SoC. Even with fifty boards QEMU does not cover more than a small fraction of the Arm hardware ecosystem.

The situation for 64-bit Arm is fairly similar, except that we don’t implement so many different machines.

As well as the more common “A-profile” CPUs (which have MMUs and will run Linux) QEMU also supports “M-profile” CPUs such as the Cortex-M0, Cortex-M4 and Cortex-M33 (which are microcontrollers used in very embedded boards). For most boards the CPU type is fixed (matching what the hardware has), so typically you don’t need to specify the CPU type by hand, except for special cases like the `virt` board.

## Choosing a board model

For QEMU’s Arm system emulation, you must specify which board model you want to use with the `-M` or `--machine` option; there is no default.

Because Arm systems differ so much and in fundamental ways, typically operating system or firmware images intended to run on one machine will not run at all on any other. This is often surprising for new users who are used to the x86 world where every system looks like a standard PC. (Once the kernel has booted, most userspace software cares much less about the detail of the hardware.)

If you already have a system image or a kernel that works on hardware and you want to boot with QEMU, check whether QEMU lists that machine in its `-machine help` output. If it is listed, then you can probably use that board model. If it is not listed, then unfortunately your image will almost certainly not boot on QEMU. (You might be able to extract the filesystem and use that with a different kernel which boots on a system that QEMU does emulate.)

If you don’t care about reproducing the idiosyncrasies of a particular bit of hardware, such as small amount of RAM, no PCI or other hard disk, etc., and just want to run Linux, the best option is to use the `virt` board. This is a platform which doesn’t correspond to any real hardware and is designed for use in virtual machines. You’ll need to compile Linux with a suitable configuration for running on the `virt` board. `virt` supports PCI, virtio, recent CPUs and large amounts of RAM. It also supports 64-bit CPUs.

## Board-specific documentation

- Analog Devices max78000 board (`max78000fthr`)
- Arm Integrator/CP (`integratorcp`)
- Arm MPS2 and MPS3 boards (`mps2-an385`, `mps2-an386`, `mps2-an500`, `mps2-an505`, `mps2-an511`, `mps2-an521`, `mps3-an524`, `mps3-an536`, `mps3-an547`)
- Arm Musca boards (`musca-a`, `musca-b1`)
- Arm Realview boards (`realview-eb`, `realview-eb-mpcore`, `realview-pb-a8`, `realview-pbx-a9`)
- Arm Server Base System Architecture Reference board (`sbsa-ref`)
- Arm Versatile boards (`versatileab`, `versatilepb`)
- Arm Versatile Express boards (`vexpress-a9`, `vexpress-a15`)
- Aspeed family boards (`anacapa-bmc`, `ast2500-evb`, `ast2600-evb`, `bletchley-bmc`, `fuji-bmc`, `gb200nvl-bmc`, `fby35-bmc`, `g220a-bmc`, `palmetto-bmc`, `quanta-q71l-bmc`, `rainier-bmc`, `romulus-bmc`, `supermicrox11-bmc`, `supermicrox11spi-bmc`, `tiogapass-bmc`, `witherspoon-bmc`, `yosemitev2-bmc`)
- Aspeed 2700 family boards (`ast2700-evb`, `ast2700fc`)
- Aspeed Bridge IC and Platform Root of Trust processor family boards (`ast1030-evb`, `ast1040-evb`, `ast1060-evb`)
- Banana Pi BPI-M2U (`bpim2u`)
- B-L475E-IOT01A IoT Node (`b-l475e-iot01a`)
- Boundary Devices SABRE Lite (`sabrelite`)
- Canon A1100 (`canon-a1100`)
- Cubietech Cubieboard (`cubieboard`)
- Emcraft SmartFusion2 SOM kit (`emcraft-sf2`)
- Exynos4 boards (`nuri`, `smdkc210`)
- Freecom MusicPal (`musicpal`)
- Kyoto Microcomputer KZM-ARM11-01 (`kzm`)
- Nordic nRF boards (`microbit`)
- Nuvoton iBMC boards (`kudo-bmc`, `mori-bmc`, `npcm750-evb`, `quanta-gbs-bmc`, `quanta-gsj`, `npcm845-evb`)
- NXP i.MX25 PDK board (`imx25-pdk`)
- NXP MCIMX6UL-EVK (`mcimx6ul-evk`)
- NXP MCIMX7D Sabre (`mcimx7d-sabre`)
- NXP i.MX 8M Plus and i.MX 8M Mini Evaluation Kits (`imx8mp-evk`, `imx8mm-evk`)
- Orange Pi PC (`orangepi-pc`)
- Raspberry Pi boards (`raspi0`, `raspi1ap`, `raspi2b`, `raspi3ap`, `raspi3b`, `raspi4b`)
- Sharp Zaurus SL-5500 (`collie`)
- Siemens SX1 (`sx1`, `sx1-v1`)
- Stellaris boards (`lm3s6965evb`, `lm3s811evb`)
- STMicroelectronics STM32 boards (`netduino2`, `netduinoplus2`, `olimex-stm32-h405`, `stm32vldiscovery`)
- ‘virt’ generic virtual platform (`virt`)
- VMApple machine emulation
- Xen Device Emulation Backend (`xenpvh`)
- AMD Versal Virt (`amd-versal-virt`, `amd-versal2-virt`)
- Xilinx Zynq board (`xilinx-zynq-a9`)
- Xilinx ZynqMP ZCU102 (`xlnx-zcu102`)

## Emulated CPU architecture support

- A-profile CPU architecture support
- R-profile CPU architecture support
- M-profile CPU architecture support

## Arm CPU features

- Arm CPU Features
- CPU Feature Probing
  - A note about CPU feature dependencies
  - A note about CPU models and KVM
- Using CPU Features
- KVM VCPU Features
- TCG VCPU Features
- SVE CPU Properties
  - SVE CPU Property Dependencies and Constraints
  - SVE CPU Property Parsing Semantics
  - SVE CPU Property Examples
  - SVE CPU Property Recommendations
  - SME CPU Property Examples
  - SVE User-mode Default Vector Length Property
- SME CPU Properties
  - SME User-mode Default Vector Length Property
- RME CPU Properties
  - RME Level 0 GPT Size Property