2023-01-24 21:01:12 +03:00
|
|
|
.. _Arm Emulation:
|
|
|
|
|
2021-06-17 17:03:28 +03:00
|
|
|
A-profile CPU architecture support
|
|
|
|
==================================
|
|
|
|
|
|
|
|
QEMU's TCG emulation includes support for the Armv5, Armv6, Armv7 and
|
|
|
|
Armv8 versions of the A-profile architecture. It also has support for
|
|
|
|
the following architecture extensions:
|
|
|
|
|
|
|
|
- FEAT_AA32BF16 (AArch32 BFloat16 instructions)
|
|
|
|
- FEAT_AA32HPD (AArch32 hierarchical permission disables)
|
|
|
|
- FEAT_AA32I8MM (AArch32 Int8 matrix multiplication instructions)
|
|
|
|
- FEAT_AES (AESD and AESE instructions)
|
target/arm: Advertise support for FEAT_BBM level 2
The description in the Arm ARM of the requirements of FEAT_BBM is
admirably clear on the guarantees it provides software, but slightly
more obscure on what that means for implementations. The description
of the equivalent SMMU feature in the SMMU specification (IHI0070D.b
section 3.21.1) is perhaps a bit more detailed and includes some
example valid implementation choices. (The SMMU version of this
feature is slightly tighter than the CPU version: the CPU is permitted
to raise TLB Conflict aborts in some situations that the SMMU may
not. This doesn't matter for QEMU because we don't want to do TLB
Conflict aborts anyway.)
The informal summary of FEAT_BBM is that it is about permitting an OS
to switch a range of memory between "covered by a huge page" and
"covered by a sequence of normal pages" without having to engage in
the 'break-before-make' dance that has traditionally been
necessary. The 'break-before-make' sequence is:
* replace the old translation table entry with an invalid entry
* execute a DSB insn
* execute a broadcast TLB invalidate insn
* execute a DSB insn
* write the new translation table entry
* execute a DSB insn
The point of this is to ensure that no TLB can simultaneously contain
TLB entries for the old and the new entry, which would traditionally
be UNPREDICTABLE (allowing the CPU to generate a TLB Conflict fault
or to use a random mishmash of values from the old and the new
entry). FEAT_BBM level 2 says "for the specific case where the only
thing that changed is the size of the block, the TLB is guaranteed
not to do weird things even if there are multiple entries for an
address", which means that software can now do:
* replace old translation table entry with new entry
* DSB
* broadcast TLB invalidate
* DSB
As the SMMU spec notes, valid ways to do this include:
* if there are multiple entries in the TLB for an address,
choose one of them and use it, ignoring the others
* if there are multiple entries in the TLB for an address,
throw them all out and do a page table walk to get a new one
QEMU's page table walk implementation for Arm CPUs already meets the
requirements for FEAT_BBM level 2. When we cache an entry in our TCG
TLB, we do so only for the specific (non-huge) page that the address
is in, and there is no way for the TLB data structure to ever have
more than one TLB entry for that page. (We handle huge pages only in
that we track what part of the address space is covered by huge pages
so that a TLB invalidate operation for an address in a huge page
results in an invalidation of the whole TLB.) We ignore the Contiguous
bit in page table entries, so we don't have to do anything for the
parts of FEAT_BBM that deal with changis to the Contiguous bit.
FEAT_BBM level 2 also requires that the nT bit in block descriptors
must be ignored; since commit 39a1fd25287f5dece5 we do this.
It's therefore safe for QEMU to advertise FEAT_BBM level 2 by
setting ID_AA64MMFR2_EL1.BBM to 2.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220426160422.2353158-3-peter.maydell@linaro.org
2022-04-26 19:04:21 +03:00
|
|
|
- FEAT_BBM at level 2 (Translation table break-before-make levels)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_BF16 (AArch64 BFloat16 instructions)
|
|
|
|
- FEAT_BTI (Branch Target Identification)
|
2022-05-06 21:02:37 +03:00
|
|
|
- FEAT_CSV2 (Cache speculation variant 2)
|
2022-05-06 21:02:38 +03:00
|
|
|
- FEAT_CSV2_1p1 (Cache speculation variant 2, version 1.1)
|
|
|
|
- FEAT_CSV2_1p2 (Cache speculation variant 2, version 1.2)
|
|
|
|
- FEAT_CSV2_2 (Cache speculation variant 2, version 2)
|
2022-05-06 21:02:39 +03:00
|
|
|
- FEAT_CSV3 (Cache speculation variant 3)
|
2022-05-06 21:02:40 +03:00
|
|
|
- FEAT_DGH (Data gathering hint)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_DIT (Data Independent Timing instructions)
|
|
|
|
- FEAT_DPB (DC CVAP instruction)
|
2022-05-06 21:02:29 +03:00
|
|
|
- FEAT_Debugv8p2 (Debug changes for v8.2)
|
2022-05-06 21:02:30 +03:00
|
|
|
- FEAT_Debugv8p4 (Debug changes for v8.4)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_DotProd (Advanced SIMD dot product instructions)
|
2022-06-08 21:38:46 +03:00
|
|
|
- FEAT_DoubleFault (Double Fault Extension)
|
2022-10-21 19:01:31 +03:00
|
|
|
- FEAT_E0PD (Preventing EL0 access to halves of address maps)
|
2022-08-19 14:00:51 +03:00
|
|
|
- FEAT_ETS (Enhanced Translation Synchronization)
|
2022-12-14 17:27:10 +03:00
|
|
|
- FEAT_EVT (Enhanced Virtualization Traps)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_FCMA (Floating-point complex number instructions)
|
2023-01-30 21:24:59 +03:00
|
|
|
- FEAT_FGT (Fine-Grained Traps)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_FHM (Floating-point half-precision multiplication instructions)
|
|
|
|
- FEAT_FP16 (Half-precision floating-point data processing)
|
|
|
|
- FEAT_FRINTTS (Floating-point to integer instructions)
|
|
|
|
- FEAT_FlagM (Flag manipulation instructions v2)
|
|
|
|
- FEAT_FlagM2 (Enhancements to flag manipulation instructions)
|
2022-10-03 19:23:15 +03:00
|
|
|
- FEAT_GTG (Guest translation granule size)
|
2022-10-24 08:18:49 +03:00
|
|
|
- FEAT_HAFDBS (Hardware management of the access flag and dirty bit state)
|
2022-05-30 12:26:52 +03:00
|
|
|
- FEAT_HCX (Support for the HCRX_EL2 register)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_HPDS (Hierarchical permission disables)
|
2023-08-31 11:45:16 +03:00
|
|
|
- FEAT_HPDS2 (Translation table page-based hardware attributes)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_I8MM (AArch64 Int8 matrix multiplication instructions)
|
2022-05-09 18:54:57 +03:00
|
|
|
- FEAT_IDST (ID space trap handling)
|
2022-05-06 21:02:36 +03:00
|
|
|
- FEAT_IESB (Implicit error synchronization event)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_JSCVT (JavaScript conversion instructions)
|
|
|
|
- FEAT_LOR (Limited ordering regions)
|
2022-03-02 00:59:50 +03:00
|
|
|
- FEAT_LPA (Large Physical Address space)
|
2022-03-02 00:59:56 +03:00
|
|
|
- FEAT_LPA2 (Large Physical and virtual Address space v2)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_LRCPC (Load-acquire RCpc instructions)
|
|
|
|
- FEAT_LRCPC2 (Load-acquire RCpc instructions v2)
|
|
|
|
- FEAT_LSE (Large System Extensions)
|
2023-06-06 12:19:39 +03:00
|
|
|
- FEAT_LSE2 (Large System Extensions v2)
|
2022-03-02 00:59:49 +03:00
|
|
|
- FEAT_LVA (Large Virtual Address space)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_MTE (Memory Tagging Extension)
|
|
|
|
- FEAT_MTE2 (Memory Tagging Extension)
|
2021-06-16 22:56:14 +03:00
|
|
|
- FEAT_MTE3 (MTE Asymmetric Fault Handling)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_PAN (Privileged access never)
|
|
|
|
- FEAT_PAN2 (AT S1E1R and AT S1E1W instruction variants affected by PSTATE.PAN)
|
2023-04-20 12:21:16 +03:00
|
|
|
- FEAT_PAN3 (Support for SCTLR_ELx.EPAN)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_PAuth (Pointer authentication)
|
|
|
|
- FEAT_PMULL (PMULL, PMULL2 instructions)
|
|
|
|
- FEAT_PMUv3p1 (PMU Extensions v3.1)
|
|
|
|
- FEAT_PMUv3p4 (PMU Extensions v3.4)
|
2022-08-22 16:23:58 +03:00
|
|
|
- FEAT_PMUv3p5 (PMU Extensions v3.5)
|
2022-05-06 21:02:35 +03:00
|
|
|
- FEAT_RAS (Reliability, availability, and serviceability)
|
2022-06-08 21:38:46 +03:00
|
|
|
- FEAT_RASv1p1 (RAS Extension v1.1)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_RDM (Advanced SIMD rounding double multiply accumulate instructions)
|
2023-06-22 17:30:46 +03:00
|
|
|
- FEAT_RME (Realm Management Extension) (NB: support status in QEMU is experimental)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_RNG (Random number generator)
|
2022-05-05 21:39:50 +03:00
|
|
|
- FEAT_S2FWB (Stage 2 forced Write-Back)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_SB (Speculation Barrier)
|
|
|
|
- FEAT_SEL2 (Secure EL2)
|
|
|
|
- FEAT_SHA1 (SHA1 instructions)
|
|
|
|
- FEAT_SHA256 (SHA256 instructions)
|
|
|
|
- FEAT_SHA3 (Advanced SIMD SHA3 instructions)
|
|
|
|
- FEAT_SHA512 (Advanced SIMD SHA512 instructions)
|
|
|
|
- FEAT_SM3 (Advanced SIMD SM3 instructions)
|
|
|
|
- FEAT_SM4 (Advanced SIMD SM4 instructions)
|
2022-07-08 18:15:27 +03:00
|
|
|
- FEAT_SME (Scalable Matrix Extension)
|
|
|
|
- FEAT_SME_FA64 (Full A64 instruction set in Streaming SVE mode)
|
|
|
|
- FEAT_SME_F64F64 (Double-precision floating-point outer product instructions)
|
|
|
|
- FEAT_SME_I16I64 (16-bit to 64-bit integer widening outer product instructions)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_SPECRES (Speculation restriction instructions)
|
|
|
|
- FEAT_SSBS (Speculative Store Bypass Safe)
|
|
|
|
- FEAT_TLBIOS (TLB invalidate instructions in Outer Shareable domain)
|
|
|
|
- FEAT_TLBIRANGE (TLB invalidate range instructions)
|
|
|
|
- FEAT_TTCNP (Translation table Common not private translations)
|
2022-04-26 19:04:20 +03:00
|
|
|
- FEAT_TTL (Translation Table Level)
|
2021-06-17 17:03:28 +03:00
|
|
|
- FEAT_TTST (Small translation tables)
|
|
|
|
- FEAT_UAO (Unprivileged Access Override control)
|
|
|
|
- FEAT_VHE (Virtualization Host Extensions)
|
|
|
|
- FEAT_VMID16 (16-bit VMID)
|
|
|
|
- FEAT_XNX (Translation table stage 2 Unprivileged Execute-never)
|
|
|
|
- SVE (The Scalable Vector Extension)
|
|
|
|
- SVE2 (The Scalable Vector Extension v2)
|
|
|
|
|
|
|
|
For information on the specifics of these extensions, please refer
|
|
|
|
to the `Armv8-A Arm Architecture Reference Manual
|
|
|
|
<https://developer.arm.com/documentation/ddi0487/latest>`_.
|
|
|
|
|
|
|
|
When a specific named CPU is being emulated, only those features which
|
|
|
|
are present in hardware for that CPU are emulated. (If a feature is
|
|
|
|
not in the list above then it is not supported, even if the real
|
|
|
|
hardware should have it.) The ``max`` CPU enables all features.
|
|
|
|
|
|
|
|
R-profile CPU architecture support
|
|
|
|
==================================
|
|
|
|
|
|
|
|
QEMU's TCG emulation support for R-profile CPUs is currently limited.
|
|
|
|
We emulate only the Cortex-R5 and Cortex-R5F CPUs.
|
|
|
|
|
|
|
|
M-profile CPU architecture support
|
|
|
|
==================================
|
|
|
|
|
|
|
|
QEMU's TCG emulation includes support for Armv6-M, Armv7-M, Armv8-M, and
|
|
|
|
Armv8.1-M versions of the M-profile architucture. It also has support
|
|
|
|
for the following architecture extensions:
|
|
|
|
|
|
|
|
- FP (Floating-point Extension)
|
|
|
|
- FPCXT (FPCXT access instructions)
|
|
|
|
- HP (Half-precision floating-point instructions)
|
|
|
|
- LOB (Low Overhead loops and Branch future)
|
|
|
|
- M (Main Extension)
|
|
|
|
- MPU (Memory Protection Unit Extension)
|
|
|
|
- PXN (Privileged Execute Never)
|
|
|
|
- RAS (Reliability, Serviceability and Availability): "minimum RAS Extension" only
|
|
|
|
- S (Security Extension)
|
|
|
|
- ST (System Timer Extension)
|
|
|
|
|
|
|
|
For information on the specifics of these extensions, please refer
|
|
|
|
to the `Armv8-M Arm Architecture Reference Manual
|
|
|
|
<https://developer.arm.com/documentation/ddi0553/latest>`_.
|
|
|
|
|
|
|
|
When a specific named CPU is being emulated, only those features which
|
|
|
|
are present in hardware for that CPU are emulated. (If a feature is
|
|
|
|
not in the list above then it is not supported, even if the real
|
|
|
|
hardware should have it.) There is no equivalent of the ``max`` CPU for
|
|
|
|
M-profile.
|