]> git.proxmox.com Git - mirror_qemu.git/blob - docs/system/arm/virt.rst
docs/system/arm/virt.rst: Add note on CPU features off by default
[mirror_qemu.git] / docs / system / arm / virt.rst
1 'virt' generic virtual platform (``virt``)
2 ==========================================
3
4 The ``virt`` board is a platform which does not correspond to any
5 real hardware; it is designed for use in virtual machines.
6 It is the recommended board type if you simply want to run
7 a guest such as Linux and do not care about reproducing the
8 idiosyncrasies and limitations of a particular bit of real-world
9 hardware.
10
11 This is a "versioned" board model, so as well as the ``virt`` machine
12 type itself (which may have improvements, bugfixes and other minor
13 changes between QEMU versions) a version is provided that guarantees
14 to have the same behaviour as that of previous QEMU releases, so
15 that VM migration will work between QEMU versions. For instance the
16 ``virt-5.0`` machine type will behave like the ``virt`` machine from
17 the QEMU 5.0 release, and migration should work between ``virt-5.0``
18 of the 5.0 release and ``virt-5.0`` of the 5.1 release. Migration
19 is not guaranteed to work between different QEMU releases for
20 the non-versioned ``virt`` machine type.
21
22 Supported devices
23 """""""""""""""""
24
25 The virt board supports:
26
27 - PCI/PCIe devices
28 - Flash memory
29 - One PL011 UART
30 - An RTC
31 - The fw_cfg device that allows a guest to obtain data from QEMU
32 - A PL061 GPIO controller
33 - An optional SMMUv3 IOMMU
34 - hotpluggable DIMMs
35 - hotpluggable NVDIMMs
36 - An MSI controller (GICv2M or ITS). GICv2M is selected by default along
37 with GICv2. ITS is selected by default with GICv3 (>= virt-2.7). Note
38 that ITS is not modeled in TCG mode.
39 - 32 virtio-mmio transport devices
40 - running guests using the KVM accelerator on aarch64 hardware
41 - large amounts of RAM (at least 255GB, and more if using highmem)
42 - many CPUs (up to 512 if using a GICv3 and highmem)
43 - Secure-World-only devices if the CPU has TrustZone:
44
45 - A second PL011 UART
46 - A second PL061 GPIO controller, with GPIO lines for triggering
47 a system reset or system poweroff
48 - A secure flash memory
49 - 16MB of secure RAM
50
51 Supported guest CPU types:
52
53 - ``cortex-a7`` (32-bit)
54 - ``cortex-a15`` (32-bit; the default)
55 - ``cortex-a35`` (64-bit)
56 - ``cortex-a53`` (64-bit)
57 - ``cortex-a55`` (64-bit)
58 - ``cortex-a57`` (64-bit)
59 - ``cortex-a72`` (64-bit)
60 - ``cortex-a76`` (64-bit)
61 - ``cortex-a710`` (64-bit)
62 - ``a64fx`` (64-bit)
63 - ``host`` (with KVM only)
64 - ``neoverse-n1`` (64-bit)
65 - ``neoverse-v1`` (64-bit)
66 - ``neoverse-n2`` (64-bit)
67 - ``max`` (same as ``host`` for KVM; best possible emulation with TCG)
68
69 Note that the default is ``cortex-a15``, so for an AArch64 guest you must
70 specify a CPU type.
71
72 Also, please note that passing ``max`` CPU (i.e. ``-cpu max``) won't
73 enable all the CPU features for a given ``virt`` machine. Where a CPU
74 architectural feature requires support in both the CPU itself and in the
75 wider system (e.g. the MTE feature), it may not be enabled by default,
76 but instead requires a machine option to enable it.
77
78 For example, MTE support must be enabled with ``-machine virt,mte=on``,
79 as well as by selecting an MTE-capable CPU (e.g., ``max``) with the
80 ``-cpu`` option.
81
82 See the machine-specific options below, or check them for a given machine
83 by passing the ``help`` suboption, like: ``-machine virt-9.0,help``.
84
85 Graphics output is available, but unlike the x86 PC machine types
86 there is no default display device enabled: you should select one from
87 the Display devices section of "-device help". The recommended option
88 is ``virtio-gpu-pci``; this is the only one which will work correctly
89 with KVM. You may also need to ensure your guest kernel is configured
90 with support for this; see below.
91
92 Machine-specific options
93 """"""""""""""""""""""""
94
95 The following machine-specific options are supported:
96
97 secure
98 Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
99 Arm Security Extensions (TrustZone). The default is ``off``.
100
101 virtualization
102 Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
103 Arm Virtualization Extensions. The default is ``off``.
104
105 mte
106 Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
107 Arm Memory Tagging Extensions. The default is ``off``.
108
109 highmem
110 Set ``on``/``off`` to enable/disable placing devices and RAM in physical
111 address space above 32 bits. The default is ``on`` for machine types
112 later than ``virt-2.12`` when the CPU supports an address space
113 bigger than 32 bits (i.e. 64-bit CPUs, and 32-bit CPUs with the
114 Large Physical Address Extension (LPAE) feature). If you want to
115 boot a 32-bit kernel which does not have ``CONFIG_LPAE`` enabled on
116 a CPU type which implements LPAE, you will need to manually set
117 this to ``off``; otherwise some devices, such as the PCI controller,
118 will not be accessible.
119
120 compact-highmem
121 Set ``on``/``off`` to enable/disable the compact layout for high memory regions.
122 The default is ``on`` for machine types later than ``virt-7.2``.
123
124 highmem-redists
125 Set ``on``/``off`` to enable/disable the high memory region for GICv3 or
126 GICv4 redistributor. The default is ``on``. Setting this to ``off`` will
127 limit the maximum number of CPUs when GICv3 or GICv4 is used.
128
129 highmem-ecam
130 Set ``on``/``off`` to enable/disable the high memory region for PCI ECAM.
131 The default is ``on`` for machine types later than ``virt-3.0``.
132
133 highmem-mmio
134 Set ``on``/``off`` to enable/disable the high memory region for PCI MMIO.
135 The default is ``on``.
136
137 gic-version
138 Specify the version of the Generic Interrupt Controller (GIC) to provide.
139 Valid values are:
140
141 ``2``
142 GICv2. Note that this limits the number of CPUs to 8.
143 ``3``
144 GICv3. This allows up to 512 CPUs.
145 ``4``
146 GICv4. Requires ``virtualization`` to be ``on``; allows up to 317 CPUs.
147 ``host``
148 Use the same GIC version the host provides, when using KVM
149 ``max``
150 Use the best GIC version possible (same as host when using KVM;
151 with TCG this is currently ``3`` if ``virtualization`` is ``off`` and
152 ``4`` if ``virtualization`` is ``on``, but this may change in future)
153
154 its
155 Set ``on``/``off`` to enable/disable ITS instantiation. The default is ``on``
156 for machine types later than ``virt-2.7``.
157
158 iommu
159 Set the IOMMU type to create for the guest. Valid values are:
160
161 ``none``
162 Don't create an IOMMU (the default)
163 ``smmuv3``
164 Create an SMMUv3
165
166 ras
167 Set ``on``/``off`` to enable/disable reporting host memory errors to a guest
168 using ACPI and guest external abort exceptions. The default is off.
169
170 dtb-randomness
171 Set ``on``/``off`` to pass random seeds via the guest DTB
172 rng-seed and kaslr-seed nodes (in both "/chosen" and
173 "/secure-chosen") to use for features like the random number
174 generator and address space randomisation. The default is
175 ``on``. You will want to disable it if your trusted boot chain
176 will verify the DTB it is passed, since this option causes the
177 DTB to be non-deterministic. It would be the responsibility of
178 the firmware to come up with a seed and pass it on if it wants to.
179
180 dtb-kaslr-seed
181 A deprecated synonym for dtb-randomness.
182
183 Linux guest kernel configuration
184 """"""""""""""""""""""""""""""""
185
186 The 'defconfig' for Linux arm and arm64 kernels should include the
187 right device drivers for virtio and the PCI controller; however some older
188 kernel versions, especially for 32-bit Arm, did not have everything
189 enabled by default. If you're not seeing PCI devices that you expect,
190 then check that your guest config has::
191
192 CONFIG_PCI=y
193 CONFIG_VIRTIO_PCI=y
194 CONFIG_PCI_HOST_GENERIC=y
195
196 If you want to use the ``virtio-gpu-pci`` graphics device you will also
197 need::
198
199 CONFIG_DRM=y
200 CONFIG_DRM_VIRTIO_GPU=y
201
202 Hardware configuration information for bare-metal programming
203 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
204
205 The ``virt`` board automatically generates a device tree blob ("dtb")
206 which it passes to the guest. This provides information about the
207 addresses, interrupt lines and other configuration of the various devices
208 in the system. Guest code can rely on and hard-code the following
209 addresses:
210
211 - Flash memory starts at address 0x0000_0000
212
213 - RAM starts at 0x4000_0000
214
215 All other information about device locations may change between
216 QEMU versions, so guest code must look in the DTB.
217
218 QEMU supports two types of guest image boot for ``virt``, and
219 the way for the guest code to locate the dtb binary differs:
220
221 - For guests using the Linux kernel boot protocol (this means any
222 non-ELF file passed to the QEMU ``-kernel`` option) the address
223 of the DTB is passed in a register (``r2`` for 32-bit guests,
224 or ``x0`` for 64-bit guests)
225
226 - For guests booting as "bare-metal" (any other kind of boot),
227 the DTB is at the start of RAM (0x4000_0000)