1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Copyright (c) 2018-2025 by the author(s)
//
// Author(s):
// - Andre Richter <andre.o.richter@gmail.com>
// - Berkus Decker <berkus+github@metta.systems>
// - Bradley Landherr <landhb@users.noreply.github.com>
// - Yan Tan <tanyan@kylinos.cn>
//! Exception Syndrome Register - EL2
//!
//! Holds syndrome information for an exception taken to EL2.
use tock_registers::{
interfaces::{Readable, Writeable},
register_bitfields,
};
register_bitfields! {u64,
pub ESR_EL2 [
/// Reserved
RES0 OFFSET(37) NUMBITS(27) [],
/// Instruction Specific Syndrome 2. If a memory access generated by an ST64BV or ST64BV0
/// instruction generates a Data Abort for a Translation fault, Access flag fault, or
/// Permission fault, then this field holds register specifier, Xs.
///
/// For any other Data Abort, this field is RES0.
ISS2 OFFSET(32) NUMBITS(5) [],
/// Exception Class. Indicates the reason for the exception that this register holds
/// information about.
///
/// For each EC value, the table references a subsection that gives information about:
/// - The cause of the exception, for example the configuration required to enable the
/// trap.
/// - The encoding of the associated ISS.
EC OFFSET(26) NUMBITS(6) [
/// Unknown reason
Unknown = 0b00_0000,
/// Trapped WF* instruction execution
TrappedWFIorWFE = 0b00_0001,
/// Trapped MCR or MRC access with (coproc==0b1111) (FEAT_AA32)
TrappedMCRorMRC = 0b00_0011,
/// Trapped MCRR or MRRC access with (coproc==0b1111) (FEAT_AA32)
TrappedMCRRorMRRC = 0b00_0100,
/// Trapped MCR or MRC access with (coproc==0b1110) (FEAT_AA32)
TrappedMCRorMRC2 = 0b00_0101,
/// Trapped LDC or STC access (FEAT_AA32)
TrappedLDCorSTC = 0b00_0110,
/// Access to SME, SVE, Advanced SIMD or floating-point functionality trapped
TrappedFP = 0b00_0111,
/// Trapped VMRS access, from ID group trap (FEAT_AA32)
TrappedVMRS = 0b00_1000,
/// Trapped use of a Pointer authentication instruction (FEAT_PAuth)
TrappedPointerAuth = 0b00_1001,
/// Trapped execution of any instruction not covered by other EC values (FEAT_LS64/FEAT_SPEv1p5/FEAT_TRBEv1p1)
TrappedNotCovered = 0b00_1010,
/// Trapped MRRC access with (coproc==0b1110) (FEAT_AA32)
TrappedMRRC = 0b00_1100,
/// Branch Target Exception (FEAT_BTI)
BranchTarget = 0b00_1101,
/// Illegal Execution state
IllegalExecutionState = 0b00_1110,
/// SVC instruction execution in AArch32 state (FEAT_AA32)
SVC32 = 0b01_0001,
/// HVC instruction execution in AArch32 state (FEAT_AA32)
HVC32 = 0b01_0010,
/// SMC instruction execution in AArch32 state (FEAT_AA32)
SMC32 = 0b01_0011,
/// Trapped MSRR, MRRS or System instruction execution in AArch64 state (FEAT_SYSREG128/FEAT_SYSINSTR128)
TrappedMSRR_MRRS = 0b01_0100,
/// SVC instruction execution in AArch64 state (FEAT_AA64)
SVC64 = 0b01_0101,
/// HVC instruction execution in AArch64 state (FEAT_AA64)
HVC64 = 0b01_0110,
/// SMC instruction execution in AArch64 state (FEAT_AA64)
SMC64 = 0b01_0111,
/// Trapped MSR, MRS or System instruction execution in AArch64 state (FEAT_AA64)
TrappedMsrMrs = 0b01_1000,
/// Access to SVE functionality trapped (FEAT_SVE)
TrappedSve = 0b01_1001,
/// Trapped ERET, ERETAA, or ERETAB instruction execution (FEAT_FGT/FEAT_NV)
TrappedERET = 0b01_1010,
/// Exception from TSTART instruction (FEAT_TME)
TrappedTSTART = 0b01_1011,
/// Exception from a PAC Fail (FEAT_FPAC)
PointerAuth = 0b01_1100,
/// Access to SME functionality trapped (FEAT_SME)
TrappedSME = 0b01_1101,
/// Instruction Abort from a lower Exception level
InstrAbortLowerEL = 0b10_0000,
/// Instruction Abort taken without a change in Exception level
InstrAbortCurrentEL = 0b10_0001,
/// PC alignment fault exception
PCAlignmentFault = 0b10_0010,
/// Data Abort exception from a lower Exception level
DataAbortLowerEL = 0b10_0100,
/// Data Abort exception without a change in Exception level
DataAbortCurrentEL = 0b10_0101,
/// SP alignment fault exception
SPAlignmentFault = 0b10_0110,
/// Memory Operation Exception (FEAT_MOPS)
MemoryOperationException = 0b10_0111,
/// Trapped floating-point exception taken from AArch32 state (FEAT_AA32)
TrappedFP32 = 0b10_1000,
/// Trapped floating-point exception taken from AArch64 state (FEAT_AA64)
TrappedFP64 = 0b10_1100,
/// GCS exception (FEAT_GCS)
GCSException = 0b10_1101,
/// SError exception
SError = 0b10_1111,
/// Breakpoint exception from a lower Exception level
BreakpointLowerEL = 0b11_0000,
/// Breakpoint exception taken without a change in Exception level
BreakpointCurrentEL = 0b11_0001,
/// Software Step exception from a lower Exception level
SoftwareStepLowerEL = 0b11_0010,
/// Software Step exception taken without a change in Exception level
SoftwareStepCurrentEL = 0b11_0011,
/// Watchpoint exception from a lower Exception level
WatchpointLowerEL = 0b11_0100,
/// Watchpoint exception taken without a change in Exception level
WatchpointCurrentEL = 0b11_0101,
/// BKPT instruction execution in AArch32 state (FEAT_AA32)
Bkpt32 = 0b11_1000,
/// Vector Catch exception from AArch32 state (FEAT_AA32)
VectorCatch32 = 0b11_1010,
/// BRK instruction execution in AArch64 state (FEAT_AA64)
Brk64 = 0b11_1100,
/// Profiling exception (FEAT_EBEP/FEAT_SPE_EXC/FEAT_TRBE_EXC)
ProfilingException = 0b11_1101
],
/// Instruction Length for synchronous exceptions.
IL OFFSET(25) NUMBITS(1) [],
/// Instruction Specific Syndrome. Architecturally, this field can be defined independently
/// for each defined Exception class. However, in practice, some ISS encodings are used for
/// more than one Exception class.
ISS OFFSET(0) NUMBITS(25) []
]
}
pub struct Reg;
impl Readable for Reg {
type T = u64;
type R = ESR_EL2::Register;
sys_coproc_read_raw!(u64, "ESR_EL2", "x");
}
impl Writeable for Reg {
type T = u64;
type R = ();
sys_coproc_write_raw!(u64, "ESR_EL2", "x");
}
pub const ESR_EL2: Reg = Reg {};