ARMv8 Overview
ARMv8 Overview
Background
MA Physics & Computer Science, Cambridge University, 1986
Background as an embedded software consultant for 17 years
Software Engineer
Project Manager
Technical Director
Engineering Manager
Training Manager
AArch32
Evolution of ARMv7-A
A32 (ARM) and T32 (Thumb) instruction sets
ARMv8-A adds some new instructions
Traditional ARM exception model
Virtual addresses stored in 32-bit registers
AArch64
New 64-bit general purpose registers (X0 to X30)
New instructions – A64, fixed length 32-bit instruction set
Includes SIMD, floating point and crypto instructions
New exception model
Virtual addresses now stored in 64-bit registers
Privilege levels
AArch64 Registers
Non-Secure Secure
SVC, Abort, OS
EL1 OS Trusted Kernel EL3
IRQ, etc...
When EL3 is using AArch32, in the Secure world the EL1 modes are treated as EL3
No effect on the Normal world
AArch64 OS AArch32 OS
AArch64 Hypervisor
can host AArch64 and AArch32 Hypervisor
AArch32 OSs AArch64 Hypervisor cannot host AArch64
OSs
Privilege levels
AArch64 Registers
63 32 31 0
Wn
Xn
Separate register file for floating point, SIMD and crypto operations - Vn
32 registers, each 128-bits
Can also be accessed in 32-bit (Sn) or 64-bit (Dn) forms
S0 S1
D0 D1
V0 V1
There are separate link registers for function calls and exceptions
X30 – Updated by branch with link instructions (BL & BLR)
Use RET instruction to return from sub-routines
ELR_ELn – Updated on exception entry
Use ERET instruction to return from exceptions
Fields Description
N, Z, C and V ALU flags
Q Sticky overflow (AArch32 only)
DAIF Exception mask bits
SPSel SP selection (EL0 or ELn), not applicable to EL0
CurrentEL The current exception level
E Data endianness (AArch32 only)
IL Illegal flag. When set, all instructions treated as UNDEFINED
SS Software stepping bit
Privilege levels
AArch64 Registers
Privilege levels
AArch64 Registers
Privilege levels
AArch64 Registers
Normal
Used for code and data
Processor allowed to re-order, re-size and repeat accesses
Speculative accesses allowed
Device
Used for peripherals
Accesses could have side effects, so there are more restrictions on what optimizations a processor can perform
Speculative data accesses not allowed
Unaligned data accesses to addresses marked as Device will always trigger an exception
Synchronous data abort
FAULT
RAM
0x0000,FFFF,FFFF,FFFF
Translation
Application
Tables
0x0 TTBR0_ELn
Each core has its own MMU configuration , register bank, internal state and Program Counter
Core0 might be executing in Non-secure, AArch32 EL0 while Core1 is executing in Secure, AArch64 EL1
Each core has separate L1 data and instruction Core0 Core1 Core2 Core3
caches
Hardware will maintain coherency between L1 data D$ I$ D$ I$ D$ I$ D$ I$
caches for certain memory types
Unified L2 Cache
Some cache and TLB instructions are broadcast to other
cores
All cores share a common physical memory map
Examples:
Processor currently executing in EL3 as AArch64, executing A64 instructions
Where a bit can be RES at one Execution State and used in another
The Architecture defines the bit field as writeable or “stateful”
Allows the correct value to be written for a context switch
The Execution State of the highest EL (entered on reset) defines the reset contents of System
Registers
If the highest EL uses AArch64, but lower ELs use AArch32
You may need to initialize ARMv7/AArch32 System Registers with expected ARMv7/AArch32 reset values in software
before changing EL
And other enhancements to the memory system architecture, such as Privileged Access Never
(PAN) state bit
Linux Kernel
AArch64 support has been available in mainline for several releases
Under arch/arm64/
Filesystems
AArch64 kernel supports both legacy ARMv7-A and AAarch64 filesystem components
Some guidance on building file-systems for AArch64 is available here
https://wiki.linaro.org/HowTo/ARMv8/OpenEmbedded
Both Fedora and openSUSE have AArch64 releases
ARM tools
The ARM compiler supports AArch64 and is suitable for bare-metal/validation environments
DS-5 includes debug support for ARMv8 hardware and models http://www.arm.com/products/tools/software-tools/ds-
5/index.php
Fast Models allows the creation of Cortex-A5x based ARM Virtual Platforms for software development
http://www.arm.com/training