gem5 v24.0.0.0
Loading...
Searching...
No Matches
misc.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010-2013, 2015-2024 Arm Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are
16 * met: redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer;
18 * redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution;
21 * neither the name of the copyright holders nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include "arch/arm/regs/misc.hh"
39
40#include <tuple>
41
43#include "arch/arm/isa.hh"
44#include "base/bitfield.hh"
45#include "base/logging.hh"
46#include "cpu/thread_context.hh"
48#include "params/ArmISA.hh"
49#include "sim/full_system.hh"
50
51namespace gem5
52{
53
54namespace ArmISA
55{
56
57namespace
58{
59
60std::unordered_map<MiscRegNum32, MiscRegIndex> miscRegNum32ToIdx{
61 // MCR/MRC regs
62 { MiscRegNum32(14, 0, 0, 0, 0), MISCREG_DBGDIDR },
63 { MiscRegNum32(14, 0, 0, 0, 2), MISCREG_DBGDTRRXext },
64 { MiscRegNum32(14, 0, 0, 0, 4), MISCREG_DBGBVR0 },
65 { MiscRegNum32(14, 0, 0, 0, 5), MISCREG_DBGBCR0 },
66 { MiscRegNum32(14, 0, 0, 0, 6), MISCREG_DBGWVR0 },
67 { MiscRegNum32(14, 0, 0, 0, 7), MISCREG_DBGWCR0 },
68 { MiscRegNum32(14, 0, 0, 1, 0), MISCREG_DBGDSCRint },
69 { MiscRegNum32(14, 0, 0, 1, 4), MISCREG_DBGBVR1 },
70 { MiscRegNum32(14, 0, 0, 1, 5), MISCREG_DBGBCR1 },
71 { MiscRegNum32(14, 0, 0, 1, 6), MISCREG_DBGWVR1 },
72 { MiscRegNum32(14, 0, 0, 1, 7), MISCREG_DBGWCR1 },
73 { MiscRegNum32(14, 0, 0, 2, 2), MISCREG_DBGDSCRext },
74 { MiscRegNum32(14, 0, 0, 2, 4), MISCREG_DBGBVR2 },
75 { MiscRegNum32(14, 0, 0, 2, 5), MISCREG_DBGBCR2 },
76 { MiscRegNum32(14, 0, 0, 2, 6), MISCREG_DBGWVR2 },
77 { MiscRegNum32(14, 0, 0, 2, 7), MISCREG_DBGWCR2 },
78 { MiscRegNum32(14, 0, 0, 3, 2), MISCREG_DBGDTRTXext },
79 { MiscRegNum32(14, 0, 0, 3, 4), MISCREG_DBGBVR3 },
80 { MiscRegNum32(14, 0, 0, 3, 5), MISCREG_DBGBCR3 },
81 { MiscRegNum32(14, 0, 0, 3, 6), MISCREG_DBGWVR3 },
82 { MiscRegNum32(14, 0, 0, 3, 7), MISCREG_DBGWCR3 },
83 { MiscRegNum32(14, 0, 0, 4, 4), MISCREG_DBGBVR4 },
84 { MiscRegNum32(14, 0, 0, 4, 5), MISCREG_DBGBCR4 },
85 { MiscRegNum32(14, 0, 0, 4, 6), MISCREG_DBGWVR4 },
86 { MiscRegNum32(14, 0, 0, 4, 7), MISCREG_DBGWCR4 },
87 { MiscRegNum32(14, 0, 0, 5, 4), MISCREG_DBGBVR5 },
88 { MiscRegNum32(14, 0, 0, 5, 5), MISCREG_DBGBCR5 },
89 { MiscRegNum32(14, 0, 0, 5, 6), MISCREG_DBGWVR5 },
90 { MiscRegNum32(14, 0, 0, 5, 7), MISCREG_DBGWCR5 },
91 { MiscRegNum32(14, 0, 0, 6, 2), MISCREG_DBGOSECCR },
92 { MiscRegNum32(14, 0, 0, 6, 4), MISCREG_DBGBVR6 },
93 { MiscRegNum32(14, 0, 0, 6, 5), MISCREG_DBGBCR6 },
94 { MiscRegNum32(14, 0, 0, 6, 6), MISCREG_DBGWVR6 },
95 { MiscRegNum32(14, 0, 0, 6, 7), MISCREG_DBGWCR6 },
96 { MiscRegNum32(14, 0, 0, 7, 0), MISCREG_DBGVCR },
97 { MiscRegNum32(14, 0, 0, 7, 4), MISCREG_DBGBVR7 },
98 { MiscRegNum32(14, 0, 0, 7, 5), MISCREG_DBGBCR7 },
99 { MiscRegNum32(14, 0, 0, 7, 6), MISCREG_DBGWVR7 },
100 { MiscRegNum32(14, 0, 0, 7, 7), MISCREG_DBGWCR7 },
101 { MiscRegNum32(14, 0, 0, 8, 4), MISCREG_DBGBVR8 },
102 { MiscRegNum32(14, 0, 0, 8, 5), MISCREG_DBGBCR8 },
103 { MiscRegNum32(14, 0, 0, 8, 6), MISCREG_DBGWVR8 },
104 { MiscRegNum32(14, 0, 0, 8, 7), MISCREG_DBGWCR8 },
105 { MiscRegNum32(14, 0, 0, 9, 4), MISCREG_DBGBVR9 },
106 { MiscRegNum32(14, 0, 0, 9, 5), MISCREG_DBGBCR9 },
107 { MiscRegNum32(14, 0, 0, 9, 6), MISCREG_DBGWVR9 },
108 { MiscRegNum32(14, 0, 0, 9, 7), MISCREG_DBGWCR9 },
109 { MiscRegNum32(14, 0, 0, 10, 4), MISCREG_DBGBVR10 },
110 { MiscRegNum32(14, 0, 0, 10, 5), MISCREG_DBGBCR10 },
111 { MiscRegNum32(14, 0, 0, 10, 6), MISCREG_DBGWVR10 },
112 { MiscRegNum32(14, 0, 0, 10, 7), MISCREG_DBGWCR10 },
113 { MiscRegNum32(14, 0, 0, 11, 4), MISCREG_DBGBVR11 },
114 { MiscRegNum32(14, 0, 0, 11, 5), MISCREG_DBGBCR11 },
115 { MiscRegNum32(14, 0, 0, 11, 6), MISCREG_DBGWVR11 },
116 { MiscRegNum32(14, 0, 0, 11, 7), MISCREG_DBGWCR11 },
117 { MiscRegNum32(14, 0, 0, 12, 4), MISCREG_DBGBVR12 },
118 { MiscRegNum32(14, 0, 0, 12, 5), MISCREG_DBGBCR12 },
119 { MiscRegNum32(14, 0, 0, 12, 6), MISCREG_DBGWVR12 },
120 { MiscRegNum32(14, 0, 0, 12, 7), MISCREG_DBGWCR12 },
121 { MiscRegNum32(14, 0, 0, 13, 4), MISCREG_DBGBVR13 },
122 { MiscRegNum32(14, 0, 0, 13, 5), MISCREG_DBGBCR13 },
123 { MiscRegNum32(14, 0, 0, 13, 6), MISCREG_DBGWVR13 },
124 { MiscRegNum32(14, 0, 0, 13, 7), MISCREG_DBGWCR13 },
125 { MiscRegNum32(14, 0, 0, 14, 4), MISCREG_DBGBVR14 },
126 { MiscRegNum32(14, 0, 0, 14, 5), MISCREG_DBGBCR14 },
127 { MiscRegNum32(14, 0, 0, 14, 6), MISCREG_DBGWVR14 },
128 { MiscRegNum32(14, 0, 0, 14, 7), MISCREG_DBGWCR14 },
129 { MiscRegNum32(14, 0, 0, 15, 4), MISCREG_DBGBVR15 },
130 { MiscRegNum32(14, 0, 0, 15, 5), MISCREG_DBGBCR15 },
131 { MiscRegNum32(14, 0, 0, 15, 6), MISCREG_DBGWVR15 },
132 { MiscRegNum32(14, 0, 0, 15, 7), MISCREG_DBGWCR15 },
133 { MiscRegNum32(14, 0, 1, 0, 1), MISCREG_DBGBXVR0 },
134 { MiscRegNum32(14, 0, 1, 0, 4), MISCREG_DBGOSLAR },
135 { MiscRegNum32(14, 0, 1, 1, 1), MISCREG_DBGBXVR1 },
136 { MiscRegNum32(14, 0, 1, 1, 4), MISCREG_DBGOSLSR },
137 { MiscRegNum32(14, 0, 1, 2, 1), MISCREG_DBGBXVR2 },
138 { MiscRegNum32(14, 0, 1, 3, 1), MISCREG_DBGBXVR3 },
139 { MiscRegNum32(14, 0, 1, 3, 4), MISCREG_DBGOSDLR },
140 { MiscRegNum32(14, 0, 1, 4, 1), MISCREG_DBGBXVR4 },
141 { MiscRegNum32(14, 0, 1, 4, 4), MISCREG_DBGPRCR },
142 { MiscRegNum32(14, 0, 1, 5, 1), MISCREG_DBGBXVR5 },
143 { MiscRegNum32(14, 0, 1, 6, 1), MISCREG_DBGBXVR6 },
144 { MiscRegNum32(14, 0, 1, 7, 1), MISCREG_DBGBXVR7 },
145 { MiscRegNum32(14, 0, 1, 8, 1), MISCREG_DBGBXVR8 },
146 { MiscRegNum32(14, 0, 1, 9, 1), MISCREG_DBGBXVR9 },
147 { MiscRegNum32(14, 0, 1, 10, 1), MISCREG_DBGBXVR10 },
148 { MiscRegNum32(14, 0, 1, 11, 1), MISCREG_DBGBXVR11 },
149 { MiscRegNum32(14, 0, 1, 12, 1), MISCREG_DBGBXVR12 },
150 { MiscRegNum32(14, 0, 1, 13, 1), MISCREG_DBGBXVR13 },
151 { MiscRegNum32(14, 0, 1, 14, 1), MISCREG_DBGBXVR14 },
152 { MiscRegNum32(14, 0, 1, 15, 1), MISCREG_DBGBXVR15 },
153 { MiscRegNum32(14, 6, 1, 0, 0), MISCREG_TEEHBR },
154 { MiscRegNum32(14, 7, 0, 0, 0), MISCREG_JIDR },
155 { MiscRegNum32(14, 7, 1, 0, 0), MISCREG_JOSCR },
156 { MiscRegNum32(14, 7, 2, 0, 0), MISCREG_JMCR },
157 { MiscRegNum32(15, 0, 0, 0, 0), MISCREG_MIDR },
158 { MiscRegNum32(15, 0, 0, 0, 1), MISCREG_CTR },
159 { MiscRegNum32(15, 0, 0, 0, 2), MISCREG_TCMTR },
160 { MiscRegNum32(15, 0, 0, 0, 3), MISCREG_TLBTR },
161 { MiscRegNum32(15, 0, 0, 0, 4), MISCREG_MIDR },
162 { MiscRegNum32(15, 0, 0, 0, 5), MISCREG_MPIDR },
163 { MiscRegNum32(15, 0, 0, 0, 6), MISCREG_REVIDR },
164 { MiscRegNum32(15, 0, 0, 0, 7), MISCREG_MIDR },
165 { MiscRegNum32(15, 0, 0, 1, 0), MISCREG_ID_PFR0 },
166 { MiscRegNum32(15, 0, 0, 1, 1), MISCREG_ID_PFR1 },
167 { MiscRegNum32(15, 0, 0, 1, 2), MISCREG_ID_DFR0 },
168 { MiscRegNum32(15, 0, 0, 1, 3), MISCREG_ID_AFR0 },
169 { MiscRegNum32(15, 0, 0, 1, 4), MISCREG_ID_MMFR0 },
170 { MiscRegNum32(15, 0, 0, 1, 5), MISCREG_ID_MMFR1 },
171 { MiscRegNum32(15, 0, 0, 1, 6), MISCREG_ID_MMFR2 },
172 { MiscRegNum32(15, 0, 0, 1, 7), MISCREG_ID_MMFR3 },
173 { MiscRegNum32(15, 0, 0, 2, 0), MISCREG_ID_ISAR0 },
174 { MiscRegNum32(15, 0, 0, 2, 1), MISCREG_ID_ISAR1 },
175 { MiscRegNum32(15, 0, 0, 2, 2), MISCREG_ID_ISAR2 },
176 { MiscRegNum32(15, 0, 0, 2, 3), MISCREG_ID_ISAR3 },
177 { MiscRegNum32(15, 0, 0, 2, 4), MISCREG_ID_ISAR4 },
178 { MiscRegNum32(15, 0, 0, 2, 5), MISCREG_ID_ISAR5 },
179 { MiscRegNum32(15, 0, 0, 2, 6), MISCREG_ID_MMFR4 },
180 { MiscRegNum32(15, 0, 0, 2, 7), MISCREG_ID_ISAR6 },
181 { MiscRegNum32(15, 0, 0, 3, 0), MISCREG_RAZ },
182 { MiscRegNum32(15, 0, 0, 3, 1), MISCREG_RAZ },
183 { MiscRegNum32(15, 0, 0, 3, 2), MISCREG_RAZ },
184 { MiscRegNum32(15, 0, 0, 3, 3), MISCREG_RAZ },
185 { MiscRegNum32(15, 0, 0, 3, 4), MISCREG_RAZ },
186 { MiscRegNum32(15, 0, 0, 3, 5), MISCREG_RAZ },
187 { MiscRegNum32(15, 0, 0, 3, 6), MISCREG_RAZ },
188 { MiscRegNum32(15, 0, 0, 3, 7), MISCREG_RAZ },
189 { MiscRegNum32(15, 0, 0, 4, 0), MISCREG_RAZ },
190 { MiscRegNum32(15, 0, 0, 4, 1), MISCREG_RAZ },
191 { MiscRegNum32(15, 0, 0, 4, 2), MISCREG_RAZ },
192 { MiscRegNum32(15, 0, 0, 4, 3), MISCREG_RAZ },
193 { MiscRegNum32(15, 0, 0, 4, 4), MISCREG_RAZ },
194 { MiscRegNum32(15, 0, 0, 4, 5), MISCREG_RAZ },
195 { MiscRegNum32(15, 0, 0, 4, 6), MISCREG_RAZ },
196 { MiscRegNum32(15, 0, 0, 4, 7), MISCREG_RAZ },
197 { MiscRegNum32(15, 0, 0, 5, 0), MISCREG_RAZ },
198 { MiscRegNum32(15, 0, 0, 5, 1), MISCREG_RAZ },
199 { MiscRegNum32(15, 0, 0, 5, 2), MISCREG_RAZ },
200 { MiscRegNum32(15, 0, 0, 5, 3), MISCREG_RAZ },
201 { MiscRegNum32(15, 0, 0, 5, 4), MISCREG_RAZ },
202 { MiscRegNum32(15, 0, 0, 5, 5), MISCREG_RAZ },
203 { MiscRegNum32(15, 0, 0, 5, 6), MISCREG_RAZ },
204 { MiscRegNum32(15, 0, 0, 5, 7), MISCREG_RAZ },
205 { MiscRegNum32(15, 0, 0, 6, 0), MISCREG_RAZ },
206 { MiscRegNum32(15, 0, 0, 6, 1), MISCREG_RAZ },
207 { MiscRegNum32(15, 0, 0, 6, 2), MISCREG_RAZ },
208 { MiscRegNum32(15, 0, 0, 6, 3), MISCREG_RAZ },
209 { MiscRegNum32(15, 0, 0, 6, 4), MISCREG_RAZ },
210 { MiscRegNum32(15, 0, 0, 6, 5), MISCREG_RAZ },
211 { MiscRegNum32(15, 0, 0, 6, 6), MISCREG_RAZ },
212 { MiscRegNum32(15, 0, 0, 6, 7), MISCREG_RAZ },
213 { MiscRegNum32(15, 0, 0, 7, 0), MISCREG_RAZ },
214 { MiscRegNum32(15, 0, 0, 7, 1), MISCREG_RAZ },
215 { MiscRegNum32(15, 0, 0, 7, 2), MISCREG_RAZ },
216 { MiscRegNum32(15, 0, 0, 7, 3), MISCREG_RAZ },
217 { MiscRegNum32(15, 0, 0, 7, 4), MISCREG_RAZ },
218 { MiscRegNum32(15, 0, 0, 7, 5), MISCREG_RAZ },
219 { MiscRegNum32(15, 0, 0, 7, 6), MISCREG_RAZ },
220 { MiscRegNum32(15, 0, 0, 7, 7), MISCREG_RAZ },
221 { MiscRegNum32(15, 0, 0, 8, 0), MISCREG_RAZ },
222 { MiscRegNum32(15, 0, 0, 8, 1), MISCREG_RAZ },
223 { MiscRegNum32(15, 0, 0, 8, 2), MISCREG_RAZ },
224 { MiscRegNum32(15, 0, 0, 8, 3), MISCREG_RAZ },
225 { MiscRegNum32(15, 0, 0, 8, 4), MISCREG_RAZ },
226 { MiscRegNum32(15, 0, 0, 8, 5), MISCREG_RAZ },
227 { MiscRegNum32(15, 0, 0, 8, 6), MISCREG_RAZ },
228 { MiscRegNum32(15, 0, 0, 8, 7), MISCREG_RAZ },
229 { MiscRegNum32(15, 0, 0, 9, 0), MISCREG_RAZ },
230 { MiscRegNum32(15, 0, 0, 9, 1), MISCREG_RAZ },
231 { MiscRegNum32(15, 0, 0, 9, 2), MISCREG_RAZ },
232 { MiscRegNum32(15, 0, 0, 9, 3), MISCREG_RAZ },
233 { MiscRegNum32(15, 0, 0, 9, 4), MISCREG_RAZ },
234 { MiscRegNum32(15, 0, 0, 9, 5), MISCREG_RAZ },
235 { MiscRegNum32(15, 0, 0, 9, 6), MISCREG_RAZ },
236 { MiscRegNum32(15, 0, 0, 9, 7), MISCREG_RAZ },
237 { MiscRegNum32(15, 0, 0, 10, 0), MISCREG_RAZ },
238 { MiscRegNum32(15, 0, 0, 10, 1), MISCREG_RAZ },
239 { MiscRegNum32(15, 0, 0, 10, 2), MISCREG_RAZ },
240 { MiscRegNum32(15, 0, 0, 10, 3), MISCREG_RAZ },
241 { MiscRegNum32(15, 0, 0, 10, 4), MISCREG_RAZ },
242 { MiscRegNum32(15, 0, 0, 10, 5), MISCREG_RAZ },
243 { MiscRegNum32(15, 0, 0, 10, 6), MISCREG_RAZ },
244 { MiscRegNum32(15, 0, 0, 10, 7), MISCREG_RAZ },
245 { MiscRegNum32(15, 0, 0, 11, 0), MISCREG_RAZ },
246 { MiscRegNum32(15, 0, 0, 11, 1), MISCREG_RAZ },
247 { MiscRegNum32(15, 0, 0, 11, 2), MISCREG_RAZ },
248 { MiscRegNum32(15, 0, 0, 11, 3), MISCREG_RAZ },
249 { MiscRegNum32(15, 0, 0, 11, 4), MISCREG_RAZ },
250 { MiscRegNum32(15, 0, 0, 11, 5), MISCREG_RAZ },
251 { MiscRegNum32(15, 0, 0, 11, 6), MISCREG_RAZ },
252 { MiscRegNum32(15, 0, 0, 11, 7), MISCREG_RAZ },
253 { MiscRegNum32(15, 0, 0, 12, 0), MISCREG_RAZ },
254 { MiscRegNum32(15, 0, 0, 12, 1), MISCREG_RAZ },
255 { MiscRegNum32(15, 0, 0, 12, 2), MISCREG_RAZ },
256 { MiscRegNum32(15, 0, 0, 12, 3), MISCREG_RAZ },
257 { MiscRegNum32(15, 0, 0, 12, 4), MISCREG_RAZ },
258 { MiscRegNum32(15, 0, 0, 12, 5), MISCREG_RAZ },
259 { MiscRegNum32(15, 0, 0, 12, 6), MISCREG_RAZ },
260 { MiscRegNum32(15, 0, 0, 12, 7), MISCREG_RAZ },
261 { MiscRegNum32(15, 0, 0, 13, 0), MISCREG_RAZ },
262 { MiscRegNum32(15, 0, 0, 13, 1), MISCREG_RAZ },
263 { MiscRegNum32(15, 0, 0, 13, 2), MISCREG_RAZ },
264 { MiscRegNum32(15, 0, 0, 13, 3), MISCREG_RAZ },
265 { MiscRegNum32(15, 0, 0, 13, 4), MISCREG_RAZ },
266 { MiscRegNum32(15, 0, 0, 13, 5), MISCREG_RAZ },
267 { MiscRegNum32(15, 0, 0, 13, 6), MISCREG_RAZ },
268 { MiscRegNum32(15, 0, 0, 13, 7), MISCREG_RAZ },
269 { MiscRegNum32(15, 0, 0, 14, 0), MISCREG_RAZ },
270 { MiscRegNum32(15, 0, 0, 14, 1), MISCREG_RAZ },
271 { MiscRegNum32(15, 0, 0, 14, 2), MISCREG_RAZ },
272 { MiscRegNum32(15, 0, 0, 14, 3), MISCREG_RAZ },
273 { MiscRegNum32(15, 0, 0, 14, 4), MISCREG_RAZ },
274 { MiscRegNum32(15, 0, 0, 14, 5), MISCREG_RAZ },
275 { MiscRegNum32(15, 0, 0, 14, 6), MISCREG_RAZ },
276 { MiscRegNum32(15, 0, 0, 14, 7), MISCREG_RAZ },
277 { MiscRegNum32(15, 0, 0, 15, 0), MISCREG_RAZ },
278 { MiscRegNum32(15, 0, 0, 15, 1), MISCREG_RAZ },
279 { MiscRegNum32(15, 0, 0, 15, 2), MISCREG_RAZ },
280 { MiscRegNum32(15, 0, 0, 15, 3), MISCREG_RAZ },
281 { MiscRegNum32(15, 0, 0, 15, 4), MISCREG_RAZ },
282 { MiscRegNum32(15, 0, 0, 15, 5), MISCREG_RAZ },
283 { MiscRegNum32(15, 0, 0, 15, 6), MISCREG_RAZ },
284 { MiscRegNum32(15, 0, 0, 15, 7), MISCREG_RAZ },
285 { MiscRegNum32(15, 0, 1, 0, 0), MISCREG_SCTLR },
286 { MiscRegNum32(15, 0, 1, 0, 1), MISCREG_ACTLR },
287 { MiscRegNum32(15, 0, 1, 0, 2), MISCREG_CPACR },
288 { MiscRegNum32(15, 0, 1, 1, 0), MISCREG_SCR },
289 { MiscRegNum32(15, 0, 1, 1, 1), MISCREG_SDER },
290 { MiscRegNum32(15, 0, 1, 1, 2), MISCREG_NSACR },
291 { MiscRegNum32(15, 0, 1, 3, 1), MISCREG_SDCR },
292 { MiscRegNum32(15, 0, 2, 0, 0), MISCREG_TTBR0 },
293 { MiscRegNum32(15, 0, 2, 0, 1), MISCREG_TTBR1 },
294 { MiscRegNum32(15, 0, 2, 0, 2), MISCREG_TTBCR },
295 { MiscRegNum32(15, 0, 3, 0, 0), MISCREG_DACR },
296 { MiscRegNum32(15, 0, 4, 6, 0), MISCREG_ICC_PMR },
297 { MiscRegNum32(15, 0, 5, 0, 0), MISCREG_DFSR },
298 { MiscRegNum32(15, 0, 5, 0, 1), MISCREG_IFSR },
299 { MiscRegNum32(15, 0, 5, 1, 0), MISCREG_ADFSR },
300 { MiscRegNum32(15, 0, 5, 1, 1), MISCREG_AIFSR },
301 { MiscRegNum32(15, 0, 6, 0, 0), MISCREG_DFAR },
302 { MiscRegNum32(15, 0, 6, 0, 2), MISCREG_IFAR },
303 { MiscRegNum32(15, 0, 7, 0, 4), MISCREG_NOP },
304 { MiscRegNum32(15, 0, 7, 1, 0), MISCREG_ICIALLUIS },
305 { MiscRegNum32(15, 0, 7, 1, 6), MISCREG_BPIALLIS },
306 { MiscRegNum32(15, 0, 7, 2, 7), MISCREG_DBGDEVID0 },
307 { MiscRegNum32(15, 0, 7, 4, 0), MISCREG_PAR },
308 { MiscRegNum32(15, 0, 7, 5, 0), MISCREG_ICIALLU },
309 { MiscRegNum32(15, 0, 7, 5, 1), MISCREG_ICIMVAU },
310 { MiscRegNum32(15, 0, 7, 5, 4), MISCREG_CP15ISB },
311 { MiscRegNum32(15, 0, 7, 5, 6), MISCREG_BPIALL },
312 { MiscRegNum32(15, 0, 7, 5, 7), MISCREG_BPIMVA },
313 { MiscRegNum32(15, 0, 7, 6, 1), MISCREG_DCIMVAC },
314 { MiscRegNum32(15, 0, 7, 6, 2), MISCREG_DCISW },
315 { MiscRegNum32(15, 0, 7, 8, 0), MISCREG_ATS1CPR },
316 { MiscRegNum32(15, 0, 7, 8, 1), MISCREG_ATS1CPW },
317 { MiscRegNum32(15, 0, 7, 8, 2), MISCREG_ATS1CUR },
318 { MiscRegNum32(15, 0, 7, 8, 3), MISCREG_ATS1CUW },
319 { MiscRegNum32(15, 0, 7, 8, 4), MISCREG_ATS12NSOPR },
320 { MiscRegNum32(15, 0, 7, 8, 5), MISCREG_ATS12NSOPW },
321 { MiscRegNum32(15, 0, 7, 8, 6), MISCREG_ATS12NSOUR },
322 { MiscRegNum32(15, 0, 7, 8, 7), MISCREG_ATS12NSOUW },
323 { MiscRegNum32(15, 0, 7, 10, 1), MISCREG_DCCMVAC },
324 { MiscRegNum32(15, 0, 7, 10, 2), MISCREG_DCCSW },
325 { MiscRegNum32(15, 0, 7, 10, 4), MISCREG_CP15DSB },
326 { MiscRegNum32(15, 0, 7, 10, 5), MISCREG_CP15DMB },
327 { MiscRegNum32(15, 0, 7, 11, 1), MISCREG_DCCMVAU },
328 { MiscRegNum32(15, 0, 7, 13, 1), MISCREG_NOP },
329 { MiscRegNum32(15, 0, 7, 14, 1), MISCREG_DCCIMVAC },
330 { MiscRegNum32(15, 0, 7, 14, 2), MISCREG_DCCISW },
331 { MiscRegNum32(15, 0, 8, 3, 0), MISCREG_TLBIALLIS },
332 { MiscRegNum32(15, 0, 8, 3, 1), MISCREG_TLBIMVAIS },
333 { MiscRegNum32(15, 0, 8, 3, 2), MISCREG_TLBIASIDIS },
334 { MiscRegNum32(15, 0, 8, 3, 3), MISCREG_TLBIMVAAIS },
335 { MiscRegNum32(15, 0, 8, 3, 5), MISCREG_TLBIMVALIS },
336 { MiscRegNum32(15, 0, 8, 3, 7), MISCREG_TLBIMVAALIS },
337 { MiscRegNum32(15, 0, 8, 5, 0), MISCREG_ITLBIALL },
338 { MiscRegNum32(15, 0, 8, 5, 1), MISCREG_ITLBIMVA },
339 { MiscRegNum32(15, 0, 8, 5, 2), MISCREG_ITLBIASID },
340 { MiscRegNum32(15, 0, 8, 6, 0), MISCREG_DTLBIALL },
341 { MiscRegNum32(15, 0, 8, 6, 1), MISCREG_DTLBIMVA },
342 { MiscRegNum32(15, 0, 8, 6, 2), MISCREG_DTLBIASID },
343 { MiscRegNum32(15, 0, 8, 7, 0), MISCREG_TLBIALL },
344 { MiscRegNum32(15, 0, 8, 7, 1), MISCREG_TLBIMVA },
345 { MiscRegNum32(15, 0, 8, 7, 2), MISCREG_TLBIASID },
346 { MiscRegNum32(15, 0, 8, 7, 3), MISCREG_TLBIMVAA },
347 { MiscRegNum32(15, 0, 8, 7, 5), MISCREG_TLBIMVAL },
348 { MiscRegNum32(15, 0, 8, 7, 7), MISCREG_TLBIMVAAL },
349 { MiscRegNum32(15, 0, 9, 12, 0), MISCREG_PMCR },
350 { MiscRegNum32(15, 0, 9, 12, 1), MISCREG_PMCNTENSET },
351 { MiscRegNum32(15, 0, 9, 12, 2), MISCREG_PMCNTENCLR },
352 { MiscRegNum32(15, 0, 9, 12, 3), MISCREG_PMOVSR },
353 { MiscRegNum32(15, 0, 9, 12, 4), MISCREG_PMSWINC },
354 { MiscRegNum32(15, 0, 9, 12, 5), MISCREG_PMSELR },
355 { MiscRegNum32(15, 0, 9, 12, 6), MISCREG_PMCEID0 },
356 { MiscRegNum32(15, 0, 9, 12, 7), MISCREG_PMCEID1 },
357 { MiscRegNum32(15, 0, 9, 13, 0), MISCREG_PMCCNTR },
358 { MiscRegNum32(15, 0, 9, 13, 1), MISCREG_PMXEVTYPER_PMCCFILTR },
359 { MiscRegNum32(15, 0, 9, 13, 2), MISCREG_PMXEVCNTR },
360 { MiscRegNum32(15, 0, 9, 14, 0), MISCREG_PMUSERENR },
361 { MiscRegNum32(15, 0, 9, 14, 1), MISCREG_PMINTENSET },
362 { MiscRegNum32(15, 0, 9, 14, 2), MISCREG_PMINTENCLR },
363 { MiscRegNum32(15, 0, 9, 14, 3), MISCREG_PMOVSSET },
364 { MiscRegNum32(15, 0, 10, 2, 0), MISCREG_PRRR_MAIR0 },
365 { MiscRegNum32(15, 0, 10, 2, 1), MISCREG_NMRR_MAIR1 },
366 { MiscRegNum32(15, 0, 10, 3, 0), MISCREG_AMAIR0 },
367 { MiscRegNum32(15, 0, 10, 3, 1), MISCREG_AMAIR1 },
368 { MiscRegNum32(15, 0, 12, 0, 0), MISCREG_VBAR },
369 { MiscRegNum32(15, 0, 12, 0, 1), MISCREG_MVBAR },
370 { MiscRegNum32(15, 0, 12, 1, 0), MISCREG_ISR },
371 { MiscRegNum32(15, 0, 12, 8, 0), MISCREG_ICC_IAR0 },
372 { MiscRegNum32(15, 0, 12, 8, 1), MISCREG_ICC_EOIR0 },
373 { MiscRegNum32(15, 0, 12, 8, 2), MISCREG_ICC_HPPIR0 },
374 { MiscRegNum32(15, 0, 12, 8, 3), MISCREG_ICC_BPR0 },
375 { MiscRegNum32(15, 0, 12, 8, 4), MISCREG_ICC_AP0R0 },
376 { MiscRegNum32(15, 0, 12, 8, 5), MISCREG_ICC_AP0R1 },
377 { MiscRegNum32(15, 0, 12, 8, 6), MISCREG_ICC_AP0R2 },
378 { MiscRegNum32(15, 0, 12, 8, 7), MISCREG_ICC_AP0R3 },
379 { MiscRegNum32(15, 0, 12, 9, 0), MISCREG_ICC_AP1R0 },
380 { MiscRegNum32(15, 0, 12, 9, 1), MISCREG_ICC_AP1R1 },
381 { MiscRegNum32(15, 0, 12, 9, 2), MISCREG_ICC_AP1R2 },
382 { MiscRegNum32(15, 0, 12, 9, 3), MISCREG_ICC_AP1R3 },
383 { MiscRegNum32(15, 0, 12, 11, 1), MISCREG_ICC_DIR },
384 { MiscRegNum32(15, 0, 12, 11, 3), MISCREG_ICC_RPR },
385 { MiscRegNum32(15, 0, 12, 12, 0), MISCREG_ICC_IAR1 },
386 { MiscRegNum32(15, 0, 12, 12, 1), MISCREG_ICC_EOIR1 },
387 { MiscRegNum32(15, 0, 12, 12, 2), MISCREG_ICC_HPPIR1 },
388 { MiscRegNum32(15, 0, 12, 12, 3), MISCREG_ICC_BPR1 },
389 { MiscRegNum32(15, 0, 12, 12, 4), MISCREG_ICC_CTLR },
390 { MiscRegNum32(15, 0, 12, 12, 5), MISCREG_ICC_SRE },
391 { MiscRegNum32(15, 0, 12, 12, 6), MISCREG_ICC_IGRPEN0 },
392 { MiscRegNum32(15, 0, 12, 12, 7), MISCREG_ICC_IGRPEN1 },
393 { MiscRegNum32(15, 0, 13, 0, 0), MISCREG_FCSEIDR },
394 { MiscRegNum32(15, 0, 13, 0, 1), MISCREG_CONTEXTIDR },
395 { MiscRegNum32(15, 0, 13, 0, 2), MISCREG_TPIDRURW },
396 { MiscRegNum32(15, 0, 13, 0, 3), MISCREG_TPIDRURO },
397 { MiscRegNum32(15, 0, 13, 0, 4), MISCREG_TPIDRPRW },
398 { MiscRegNum32(15, 0, 14, 0, 0), MISCREG_CNTFRQ },
399 { MiscRegNum32(15, 0, 14, 1, 0), MISCREG_CNTKCTL },
400 { MiscRegNum32(15, 0, 14, 2, 0), MISCREG_CNTP_TVAL },
401 { MiscRegNum32(15, 0, 14, 2, 1), MISCREG_CNTP_CTL },
402 { MiscRegNum32(15, 0, 14, 3, 0), MISCREG_CNTV_TVAL },
403 { MiscRegNum32(15, 0, 14, 3, 1), MISCREG_CNTV_CTL },
404 { MiscRegNum32(15, 1, 0, 0, 0), MISCREG_CCSIDR },
405 { MiscRegNum32(15, 1, 0, 0, 1), MISCREG_CLIDR },
406 { MiscRegNum32(15, 1, 0, 0, 7), MISCREG_AIDR },
407 { MiscRegNum32(15, 2, 0, 0, 0), MISCREG_CSSELR },
408 { MiscRegNum32(15, 4, 0, 0, 0), MISCREG_VPIDR },
409 { MiscRegNum32(15, 4, 0, 0, 5), MISCREG_VMPIDR },
410 { MiscRegNum32(15, 4, 1, 0, 0), MISCREG_HSCTLR },
411 { MiscRegNum32(15, 4, 1, 0, 1), MISCREG_HACTLR },
412 { MiscRegNum32(15, 4, 1, 1, 0), MISCREG_HCR },
413 { MiscRegNum32(15, 4, 1, 1, 1), MISCREG_HDCR },
414 { MiscRegNum32(15, 4, 1, 1, 2), MISCREG_HCPTR },
415 { MiscRegNum32(15, 4, 1, 1, 3), MISCREG_HSTR },
416 { MiscRegNum32(15, 4, 1, 1, 4), MISCREG_HCR2 },
417 { MiscRegNum32(15, 4, 1, 1, 7), MISCREG_HACR },
418 { MiscRegNum32(15, 4, 2, 0, 2), MISCREG_HTCR },
419 { MiscRegNum32(15, 4, 2, 1, 2), MISCREG_VTCR },
420 { MiscRegNum32(15, 4, 5, 1, 0), MISCREG_HADFSR },
421 { MiscRegNum32(15, 4, 5, 1, 1), MISCREG_HAIFSR },
422 { MiscRegNum32(15, 4, 5, 2, 0), MISCREG_HSR },
423 { MiscRegNum32(15, 4, 6, 0, 0), MISCREG_HDFAR },
424 { MiscRegNum32(15, 4, 6, 0, 2), MISCREG_HIFAR },
425 { MiscRegNum32(15, 4, 6, 0, 4), MISCREG_HPFAR },
426 { MiscRegNum32(15, 4, 7, 8, 0), MISCREG_ATS1HR },
427 { MiscRegNum32(15, 4, 7, 8, 1), MISCREG_ATS1HW },
428 { MiscRegNum32(15, 4, 8, 0, 1), MISCREG_TLBIIPAS2IS },
429 { MiscRegNum32(15, 4, 8, 0, 5), MISCREG_TLBIIPAS2LIS },
430 { MiscRegNum32(15, 4, 8, 3, 0), MISCREG_TLBIALLHIS },
431 { MiscRegNum32(15, 4, 8, 3, 1), MISCREG_TLBIMVAHIS },
432 { MiscRegNum32(15, 4, 8, 3, 4), MISCREG_TLBIALLNSNHIS },
433 { MiscRegNum32(15, 4, 8, 3, 5), MISCREG_TLBIMVALHIS },
434 { MiscRegNum32(15, 4, 8, 4, 1), MISCREG_TLBIIPAS2 },
435 { MiscRegNum32(15, 4, 8, 4, 5), MISCREG_TLBIIPAS2L },
436 { MiscRegNum32(15, 4, 8, 7, 0), MISCREG_TLBIALLH },
437 { MiscRegNum32(15, 4, 8, 7, 1), MISCREG_TLBIMVAH },
438 { MiscRegNum32(15, 4, 8, 7, 4), MISCREG_TLBIALLNSNH },
439 { MiscRegNum32(15, 4, 8, 7, 5), MISCREG_TLBIMVALH },
440 { MiscRegNum32(15, 4, 10, 2, 0), MISCREG_HMAIR0 },
441 { MiscRegNum32(15, 4, 10, 2, 1), MISCREG_HMAIR1 },
442 { MiscRegNum32(15, 4, 10, 3, 0), MISCREG_HAMAIR0 },
443 { MiscRegNum32(15, 4, 10, 3, 1), MISCREG_HAMAIR1 },
444 { MiscRegNum32(15, 4, 12, 0, 0), MISCREG_HVBAR },
445 { MiscRegNum32(15, 4, 12, 8, 0), MISCREG_ICH_AP0R0 },
446 { MiscRegNum32(15, 4, 12, 8, 1), MISCREG_ICH_AP0R1 },
447 { MiscRegNum32(15, 4, 12, 8, 2), MISCREG_ICH_AP0R2 },
448 { MiscRegNum32(15, 4, 12, 8, 3), MISCREG_ICH_AP0R3 },
449 { MiscRegNum32(15, 4, 12, 9, 0), MISCREG_ICH_AP1R0 },
450 { MiscRegNum32(15, 4, 12, 9, 1), MISCREG_ICH_AP1R1 },
451 { MiscRegNum32(15, 4, 12, 9, 2), MISCREG_ICH_AP1R2 },
452 { MiscRegNum32(15, 4, 12, 9, 3), MISCREG_ICH_AP1R3 },
453 { MiscRegNum32(15, 4, 12, 9, 5), MISCREG_ICC_HSRE },
454 { MiscRegNum32(15, 4, 12, 11, 0), MISCREG_ICH_HCR },
455 { MiscRegNum32(15, 4, 12, 11, 1), MISCREG_ICH_VTR },
456 { MiscRegNum32(15, 4, 12, 11, 2), MISCREG_ICH_MISR },
457 { MiscRegNum32(15, 4, 12, 11, 3), MISCREG_ICH_EISR },
458 { MiscRegNum32(15, 4, 12, 11, 5), MISCREG_ICH_ELRSR },
459 { MiscRegNum32(15, 4, 12, 11, 7), MISCREG_ICH_VMCR },
460 { MiscRegNum32(15, 4, 12, 12, 0), MISCREG_ICH_LR0 },
461 { MiscRegNum32(15, 4, 12, 12, 1), MISCREG_ICH_LR1 },
462 { MiscRegNum32(15, 4, 12, 12, 2), MISCREG_ICH_LR2 },
463 { MiscRegNum32(15, 4, 12, 12, 3), MISCREG_ICH_LR3 },
464 { MiscRegNum32(15, 4, 12, 12, 4), MISCREG_ICH_LR4 },
465 { MiscRegNum32(15, 4, 12, 12, 5), MISCREG_ICH_LR5 },
466 { MiscRegNum32(15, 4, 12, 12, 6), MISCREG_ICH_LR6 },
467 { MiscRegNum32(15, 4, 12, 12, 7), MISCREG_ICH_LR7 },
468 { MiscRegNum32(15, 4, 12, 13, 0), MISCREG_ICH_LR8 },
469 { MiscRegNum32(15, 4, 12, 13, 1), MISCREG_ICH_LR9 },
470 { MiscRegNum32(15, 4, 12, 13, 2), MISCREG_ICH_LR10 },
471 { MiscRegNum32(15, 4, 12, 13, 3), MISCREG_ICH_LR11 },
472 { MiscRegNum32(15, 4, 12, 13, 4), MISCREG_ICH_LR12 },
473 { MiscRegNum32(15, 4, 12, 13, 5), MISCREG_ICH_LR13 },
474 { MiscRegNum32(15, 4, 12, 13, 6), MISCREG_ICH_LR14 },
475 { MiscRegNum32(15, 4, 12, 13, 7), MISCREG_ICH_LR15 },
476 { MiscRegNum32(15, 4, 12, 14, 0), MISCREG_ICH_LRC0 },
477 { MiscRegNum32(15, 4, 12, 14, 1), MISCREG_ICH_LRC1 },
478 { MiscRegNum32(15, 4, 12, 14, 2), MISCREG_ICH_LRC2 },
479 { MiscRegNum32(15, 4, 12, 14, 3), MISCREG_ICH_LRC3 },
480 { MiscRegNum32(15, 4, 12, 14, 4), MISCREG_ICH_LRC4 },
481 { MiscRegNum32(15, 4, 12, 14, 5), MISCREG_ICH_LRC5 },
482 { MiscRegNum32(15, 4, 12, 14, 6), MISCREG_ICH_LRC6 },
483 { MiscRegNum32(15, 4, 12, 14, 7), MISCREG_ICH_LRC7 },
484 { MiscRegNum32(15, 4, 12, 15, 0), MISCREG_ICH_LRC8 },
485 { MiscRegNum32(15, 4, 12, 15, 1), MISCREG_ICH_LRC9 },
486 { MiscRegNum32(15, 4, 12, 15, 2), MISCREG_ICH_LRC10 },
487 { MiscRegNum32(15, 4, 12, 15, 3), MISCREG_ICH_LRC11 },
488 { MiscRegNum32(15, 4, 12, 15, 4), MISCREG_ICH_LRC12 },
489 { MiscRegNum32(15, 4, 12, 15, 5), MISCREG_ICH_LRC13 },
490 { MiscRegNum32(15, 4, 12, 15, 6), MISCREG_ICH_LRC14 },
491 { MiscRegNum32(15, 4, 12, 15, 7), MISCREG_ICH_LRC15 },
492 { MiscRegNum32(15, 4, 13, 0, 2), MISCREG_HTPIDR },
493 { MiscRegNum32(15, 4, 14, 1, 0), MISCREG_CNTHCTL },
494 { MiscRegNum32(15, 4, 14, 2, 0), MISCREG_CNTHP_TVAL },
495 { MiscRegNum32(15, 4, 14, 2, 1), MISCREG_CNTHP_CTL },
496 { MiscRegNum32(15, 6, 12, 12, 4), MISCREG_ICC_MCTLR },
497 { MiscRegNum32(15, 6, 12, 12, 5), MISCREG_ICC_MSRE },
498 { MiscRegNum32(15, 6, 12, 12, 7), MISCREG_ICC_MGRPEN1 },
499 // MCRR/MRRC regs
500 { MiscRegNum32(15, 0, 2), MISCREG_TTBR0 },
501 { MiscRegNum32(15, 0, 7), MISCREG_PAR },
502 { MiscRegNum32(15, 0, 12), MISCREG_ICC_SGI1R },
503 { MiscRegNum32(15, 0, 14), MISCREG_CNTPCT },
504 { MiscRegNum32(15, 0, 15), MISCREG_CPUMERRSR },
505 { MiscRegNum32(15, 1, 2), MISCREG_TTBR1 },
506 { MiscRegNum32(15, 1, 12), MISCREG_ICC_ASGI1R },
507 { MiscRegNum32(15, 1, 14), MISCREG_CNTVCT },
508 { MiscRegNum32(15, 1, 15), MISCREG_L2MERRSR },
509 { MiscRegNum32(15, 2, 12), MISCREG_ICC_SGI0R },
510 { MiscRegNum32(15, 2, 14), MISCREG_CNTP_CVAL },
511 { MiscRegNum32(15, 3, 14), MISCREG_CNTV_CVAL },
512 { MiscRegNum32(15, 4, 2), MISCREG_HTTBR },
513 { MiscRegNum32(15, 4, 14), MISCREG_CNTVOFF },
514 { MiscRegNum32(15, 6, 2), MISCREG_VTTBR },
515 { MiscRegNum32(15, 6, 14), MISCREG_CNTHP_CVAL },
516};
517
518}
519
521decodeCP14Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
522{
523 MiscRegNum32 cop_reg(14, opc1, crn, crm, opc2);
524 auto it = miscRegNum32ToIdx.find(cop_reg);
525 if (it != miscRegNum32ToIdx.end()) {
526 return it->second;
527 } else {
528 warn("CP14 unimplemented crn[%d], opc1[%d], crm[%d], opc2[%d]",
529 crn, opc1, crm, opc2);
530 return MISCREG_UNKNOWN;
531 }
532}
533
535decodeCP15Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
536{
537 MiscRegNum32 cop_reg(15, opc1, crn, crm, opc2);
538 auto it = miscRegNum32ToIdx.find(cop_reg);
539 if (it != miscRegNum32ToIdx.end()) {
540 return it->second;
541 } else {
542 if ((crn == 15) ||
543 (crn == 9 && (crm <= 2 || crm >= 5)) ||
544 (crn == 10 && opc1 == 0 && crm <= 1) ||
545 (crn == 11 && opc1 <= 7 && (crm <= 8 || crm ==15))) {
547 } else {
548 return MISCREG_UNKNOWN;
549 }
550 }
551}
552
554decodeCP15Reg64(unsigned crm, unsigned opc1)
555{
556 MiscRegNum32 cop_reg(15, opc1, crm);
557 auto it = miscRegNum32ToIdx.find(cop_reg);
558 if (it != miscRegNum32ToIdx.end()) {
559 return it->second;
560 } else {
561 return MISCREG_UNKNOWN;
562 }
563}
564
565std::tuple<bool, bool>
567{
568 bool secure = !scr.ns;
569 bool can_read = false;
570 bool undefined = false;
571 auto& miscreg_info = lookUpMiscReg[reg].info;
572
573 switch (cpsr.mode) {
574 case MODE_USER:
575 can_read = secure ? miscreg_info[MISCREG_USR_S_RD] :
576 miscreg_info[MISCREG_USR_NS_RD];
577 break;
578 case MODE_FIQ:
579 case MODE_IRQ:
580 case MODE_SVC:
581 case MODE_ABORT:
582 case MODE_UNDEFINED:
583 case MODE_SYSTEM:
584 can_read = secure ? miscreg_info[MISCREG_PRI_S_RD] :
585 miscreg_info[MISCREG_PRI_NS_RD];
586 break;
587 case MODE_MON:
588 can_read = secure ? miscreg_info[MISCREG_MON_NS0_RD] :
589 miscreg_info[MISCREG_MON_NS1_RD];
590 break;
591 case MODE_HYP:
592 can_read = miscreg_info[MISCREG_HYP_NS_RD];
593 break;
594 default:
595 undefined = true;
596 }
597
598 switch (reg) {
600 if (!undefined)
601 undefined = AArch32isUndefinedGenericTimer(reg, tc);
602 break;
603 default:
604 break;
605 }
606
607 // can't do permissions checkes on the root of a banked pair of regs
608 assert(!miscreg_info[MISCREG_BANKED]);
609 return std::make_tuple(can_read, undefined);
610}
611
612std::tuple<bool, bool>
614{
615 bool secure = !scr.ns;
616 bool can_write = false;
617 bool undefined = false;
618 const auto& miscreg_info = lookUpMiscReg[reg].info;
619
620 switch (cpsr.mode) {
621 case MODE_USER:
622 can_write = secure ? miscreg_info[MISCREG_USR_S_WR] :
623 miscreg_info[MISCREG_USR_NS_WR];
624 break;
625 case MODE_FIQ:
626 case MODE_IRQ:
627 case MODE_SVC:
628 case MODE_ABORT:
629 case MODE_UNDEFINED:
630 case MODE_SYSTEM:
631 can_write = secure ? miscreg_info[MISCREG_PRI_S_WR] :
632 miscreg_info[MISCREG_PRI_NS_WR];
633 break;
634 case MODE_MON:
635 can_write = secure ? miscreg_info[MISCREG_MON_NS0_WR] :
636 miscreg_info[MISCREG_MON_NS1_WR];
637 break;
638 case MODE_HYP:
639 can_write = miscreg_info[MISCREG_HYP_NS_WR];
640 break;
641 default:
642 undefined = true;
643 }
644
645 switch (reg) {
647 if (!undefined)
648 undefined = AArch32isUndefinedGenericTimer(reg, tc);
649 break;
650 default:
651 break;
652 }
653
654 // can't do permissions checkes on the root of a banked pair of regs
655 assert(!miscreg_info[MISCREG_BANKED]);
656 return std::make_tuple(can_write, undefined);
657}
658
659bool
661{
662 if (currEL(tc) == EL0 && ELIs32(tc, EL1)) {
663 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
664 bool trap_cond = condGenericTimerSystemAccessTrapEL1(reg, tc);
665 if (trap_cond && (!EL2Enabled(tc) || !hcr.tge))
666 return true;
667 }
668 return false;
669}
670
671int
673{
674 SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
675 return snsBankedIndex(reg, tc, scr.ns);
676}
677
678int
680{
681 int reg_as_int = static_cast<int>(reg);
682 if (lookUpMiscReg[reg].info[MISCREG_BANKED]) {
683 reg_as_int += (ArmSystem::haveEL(tc, EL3) &&
684 !ArmSystem::highestELIs64(tc) && !ns) ? 2 : 1;
685 }
686 return reg_as_int;
687}
688
689int
691{
692 auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
693 SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
694 return isa->snsBankedIndex64(reg, scr.ns);
695}
696
706
707void
709{
710 int reg = -1;
711 for (int i = 0 ; i < NUM_MISCREGS; i++){
712 if (lookUpMiscReg[i].info[MISCREG_BANKED])
713 reg = i;
716 else
718 // if this assert fails, no parent was found, and something is broken
719 assert(unflattenResultMiscReg[i] > -1);
720 }
721}
722
723int
725{
727}
728
729Fault
731 ThreadContext *tc, const MiscRegOp64 &inst)
732{
733 return lookUpMiscReg[reg].checkFault(tc, inst, currEL(cpsr));
734}
735
737
738namespace {
739// The map is translating a MiscRegIndex into AArch64 system register
740// numbers (op0, op1, crn, crm, op2)
741std::unordered_map<MiscRegIndex, MiscRegNum64> idxToMiscRegNum;
742
743// The map is translating AArch64 system register numbers
744// (op0, op1, crn, crm, op2) into a MiscRegIndex
745std::unordered_map<MiscRegNum64, MiscRegIndex> miscRegNumToIdx{
746 { MiscRegNum64(1, 0, 7, 1, 0), MISCREG_IC_IALLUIS },
747 { MiscRegNum64(1, 0, 7, 5, 0), MISCREG_IC_IALLU },
748 { MiscRegNum64(1, 0, 7, 6, 1), MISCREG_DC_IVAC_Xt },
749 { MiscRegNum64(1, 0, 7, 6, 2), MISCREG_DC_ISW_Xt },
750 { MiscRegNum64(1, 0, 7, 8, 0), MISCREG_AT_S1E1R_Xt },
751 { MiscRegNum64(1, 0, 7, 8, 1), MISCREG_AT_S1E1W_Xt },
752 { MiscRegNum64(1, 0, 7, 8, 2), MISCREG_AT_S1E0R_Xt },
753 { MiscRegNum64(1, 0, 7, 8, 3), MISCREG_AT_S1E0W_Xt },
754 { MiscRegNum64(1, 0, 7, 10, 2), MISCREG_DC_CSW_Xt },
755 { MiscRegNum64(1, 0, 7, 14, 2), MISCREG_DC_CISW_Xt },
756 { MiscRegNum64(1, 0, 8, 1, 0), MISCREG_TLBI_VMALLE1OS },
757 { MiscRegNum64(1, 0, 8, 1, 1), MISCREG_TLBI_VAE1OS },
758 { MiscRegNum64(1, 0, 8, 1, 2), MISCREG_TLBI_ASIDE1OS },
759 { MiscRegNum64(1, 0, 8, 1, 3), MISCREG_TLBI_VAAE1OS },
760 { MiscRegNum64(1, 0, 8, 1, 5), MISCREG_TLBI_VALE1OS },
761 { MiscRegNum64(1, 0, 8, 1, 7), MISCREG_TLBI_VAALE1OS },
762 { MiscRegNum64(1, 0, 8, 2, 1), MISCREG_TLBI_RVAE1IS },
763 { MiscRegNum64(1, 0, 8, 2, 3), MISCREG_TLBI_RVAAE1IS },
764 { MiscRegNum64(1, 0, 8, 2, 5), MISCREG_TLBI_RVALE1IS },
765 { MiscRegNum64(1, 0, 8, 2, 7), MISCREG_TLBI_RVAALE1IS },
766 { MiscRegNum64(1, 0, 8, 3, 0), MISCREG_TLBI_VMALLE1IS },
767 { MiscRegNum64(1, 0, 8, 3, 1), MISCREG_TLBI_VAE1IS },
768 { MiscRegNum64(1, 0, 8, 3, 2), MISCREG_TLBI_ASIDE1IS },
769 { MiscRegNum64(1, 0, 8, 3, 3), MISCREG_TLBI_VAAE1IS },
770 { MiscRegNum64(1, 0, 8, 3, 5), MISCREG_TLBI_VALE1IS },
771 { MiscRegNum64(1, 0, 8, 3, 7), MISCREG_TLBI_VAALE1IS },
772 { MiscRegNum64(1, 0, 8, 5, 1), MISCREG_TLBI_RVAE1OS },
773 { MiscRegNum64(1, 0, 8, 5, 3), MISCREG_TLBI_RVAAE1OS },
774 { MiscRegNum64(1, 0, 8, 5, 5), MISCREG_TLBI_RVALE1OS },
775 { MiscRegNum64(1, 0, 8, 5, 7), MISCREG_TLBI_RVAALE1OS },
776 { MiscRegNum64(1, 0, 8, 6, 1), MISCREG_TLBI_RVAE1 },
777 { MiscRegNum64(1, 0, 8, 6, 3), MISCREG_TLBI_RVAAE1 },
778 { MiscRegNum64(1, 0, 8, 6, 5), MISCREG_TLBI_RVALE1 },
779 { MiscRegNum64(1, 0, 8, 6, 7), MISCREG_TLBI_RVAALE1 },
780 { MiscRegNum64(1, 0, 8, 7, 0), MISCREG_TLBI_VMALLE1 },
781 { MiscRegNum64(1, 0, 8, 7, 1), MISCREG_TLBI_VAE1 },
782 { MiscRegNum64(1, 0, 8, 7, 2), MISCREG_TLBI_ASIDE1 },
783 { MiscRegNum64(1, 0, 8, 7, 3), MISCREG_TLBI_VAAE1 },
784 { MiscRegNum64(1, 0, 8, 7, 5), MISCREG_TLBI_VALE1 },
785 { MiscRegNum64(1, 0, 8, 7, 7), MISCREG_TLBI_VAALE1 },
786 { MiscRegNum64(1, 3, 7, 4, 1), MISCREG_DC_ZVA_Xt },
787 { MiscRegNum64(1, 3, 7, 5, 1), MISCREG_IC_IVAU_Xt },
788 { MiscRegNum64(1, 3, 7, 10, 1), MISCREG_DC_CVAC_Xt },
789 { MiscRegNum64(1, 3, 7, 11, 1), MISCREG_DC_CVAU_Xt },
790 { MiscRegNum64(1, 3, 7, 14, 1), MISCREG_DC_CIVAC_Xt },
791 { MiscRegNum64(1, 4, 7, 8, 0), MISCREG_AT_S1E2R_Xt },
792 { MiscRegNum64(1, 4, 7, 8, 1), MISCREG_AT_S1E2W_Xt },
793 { MiscRegNum64(1, 4, 7, 8, 4), MISCREG_AT_S12E1R_Xt },
794 { MiscRegNum64(1, 4, 7, 8, 5), MISCREG_AT_S12E1W_Xt },
795 { MiscRegNum64(1, 4, 7, 8, 6), MISCREG_AT_S12E0R_Xt },
796 { MiscRegNum64(1, 4, 7, 8, 7), MISCREG_AT_S12E0W_Xt },
797 { MiscRegNum64(1, 4, 8, 0, 1), MISCREG_TLBI_IPAS2E1IS },
798 { MiscRegNum64(1, 4, 8, 0, 2), MISCREG_TLBI_RIPAS2E1IS },
799 { MiscRegNum64(1, 4, 8, 0, 5), MISCREG_TLBI_IPAS2LE1IS },
800 { MiscRegNum64(1, 4, 8, 1, 0), MISCREG_TLBI_ALLE2OS },
801 { MiscRegNum64(1, 4, 8, 1, 1), MISCREG_TLBI_VAE2OS },
802 { MiscRegNum64(1, 4, 8, 1, 4), MISCREG_TLBI_ALLE1OS },
803 { MiscRegNum64(1, 4, 8, 1, 5), MISCREG_TLBI_VALE2OS },
804 { MiscRegNum64(1, 4, 8, 1, 6), MISCREG_TLBI_VMALLS12E1OS },
805 { MiscRegNum64(1, 4, 8, 0, 6), MISCREG_TLBI_RIPAS2LE1IS },
806 { MiscRegNum64(1, 4, 8, 2, 1), MISCREG_TLBI_RVAE2IS },
807 { MiscRegNum64(1, 4, 8, 2, 5), MISCREG_TLBI_RVALE2IS },
808 { MiscRegNum64(1, 4, 8, 3, 0), MISCREG_TLBI_ALLE2IS },
809 { MiscRegNum64(1, 4, 8, 3, 1), MISCREG_TLBI_VAE2IS },
810 { MiscRegNum64(1, 4, 8, 3, 4), MISCREG_TLBI_ALLE1IS },
811 { MiscRegNum64(1, 4, 8, 3, 5), MISCREG_TLBI_VALE2IS },
812 { MiscRegNum64(1, 4, 8, 3, 6), MISCREG_TLBI_VMALLS12E1IS },
813 { MiscRegNum64(1, 4, 8, 4, 0), MISCREG_TLBI_IPAS2E1OS },
814 { MiscRegNum64(1, 4, 8, 4, 1), MISCREG_TLBI_IPAS2E1 },
815 { MiscRegNum64(1, 4, 8, 4, 2), MISCREG_TLBI_RIPAS2E1 },
816 { MiscRegNum64(1, 4, 8, 4, 3), MISCREG_TLBI_RIPAS2E1OS },
817 { MiscRegNum64(1, 4, 8, 4, 4), MISCREG_TLBI_IPAS2LE1OS },
818 { MiscRegNum64(1, 4, 8, 4, 5), MISCREG_TLBI_IPAS2LE1 },
819 { MiscRegNum64(1, 4, 8, 4, 6), MISCREG_TLBI_RIPAS2LE1 },
820 { MiscRegNum64(1, 4, 8, 4, 7), MISCREG_TLBI_RIPAS2LE1OS },
821 { MiscRegNum64(1, 4, 8, 5, 1), MISCREG_TLBI_RVAE2OS },
822 { MiscRegNum64(1, 4, 8, 5, 5), MISCREG_TLBI_RVALE2OS },
823 { MiscRegNum64(1, 4, 8, 6, 1), MISCREG_TLBI_RVAE2 },
824 { MiscRegNum64(1, 4, 8, 6, 5), MISCREG_TLBI_RVALE2 },
825 { MiscRegNum64(1, 4, 8, 7, 0), MISCREG_TLBI_ALLE2 },
826 { MiscRegNum64(1, 4, 8, 7, 1), MISCREG_TLBI_VAE2 },
827 { MiscRegNum64(1, 4, 8, 7, 4), MISCREG_TLBI_ALLE1 },
828 { MiscRegNum64(1, 4, 8, 7, 5), MISCREG_TLBI_VALE2 },
829 { MiscRegNum64(1, 4, 8, 7, 6), MISCREG_TLBI_VMALLS12E1 },
830 { MiscRegNum64(1, 6, 7, 8, 0), MISCREG_AT_S1E3R_Xt },
831 { MiscRegNum64(1, 6, 7, 8, 1), MISCREG_AT_S1E3W_Xt },
832 { MiscRegNum64(1, 6, 8, 1, 0), MISCREG_TLBI_ALLE3OS },
833 { MiscRegNum64(1, 6, 8, 1, 1), MISCREG_TLBI_VAE3OS },
834 { MiscRegNum64(1, 6, 8, 1, 5), MISCREG_TLBI_VALE3OS },
835 { MiscRegNum64(1, 6, 8, 2, 1), MISCREG_TLBI_RVAE3IS },
836 { MiscRegNum64(1, 6, 8, 2, 5), MISCREG_TLBI_RVALE3IS },
837 { MiscRegNum64(1, 6, 8, 3, 0), MISCREG_TLBI_ALLE3IS },
838 { MiscRegNum64(1, 6, 8, 3, 1), MISCREG_TLBI_VAE3IS },
839 { MiscRegNum64(1, 6, 8, 3, 5), MISCREG_TLBI_VALE3IS },
840 { MiscRegNum64(1, 6, 8, 5, 1), MISCREG_TLBI_RVAE3OS },
841 { MiscRegNum64(1, 6, 8, 5, 5), MISCREG_TLBI_RVALE3OS },
842 { MiscRegNum64(1, 6, 8, 6, 1), MISCREG_TLBI_RVAE3 },
843 { MiscRegNum64(1, 6, 8, 6, 5), MISCREG_TLBI_RVALE3 },
844 { MiscRegNum64(1, 6, 8, 7, 0), MISCREG_TLBI_ALLE3 },
845 { MiscRegNum64(1, 6, 8, 7, 1), MISCREG_TLBI_VAE3 },
846 { MiscRegNum64(1, 6, 8, 7, 5), MISCREG_TLBI_VALE3 },
847 { MiscRegNum64(2, 0, 0, 0, 2), MISCREG_OSDTRRX_EL1 },
848 { MiscRegNum64(2, 0, 0, 0, 4), MISCREG_DBGBVR0_EL1 },
849 { MiscRegNum64(2, 0, 0, 0, 5), MISCREG_DBGBCR0_EL1 },
850 { MiscRegNum64(2, 0, 0, 0, 6), MISCREG_DBGWVR0_EL1 },
851 { MiscRegNum64(2, 0, 0, 0, 7), MISCREG_DBGWCR0_EL1 },
852 { MiscRegNum64(2, 0, 0, 1, 4), MISCREG_DBGBVR1_EL1 },
853 { MiscRegNum64(2, 0, 0, 1, 5), MISCREG_DBGBCR1_EL1 },
854 { MiscRegNum64(2, 0, 0, 1, 6), MISCREG_DBGWVR1_EL1 },
855 { MiscRegNum64(2, 0, 0, 1, 7), MISCREG_DBGWCR1_EL1 },
856 { MiscRegNum64(2, 0, 0, 2, 0), MISCREG_MDCCINT_EL1 },
857 { MiscRegNum64(2, 0, 0, 2, 2), MISCREG_MDSCR_EL1 },
858 { MiscRegNum64(2, 0, 0, 2, 4), MISCREG_DBGBVR2_EL1 },
859 { MiscRegNum64(2, 0, 0, 2, 5), MISCREG_DBGBCR2_EL1 },
860 { MiscRegNum64(2, 0, 0, 2, 6), MISCREG_DBGWVR2_EL1 },
861 { MiscRegNum64(2, 0, 0, 2, 7), MISCREG_DBGWCR2_EL1 },
862 { MiscRegNum64(2, 0, 0, 3, 2), MISCREG_OSDTRTX_EL1 },
863 { MiscRegNum64(2, 0, 0, 3, 4), MISCREG_DBGBVR3_EL1 },
864 { MiscRegNum64(2, 0, 0, 3, 5), MISCREG_DBGBCR3_EL1 },
865 { MiscRegNum64(2, 0, 0, 3, 6), MISCREG_DBGWVR3_EL1 },
866 { MiscRegNum64(2, 0, 0, 3, 7), MISCREG_DBGWCR3_EL1 },
867 { MiscRegNum64(2, 0, 0, 4, 4), MISCREG_DBGBVR4_EL1 },
868 { MiscRegNum64(2, 0, 0, 4, 5), MISCREG_DBGBCR4_EL1 },
869 { MiscRegNum64(2, 0, 0, 4, 6), MISCREG_DBGWVR4_EL1 },
870 { MiscRegNum64(2, 0, 0, 4, 7), MISCREG_DBGWCR4_EL1 },
871 { MiscRegNum64(2, 0, 0, 5, 4), MISCREG_DBGBVR5_EL1 },
872 { MiscRegNum64(2, 0, 0, 5, 5), MISCREG_DBGBCR5_EL1 },
873 { MiscRegNum64(2, 0, 0, 5, 6), MISCREG_DBGWVR5_EL1 },
874 { MiscRegNum64(2, 0, 0, 5, 7), MISCREG_DBGWCR5_EL1 },
875 { MiscRegNum64(2, 0, 0, 6, 2), MISCREG_OSECCR_EL1 },
876 { MiscRegNum64(2, 0, 0, 6, 4), MISCREG_DBGBVR6_EL1 },
877 { MiscRegNum64(2, 0, 0, 6, 5), MISCREG_DBGBCR6_EL1 },
878 { MiscRegNum64(2, 0, 0, 6, 6), MISCREG_DBGWVR6_EL1 },
879 { MiscRegNum64(2, 0, 0, 6, 7), MISCREG_DBGWCR6_EL1 },
880 { MiscRegNum64(2, 0, 0, 7, 4), MISCREG_DBGBVR7_EL1 },
881 { MiscRegNum64(2, 0, 0, 7, 5), MISCREG_DBGBCR7_EL1 },
882 { MiscRegNum64(2, 0, 0, 7, 6), MISCREG_DBGWVR7_EL1 },
883 { MiscRegNum64(2, 0, 0, 7, 7), MISCREG_DBGWCR7_EL1 },
884 { MiscRegNum64(2, 0, 0, 8, 4), MISCREG_DBGBVR8_EL1 },
885 { MiscRegNum64(2, 0, 0, 8, 5), MISCREG_DBGBCR8_EL1 },
886 { MiscRegNum64(2, 0, 0, 8, 6), MISCREG_DBGWVR8_EL1 },
887 { MiscRegNum64(2, 0, 0, 8, 7), MISCREG_DBGWCR8_EL1 },
888 { MiscRegNum64(2, 0, 0, 9, 4), MISCREG_DBGBVR9_EL1 },
889 { MiscRegNum64(2, 0, 0, 9, 5), MISCREG_DBGBCR9_EL1 },
890 { MiscRegNum64(2, 0, 0, 9, 6), MISCREG_DBGWVR9_EL1 },
891 { MiscRegNum64(2, 0, 0, 9, 7), MISCREG_DBGWCR9_EL1 },
892 { MiscRegNum64(2, 0, 0, 10, 4), MISCREG_DBGBVR10_EL1 },
893 { MiscRegNum64(2, 0, 0, 10, 5), MISCREG_DBGBCR10_EL1 },
894 { MiscRegNum64(2, 0, 0, 10, 6), MISCREG_DBGWVR10_EL1 },
895 { MiscRegNum64(2, 0, 0, 10, 7), MISCREG_DBGWCR10_EL1 },
896 { MiscRegNum64(2, 0, 0, 11, 4), MISCREG_DBGBVR11_EL1 },
897 { MiscRegNum64(2, 0, 0, 11, 5), MISCREG_DBGBCR11_EL1 },
898 { MiscRegNum64(2, 0, 0, 11, 6), MISCREG_DBGWVR11_EL1 },
899 { MiscRegNum64(2, 0, 0, 11, 7), MISCREG_DBGWCR11_EL1 },
900 { MiscRegNum64(2, 0, 0, 12, 4), MISCREG_DBGBVR12_EL1 },
901 { MiscRegNum64(2, 0, 0, 12, 5), MISCREG_DBGBCR12_EL1 },
902 { MiscRegNum64(2, 0, 0, 12, 6), MISCREG_DBGWVR12_EL1 },
903 { MiscRegNum64(2, 0, 0, 12, 7), MISCREG_DBGWCR12_EL1 },
904 { MiscRegNum64(2, 0, 0, 13, 4), MISCREG_DBGBVR13_EL1 },
905 { MiscRegNum64(2, 0, 0, 13, 5), MISCREG_DBGBCR13_EL1 },
906 { MiscRegNum64(2, 0, 0, 13, 6), MISCREG_DBGWVR13_EL1 },
907 { MiscRegNum64(2, 0, 0, 13, 7), MISCREG_DBGWCR13_EL1 },
908 { MiscRegNum64(2, 0, 0, 14, 4), MISCREG_DBGBVR14_EL1 },
909 { MiscRegNum64(2, 0, 0, 14, 5), MISCREG_DBGBCR14_EL1 },
910 { MiscRegNum64(2, 0, 0, 14, 6), MISCREG_DBGWVR14_EL1 },
911 { MiscRegNum64(2, 0, 0, 14, 7), MISCREG_DBGWCR14_EL1 },
912 { MiscRegNum64(2, 0, 0, 15, 4), MISCREG_DBGBVR15_EL1 },
913 { MiscRegNum64(2, 0, 0, 15, 5), MISCREG_DBGBCR15_EL1 },
914 { MiscRegNum64(2, 0, 0, 15, 6), MISCREG_DBGWVR15_EL1 },
915 { MiscRegNum64(2, 0, 0, 15, 7), MISCREG_DBGWCR15_EL1 },
916 { MiscRegNum64(2, 0, 1, 0, 0), MISCREG_MDRAR_EL1 },
917 { MiscRegNum64(2, 0, 1, 0, 4), MISCREG_OSLAR_EL1 },
918 { MiscRegNum64(2, 0, 1, 1, 4), MISCREG_OSLSR_EL1 },
919 { MiscRegNum64(2, 0, 1, 3, 4), MISCREG_OSDLR_EL1 },
920 { MiscRegNum64(2, 0, 1, 4, 4), MISCREG_DBGPRCR_EL1 },
921 { MiscRegNum64(2, 0, 7, 8, 6), MISCREG_DBGCLAIMSET_EL1 },
922 { MiscRegNum64(2, 0, 7, 9, 6), MISCREG_DBGCLAIMCLR_EL1 },
923 { MiscRegNum64(2, 0, 7, 14, 6), MISCREG_DBGAUTHSTATUS_EL1 },
924 { MiscRegNum64(2, 2, 0, 0, 0), MISCREG_TEECR32_EL1 },
925 { MiscRegNum64(2, 2, 1, 0, 0), MISCREG_TEEHBR32_EL1 },
926 { MiscRegNum64(2, 3, 0, 1, 0), MISCREG_MDCCSR_EL0 },
927 { MiscRegNum64(2, 3, 0, 4, 0), MISCREG_MDDTR_EL0 },
928 { MiscRegNum64(2, 3, 0, 5, 0), MISCREG_MDDTRRX_EL0 },
929 { MiscRegNum64(2, 4, 0, 7, 0), MISCREG_DBGVCR32_EL2 },
930 { MiscRegNum64(3, 0, 0, 0, 0), MISCREG_MIDR_EL1 },
931 { MiscRegNum64(3, 0, 0, 0, 5), MISCREG_MPIDR_EL1 },
932 { MiscRegNum64(3, 0, 0, 0, 6), MISCREG_REVIDR_EL1 },
933 { MiscRegNum64(3, 0, 0, 1, 0), MISCREG_ID_PFR0_EL1 },
934 { MiscRegNum64(3, 0, 0, 1, 1), MISCREG_ID_PFR1_EL1 },
935 { MiscRegNum64(3, 0, 0, 1, 2), MISCREG_ID_DFR0_EL1 },
936 { MiscRegNum64(3, 0, 0, 1, 3), MISCREG_ID_AFR0_EL1 },
937 { MiscRegNum64(3, 0, 0, 1, 4), MISCREG_ID_MMFR0_EL1 },
938 { MiscRegNum64(3, 0, 0, 1, 5), MISCREG_ID_MMFR1_EL1 },
939 { MiscRegNum64(3, 0, 0, 1, 6), MISCREG_ID_MMFR2_EL1 },
940 { MiscRegNum64(3, 0, 0, 1, 7), MISCREG_ID_MMFR3_EL1 },
941 { MiscRegNum64(3, 0, 0, 2, 0), MISCREG_ID_ISAR0_EL1 },
942 { MiscRegNum64(3, 0, 0, 2, 1), MISCREG_ID_ISAR1_EL1 },
943 { MiscRegNum64(3, 0, 0, 2, 2), MISCREG_ID_ISAR2_EL1 },
944 { MiscRegNum64(3, 0, 0, 2, 3), MISCREG_ID_ISAR3_EL1 },
945 { MiscRegNum64(3, 0, 0, 2, 4), MISCREG_ID_ISAR4_EL1 },
946 { MiscRegNum64(3, 0, 0, 2, 5), MISCREG_ID_ISAR5_EL1 },
947 { MiscRegNum64(3, 0, 0, 2, 6), MISCREG_ID_MMFR4_EL1 },
948 { MiscRegNum64(3, 0, 0, 2, 7), MISCREG_ID_ISAR6_EL1 },
949 { MiscRegNum64(3, 0, 0, 3, 0), MISCREG_MVFR0_EL1 },
950 { MiscRegNum64(3, 0, 0, 3, 1), MISCREG_MVFR1_EL1 },
951 { MiscRegNum64(3, 0, 0, 3, 2), MISCREG_MVFR2_EL1 },
952 { MiscRegNum64(3, 0, 0, 3, 3), MISCREG_RAZ },
953 { MiscRegNum64(3, 0, 0, 3, 4), MISCREG_RAZ },
954 { MiscRegNum64(3, 0, 0, 3, 5), MISCREG_RAZ },
955 { MiscRegNum64(3, 0, 0, 3, 6), MISCREG_RAZ },
956 { MiscRegNum64(3, 0, 0, 3, 7), MISCREG_RAZ },
957 { MiscRegNum64(3, 0, 0, 4, 0), MISCREG_ID_AA64PFR0_EL1 },
958 { MiscRegNum64(3, 0, 0, 4, 1), MISCREG_ID_AA64PFR1_EL1 },
959 { MiscRegNum64(3, 0, 0, 4, 2), MISCREG_RAZ },
960 { MiscRegNum64(3, 0, 0, 4, 3), MISCREG_RAZ },
961 { MiscRegNum64(3, 0, 0, 4, 4), MISCREG_ID_AA64ZFR0_EL1 },
962 { MiscRegNum64(3, 0, 0, 4, 5), MISCREG_ID_AA64SMFR0_EL1 },
963 { MiscRegNum64(3, 0, 0, 4, 6), MISCREG_RAZ },
964 { MiscRegNum64(3, 0, 0, 4, 7), MISCREG_RAZ },
965 { MiscRegNum64(3, 0, 0, 5, 0), MISCREG_ID_AA64DFR0_EL1 },
966 { MiscRegNum64(3, 0, 0, 5, 1), MISCREG_ID_AA64DFR1_EL1 },
967 { MiscRegNum64(3, 0, 0, 5, 2), MISCREG_RAZ },
968 { MiscRegNum64(3, 0, 0, 5, 3), MISCREG_RAZ },
969 { MiscRegNum64(3, 0, 0, 5, 4), MISCREG_ID_AA64AFR0_EL1 },
970 { MiscRegNum64(3, 0, 0, 5, 5), MISCREG_ID_AA64AFR1_EL1 },
971 { MiscRegNum64(3, 0, 0, 5, 6), MISCREG_RAZ },
972 { MiscRegNum64(3, 0, 0, 5, 7), MISCREG_RAZ },
973 { MiscRegNum64(3, 0, 0, 6, 0), MISCREG_ID_AA64ISAR0_EL1 },
974 { MiscRegNum64(3, 0, 0, 6, 1), MISCREG_ID_AA64ISAR1_EL1 },
975 { MiscRegNum64(3, 0, 0, 6, 2), MISCREG_RAZ },
976 { MiscRegNum64(3, 0, 0, 6, 3), MISCREG_RAZ },
977 { MiscRegNum64(3, 0, 0, 6, 4), MISCREG_RAZ },
978 { MiscRegNum64(3, 0, 0, 6, 5), MISCREG_RAZ },
979 { MiscRegNum64(3, 0, 0, 6, 6), MISCREG_RAZ },
980 { MiscRegNum64(3, 0, 0, 6, 7), MISCREG_RAZ },
981 { MiscRegNum64(3, 0, 0, 7, 0), MISCREG_ID_AA64MMFR0_EL1 },
982 { MiscRegNum64(3, 0, 0, 7, 1), MISCREG_ID_AA64MMFR1_EL1 },
983 { MiscRegNum64(3, 0, 0, 7, 2), MISCREG_ID_AA64MMFR2_EL1 },
984 { MiscRegNum64(3, 0, 0, 7, 3), MISCREG_ID_AA64MMFR3_EL1 },
985 { MiscRegNum64(3, 0, 0, 7, 4), MISCREG_RAZ },
986 { MiscRegNum64(3, 0, 0, 7, 5), MISCREG_RAZ },
987 { MiscRegNum64(3, 0, 0, 7, 6), MISCREG_RAZ },
988 { MiscRegNum64(3, 0, 0, 7, 7), MISCREG_RAZ },
989 { MiscRegNum64(3, 0, 1, 0, 0), MISCREG_SCTLR_EL1 },
990 { MiscRegNum64(3, 0, 1, 0, 1), MISCREG_ACTLR_EL1 },
991 { MiscRegNum64(3, 0, 1, 0, 2), MISCREG_CPACR_EL1 },
992 { MiscRegNum64(3, 0, 1, 0, 3), MISCREG_SCTLR2_EL1 },
993 { MiscRegNum64(3, 0, 1, 2, 0), MISCREG_ZCR_EL1 },
994 { MiscRegNum64(3, 0, 1, 2, 4), MISCREG_SMPRI_EL1 },
995 { MiscRegNum64(3, 0, 1, 2, 6), MISCREG_SMCR_EL1 },
996 { MiscRegNum64(3, 0, 2, 0, 0), MISCREG_TTBR0_EL1 },
997 { MiscRegNum64(3, 0, 2, 0, 1), MISCREG_TTBR1_EL1 },
998 { MiscRegNum64(3, 0, 2, 0, 2), MISCREG_TCR_EL1 },
999 { MiscRegNum64(3, 0, 2, 0, 3), MISCREG_TCR2_EL1 },
1000 { MiscRegNum64(3, 0, 2, 1, 0), MISCREG_APIAKeyLo_EL1 },
1001 { MiscRegNum64(3, 0, 2, 1, 1), MISCREG_APIAKeyHi_EL1 },
1002 { MiscRegNum64(3, 0, 2, 1, 2), MISCREG_APIBKeyLo_EL1 },
1003 { MiscRegNum64(3, 0, 2, 1, 3), MISCREG_APIBKeyHi_EL1 },
1004 { MiscRegNum64(3, 0, 2, 2, 0), MISCREG_APDAKeyLo_EL1 },
1005 { MiscRegNum64(3, 0, 2, 2, 1), MISCREG_APDAKeyHi_EL1 },
1006 { MiscRegNum64(3, 0, 2, 2, 2), MISCREG_APDBKeyLo_EL1 },
1007 { MiscRegNum64(3, 0, 2, 2, 3), MISCREG_APDBKeyHi_EL1 },
1008 { MiscRegNum64(3, 0, 2, 3, 0), MISCREG_APGAKeyLo_EL1 },
1009 { MiscRegNum64(3, 0, 2, 3, 1), MISCREG_APGAKeyHi_EL1 },
1010 { MiscRegNum64(3, 0, 4, 0, 0), MISCREG_SPSR_EL1 },
1011 { MiscRegNum64(3, 0, 4, 0, 1), MISCREG_ELR_EL1 },
1012 { MiscRegNum64(3, 0, 4, 1, 0), MISCREG_SP_EL0 },
1013 { MiscRegNum64(3, 0, 4, 2, 0), MISCREG_SPSEL },
1014 { MiscRegNum64(3, 0, 4, 2, 2), MISCREG_CURRENTEL },
1015 { MiscRegNum64(3, 0, 4, 2, 3), MISCREG_PAN },
1016 { MiscRegNum64(3, 0, 4, 2, 4), MISCREG_UAO },
1017 { MiscRegNum64(3, 0, 4, 6, 0), MISCREG_ICC_PMR_EL1 },
1018 { MiscRegNum64(3, 0, 5, 1, 0), MISCREG_AFSR0_EL1 },
1019 { MiscRegNum64(3, 0, 5, 1, 1), MISCREG_AFSR1_EL1 },
1020 { MiscRegNum64(3, 0, 5, 2, 0), MISCREG_ESR_EL1 },
1021 { MiscRegNum64(3, 0, 5, 3, 0), MISCREG_ERRIDR_EL1 },
1022 { MiscRegNum64(3, 0, 5, 3, 1), MISCREG_ERRSELR_EL1 },
1023 { MiscRegNum64(3, 0, 5, 4, 0), MISCREG_ERXFR_EL1 },
1024 { MiscRegNum64(3, 0, 5, 4, 1), MISCREG_ERXCTLR_EL1 },
1025 { MiscRegNum64(3, 0, 5, 4, 2), MISCREG_ERXSTATUS_EL1 },
1026 { MiscRegNum64(3, 0, 5, 4, 3), MISCREG_ERXADDR_EL1 },
1027 { MiscRegNum64(3, 0, 5, 5, 0), MISCREG_ERXMISC0_EL1 },
1028 { MiscRegNum64(3, 0, 5, 5, 1), MISCREG_ERXMISC1_EL1 },
1029 { MiscRegNum64(3, 0, 6, 0, 0), MISCREG_FAR_EL1 },
1030 { MiscRegNum64(3, 0, 7, 4, 0), MISCREG_PAR_EL1 },
1031 { MiscRegNum64(3, 0, 9, 14, 1), MISCREG_PMINTENSET_EL1 },
1032 { MiscRegNum64(3, 0, 9, 14, 2), MISCREG_PMINTENCLR_EL1 },
1033 { MiscRegNum64(3, 0, 10, 2, 0), MISCREG_MAIR_EL1 },
1034 { MiscRegNum64(3, 0, 10, 3, 0), MISCREG_AMAIR_EL1 },
1035 { MiscRegNum64(3, 0, 10, 4, 4), MISCREG_MPAMIDR_EL1 },
1036 { MiscRegNum64(3, 0, 10, 5, 0), MISCREG_MPAM1_EL1 },
1037 { MiscRegNum64(3, 0, 10, 5, 1), MISCREG_MPAM0_EL1 },
1038 { MiscRegNum64(3, 0, 10, 5, 3), MISCREG_MPAMSM_EL1 },
1039 { MiscRegNum64(3, 0, 12, 0, 0), MISCREG_VBAR_EL1 },
1040 { MiscRegNum64(3, 0, 12, 0, 1), MISCREG_RVBAR_EL1 },
1041 { MiscRegNum64(3, 0, 12, 1, 0), MISCREG_ISR_EL1 },
1042 { MiscRegNum64(3, 0, 12, 1, 1), MISCREG_DISR_EL1 },
1043 { MiscRegNum64(3, 0, 12, 8, 0), MISCREG_ICC_IAR0_EL1 },
1044 { MiscRegNum64(3, 0, 12, 8, 1), MISCREG_ICC_EOIR0_EL1 },
1045 { MiscRegNum64(3, 0, 12, 8, 2), MISCREG_ICC_HPPIR0_EL1 },
1046 { MiscRegNum64(3, 0, 12, 8, 3), MISCREG_ICC_BPR0_EL1 },
1047 { MiscRegNum64(3, 0, 12, 8, 4), MISCREG_ICC_AP0R0_EL1 },
1048 { MiscRegNum64(3, 0, 12, 8, 5), MISCREG_ICC_AP0R1_EL1 },
1049 { MiscRegNum64(3, 0, 12, 8, 6), MISCREG_ICC_AP0R2_EL1 },
1050 { MiscRegNum64(3, 0, 12, 8, 7), MISCREG_ICC_AP0R3_EL1 },
1051 { MiscRegNum64(3, 0, 12, 9, 0), MISCREG_ICC_AP1R0_EL1 },
1052 { MiscRegNum64(3, 0, 12, 9, 1), MISCREG_ICC_AP1R1_EL1 },
1053 { MiscRegNum64(3, 0, 12, 9, 2), MISCREG_ICC_AP1R2_EL1 },
1054 { MiscRegNum64(3, 0, 12, 9, 3), MISCREG_ICC_AP1R3_EL1 },
1055 { MiscRegNum64(3, 0, 12, 11, 1), MISCREG_ICC_DIR_EL1 },
1056 { MiscRegNum64(3, 0, 12, 11, 3), MISCREG_ICC_RPR_EL1 },
1057 { MiscRegNum64(3, 0, 12, 11, 5), MISCREG_ICC_SGI1R_EL1 },
1058 { MiscRegNum64(3, 0, 12, 11, 6), MISCREG_ICC_ASGI1R_EL1 },
1059 { MiscRegNum64(3, 0, 12, 11, 7), MISCREG_ICC_SGI0R_EL1 },
1060 { MiscRegNum64(3, 0, 12, 12, 0), MISCREG_ICC_IAR1_EL1 },
1061 { MiscRegNum64(3, 0, 12, 12, 1), MISCREG_ICC_EOIR1_EL1 },
1062 { MiscRegNum64(3, 0, 12, 12, 2), MISCREG_ICC_HPPIR1_EL1 },
1063 { MiscRegNum64(3, 0, 12, 12, 3), MISCREG_ICC_BPR1_EL1 },
1064 { MiscRegNum64(3, 0, 12, 12, 4), MISCREG_ICC_CTLR_EL1 },
1065 { MiscRegNum64(3, 0, 12, 12, 5), MISCREG_ICC_SRE_EL1 },
1066 { MiscRegNum64(3, 0, 12, 12, 6), MISCREG_ICC_IGRPEN0_EL1 },
1067 { MiscRegNum64(3, 0, 12, 12, 7), MISCREG_ICC_IGRPEN1_EL1 },
1068 { MiscRegNum64(3, 0, 13, 0, 1), MISCREG_CONTEXTIDR_EL1 },
1069 { MiscRegNum64(3, 0, 13, 0, 4), MISCREG_TPIDR_EL1 },
1070 { MiscRegNum64(3, 0, 14, 1, 0), MISCREG_CNTKCTL_EL1 },
1071 { MiscRegNum64(3, 0, 15, 0, 0), MISCREG_IL1DATA0_EL1 },
1072 { MiscRegNum64(3, 0, 15, 0, 1), MISCREG_IL1DATA1_EL1 },
1073 { MiscRegNum64(3, 0, 15, 0, 2), MISCREG_IL1DATA2_EL1 },
1074 { MiscRegNum64(3, 0, 15, 0, 3), MISCREG_IL1DATA3_EL1 },
1075 { MiscRegNum64(3, 0, 15, 1, 0), MISCREG_DL1DATA0_EL1 },
1076 { MiscRegNum64(3, 0, 15, 1, 1), MISCREG_DL1DATA1_EL1 },
1077 { MiscRegNum64(3, 0, 15, 1, 2), MISCREG_DL1DATA2_EL1 },
1078 { MiscRegNum64(3, 0, 15, 1, 3), MISCREG_DL1DATA3_EL1 },
1079 { MiscRegNum64(3, 0, 15, 1, 4), MISCREG_DL1DATA4_EL1 },
1080 { MiscRegNum64(3, 1, 0, 0, 0), MISCREG_CCSIDR_EL1 },
1081 { MiscRegNum64(3, 1, 0, 0, 1), MISCREG_CLIDR_EL1 },
1082 { MiscRegNum64(3, 1, 0, 0, 6), MISCREG_SMIDR_EL1 },
1083 { MiscRegNum64(3, 1, 0, 0, 7), MISCREG_AIDR_EL1 },
1084 { MiscRegNum64(3, 1, 11, 0, 2), MISCREG_L2CTLR_EL1 },
1085 { MiscRegNum64(3, 1, 11, 0, 3), MISCREG_L2ECTLR_EL1 },
1086 { MiscRegNum64(3, 1, 15, 0, 0), MISCREG_L2ACTLR_EL1 },
1087 { MiscRegNum64(3, 1, 15, 2, 0), MISCREG_CPUACTLR_EL1 },
1088 { MiscRegNum64(3, 1, 15, 2, 1), MISCREG_CPUECTLR_EL1 },
1089 { MiscRegNum64(3, 1, 15, 2, 2), MISCREG_CPUMERRSR_EL1 },
1090 { MiscRegNum64(3, 1, 15, 2, 3), MISCREG_L2MERRSR_EL1 },
1091 { MiscRegNum64(3, 1, 15, 3, 0), MISCREG_CBAR_EL1 },
1092 { MiscRegNum64(3, 2, 0, 0, 0), MISCREG_CSSELR_EL1 },
1093 { MiscRegNum64(3, 3, 0, 0, 1), MISCREG_CTR_EL0 },
1094 { MiscRegNum64(3, 3, 0, 0, 7), MISCREG_DCZID_EL0 },
1095 { MiscRegNum64(3, 3, 2, 4, 0), MISCREG_RNDR },
1096 { MiscRegNum64(3, 3, 2, 4, 1), MISCREG_RNDRRS },
1097 { MiscRegNum64(3, 3, 4, 2, 0), MISCREG_NZCV },
1098 { MiscRegNum64(3, 3, 4, 2, 1), MISCREG_DAIF },
1099 { MiscRegNum64(3, 3, 4, 2, 2), MISCREG_SVCR },
1100 { MiscRegNum64(3, 3, 4, 4, 0), MISCREG_FPCR },
1101 { MiscRegNum64(3, 3, 4, 4, 1), MISCREG_FPSR },
1102 { MiscRegNum64(3, 3, 4, 5, 0), MISCREG_DSPSR_EL0 },
1103 { MiscRegNum64(3, 3, 4, 5, 1), MISCREG_DLR_EL0 },
1104 { MiscRegNum64(3, 3, 9, 12, 0), MISCREG_PMCR_EL0 },
1105 { MiscRegNum64(3, 3, 9, 12, 1), MISCREG_PMCNTENSET_EL0 },
1106 { MiscRegNum64(3, 3, 9, 12, 2), MISCREG_PMCNTENCLR_EL0 },
1107 { MiscRegNum64(3, 3, 9, 12, 3), MISCREG_PMOVSCLR_EL0 },
1108 { MiscRegNum64(3, 3, 9, 12, 4), MISCREG_PMSWINC_EL0 },
1109 { MiscRegNum64(3, 3, 9, 12, 5), MISCREG_PMSELR_EL0 },
1110 { MiscRegNum64(3, 3, 9, 12, 6), MISCREG_PMCEID0_EL0 },
1111 { MiscRegNum64(3, 3, 9, 12, 7), MISCREG_PMCEID1_EL0 },
1112 { MiscRegNum64(3, 3, 9, 13, 0), MISCREG_PMCCNTR_EL0 },
1113 { MiscRegNum64(3, 3, 9, 13, 1), MISCREG_PMXEVTYPER_EL0 },
1114 { MiscRegNum64(3, 3, 9, 13, 2), MISCREG_PMXEVCNTR_EL0 },
1115 { MiscRegNum64(3, 3, 9, 14, 0), MISCREG_PMUSERENR_EL0 },
1116 { MiscRegNum64(3, 3, 9, 14, 3), MISCREG_PMOVSSET_EL0 },
1117 { MiscRegNum64(3, 3, 13, 0, 2), MISCREG_TPIDR_EL0 },
1118 { MiscRegNum64(3, 3, 13, 0, 3), MISCREG_TPIDRRO_EL0 },
1119 { MiscRegNum64(3, 3, 13, 0, 5), MISCREG_TPIDR2_EL0 },
1120 { MiscRegNum64(3, 3, 14, 0, 0), MISCREG_CNTFRQ_EL0 },
1121 { MiscRegNum64(3, 3, 14, 0, 1), MISCREG_CNTPCT_EL0 },
1122 { MiscRegNum64(3, 3, 14, 0, 2), MISCREG_CNTVCT_EL0 },
1123 { MiscRegNum64(3, 3, 14, 2, 0), MISCREG_CNTP_TVAL_EL0 },
1124 { MiscRegNum64(3, 3, 14, 2, 1), MISCREG_CNTP_CTL_EL0 },
1125 { MiscRegNum64(3, 3, 14, 2, 2), MISCREG_CNTP_CVAL_EL0 },
1126 { MiscRegNum64(3, 3, 14, 3, 0), MISCREG_CNTV_TVAL_EL0 },
1127 { MiscRegNum64(3, 3, 14, 3, 1), MISCREG_CNTV_CTL_EL0 },
1128 { MiscRegNum64(3, 3, 14, 3, 2), MISCREG_CNTV_CVAL_EL0 },
1129 { MiscRegNum64(3, 3, 14, 8, 0), MISCREG_PMEVCNTR0_EL0 },
1130 { MiscRegNum64(3, 3, 14, 8, 1), MISCREG_PMEVCNTR1_EL0 },
1131 { MiscRegNum64(3, 3, 14, 8, 2), MISCREG_PMEVCNTR2_EL0 },
1132 { MiscRegNum64(3, 3, 14, 8, 3), MISCREG_PMEVCNTR3_EL0 },
1133 { MiscRegNum64(3, 3, 14, 8, 4), MISCREG_PMEVCNTR4_EL0 },
1134 { MiscRegNum64(3, 3, 14, 8, 5), MISCREG_PMEVCNTR5_EL0 },
1135 { MiscRegNum64(3, 3, 14, 12, 0), MISCREG_PMEVTYPER0_EL0 },
1136 { MiscRegNum64(3, 3, 14, 12, 1), MISCREG_PMEVTYPER1_EL0 },
1137 { MiscRegNum64(3, 3, 14, 12, 2), MISCREG_PMEVTYPER2_EL0 },
1138 { MiscRegNum64(3, 3, 14, 12, 3), MISCREG_PMEVTYPER3_EL0 },
1139 { MiscRegNum64(3, 3, 14, 12, 4), MISCREG_PMEVTYPER4_EL0 },
1140 { MiscRegNum64(3, 3, 14, 12, 5), MISCREG_PMEVTYPER5_EL0 },
1141 { MiscRegNum64(3, 3, 14, 15, 7), MISCREG_PMCCFILTR_EL0 },
1142 { MiscRegNum64(3, 4, 0, 0, 0), MISCREG_VPIDR_EL2 },
1143 { MiscRegNum64(3, 4, 0, 0, 5), MISCREG_VMPIDR_EL2 },
1144 { MiscRegNum64(3, 4, 1, 0, 0), MISCREG_SCTLR_EL2 },
1145 { MiscRegNum64(3, 4, 1, 0, 1), MISCREG_ACTLR_EL2 },
1146 { MiscRegNum64(3, 4, 1, 0, 3), MISCREG_SCTLR2_EL2 },
1147 { MiscRegNum64(3, 4, 1, 1, 0), MISCREG_HCR_EL2 },
1148 { MiscRegNum64(3, 4, 1, 1, 1), MISCREG_MDCR_EL2 },
1149 { MiscRegNum64(3, 4, 1, 1, 2), MISCREG_CPTR_EL2 },
1150 { MiscRegNum64(3, 4, 1, 1, 3), MISCREG_HSTR_EL2 },
1151 { MiscRegNum64(3, 4, 1, 1, 4), MISCREG_HFGRTR_EL2 },
1152 { MiscRegNum64(3, 4, 1, 1, 5), MISCREG_HFGWTR_EL2 },
1153 { MiscRegNum64(3, 4, 1, 1, 6), MISCREG_HFGITR_EL2 },
1154 { MiscRegNum64(3, 4, 1, 1, 7), MISCREG_HACR_EL2 },
1155 { MiscRegNum64(3, 4, 1, 2, 0), MISCREG_ZCR_EL2 },
1156 { MiscRegNum64(3, 4, 1, 2, 2), MISCREG_HCRX_EL2 },
1157 { MiscRegNum64(3, 4, 1, 2, 5), MISCREG_SMPRIMAP_EL2 },
1158 { MiscRegNum64(3, 4, 1, 2, 6), MISCREG_SMCR_EL2 },
1159 { MiscRegNum64(3, 4, 2, 0, 0), MISCREG_TTBR0_EL2 },
1160 { MiscRegNum64(3, 4, 2, 0, 1), MISCREG_TTBR1_EL2 },
1161 { MiscRegNum64(3, 4, 2, 0, 2), MISCREG_TCR_EL2 },
1162 { MiscRegNum64(3, 4, 2, 0, 3), MISCREG_TCR2_EL2 },
1163 { MiscRegNum64(3, 4, 2, 1, 0), MISCREG_VTTBR_EL2 },
1164 { MiscRegNum64(3, 4, 2, 1, 2), MISCREG_VTCR_EL2 },
1165 { MiscRegNum64(3, 4, 2, 6, 0), MISCREG_VSTTBR_EL2 },
1166 { MiscRegNum64(3, 4, 2, 6, 2), MISCREG_VSTCR_EL2 },
1167 { MiscRegNum64(3, 4, 3, 0, 0), MISCREG_DACR32_EL2 },
1168 { MiscRegNum64(3, 4, 3, 1, 4), MISCREG_HDFGRTR_EL2 },
1169 { MiscRegNum64(3, 4, 3, 1, 5), MISCREG_HDFGWTR_EL2 },
1170 { MiscRegNum64(3, 4, 4, 0, 0), MISCREG_SPSR_EL2 },
1171 { MiscRegNum64(3, 4, 4, 0, 1), MISCREG_ELR_EL2 },
1172 { MiscRegNum64(3, 4, 4, 1, 0), MISCREG_SP_EL1 },
1173 { MiscRegNum64(3, 4, 4, 3, 0), MISCREG_SPSR_IRQ_AA64 },
1174 { MiscRegNum64(3, 4, 4, 3, 1), MISCREG_SPSR_ABT_AA64 },
1175 { MiscRegNum64(3, 4, 4, 3, 2), MISCREG_SPSR_UND_AA64 },
1176 { MiscRegNum64(3, 4, 4, 3, 3), MISCREG_SPSR_FIQ_AA64 },
1177 { MiscRegNum64(3, 4, 5, 0, 1), MISCREG_IFSR32_EL2 },
1178 { MiscRegNum64(3, 4, 5, 1, 0), MISCREG_AFSR0_EL2 },
1179 { MiscRegNum64(3, 4, 5, 1, 1), MISCREG_AFSR1_EL2 },
1180 { MiscRegNum64(3, 4, 5, 2, 0), MISCREG_ESR_EL2 },
1181 { MiscRegNum64(3, 4, 5, 2, 3), MISCREG_VSESR_EL2 },
1182 { MiscRegNum64(3, 4, 5, 3, 0), MISCREG_FPEXC32_EL2 },
1183 { MiscRegNum64(3, 4, 6, 0, 0), MISCREG_FAR_EL2 },
1184 { MiscRegNum64(3, 4, 6, 0, 4), MISCREG_HPFAR_EL2 },
1185 { MiscRegNum64(3, 4, 10, 2, 0), MISCREG_MAIR_EL2 },
1186 { MiscRegNum64(3, 4, 10, 3, 0), MISCREG_AMAIR_EL2 },
1187 { MiscRegNum64(3, 4, 10, 4, 0), MISCREG_MPAMHCR_EL2 },
1188 { MiscRegNum64(3, 4, 10, 4, 1), MISCREG_MPAMVPMV_EL2 },
1189 { MiscRegNum64(3, 4, 10, 5, 0), MISCREG_MPAM2_EL2 },
1190 { MiscRegNum64(3, 4, 10, 6, 0), MISCREG_MPAMVPM0_EL2 },
1191 { MiscRegNum64(3, 4, 10, 6, 1), MISCREG_MPAMVPM1_EL2 },
1192 { MiscRegNum64(3, 4, 10, 6, 2), MISCREG_MPAMVPM2_EL2 },
1193 { MiscRegNum64(3, 4, 10, 6, 3), MISCREG_MPAMVPM3_EL2 },
1194 { MiscRegNum64(3, 4, 10, 6, 4), MISCREG_MPAMVPM4_EL2 },
1195 { MiscRegNum64(3, 4, 10, 6, 5), MISCREG_MPAMVPM5_EL2 },
1196 { MiscRegNum64(3, 4, 10, 6, 6), MISCREG_MPAMVPM6_EL2 },
1197 { MiscRegNum64(3, 4, 10, 6, 7), MISCREG_MPAMVPM7_EL2 },
1198 { MiscRegNum64(3, 4, 12, 0, 0), MISCREG_VBAR_EL2 },
1199 { MiscRegNum64(3, 4, 12, 0, 1), MISCREG_RVBAR_EL2 },
1200 { MiscRegNum64(3, 4, 12, 1, 1), MISCREG_VDISR_EL2 },
1201 { MiscRegNum64(3, 4, 12, 8, 0), MISCREG_ICH_AP0R0_EL2 },
1202 { MiscRegNum64(3, 4, 12, 8, 1), MISCREG_ICH_AP0R1_EL2 },
1203 { MiscRegNum64(3, 4, 12, 8, 2), MISCREG_ICH_AP0R2_EL2 },
1204 { MiscRegNum64(3, 4, 12, 8, 3), MISCREG_ICH_AP0R3_EL2 },
1205 { MiscRegNum64(3, 4, 12, 9, 0), MISCREG_ICH_AP1R0_EL2 },
1206 { MiscRegNum64(3, 4, 12, 9, 1), MISCREG_ICH_AP1R1_EL2 },
1207 { MiscRegNum64(3, 4, 12, 9, 2), MISCREG_ICH_AP1R2_EL2 },
1208 { MiscRegNum64(3, 4, 12, 9, 3), MISCREG_ICH_AP1R3_EL2 },
1209 { MiscRegNum64(3, 4, 12, 9, 5), MISCREG_ICC_SRE_EL2 },
1210 { MiscRegNum64(3, 4, 12, 11, 0), MISCREG_ICH_HCR_EL2 },
1211 { MiscRegNum64(3, 4, 12, 11, 1), MISCREG_ICH_VTR_EL2 },
1212 { MiscRegNum64(3, 4, 12, 11, 2), MISCREG_ICH_MISR_EL2 },
1213 { MiscRegNum64(3, 4, 12, 11, 3), MISCREG_ICH_EISR_EL2 },
1214 { MiscRegNum64(3, 4, 12, 11, 5), MISCREG_ICH_ELRSR_EL2 },
1215 { MiscRegNum64(3, 4, 12, 11, 7), MISCREG_ICH_VMCR_EL2 },
1216 { MiscRegNum64(3, 4, 12, 12, 0), MISCREG_ICH_LR0_EL2 },
1217 { MiscRegNum64(3, 4, 12, 12, 1), MISCREG_ICH_LR1_EL2 },
1218 { MiscRegNum64(3, 4, 12, 12, 2), MISCREG_ICH_LR2_EL2 },
1219 { MiscRegNum64(3, 4, 12, 12, 3), MISCREG_ICH_LR3_EL2 },
1220 { MiscRegNum64(3, 4, 12, 12, 4), MISCREG_ICH_LR4_EL2 },
1221 { MiscRegNum64(3, 4, 12, 12, 5), MISCREG_ICH_LR5_EL2 },
1222 { MiscRegNum64(3, 4, 12, 12, 6), MISCREG_ICH_LR6_EL2 },
1223 { MiscRegNum64(3, 4, 12, 12, 7), MISCREG_ICH_LR7_EL2 },
1224 { MiscRegNum64(3, 4, 12, 13, 0), MISCREG_ICH_LR8_EL2 },
1225 { MiscRegNum64(3, 4, 12, 13, 1), MISCREG_ICH_LR9_EL2 },
1226 { MiscRegNum64(3, 4, 12, 13, 2), MISCREG_ICH_LR10_EL2 },
1227 { MiscRegNum64(3, 4, 12, 13, 3), MISCREG_ICH_LR11_EL2 },
1228 { MiscRegNum64(3, 4, 12, 13, 4), MISCREG_ICH_LR12_EL2 },
1229 { MiscRegNum64(3, 4, 12, 13, 5), MISCREG_ICH_LR13_EL2 },
1230 { MiscRegNum64(3, 4, 12, 13, 6), MISCREG_ICH_LR14_EL2 },
1231 { MiscRegNum64(3, 4, 12, 13, 7), MISCREG_ICH_LR15_EL2 },
1232 { MiscRegNum64(3, 4, 13, 0, 1), MISCREG_CONTEXTIDR_EL2 },
1233 { MiscRegNum64(3, 4, 13, 0, 2), MISCREG_TPIDR_EL2 },
1234 { MiscRegNum64(3, 4, 14, 0, 3), MISCREG_CNTVOFF_EL2 },
1235 { MiscRegNum64(3, 4, 14, 1, 0), MISCREG_CNTHCTL_EL2 },
1236 { MiscRegNum64(3, 4, 14, 2, 0), MISCREG_CNTHP_TVAL_EL2 },
1237 { MiscRegNum64(3, 4, 14, 2, 1), MISCREG_CNTHP_CTL_EL2 },
1238 { MiscRegNum64(3, 4, 14, 2, 2), MISCREG_CNTHP_CVAL_EL2 },
1239 { MiscRegNum64(3, 4, 14, 3, 0), MISCREG_CNTHV_TVAL_EL2 },
1240 { MiscRegNum64(3, 4, 14, 3, 1), MISCREG_CNTHV_CTL_EL2 },
1241 { MiscRegNum64(3, 4, 14, 3, 2), MISCREG_CNTHV_CVAL_EL2 },
1242 { MiscRegNum64(3, 4, 14, 4, 0), MISCREG_CNTHVS_TVAL_EL2 },
1243 { MiscRegNum64(3, 4, 14, 4, 1), MISCREG_CNTHVS_CTL_EL2 },
1244 { MiscRegNum64(3, 4, 14, 4, 2), MISCREG_CNTHVS_CVAL_EL2 },
1245 { MiscRegNum64(3, 4, 14, 5, 0), MISCREG_CNTHPS_TVAL_EL2 },
1246 { MiscRegNum64(3, 4, 14, 5, 1), MISCREG_CNTHPS_CTL_EL2 },
1247 { MiscRegNum64(3, 4, 14, 5, 2), MISCREG_CNTHPS_CVAL_EL2 },
1248 { MiscRegNum64(3, 5, 1, 0, 0), MISCREG_SCTLR_EL12 },
1249 { MiscRegNum64(3, 5, 1, 0, 2), MISCREG_CPACR_EL12 },
1250 { MiscRegNum64(3, 5, 1, 0, 3), MISCREG_SCTLR2_EL12 },
1251 { MiscRegNum64(3, 5, 1, 2, 0), MISCREG_ZCR_EL12 },
1252 { MiscRegNum64(3, 5, 1, 2, 6), MISCREG_SMCR_EL12 },
1253 { MiscRegNum64(3, 5, 2, 0, 0), MISCREG_TTBR0_EL12 },
1254 { MiscRegNum64(3, 5, 2, 0, 1), MISCREG_TTBR1_EL12 },
1255 { MiscRegNum64(3, 5, 2, 0, 2), MISCREG_TCR_EL12 },
1256 { MiscRegNum64(3, 5, 2, 0, 3), MISCREG_TCR2_EL12 },
1257 { MiscRegNum64(3, 5, 4, 0, 0), MISCREG_SPSR_EL12 },
1258 { MiscRegNum64(3, 5, 4, 0, 1), MISCREG_ELR_EL12 },
1259 { MiscRegNum64(3, 5, 5, 1, 0), MISCREG_AFSR0_EL12 },
1260 { MiscRegNum64(3, 5, 5, 1, 1), MISCREG_AFSR1_EL12 },
1261 { MiscRegNum64(3, 5, 5, 2, 0), MISCREG_ESR_EL12 },
1262 { MiscRegNum64(3, 5, 6, 0, 0), MISCREG_FAR_EL12 },
1263 { MiscRegNum64(3, 5, 10, 2, 0), MISCREG_MAIR_EL12 },
1264 { MiscRegNum64(3, 5, 10, 3, 0), MISCREG_AMAIR_EL12 },
1265 { MiscRegNum64(3, 5, 10, 5, 0), MISCREG_MPAM1_EL12 },
1266 { MiscRegNum64(3, 5, 12, 0, 0), MISCREG_VBAR_EL12 },
1267 { MiscRegNum64(3, 5, 13, 0, 1), MISCREG_CONTEXTIDR_EL12 },
1268 { MiscRegNum64(3, 5, 14, 1, 0), MISCREG_CNTKCTL_EL12 },
1269 { MiscRegNum64(3, 5, 14, 2, 0), MISCREG_CNTP_TVAL_EL02 },
1270 { MiscRegNum64(3, 5, 14, 2, 1), MISCREG_CNTP_CTL_EL02 },
1271 { MiscRegNum64(3, 5, 14, 2, 2), MISCREG_CNTP_CVAL_EL02 },
1272 { MiscRegNum64(3, 5, 14, 3, 0), MISCREG_CNTV_TVAL_EL02 },
1273 { MiscRegNum64(3, 5, 14, 3, 1), MISCREG_CNTV_CTL_EL02 },
1274 { MiscRegNum64(3, 5, 14, 3, 2), MISCREG_CNTV_CVAL_EL02 },
1275 { MiscRegNum64(3, 6, 1, 0, 0), MISCREG_SCTLR_EL3 },
1276 { MiscRegNum64(3, 6, 1, 0, 1), MISCREG_ACTLR_EL3 },
1277 { MiscRegNum64(3, 6, 1, 0, 3), MISCREG_SCTLR2_EL3 },
1278 { MiscRegNum64(3, 6, 1, 1, 0), MISCREG_SCR_EL3 },
1279 { MiscRegNum64(3, 6, 1, 1, 1), MISCREG_SDER32_EL3 },
1280 { MiscRegNum64(3, 6, 1, 1, 2), MISCREG_CPTR_EL3 },
1281 { MiscRegNum64(3, 6, 1, 2, 0), MISCREG_ZCR_EL3 },
1282 { MiscRegNum64(3, 6, 1, 2, 6), MISCREG_SMCR_EL3 },
1283 { MiscRegNum64(3, 6, 1, 3, 1), MISCREG_MDCR_EL3 },
1284 { MiscRegNum64(3, 6, 2, 0, 0), MISCREG_TTBR0_EL3 },
1285 { MiscRegNum64(3, 6, 2, 0, 2), MISCREG_TCR_EL3 },
1286 { MiscRegNum64(3, 6, 4, 0, 0), MISCREG_SPSR_EL3 },
1287 { MiscRegNum64(3, 6, 4, 0, 1), MISCREG_ELR_EL3 },
1288 { MiscRegNum64(3, 6, 4, 1, 0), MISCREG_SP_EL2 },
1289 { MiscRegNum64(3, 6, 5, 1, 0), MISCREG_AFSR0_EL3 },
1290 { MiscRegNum64(3, 6, 5, 1, 1), MISCREG_AFSR1_EL3 },
1291 { MiscRegNum64(3, 6, 5, 2, 0), MISCREG_ESR_EL3 },
1292 { MiscRegNum64(3, 6, 6, 0, 0), MISCREG_FAR_EL3 },
1293 { MiscRegNum64(3, 6, 10, 2, 0), MISCREG_MAIR_EL3 },
1294 { MiscRegNum64(3, 6, 10, 3, 0), MISCREG_AMAIR_EL3 },
1295 { MiscRegNum64(3, 6, 10, 5, 0), MISCREG_MPAM3_EL3 },
1296 { MiscRegNum64(3, 6, 12, 0, 0), MISCREG_VBAR_EL3 },
1297 { MiscRegNum64(3, 6, 12, 0, 1), MISCREG_RVBAR_EL3 },
1298 { MiscRegNum64(3, 6, 12, 0, 2), MISCREG_RMR_EL3 },
1299 { MiscRegNum64(3, 6, 12, 12, 4), MISCREG_ICC_CTLR_EL3 },
1300 { MiscRegNum64(3, 6, 12, 12, 5), MISCREG_ICC_SRE_EL3 },
1301 { MiscRegNum64(3, 6, 12, 12, 7), MISCREG_ICC_IGRPEN1_EL3 },
1302 { MiscRegNum64(3, 6, 13, 0, 2), MISCREG_TPIDR_EL3 },
1303 { MiscRegNum64(3, 7, 14, 2, 0), MISCREG_CNTPS_TVAL_EL1 },
1304 { MiscRegNum64(3, 7, 14, 2, 1), MISCREG_CNTPS_CTL_EL1 },
1305 { MiscRegNum64(3, 7, 14, 2, 2), MISCREG_CNTPS_CVAL_EL1 }
1306};
1307
1308template <bool read>
1309HFGTR
1310fgtRegister(ThreadContext *tc)
1311{
1312 if constexpr (read) {
1313 return tc->readMiscReg(MISCREG_HFGRTR_EL2);
1314 } else {
1315 return tc->readMiscReg(MISCREG_HFGWTR_EL2);
1316 }
1317}
1318
1319template <bool read>
1320HDFGTR
1321fgtDebugRegister(ThreadContext *tc)
1322{
1323 if constexpr (read) {
1324 return tc->readMiscReg(MISCREG_HDFGRTR_EL2);
1325 } else {
1326 return tc->readMiscReg(MISCREG_HDFGWTR_EL2);
1327 }
1328}
1329
1336template<bool read, auto r_bitfield>
1337Fault
1338faultFgtEL0(const MiscRegLUTEntry &entry,
1339 ThreadContext *tc, const MiscRegOp64 &inst)
1340{
1341 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1342 const bool in_host = EL2Enabled(tc) && hcr.e2h && hcr.tge;
1343 if (fgtEnabled(tc) && !in_host &&
1344 fgtRegister<read>(tc).*r_bitfield) {
1345 return inst.generateTrap(EL2);
1346 } else {
1347 return NoFault;
1348 }
1349}
1350
1357template<bool read, auto r_bitfield>
1358Fault
1359faultFgtEL1(const MiscRegLUTEntry &entry,
1360 ThreadContext *tc, const MiscRegOp64 &inst)
1361{
1362 if (fgtEnabled(tc) && fgtRegister<read>(tc).*r_bitfield) {
1363 return inst.generateTrap(EL2);
1364 } else {
1365 return NoFault;
1366 }
1367}
1368
1374template<auto r_bitfield>
1375Fault
1376faultFgtInstEL1(const MiscRegLUTEntry &entry,
1377 ThreadContext *tc, const MiscRegOp64 &inst)
1378{
1379 if (fgtEnabled(tc) &&
1380 static_cast<HFGITR>(tc->readMiscReg(MISCREG_HFGITR_EL2)).*r_bitfield) {
1381 return inst.generateTrap(EL2);
1382 } else {
1383 return NoFault;
1384 }
1385}
1386
1393template<bool read, auto r_bitfield>
1394Fault
1395faultFgtDebugEL1(const MiscRegLUTEntry &entry,
1396 ThreadContext *tc, const MiscRegOp64 &inst)
1397{
1398 if (fgtEnabled(tc) && fgtDebugRegister<read>(tc).*r_bitfield) {
1399 return inst.generateTrap(EL2);
1400 } else {
1401 return NoFault;
1402 }
1403}
1404
1410template <auto g_bitfield>
1411Fault
1412faultHcrEL1(const MiscRegLUTEntry &entry,
1413 ThreadContext *tc, const MiscRegOp64 &inst)
1414{
1415 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1416 if (EL2Enabled(tc) && hcr.*g_bitfield) {
1417 return inst.generateTrap(EL2);
1418 } else {
1419 return NoFault;
1420 }
1421}
1422
1430template<bool read, auto g_bitfield, auto r_bitfield>
1431Fault
1432faultHcrFgtEL0(const MiscRegLUTEntry &entry,
1433 ThreadContext *tc, const MiscRegOp64 &inst)
1434{
1435 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1436 const bool in_host = EL2Enabled(tc) && hcr.e2h && hcr.tge;
1437
1438 if (EL2Enabled(tc) && !in_host && hcr.*g_bitfield) {
1439 return inst.generateTrap(EL2);
1440 } else if (auto fault = faultFgtEL0<read, r_bitfield>(entry, tc, inst);
1441 fault != NoFault) {
1442 return fault;
1443 } else {
1444 return NoFault;
1445 }
1446}
1447
1455template<bool read, auto g_bitfield, auto r_bitfield>
1456Fault
1457faultHcrFgtEL1(const MiscRegLUTEntry &entry,
1458 ThreadContext *tc, const MiscRegOp64 &inst)
1459{
1460 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1461
1462 if (EL2Enabled(tc) && hcr.*g_bitfield) {
1463 return inst.generateTrap(EL2);
1464 } else if (auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
1465 fault != NoFault) {
1466 return fault;
1467 } else {
1468 return NoFault;
1469 }
1470}
1471
1478template<auto g_bitfield, auto r_bitfield>
1479Fault
1480faultHcrFgtInstEL1(const MiscRegLUTEntry &entry,
1481 ThreadContext *tc, const MiscRegOp64 &inst)
1482{
1483 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1484
1485 if (EL2Enabled(tc) && hcr.*g_bitfield) {
1486 return inst.generateTrap(EL2);
1487 } else if (auto fault = faultFgtInstEL1<r_bitfield>(entry, tc, inst);
1488 fault != NoFault) {
1489 return fault;
1490 } else {
1491 return NoFault;
1492 }
1493}
1494
1495Fault
1496faultSpEL0(const MiscRegLUTEntry &entry, ThreadContext *tc,
1497 const MiscRegOp64 &inst)
1498{
1499 if (tc->readMiscReg(MISCREG_SPSEL) == 0)
1500 return inst.undefined();
1501 else
1502 return NoFault;
1503}
1504
1505Fault
1506faultDaif(const MiscRegLUTEntry &entry, ThreadContext *tc,
1507 const MiscRegOp64 &inst)
1508{
1509 const bool el2_enabled = EL2Enabled(tc);
1510 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1511 const SCTLR sctlr = tc->readMiscRegNoEffect(MISCREG_SCTLR_EL1);
1512 if ((el2_enabled && hcr.e2h && hcr.tge) || sctlr.uma == 0) {
1513 if (el2_enabled && hcr.tge) {
1514 return inst.generateTrap(EL2);
1515 } else {
1516 return inst.generateTrap(EL1);
1517 }
1518 } else {
1519 return NoFault;
1520 }
1521}
1522
1523Fault
1524faultDczvaEL0(const MiscRegLUTEntry &entry, ThreadContext *tc,
1525 const MiscRegOp64 &inst)
1526{
1527 if (!FullSystem)
1528 return NoFault;
1529
1530 const SCTLR sctlr = tc->readMiscRegNoEffect(MISCREG_SCTLR_EL1);
1531 const SCTLR sctlr2 = tc->readMiscRegNoEffect(MISCREG_SCTLR_EL2);
1532 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1533
1534 const bool el2_enabled = EL2Enabled(tc);
1535 const bool in_host = hcr.e2h && hcr.tge;
1536 if (!(el2_enabled && in_host) && !sctlr.dze) {
1537 if (el2_enabled && hcr.tge) {
1538 return inst.generateTrap(EL2);
1539 } else {
1540 return inst.generateTrap(EL1);
1541 }
1542 } else if (el2_enabled && !in_host && hcr.tdz) {
1543 return inst.generateTrap(EL2);
1544 } else if (el2_enabled && in_host && !sctlr2.dze) {
1545 return inst.generateTrap(EL2);
1546 } else {
1547 return NoFault;
1548 }
1549}
1550
1551Fault
1552faultCvacEL0(const MiscRegLUTEntry &entry, ThreadContext *tc,
1553 const MiscRegOp64 &inst)
1554{
1555 const SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR_EL1);
1556 const SCTLR sctlr2 = tc->readMiscReg(MISCREG_SCTLR_EL2);
1557 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1558
1559 const bool el2_enabled = EL2Enabled(tc);
1560 const bool in_host = hcr.e2h && hcr.tge;
1561 if (!(el2_enabled && in_host) && !sctlr.uci) {
1562 if (el2_enabled && hcr.tge) {
1563 return inst.generateTrap(EL2);
1564 } else {
1565 return inst.generateTrap(EL1);
1566 }
1567 } else if (el2_enabled && !in_host && hcr.tpc) {
1568 return inst.generateTrap(EL2);
1569 } else if (el2_enabled && in_host && !sctlr2.uci) {
1570 return inst.generateTrap(EL2);
1571 } else {
1572 return NoFault;
1573 }
1574}
1575
1576Fault
1577faultFpcrEL0(const MiscRegLUTEntry &entry, ThreadContext *tc,
1578 const MiscRegOp64 &inst)
1579{
1580 const CPACR cpacr = tc->readMiscReg(MISCREG_CPACR_EL1);
1581 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
1582 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1583
1584 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1585 const bool el2_enabled = EL2Enabled(tc);
1586 const bool in_host = hcr.e2h && hcr.tge;
1587 if (!(el2_enabled && in_host) && cpacr.fpen != 0b11) {
1588 if (el2_enabled && hcr.tge) {
1589 return inst.generateTrap(EL2, ExceptionClass::UNKNOWN, inst.iss());
1590 } else {
1591 return inst.generateTrap(EL1,
1593 }
1594 } else if (el2_enabled && in_host && cptr_el2.fpen != 0b11) {
1595 return inst.generateTrap(EL2,
1597 } else if (el2_enabled && hcr.e2h && ((cptr_el2.fpen & 0b1) == 0b0)) {
1598 return inst.generateTrap(EL2,
1600 } else if (el2_enabled && !hcr.e2h && cptr_el2.tfp) {
1601 return inst.generateTrap(EL2,
1603 } else if (ArmSystem::haveEL(tc, EL3) && cptr_el3.tfp) {
1604 return inst.generateTrap(EL3,
1606 } else {
1607 return NoFault;
1608 }
1609}
1610
1611Fault
1612faultFpcrEL1(const MiscRegLUTEntry &entry, ThreadContext *tc,
1613 const MiscRegOp64 &inst)
1614{
1615 const CPACR cpacr = tc->readMiscReg(MISCREG_CPACR_EL1);
1616 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
1617 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1618
1619 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1620 const bool el2_enabled = EL2Enabled(tc);
1621 if ((cpacr.fpen & 0b1) == 0b0) {
1622 return inst.generateTrap(EL1,
1624 } else if (el2_enabled && !hcr.e2h && cptr_el2.tfp) {
1625 return inst.generateTrap(EL2,
1627 } else if (el2_enabled && hcr.e2h && ((cptr_el2.fpen & 0b1) == 0b0)) {
1628 return inst.generateTrap(EL2,
1630 } else if (ArmSystem::haveEL(tc, EL3) && cptr_el3.tfp) {
1631 return inst.generateTrap(EL3,
1633 } else {
1634 return NoFault;
1635 }
1636}
1637
1638Fault
1639faultFpcrEL2(const MiscRegLUTEntry &entry, ThreadContext *tc,
1640 const MiscRegOp64 &inst)
1641{
1642 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
1643 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1644
1645 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1646 if (!hcr.e2h && cptr_el2.tfp) {
1647 return inst.generateTrap(EL2,
1649 } else if (hcr.e2h && ((cptr_el2.fpen & 0b1) == 0b0)) {
1650 return inst.generateTrap(EL2,
1652 } else if (ArmSystem::haveEL(tc, EL3) && cptr_el3.tfp) {
1653 return inst.generateTrap(EL3,
1655 } else {
1656 return NoFault;
1657 }
1658}
1659
1660Fault
1661faultFpcrEL3(const MiscRegLUTEntry &entry,
1662 ThreadContext *tc, const MiscRegOp64 &inst)
1663{
1664 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1665 if (cptr_el3.tfp) {
1666 return inst.generateTrap(EL3,
1668 } else {
1669 return NoFault;
1670 }
1671}
1672
1673Fault
1674faultPouEL0(const MiscRegLUTEntry &entry,
1675 ThreadContext *tc, const MiscRegOp64 &inst)
1676{
1677 const SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR_EL1);
1678 const SCTLR sctlr2 = tc->readMiscReg(MISCREG_SCTLR_EL2);
1679 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1680
1681 const bool el2_enabled = EL2Enabled(tc);
1682 const bool in_host = hcr.e2h && hcr.tge;
1683 if (!(el2_enabled && in_host) && !sctlr.uci) {
1684 if (el2_enabled && hcr.tge) {
1685 return inst.generateTrap(EL2);
1686 } else {
1687 return inst.generateTrap(EL1);
1688 }
1689 } else if (el2_enabled && !in_host && hcr.tpu) {
1690 return inst.generateTrap(EL2);
1691 } else if (el2_enabled && !in_host &&
1692 HaveExt(tc, ArmExtension::FEAT_EVT) && hcr.tocu) {
1693 return inst.generateTrap(EL2);
1694 } else if (el2_enabled && in_host && !sctlr2.uci) {
1695 return inst.generateTrap(EL2);
1696 } else {
1697 return NoFault;
1698 }
1699}
1700
1701template <auto bitfield>
1702Fault
1703faultPouEL1(const MiscRegLUTEntry &entry,
1704 ThreadContext *tc, const MiscRegOp64 &inst)
1705{
1706 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1707 const bool el2_enabled = EL2Enabled(tc);
1708 if (el2_enabled && hcr.tpu) {
1709 return inst.generateTrap(EL2);
1710 } else if (el2_enabled && HaveExt(tc, ArmExtension::FEAT_EVT) &&
1711 hcr.tocu) {
1712 return inst.generateTrap(EL2);
1713 } else if (auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
1714 fault != NoFault) {
1715 return fault;
1716 } else {
1717 return NoFault;
1718 }
1719}
1720
1721template <auto bitfield>
1722Fault
1723faultPouIsEL1(const MiscRegLUTEntry &entry,
1724 ThreadContext *tc, const MiscRegOp64 &inst)
1725{
1726 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1727 const bool el2_enabled = EL2Enabled(tc);
1728 if (el2_enabled && hcr.tpu) {
1729 return inst.generateTrap(EL2);
1730 } else if (el2_enabled && HaveExt(tc, ArmExtension::FEAT_EVT) &&
1731 hcr.ticab) {
1732 return inst.generateTrap(EL2);
1733 } else if (auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
1734 fault != NoFault) {
1735 return fault;
1736 } else {
1737 return NoFault;
1738 }
1739}
1740
1741Fault
1742faultCtrEL0(const MiscRegLUTEntry &entry,
1743 ThreadContext *tc, const MiscRegOp64 &inst)
1744{
1745 const SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR_EL1);
1746 const SCTLR sctlr2 = tc->readMiscReg(MISCREG_SCTLR_EL2);
1747 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1748
1749 const bool el2_enabled = EL2Enabled(tc);
1750 const bool in_host = hcr.e2h && hcr.tge;
1751 if (!(el2_enabled && in_host) && !sctlr.uct) {
1752 if (el2_enabled && hcr.tge) {
1753 return inst.generateTrap(EL2);
1754 } else {
1755 return inst.generateTrap(EL1);
1756 }
1757 } else if (auto fault = faultHcrFgtEL0<
1758 true, &HCR::tid2, &HFGTR::ctrEL0>(entry, tc, inst);
1759 fault != NoFault) {
1760 return fault;
1761 } else if (el2_enabled && in_host && !sctlr2.uct) {
1762 return inst.generateTrap(EL2);
1763 } else {
1764 return NoFault;
1765 }
1766}
1767
1768Fault
1769faultMdccsrEL0(const MiscRegLUTEntry &entry,
1770 ThreadContext *tc, const MiscRegOp64 &inst)
1771{
1772 const DBGDS32 mdscr = tc->readMiscReg(MISCREG_MDSCR_EL1);
1773 const HDCR mdcr_el2 = tc->readMiscReg(MISCREG_MDCR_EL2);
1774 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1775
1776 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1777 const bool el2_enabled = EL2Enabled(tc);
1778 if (mdscr.tdcc) {
1779 if (el2_enabled && hcr.tge) {
1780 return inst.generateTrap(EL2);
1781 } else {
1782 return inst.generateTrap(EL1);
1783 }
1784 } else if (el2_enabled && mdcr_el2.tdcc) {
1785 return inst.generateTrap(EL2);
1786 } else if (el2_enabled && (hcr.tge || (mdcr_el2.tde || mdcr_el2.tda))) {
1787 return inst.generateTrap(EL2);
1788 } else if (ArmSystem::haveEL(tc, EL3) && (mdcr_el3.tdcc || mdcr_el3.tda)) {
1789 return inst.generateTrap(EL3);
1790 } else {
1791 return NoFault;
1792 }
1793}
1794
1795Fault
1796faultMdccsrEL1(const MiscRegLUTEntry &entry,
1797 ThreadContext *tc, const MiscRegOp64 &inst)
1798{
1799 const HDCR mdcr_el2 = tc->readMiscReg(MISCREG_MDCR_EL2);
1800 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1801
1802 const bool el2_enabled = EL2Enabled(tc);
1803 if (el2_enabled && mdcr_el2.tdcc) {
1804 return inst.generateTrap(EL2);
1805 } else if (el2_enabled && (mdcr_el2.tde || mdcr_el2.tda)) {
1806 return inst.generateTrap(EL2);
1807 } else if (ArmSystem::haveEL(tc, EL3) && (mdcr_el3.tdcc || mdcr_el3.tda)) {
1808 return inst.generateTrap(EL3);
1809 } else {
1810 return NoFault;
1811 }
1812}
1813
1814Fault
1815faultMdccsrEL2(const MiscRegLUTEntry &entry,
1816 ThreadContext *tc, const MiscRegOp64 &inst)
1817{
1818 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1819 if (ArmSystem::haveEL(tc, EL3) && (mdcr_el3.tdcc || mdcr_el3.tda)) {
1820 return inst.generateTrap(EL3);
1821 } else {
1822 return NoFault;
1823 }
1824}
1825
1826Fault
1827faultDebugEL1(const MiscRegLUTEntry &entry,
1828 ThreadContext *tc, const MiscRegOp64 &inst)
1829{
1830 const HDCR mdcr_el2 = tc->readMiscReg(MISCREG_MDCR_EL2);
1831 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1832
1833 const bool el2_enabled = EL2Enabled(tc);
1834 if (el2_enabled && (mdcr_el2.tde || mdcr_el2.tda)) {
1835 return inst.generateTrap(EL2);
1836 } else if (ArmSystem::haveEL(tc, EL3) && mdcr_el3.tda) {
1837 return inst.generateTrap(EL3);
1838 } else {
1839 return NoFault;
1840 }
1841}
1842
1843Fault
1844faultDebugEL2(const MiscRegLUTEntry &entry,
1845 ThreadContext *tc, const MiscRegOp64 &inst)
1846{
1847 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1848 if (ArmSystem::haveEL(tc, EL3) && mdcr_el3.tda) {
1849 return inst.generateTrap(EL3);
1850 } else {
1851 return NoFault;
1852 }
1853}
1854
1855template<bool read, auto r_bitfield>
1856Fault
1857faultDebugWithFgtEL1(const MiscRegLUTEntry &entry,
1858 ThreadContext *tc, const MiscRegOp64 &inst)
1859{
1860 if (auto fault = faultFgtDebugEL1<read, r_bitfield>(entry, tc, inst);
1861 fault != NoFault) {
1862 return fault;
1863 } else {
1864 return faultDebugEL1(entry, tc, inst);
1865 }
1866}
1867
1868template<bool read, auto r_bitfield>
1869Fault
1870faultDebugOsEL1(const MiscRegLUTEntry &entry,
1871 ThreadContext *tc, const MiscRegOp64 &inst)
1872{
1873 const HDCR mdcr_el2 = tc->readMiscReg(MISCREG_MDCR_EL2);
1874 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1875
1876 if (auto fault = faultFgtDebugEL1<read, r_bitfield>(entry, tc, inst);
1877 fault != NoFault) {
1878 return fault;
1879 } else if (EL2Enabled(tc) && (mdcr_el2.tde || mdcr_el2.tdosa)) {
1880 return inst.generateTrap(EL2);
1881 } else if (ArmSystem::haveEL(tc, EL3) && mdcr_el3.tdosa) {
1882 return inst.generateTrap(EL3);
1883 } else {
1884 return NoFault;
1885 }
1886}
1887
1888Fault
1889faultDebugOsEL2(const MiscRegLUTEntry &entry,
1890 ThreadContext *tc, const MiscRegOp64 &inst)
1891{
1892 const HDCR mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
1893 if (ArmSystem::haveEL(tc, EL3) && mdcr_el3.tdosa) {
1894 return inst.generateTrap(EL3);
1895 } else {
1896 return NoFault;
1897 }
1898}
1899
1900Fault
1901faultHcrxEL2(const MiscRegLUTEntry &entry,
1902 ThreadContext *tc, const MiscRegOp64 &inst)
1903{
1904 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
1905 if (ArmSystem::haveEL(tc, EL3) && !scr.hxen) {
1906 return inst.generateTrap(EL3);
1907 } else {
1908 return NoFault;
1909 }
1910}
1911
1912Fault
1913faultZcrEL1(const MiscRegLUTEntry &entry,
1914 ThreadContext *tc, const MiscRegOp64 &inst)
1915{
1916 const CPACR cpacr_el1 = tc->readMiscReg(MISCREG_CPACR_EL1);
1917 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
1918 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1919
1920 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1921 const bool el2_enabled = EL2Enabled(tc);
1922 if (!(cpacr_el1.zen & 0x1)) {
1923 return inst.generateTrap(EL1, ExceptionClass::TRAPPED_SVE, 0);
1924 } else if (el2_enabled && !hcr.e2h && cptr_el2.tz) {
1925 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SVE, 0);
1926 } else if (el2_enabled && hcr.e2h && !(cptr_el2.zen & 0x1)) {
1927 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SVE, 0);
1928 } else if (ArmSystem::haveEL(tc, EL3) && !cptr_el3.ez) {
1929 return inst.generateTrap(EL3, ExceptionClass::TRAPPED_SVE, 0);
1930 } else {
1931 return NoFault;
1932 }
1933}
1934
1935Fault
1936faultZcrEL2(const MiscRegLUTEntry &entry,
1937 ThreadContext *tc, const MiscRegOp64 &inst)
1938{
1939 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
1940 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1941
1942 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1943 if (!hcr.e2h && cptr_el2.tz) {
1944 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SVE, 0);
1945 } else if (hcr.e2h && !(cptr_el2.zen & 0x1)) {
1946 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SVE, 0);
1947 } else if (ArmSystem::haveEL(tc, EL3) && !cptr_el3.ez) {
1948 return inst.generateTrap(EL3, ExceptionClass::TRAPPED_SVE, 0);
1949 } else {
1950 return NoFault;
1951 }
1952}
1953
1954Fault
1955faultZcrEL3(const MiscRegLUTEntry &entry,
1956 ThreadContext *tc, const MiscRegOp64 &inst)
1957{
1958 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
1959 if (!cptr_el3.ez) {
1960 return inst.generateTrap(EL3, ExceptionClass::TRAPPED_SVE, 0);
1961 } else {
1962 return NoFault;
1963 }
1964}
1965
1966Fault
1967faultGicv3(const MiscRegLUTEntry &entry,
1968 ThreadContext *tc, const MiscRegOp64 &inst)
1969{
1970 auto gic = static_cast<ArmSystem*>(tc->getSystemPtr())->getGIC();
1971 if (!gic->supportsVersion(BaseGic::GicVersion::GIC_V3)) {
1972 return inst.undefined();
1973 } else {
1974 return NoFault;
1975 }
1976}
1977
1978Fault
1979faultIccSgiEL1(const MiscRegLUTEntry &entry,
1980 ThreadContext *tc, const MiscRegOp64 &inst)
1981{
1982 if (auto fault = faultGicv3(entry, tc, inst); fault != NoFault) {
1983 return fault;
1984 }
1985
1986 const Gicv3CPUInterface::ICH_HCR_EL2 ich_hcr =
1987 tc->readMiscReg(MISCREG_ICH_HCR_EL2);
1988 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1989 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
1990 if (EL2Enabled(tc) && (hcr.fmo || hcr.imo || ich_hcr.TC)) {
1991 return inst.generateTrap(EL2);
1992 } else if (ArmSystem::haveEL(tc, EL3) && scr.irq && scr.fiq) {
1993 return inst.generateTrap(EL3);
1994 } else {
1995 return NoFault;
1996 }
1997}
1998
1999Fault
2000faultIccSgiEL2(const MiscRegLUTEntry &entry,
2001 ThreadContext *tc, const MiscRegOp64 &inst)
2002{
2003 if (auto fault = faultGicv3(entry, tc, inst); fault != NoFault) {
2004 return fault;
2005 }
2006
2007 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2008 if (ArmSystem::haveEL(tc, EL3) && scr.irq && scr.fiq) {
2009 return inst.generateTrap(EL3);
2010 } else {
2011 return NoFault;
2012 }
2013}
2014
2015template<bool read, auto g_bitfield>
2016Fault
2017faultSctlr2EL1(const MiscRegLUTEntry &entry,
2018 ThreadContext *tc, const MiscRegOp64 &inst)
2019{
2020 if (HaveExt(tc, ArmExtension::FEAT_SCTLR2)) {
2021 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2022 const HCRX hcrx = tc->readMiscReg(MISCREG_HCRX_EL2);
2023 if (
2024 auto fault = faultHcrFgtEL1<read, g_bitfield, &HFGTR::sctlrEL1>
2025 (
2026 entry,
2027 tc,
2028 inst
2029 );
2030 fault != NoFault
2031 ) {
2032 return fault;
2033 } else if (
2034 EL2Enabled(tc) && (!isHcrxEL2Enabled(tc) || !hcrx.sctlr2En)
2035 ) {
2036 return inst.generateTrap(EL2);
2037 } else if (ArmSystem::haveEL(tc, EL3) && !scr.sctlr2En) {
2038 return inst.generateTrap(EL3);
2039 } else {
2040 return NoFault;
2041 }
2042 } else {
2043 return inst.undefined();
2044 }
2045}
2046
2047Fault
2048faultSctlr2EL2(const MiscRegLUTEntry &entry,
2049 ThreadContext *tc, const MiscRegOp64 &inst)
2050{
2051 if (HaveExt(tc, ArmExtension::FEAT_SCTLR2)) {
2052 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2053 if (ArmSystem::haveEL(tc, EL3) && !scr.sctlr2En) {
2054 return inst.generateTrap(EL3);
2055 } else {
2056 return NoFault;
2057 }
2058 } else {
2059 return inst.undefined();
2060 }
2061}
2062
2063Fault
2064faultSctlr2VheEL2(const MiscRegLUTEntry &entry,
2065 ThreadContext *tc, const MiscRegOp64 &inst)
2066{
2067 if (HaveExt(tc, ArmExtension::FEAT_SCTLR2)) {
2068 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2069 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2070 if (hcr.e2h) {
2071 if (ArmSystem::haveEL(tc, EL3) && !scr.sctlr2En) {
2072 return inst.generateTrap(EL3);
2073 } else {
2074 return NoFault;
2075 }
2076 } else {
2077 return inst.undefined();
2078 }
2079 } else {
2080 return inst.undefined();
2081 }
2082}
2083
2084template<bool read, auto g_bitfield>
2085Fault
2086faultTcr2EL1(const MiscRegLUTEntry &entry,
2087 ThreadContext *tc, const MiscRegOp64 &inst)
2088{
2089 if (HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2090 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2091 const HCRX hcrx = tc->readMiscReg(MISCREG_HCRX_EL2);
2092 if (
2093 auto fault = faultHcrFgtEL1<read, g_bitfield, &HFGTR::sctlrEL1>
2094 (
2095 entry,
2096 tc,
2097 inst
2098 );
2099 fault != NoFault
2100 ) {
2101 return fault;
2102 } else if (EL2Enabled(tc) && (!isHcrxEL2Enabled(tc) || !hcrx.tcr2En)) {
2103 return inst.generateTrap(EL2);
2104 } else if (ArmSystem::haveEL(tc, EL3) && !scr.tcr2En) {
2105 return inst.generateTrap(EL3);
2106 } else {
2107 return NoFault;
2108 }
2109 } else {
2110 return inst.undefined();
2111 }
2112}
2113
2114Fault
2115faultTcr2EL2(const MiscRegLUTEntry &entry,
2116 ThreadContext *tc, const MiscRegOp64 &inst)
2117{
2118 if (HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2119 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2120 if (ArmSystem::haveEL(tc, EL3) && !scr.tcr2En) {
2121 return inst.generateTrap(EL3);
2122 } else {
2123 return NoFault;
2124 }
2125 } else {
2126 return inst.undefined();
2127 }
2128}
2129
2130Fault
2131faultTcr2VheEL2(const MiscRegLUTEntry &entry,
2132 ThreadContext *tc, const MiscRegOp64 &inst)
2133{
2134 if (HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2135 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2136 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2137 if (hcr.e2h) {
2138 if (ArmSystem::haveEL(tc, EL3) && !scr.tcr2En) {
2139 return inst.generateTrap(EL3);
2140 } else {
2141 return NoFault;
2142 }
2143 } else {
2144 return inst.undefined();
2145 }
2146 } else {
2147 return inst.undefined();
2148 }
2149}
2150
2151Fault
2152faultTcr2VheEL3(const MiscRegLUTEntry &entry,
2153 ThreadContext *tc, const MiscRegOp64 &inst)
2154{
2155 if (HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2156 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2157 const bool el2_host = EL2Enabled(tc) && hcr.e2h;
2158 if (el2_host) {
2159 return NoFault;
2160 } else {
2161 return inst.undefined();
2162 }
2163 } else {
2164 return inst.undefined();
2165 }
2166}
2167
2168template<bool read, auto r_bitfield>
2169Fault
2170faultCpacrEL1(const MiscRegLUTEntry &entry,
2171 ThreadContext *tc, const MiscRegOp64 &inst)
2172{
2173 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
2174 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
2175
2176 const bool el2_enabled = EL2Enabled(tc);
2177 if (el2_enabled && cptr_el2.tcpac) {
2178 return inst.generateTrap(EL2);
2179 } else if (auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
2180 fault != NoFault) {
2181 return fault;
2182 } else if (ArmSystem::haveEL(tc, EL3) && cptr_el3.tcpac) {
2183 return inst.generateTrap(EL3);
2184 } else {
2185 return NoFault;
2186 }
2187}
2188
2189Fault
2190faultCpacrEL2(const MiscRegLUTEntry &entry,
2191 ThreadContext *tc, const MiscRegOp64 &inst)
2192{
2193 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
2194 if (ArmSystem::haveEL(tc, EL3) && cptr_el3.tcpac) {
2195 return inst.generateTrap(EL3);
2196 } else {
2197 return NoFault;
2198 }
2199}
2200
2201Fault
2202faultCpacrVheEL2(const MiscRegLUTEntry &entry,
2203 ThreadContext *tc, const MiscRegOp64 &inst)
2204{
2205 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2206 if (hcr.e2h) {
2207 return faultCpacrEL2(entry, tc, inst);
2208 } else {
2209 return inst.undefined();
2210 }
2211}
2212
2213template <auto bitfield>
2214Fault
2215faultTlbiOsEL1(const MiscRegLUTEntry &entry,
2216 ThreadContext *tc, const MiscRegOp64 &inst)
2217{
2218 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2219 const bool el2_enabled = EL2Enabled(tc);
2220 if (el2_enabled && hcr.ttlb) {
2221 return inst.generateTrap(EL2);
2222 } else if (el2_enabled && HaveExt(tc, ArmExtension::FEAT_EVT) &&
2223 hcr.ttlbos) {
2224 return inst.generateTrap(EL2);
2225 } else if (auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
2226 fault != NoFault) {
2227 return fault;
2228 } else {
2229 return NoFault;
2230 }
2231}
2232
2233template <auto bitfield>
2234Fault
2235faultTlbiIsEL1(const MiscRegLUTEntry &entry,
2236 ThreadContext *tc, const MiscRegOp64 &inst)
2237{
2238 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2239 const bool el2_enabled = EL2Enabled(tc);
2240 if (el2_enabled && hcr.ttlb) {
2241 return inst.generateTrap(EL2);
2242 } else if (el2_enabled && HaveExt(tc, ArmExtension::FEAT_EVT) &&
2243 hcr.ttlbis) {
2244 return inst.generateTrap(EL2);
2245 } else if (auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
2246 fault != NoFault) {
2247 return fault;
2248 } else {
2249 return NoFault;
2250 }
2251}
2252
2253template <bool read, auto r_bitfield>
2254Fault
2255faultCacheEL1(const MiscRegLUTEntry &entry,
2256 ThreadContext *tc, const MiscRegOp64 &inst)
2257{
2258 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2259 const bool el2_enabled = EL2Enabled(tc);
2260 if (el2_enabled && hcr.tid2) {
2261 return inst.generateTrap(EL2);
2262 } else if (el2_enabled && HaveExt(tc, ArmExtension::FEAT_EVT) &&
2263 hcr.tid4) {
2264 return inst.generateTrap(EL2);
2265 } else if (auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
2266 fault != NoFault) {
2267 return fault;
2268 } else {
2269 return NoFault;
2270 }
2271}
2272
2273template <bool read, auto r_bitfield>
2274Fault
2275faultPauthEL1(const MiscRegLUTEntry &entry,
2276 ThreadContext *tc, const MiscRegOp64 &inst)
2277{
2278 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2279 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2280 const bool el2_enabled = EL2Enabled(tc);
2281
2282 if (el2_enabled && !hcr.apk) {
2283 return inst.generateTrap(EL2);
2284 } else if (auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
2285 fault != NoFault) {
2286 return fault;
2287 } else if (ArmSystem::haveEL(tc, EL3) && !scr.apk) {
2288 return inst.generateTrap(EL3);
2289 } else {
2290 return NoFault;
2291 }
2292}
2293
2294Fault
2295faultPauthEL2(const MiscRegLUTEntry &entry,
2296 ThreadContext *tc, const MiscRegOp64 &inst)
2297{
2298 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2299 if (ArmSystem::haveEL(tc, EL3) && !scr.apk) {
2300 return inst.generateTrap(EL3);
2301 } else {
2302 return NoFault;
2303 }
2304}
2305
2306Fault
2307faultGenericTimerEL0(const MiscRegLUTEntry &entry,
2308 ThreadContext *tc, const MiscRegOp64 &inst)
2309{
2310 const bool el2_enabled = EL2Enabled(tc);
2311 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2312 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2313 const CNTKCTL cntkctl_el1 = tc->readMiscReg(MISCREG_CNTKCTL_EL1);
2314 const CNTHCTL_E2H cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2315 if (!(in_host) && !cntkctl_el1.el0pcten && !cntkctl_el1.el0vcten) {
2316 if (el2_enabled && hcr.tge)
2317 return inst.generateTrap(EL2);
2318 else
2319 return inst.generateTrap(EL1);
2320 } else if (in_host && !cnthctl_el2.el0pcten && !cnthctl_el2.el0vcten) {
2321 return inst.generateTrap(EL2);
2322 } else {
2323 return NoFault;
2324 }
2325}
2326
2327Fault
2328faultCntpctEL0(const MiscRegLUTEntry &entry,
2329 ThreadContext *tc, const MiscRegOp64 &inst)
2330{
2331 const bool el2_enabled = EL2Enabled(tc);
2332 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2333 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2334 const CNTKCTL cntkctl_el1 = tc->readMiscReg(MISCREG_CNTKCTL_EL1);
2335 const RegVal cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2336 if (!(in_host) && !cntkctl_el1.el0pcten) {
2337 if (el2_enabled && hcr.tge)
2338 return inst.generateTrap(EL2);
2339 else
2340 return inst.generateTrap(EL1);
2341 } else if (el2_enabled && !hcr.e2h &&
2342 !static_cast<CNTHCTL>(cnthctl_el2).el1pcten) {
2343 return inst.generateTrap(EL2);
2344 } else if (el2_enabled && hcr.e2h && !hcr.tge &&
2345 !static_cast<CNTHCTL_E2H>(cnthctl_el2).el1pcten) {
2346 return inst.generateTrap(EL2);
2347 } else if (in_host &&
2348 !static_cast<CNTHCTL_E2H>(cnthctl_el2).el0pcten) {
2349 return inst.generateTrap(EL2);
2350 } else {
2351 return NoFault;
2352 }
2353}
2354
2355Fault
2356faultCntpctEL1(const MiscRegLUTEntry &entry,
2357 ThreadContext *tc, const MiscRegOp64 &inst)
2358{
2359 const bool el2_enabled = EL2Enabled(tc);
2360 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2361 const RegVal cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2362 if (el2_enabled && hcr.e2h &&
2363 !static_cast<CNTHCTL_E2H>(cnthctl_el2).el1pcten) {
2364 return inst.generateTrap(EL2);
2365 } else if (el2_enabled && !hcr.e2h &&
2366 !static_cast<CNTHCTL>(cnthctl_el2).el1pcten) {
2367 return inst.generateTrap(EL2);
2368 } else {
2369 return NoFault;
2370 }
2371}
2372
2373Fault
2374faultCntvctEL0(const MiscRegLUTEntry &entry,
2375 ThreadContext *tc, const MiscRegOp64 &inst)
2376{
2377 const bool el2_enabled = EL2Enabled(tc);
2378 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2379 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2380 const CNTKCTL cntkctl_el1 = tc->readMiscReg(MISCREG_CNTKCTL_EL1);
2381 const CNTHCTL_E2H cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2382 if (!(in_host) && !cntkctl_el1.el0vcten) {
2383 if (el2_enabled && hcr.tge)
2384 return inst.generateTrap(EL2);
2385 else
2386 return inst.generateTrap(EL1);
2387 } else if (in_host && !cnthctl_el2.el0vcten) {
2388 return inst.generateTrap(EL2);
2389 } else if (el2_enabled && !(hcr.e2h && hcr.tge) && cnthctl_el2.el1tvct) {
2390 return inst.generateTrap(EL2);
2391 } else {
2392 return NoFault;
2393 }
2394}
2395
2396Fault
2397faultCntvctEL1(const MiscRegLUTEntry &entry,
2398 ThreadContext *tc, const MiscRegOp64 &inst)
2399{
2400 const CNTHCTL cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2401 if (EL2Enabled(tc) && cnthctl_el2.el1tvct) {
2402 return inst.generateTrap(EL2);
2403 } else {
2404 return NoFault;
2405 }
2406}
2407
2408//TODO: See faultCntpctEL0
2409Fault
2410faultCntpCtlEL0(const MiscRegLUTEntry &entry,
2411 ThreadContext *tc, const MiscRegOp64 &inst)
2412{
2413 const bool el2_enabled = EL2Enabled(tc);
2414 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2415 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2416 const CNTKCTL cntkctl_el1 = tc->readMiscReg(MISCREG_CNTKCTL_EL1);
2417 const RegVal cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2418 if (!(in_host) && !cntkctl_el1.el0pten) {
2419 if (el2_enabled && hcr.tge)
2420 return inst.generateTrap(EL2);
2421 else
2422 return inst.generateTrap(EL1);
2423 } else if (el2_enabled && !hcr.e2h &&
2424 !static_cast<CNTHCTL>(cnthctl_el2).el1pcen) {
2425 return inst.generateTrap(EL2);
2426 } else if (el2_enabled && hcr.e2h && !hcr.tge &&
2427 !static_cast<CNTHCTL_E2H>(cnthctl_el2).el1pten) {
2428 return inst.generateTrap(EL2);
2429 } else if (in_host &&
2430 !static_cast<CNTHCTL_E2H>(cnthctl_el2).el0pten) {
2431 return inst.generateTrap(EL2);
2432 } else {
2433 return NoFault;
2434 }
2435}
2436
2437Fault
2438faultCntpCtlEL1(const MiscRegLUTEntry &entry,
2439 ThreadContext *tc, const MiscRegOp64 &inst)
2440{
2441 const bool el2_enabled = EL2Enabled(tc);
2442 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2443 const RegVal cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2444 if (el2_enabled && !hcr.e2h &&
2445 !static_cast<CNTHCTL>(cnthctl_el2).el1pcen) {
2446 return inst.generateTrap(EL2);
2447 } else if (el2_enabled && hcr.e2h &&
2448 !static_cast<CNTHCTL_E2H>(cnthctl_el2).el1pten) {
2449 return inst.generateTrap(EL2);
2450 } else {
2451 return NoFault;
2452 }
2453}
2454
2455// TODO: see faultCntvctEL0
2456Fault
2457faultCntvCtlEL0(const MiscRegLUTEntry &entry,
2458 ThreadContext *tc, const MiscRegOp64 &inst)
2459{
2460 const bool el2_enabled = EL2Enabled(tc);
2461 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2462 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2463 const CNTKCTL cntkctl_el1 = tc->readMiscReg(MISCREG_CNTKCTL_EL1);
2464 const CNTHCTL_E2H cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2465 if (!(in_host) && !cntkctl_el1.el0vten) {
2466 if (el2_enabled && hcr.tge)
2467 return inst.generateTrap(EL2);
2468 else
2469 return inst.generateTrap(EL1);
2470 } else if (in_host && !cnthctl_el2.el0vten) {
2471 return inst.generateTrap(EL2);
2472 } else if (el2_enabled && !(hcr.e2h && hcr.tge) && cnthctl_el2.el1tvt) {
2473 return inst.generateTrap(EL2);
2474 } else {
2475 return NoFault;
2476 }
2477}
2478
2479Fault
2480faultCntvCtlEL1(const MiscRegLUTEntry &entry,
2481 ThreadContext *tc, const MiscRegOp64 &inst)
2482{
2483 const CNTHCTL cnthctl_el2 = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
2484 if (EL2Enabled(tc) && cnthctl_el2.el1tvt) {
2485 return inst.generateTrap(EL2);
2486 } else {
2487 return NoFault;
2488 }
2489}
2490
2491Fault
2492faultCntpsCtlEL1(const MiscRegLUTEntry &entry,
2493 ThreadContext *tc, const MiscRegOp64 &inst)
2494{
2495 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2496 if (ArmSystem::haveEL(tc, EL3) && !scr.ns) {
2497 if (scr.eel2)
2498 return inst.undefined();
2499 else if (!scr.st)
2500 return inst.generateTrap(EL3);
2501 else
2502 return NoFault;
2503 } else {
2504 return inst.undefined();
2505 }
2506}
2507
2508Fault
2509faultUnimplemented(const MiscRegLUTEntry &entry,
2510 ThreadContext *tc, const MiscRegOp64 &inst)
2511{
2512 if (entry.info[MISCREG_WARN_NOT_FAIL]) {
2513 return NoFault;
2514 } else {
2515 return inst.undefined();
2516 }
2517}
2518
2519Fault
2520faultImpdefUnimplEL1(const MiscRegLUTEntry &entry,
2521 ThreadContext *tc, const MiscRegOp64 &inst)
2522{
2523 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2524 if (EL2Enabled(tc) && hcr.tidcp) {
2525 return inst.generateTrap(EL2);
2526 } else {
2527 return faultUnimplemented(entry, tc, inst);
2528 }
2529}
2530
2531Fault
2532faultEsm(const MiscRegLUTEntry &entry,
2533 ThreadContext *tc, const MiscRegOp64 &inst)
2534{
2535 const CPTR cptr_el3 = tc->readMiscReg(MISCREG_CPTR_EL3);
2536 if (ArmSystem::haveEL(tc, EL3) && !cptr_el3.esm) {
2537 return inst.generateTrap(EL3, ExceptionClass::TRAPPED_SME, 0);
2538 } else {
2539 return NoFault;
2540 }
2541}
2542
2543Fault
2544faultTsmSmen(const MiscRegLUTEntry &entry,
2545 ThreadContext *tc, const MiscRegOp64 &inst)
2546{
2547 const HCR hcr_el2 = tc->readMiscReg(MISCREG_HCR_EL2);
2548 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
2549 const bool el2_enabled = EL2Enabled(tc);
2550 if (el2_enabled && !hcr_el2.e2h && cptr_el2.tsm) {
2551 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SME, 0);
2552 } else if (el2_enabled && hcr_el2.e2h && !(cptr_el2.smen & 0b1)) {
2553 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SME, 0);
2554 } else {
2555 return faultEsm(entry, tc, inst);
2556 }
2557}
2558
2559Fault
2560faultSmenEL1(const MiscRegLUTEntry &entry,
2561 ThreadContext *tc, const MiscRegOp64 &inst)
2562{
2563 const CPACR cpacr = tc->readMiscReg(MISCREG_CPACR_EL1);
2564 if (!(cpacr.smen & 0b1)) {
2565 return inst.generateTrap(EL1, ExceptionClass::TRAPPED_SME, 0);
2566 } else {
2567 return faultTsmSmen(entry, tc, inst);
2568 }
2569}
2570
2571Fault
2572faultSmenEL0(const MiscRegLUTEntry &entry,
2573 ThreadContext *tc, const MiscRegOp64 &inst)
2574{
2575 const bool el2_enabled = EL2Enabled(tc);
2576 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2577 const bool in_host = hcr.e2h && hcr.tge;
2578
2579 const CPACR cpacr = tc->readMiscReg(MISCREG_CPACR_EL1);
2580 const CPTR cptr_el2 = tc->readMiscReg(MISCREG_CPTR_EL2);
2581 if (!(el2_enabled && in_host) && cpacr.smen != 0b11) {
2582 if (el2_enabled && hcr.tge)
2583 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SME, 0);
2584 else
2585 return inst.generateTrap(EL1, ExceptionClass::TRAPPED_SME, 0);
2586 } else if (el2_enabled && in_host && cptr_el2.smen != 0b11) {
2587 return inst.generateTrap(EL2, ExceptionClass::TRAPPED_SME, 0);
2588 } else {
2589 return faultTsmSmen(entry, tc, inst);
2590 }
2591}
2592
2593Fault
2594faultRng(const MiscRegLUTEntry &entry,
2595 ThreadContext *tc, const MiscRegOp64 &inst)
2596{
2597 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2598 if (HaveExt(tc, ArmExtension::FEAT_RNG_TRAP) && scr.trndr) {
2599 return inst.generateTrap(EL3);
2600 } else if (!HaveExt(tc, ArmExtension::FEAT_RNG)) {
2601 return inst.undefined();
2602 } else {
2603 return NoFault;
2604 }
2605}
2606
2607Fault
2608faultFgtCtrlRegs(const MiscRegLUTEntry &entry,
2609 ThreadContext *tc, const MiscRegOp64 &inst)
2610{
2611 if (HaveExt(tc, ArmExtension::FEAT_FGT)) {
2612 const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
2613 if (ArmSystem::haveEL(tc, EL3) && !scr.fgten) {
2614 return inst.generateTrap(EL3);
2615 } else {
2616 return NoFault;
2617 }
2618 } else {
2619 return inst.undefined();
2620 }
2621}
2622
2623Fault
2624faultIdst(const MiscRegLUTEntry &entry,
2625 ThreadContext *tc, const MiscRegOp64 &inst)
2626{
2627 if (HaveExt(tc, ArmExtension::FEAT_IDST)) {
2628 const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2629 if (EL2Enabled(tc) && hcr.tge) {
2630 return inst.generateTrap(EL2);
2631 } else {
2632 return inst.generateTrap(EL1);
2633 }
2634 } else {
2635 return inst.undefined();
2636 }
2637}
2638
2639Fault
2640faultMpamIdrEL1(const MiscRegLUTEntry &entry,
2641 ThreadContext *tc, const MiscRegOp64 &inst)
2642{
2643 if (HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2644 MPAM mpam2 = tc->readMiscReg(MISCREG_MPAM2_EL2);
2645 MPAM mpam3 = tc->readMiscReg(MISCREG_MPAM3_EL3);
2646 MPAMIDR mpamidr = tc->readMiscReg(MISCREG_MPAMIDR_EL1);
2647 MPAMHCR mpamhcr = tc->readMiscReg(MISCREG_MPAMHCR_EL2);
2648 if (ArmSystem::haveEL(tc, EL3) && mpam3.el3.trapLower) {
2649 return inst.generateTrap(EL3);
2650 } else if (EL2Enabled(tc) && mpamidr.hasHcr && mpamhcr.trapMpamIdrEL1) {
2651 return inst.generateTrap(EL2);
2652 } else if (EL2Enabled(tc) && mpamidr.hasTidr && mpam2.el2.tidr) {
2653 return inst.generateTrap(EL2);
2654 } else {
2655 return NoFault;
2656 }
2657 } else {
2658 return inst.undefined();
2659 }
2660}
2661
2662Fault
2663faultMpam0EL1(const MiscRegLUTEntry &entry,
2664 ThreadContext *tc, const MiscRegOp64 &inst)
2665{
2666 if (HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2667 MPAM mpam2 = tc->readMiscReg(MISCREG_MPAM2_EL2);
2668 MPAM mpam3 = tc->readMiscReg(MISCREG_MPAM3_EL3);
2669 if (ArmSystem::haveEL(tc, EL3) && mpam3.el3.trapLower) {
2670 return inst.generateTrap(EL3);
2671 } else if (EL2Enabled(tc) && mpam2.el2.trapMpam0EL1) {
2672 return inst.generateTrap(EL2);
2673 } else {
2674 return NoFault;
2675 }
2676 } else {
2677 return inst.undefined();
2678 }
2679}
2680
2681Fault
2682faultMpam1EL1(const MiscRegLUTEntry &entry,
2683 ThreadContext *tc, const MiscRegOp64 &inst)
2684{
2685 if (HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2686 MPAM mpam2 = tc->readMiscReg(MISCREG_MPAM2_EL2);
2687 MPAM mpam3 = tc->readMiscReg(MISCREG_MPAM3_EL3);
2688 if (ArmSystem::haveEL(tc, EL3) && mpam3.el3.trapLower) {
2689 return inst.generateTrap(EL3);
2690 } else if (EL2Enabled(tc) && mpam2.el2.trapMpam1EL1) {
2691 return inst.generateTrap(EL2);
2692 } else {
2693 return NoFault;
2694 }
2695 } else {
2696 return inst.undefined();
2697 }
2698}
2699
2700Fault
2701faultMpamEL2(const MiscRegLUTEntry &entry,
2702 ThreadContext *tc, const MiscRegOp64 &inst)
2703{
2704 if (HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2705 MPAM mpam3 = tc->readMiscReg(MISCREG_MPAM3_EL3);
2706 if (ArmSystem::haveEL(tc, EL3) && mpam3.el3.trapLower) {
2707 return inst.generateTrap(EL3);
2708 } else {
2709 return NoFault;
2710 }
2711 } else {
2712 return inst.undefined();
2713 }
2714}
2715
2716Fault
2717faultMpam12EL2(const MiscRegLUTEntry &entry,
2718 ThreadContext *tc, const MiscRegOp64 &inst)
2719{
2720 if (ELIsInHost(tc, EL2)) {
2721 return faultMpamEL2(entry, tc, inst);
2722 } else {
2723 return inst.undefined();
2724 }
2725}
2726
2727Fault
2728faultMpamsmEL1(const MiscRegLUTEntry &entry,
2729 ThreadContext *tc, const MiscRegOp64 &inst)
2730{
2731 if (HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2732 MPAM mpam2 = tc->readMiscReg(MISCREG_MPAM2_EL2);
2733 MPAM mpam3 = tc->readMiscReg(MISCREG_MPAM3_EL3);
2734 if (ArmSystem::haveEL(tc, EL3) && mpam3.el3.trapLower) {
2735 return inst.generateTrap(EL3);
2736 } else if (EL2Enabled(tc) && mpam2.el2.enMpamSm) {
2737 return inst.generateTrap(EL2);
2738 } else {
2739 return NoFault;
2740 }
2741 } else {
2742 return inst.undefined();
2743 }
2744}
2745
2746}
2747
2749decodeAArch64SysReg(unsigned op0, unsigned op1,
2750 unsigned crn, unsigned crm,
2751 unsigned op2)
2752{
2753 MiscRegNum64 sys_reg(op0, op1, crn, crm, op2);
2754 return decodeAArch64SysReg(sys_reg);
2755}
2756
2759{
2760 auto it = miscRegNumToIdx.find(sys_reg);
2761 if (it != miscRegNumToIdx.end()) {
2762 return it->second;
2763 } else {
2764 // Check for a pseudo register before returning MISCREG_UNKNOWN
2765 if ((sys_reg.op0 == 1 || sys_reg.op0 == 3) &&
2766 (sys_reg.crn == 11 || sys_reg.crn == 15)) {
2767 return MISCREG_IMPDEF_UNIMPL;
2768 } else {
2769 return MISCREG_UNKNOWN;
2770 }
2771 }
2772}
2773
2774std::optional<MiscRegNum64>
2776{
2777 if (auto it = idxToMiscRegNum.find(misc_reg);
2778 it != idxToMiscRegNum.end()) {
2779 return it->second;
2780 } else {
2781 return std::nullopt;
2782 }
2783}
2784
2785Fault
2787 const MiscRegOp64 &inst, ExceptionLevel el)
2788{
2789 return !inst.miscRead() ? faultWrite[el](*this, tc, inst) :
2790 faultRead[el](*this, tc, inst);
2791}
2792
2793template <MiscRegInfo Sec, MiscRegInfo NonSec>
2794Fault
2796 ThreadContext *tc, const MiscRegOp64 &inst)
2797{
2798 if (isSecureBelowEL3(tc) ? entry.info[Sec] : entry.info[NonSec]) {
2799 return NoFault;
2800 } else {
2801 return inst.undefined();
2802 }
2803}
2804
2805static Fault
2807 ThreadContext *tc, const MiscRegOp64 &inst)
2808{
2809 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2810 if (hcr.e2h) {
2811 return NoFault;
2812 } else {
2813 return inst.undefined();
2814 }
2815}
2816
2817static Fault
2819 ThreadContext *tc, const MiscRegOp64 &inst)
2820{
2821 const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
2822 const bool el2_host = EL2Enabled(tc) && hcr.e2h;
2823 if (el2_host) {
2824 return NoFault;
2825 } else {
2826 return inst.undefined();
2827 }
2828}
2829
2832{
2833 switch (FullSystem ? sys->highestEL() : EL1) {
2834 case EL0:
2835 case EL1: priv(); break;
2836 case EL2: hyp(); break;
2837 case EL3: mon(); break;
2838 }
2839 return *this;
2840}
2841
2842static CPSR
2844{
2845 CPSR cpsr = 0;
2846 if (!FullSystem) {
2847 cpsr.mode = MODE_USER;
2848 } else {
2849 switch (system->highestEL()) {
2850 // Set initial EL to highest implemented EL using associated stack
2851 // pointer (SP_ELx); set RVBAR_ELx to implementation defined reset
2852 // value
2853 case EL3:
2854 cpsr.mode = MODE_EL3H;
2855 break;
2856 case EL2:
2857 cpsr.mode = MODE_EL2H;
2858 break;
2859 case EL1:
2860 cpsr.mode = MODE_EL1H;
2861 break;
2862 default:
2863 panic("Invalid highest implemented exception level");
2864 break;
2865 }
2866
2867 // Initialize rest of CPSR
2868 cpsr.daif = 0xf; // Mask all interrupts
2869 cpsr.ss = 0;
2870 cpsr.il = 0;
2871 }
2872 return cpsr;
2873}
2874
2875void
2877{
2878 // the MiscReg metadata tables are shared across all instances of the
2879 // ISA object, so there's no need to initialize them multiple times.
2880 static bool completed = false;
2881 if (completed)
2882 return;
2883
2884 // This boolean variable specifies if the system is running in aarch32 at
2885 // EL3 (aarch32EL3 = true). It is false if EL3 is not implemented, or it
2886 // is running in aarch64 (aarch32EL3 = false)
2887 bool aarch32EL3 = release->has(ArmExtension::SECURITY) && !highestELIs64;
2888
2889 // Set Privileged Access Never on taking an exception to EL1 (Arm 8.1+),
2890 // unsupported
2891 bool SPAN = false;
2892
2893 // Implicit error synchronization event enable (Arm 8.2+), unsupported
2894 bool IESB = false;
2895
2896 // Load Multiple and Store Multiple Atomicity and Ordering (Arm 8.2+),
2897 // unsupported
2898 bool LSMAOE = false;
2899
2900 // No Trap Load Multiple and Store Multiple (Arm 8.2+), unsupported
2901 bool nTLSMD = false;
2902
2903 // Pointer authentication (Arm 8.3+), unsupported
2904 bool EnDA = true; // using APDAKey_EL1 key of instr addrs in ELs 0,1
2905 bool EnDB = true; // using APDBKey_EL1 key of instr addrs in ELs 0,1
2906 bool EnIA = true; // using APIAKey_EL1 key of instr addrs in ELs 0,1
2907 bool EnIB = true; // using APIBKey_EL1 key of instr addrs in ELs 0,1
2908
2909 const bool vhe_implemented = release->has(ArmExtension::FEAT_VHE);
2910 const bool sel2_implemented = release->has(ArmExtension::FEAT_SEL2);
2911
2912 const Params &p(params());
2913
2914 uint32_t midr;
2915 if (p.midr != 0x0)
2916 midr = p.midr;
2917 else if (highestELIs64)
2918 // Cortex-A57 TRM r0p0 MIDR
2919 midr = 0x410fd070;
2920 else
2921 // Cortex-A15 TRM r0p0 MIDR
2922 midr = 0x410fc0f0;
2923
2939 .allPrivileges();
2941 .allPrivileges();
2943 .allPrivileges();
2945 .allPrivileges();
2947 .allPrivileges();
2949 .allPrivileges();
2951 .allPrivileges();
2953 .allPrivileges();
2955 .allPrivileges();
2957 .allPrivileges();
2959 .reset(p.fpsid)
2960 .allPrivileges();
2962 .res0(mask(14, 13) | mask(6, 5))
2963 .allPrivileges();
2965 .reset([] () {
2966 MVFR1 mvfr1 = 0;
2967 mvfr1.flushToZero = 1;
2968 mvfr1.defaultNaN = 1;
2969 mvfr1.advSimdLoadStore = 1;
2970 mvfr1.advSimdInteger = 1;
2971 mvfr1.advSimdSinglePrecision = 1;
2972 mvfr1.advSimdHalfPrecision = 1;
2973 mvfr1.vfpHalfPrecision = 1;
2974 return mvfr1;
2975 }())
2976 .allPrivileges();
2978 .reset([] () {
2979 MVFR0 mvfr0 = 0;
2980 mvfr0.advSimdRegisters = 2;
2981 mvfr0.singlePrecision = 2;
2982 mvfr0.doublePrecision = 2;
2983 mvfr0.vfpExceptionTrapping = 0;
2984 mvfr0.divide = 1;
2985 mvfr0.squareRoot = 1;
2986 mvfr0.shortVectors = 1;
2987 mvfr0.roundingModes = 1;
2988 return mvfr0;
2989 }())
2990 .allPrivileges();
2992 .allPrivileges();
2993
2994 // Helper registers
2996 .allPrivileges();
2998 .allPrivileges();
3000 .allPrivileges();
3002 .allPrivileges();
3004 .allPrivileges();
3006 .allPrivileges();
3008 .mutex()
3009 .banked();
3011 .mutex()
3012 .privSecure(!aarch32EL3)
3013 .bankedChild();
3015 .mutex()
3016 .bankedChild();
3018 .mutex()
3019 .banked();
3021 .mutex()
3022 .privSecure(!aarch32EL3)
3023 .bankedChild();
3025 .mutex()
3026 .bankedChild();
3028 .mutex();
3030 .reset(1) // Start with an event in the mailbox
3031 .allPrivileges();
3034
3035 // AArch32 CP14 registers
3037 .reset(0x6 << 16) // Armv8 Debug architecture
3042 .unimplemented()
3043 .allPrivileges();
3045 .unimplemented()
3046 .allPrivileges();
3048 .unimplemented()
3049 .allPrivileges();
3051 .unimplemented()
3052 .allPrivileges();
3056 .unimplemented()
3057 .allPrivileges();
3059 .allPrivileges();
3061 .unimplemented()
3062 .allPrivileges();
3064 .unimplemented()
3065 .allPrivileges();
3195 .unimplemented()
3236 .unimplemented()
3237 .warnNotFail()
3238 .allPrivileges();
3240 .unimplemented()
3241 .allPrivileges();
3243 .unimplemented()
3246 .unimplemented()
3247 .allPrivileges();
3249 .unimplemented()
3250 .allPrivileges();
3252 .unimplemented()
3255 .unimplemented()
3258 .unimplemented()
3263 .unimplemented()
3264 .allPrivileges();
3266 .raz() // Jazelle trivial implementation, RAZ/WI
3267 .allPrivileges();
3269 .allPrivileges();
3271 .raz() // Jazelle trivial implementation, RAZ/WI
3272 .allPrivileges();
3274 .raz() // Jazelle trivial implementation, RAZ/WI
3275 .allPrivileges();
3276
3277 // AArch32 CP15 registers
3279 .reset(midr)
3282 .reset([system=p.system](){
3283 //all caches have the same line size in gem5
3284 //4 byte words in ARM
3285 unsigned line_size_words =
3286 system->cacheLineSize() / 4;
3287 unsigned log2_line_size_words = 0;
3288
3289 while (line_size_words >>= 1) {
3290 ++log2_line_size_words;
3291 }
3292
3293 CTR ctr = 0;
3294 //log2 of minimun i-cache line size (words)
3295 ctr.iCacheLineSize = log2_line_size_words;
3296 //b11 - gem5 uses pipt
3297 ctr.l1IndexPolicy = 0x3;
3298 //log2 of minimum d-cache line size (words)
3299 ctr.dCacheLineSize = log2_line_size_words;
3300 //log2 of max reservation size (words)
3301 ctr.erg = log2_line_size_words;
3302 //log2 of max writeback size (words)
3303 ctr.cwg = log2_line_size_words;
3304 //b100 - gem5 format is ARMv7
3305 ctr.format = 0x4;
3306
3307 return ctr;
3308 }())
3309 .unserialize(0)
3311 InitReg(MISCREG_TCMTR)
3312 .raz() // No TCM's
3314 InitReg(MISCREG_TLBTR)
3315 .reset(1) // Separate Instruction and Data TLBs
3317 InitReg(MISCREG_MPIDR)
3318 .reset(0x80000000)
3320 InitReg(MISCREG_REVIDR)
3321 .unimplemented()
3322 .warnNotFail()
3324 InitReg(MISCREG_ID_PFR0)
3325 .reset(0x00000031) // !ThumbEE | !Jazelle | Thumb | ARM
3327 InitReg(MISCREG_ID_PFR1)
3328 .reset([release=release,system=system](){
3329 // Timer | Virti | !M Profile | TrustZone | ARMv4
3330 bool have_timer = (system && system->getGenericTimer() != nullptr);
3331 return 0x00000001 |
3332 (release->has(ArmExtension::SECURITY) ?
3333 0x00000010 : 0x0) |
3334 (release->has(ArmExtension::VIRTUALIZATION) ?
3335 0x00001000 : 0x0) |
3336 (have_timer ? 0x00010000 : 0x0);
3337 }())
3338 .unserialize(0)
3340 InitReg(MISCREG_ID_DFR0)
3341 .reset(p.pmu ? 0x03000000 : 0)
3342 .allPrivileges().exceptUserMode().writes(0);
3343 InitReg(MISCREG_ID_AFR0)
3345 InitReg(MISCREG_ID_MMFR0)
3346 .reset([p,release=release](){
3347 RegVal mmfr0 = p.id_mmfr0;
3348 if (release->has(ArmExtension::LPAE))
3349 mmfr0 = (mmfr0 & ~0xf) | 0x5;
3350 return mmfr0;
3351 }())
3353 InitReg(MISCREG_ID_MMFR1)
3354 .reset(p.id_mmfr1)
3356 InitReg(MISCREG_ID_MMFR2)
3357 .reset(p.id_mmfr2)
3359 InitReg(MISCREG_ID_MMFR3)
3360 .reset(p.id_mmfr3)
3362 InitReg(MISCREG_ID_MMFR4)
3363 .reset(p.id_mmfr4)
3365 InitReg(MISCREG_ID_ISAR0)
3366 .reset(p.id_isar0)
3368 InitReg(MISCREG_ID_ISAR1)
3369 .reset(p.id_isar1)
3371 InitReg(MISCREG_ID_ISAR2)
3372 .reset(p.id_isar2)
3374 InitReg(MISCREG_ID_ISAR3)
3375 .reset(p.id_isar3)
3377 InitReg(MISCREG_ID_ISAR4)
3378 .reset(p.id_isar4)
3380 InitReg(MISCREG_ID_ISAR5)
3381 .reset([p,release=release] () {
3382 ISAR5 isar5 = p.id_isar5;
3383 isar5.crc32 = release->has(ArmExtension::FEAT_CRC32) ? 0x1 : 0x0;
3384 isar5.sha2 = release->has(ArmExtension::FEAT_SHA256) ? 0x1 : 0x0;
3385 isar5.sha1 = release->has(ArmExtension::FEAT_SHA1) ? 0x1 : 0x0;
3386 isar5.aes = release->has(ArmExtension::FEAT_PMULL) ?
3387 0x2 : release->has(ArmExtension::FEAT_AES) ?
3388 0x1 : 0x0;
3389 isar5.rdm = release->has(ArmExtension::FEAT_RDM) ? 0x1 : 0x0;
3390 isar5.vcma = release->has(ArmExtension::FEAT_FCMA) ? 0x1 : 0x0;
3391 return isar5;
3392 }())
3394 InitReg(MISCREG_ID_ISAR6)
3395 .reset([p,release=release] () {
3396 ISAR6 isar6 = p.id_isar6;
3397 isar6.jscvt = release->has(ArmExtension::FEAT_JSCVT) ? 0x1 : 0x0;
3398 return isar6;
3399 }())
3401 InitReg(MISCREG_CCSIDR)
3403 InitReg(MISCREG_CLIDR)
3405 InitReg(MISCREG_AIDR)
3406 .raz() // AUX ID set to 0
3408 InitReg(MISCREG_CSSELR)
3409 .banked();
3410 InitReg(MISCREG_CSSELR_NS)
3411 .bankedChild()
3412 .privSecure(!aarch32EL3)
3414 InitReg(MISCREG_CSSELR_S)
3415 .bankedChild()
3417 InitReg(MISCREG_VPIDR)
3418 .reset(midr)
3419 .hyp().monNonSecure();
3420 InitReg(MISCREG_VMPIDR)
3421 .res1(mask(31, 31))
3422 .hyp().monNonSecure();
3423 InitReg(MISCREG_SCTLR)
3424 .banked()
3425 // readMiscRegNoEffect() uses this metadata
3426 // despite using children (below) as backing store
3427 .res0(0x8d22c600)
3428 .res1(0x00400800 | (SPAN ? 0 : 0x800000)
3429 | (LSMAOE ? 0 : 0x10)
3430 | (nTLSMD ? 0 : 0x8));
3431
3432 auto sctlr_reset = [aarch64=highestELIs64] ()
3433 {
3434 SCTLR sctlr = 0;
3435 if (aarch64) {
3436 sctlr.afe = 1;
3437 sctlr.tre = 1;
3438 sctlr.span = 1;
3439 sctlr.uwxn = 1;
3440 sctlr.ntwe = 1;
3441 sctlr.ntwi = 1;
3442 sctlr.cp15ben = 1;
3443 sctlr.sa0 = 1;
3444 } else {
3445 sctlr.u = 1;
3446 sctlr.xp = 1;
3447 sctlr.uci = 1;
3448 sctlr.dze = 1;
3449 sctlr.rao2 = 1;
3450 sctlr.rao3 = 1;
3451 sctlr.rao4 = 0xf;
3452 }
3453 return sctlr;
3454 }();
3455 InitReg(MISCREG_SCTLR_NS)
3456 .reset(sctlr_reset)
3457 .bankedChild()
3458 .privSecure(!aarch32EL3)
3460 InitReg(MISCREG_SCTLR_S)
3461 .reset(sctlr_reset)
3462 .bankedChild()
3464 InitReg(MISCREG_ACTLR)
3465 .banked();
3466 InitReg(MISCREG_ACTLR_NS)
3467 .bankedChild()
3468 .privSecure(!aarch32EL3)
3470 InitReg(MISCREG_ACTLR_S)
3471 .bankedChild()
3473 InitReg(MISCREG_CPACR)
3475 InitReg(MISCREG_SDCR)
3476 .mon();
3477 InitReg(MISCREG_SCR)
3478 .reset(release->has(ArmExtension::SECURITY) ? 0 : 1)
3479 .mon().secure().exceptUserMode()
3480 .res0(0xff40) // [31:16], [6]
3481 .res1(0x0030); // [5:4]
3482 InitReg(MISCREG_SDER)
3483 .mon();
3484 InitReg(MISCREG_NSACR)
3486 InitReg(MISCREG_HSCTLR)
3487 .reset(0x30c50830)
3488 .hyp().monNonSecure()
3489 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
3490 | (IESB ? 0 : 0x200000)
3491 | (EnDA ? 0 : 0x8000000)
3492 | (EnIB ? 0 : 0x40000000)
3493 | (EnIA ? 0 : 0x80000000))
3494 .res1(0x30c50830);
3495 InitReg(MISCREG_HACTLR)
3496 .hyp().monNonSecure();
3497 InitReg(MISCREG_HCR)
3498 .hyp().monNonSecure()
3499 .res0(release->has(ArmExtension::VIRTUALIZATION) ?
3500 0x90000000 : mask(31, 0));
3501 InitReg(MISCREG_HCR2)
3502 .hyp().monNonSecure()
3503 .res0(release->has(ArmExtension::VIRTUALIZATION) ?
3504 0xffa9ff8c : mask(31, 0));
3505 InitReg(MISCREG_HDCR)
3506 .hyp().monNonSecure();
3507 InitReg(MISCREG_HCPTR)
3508 .res0(mask(29, 21) | mask(19, 16) | mask(14, 14))
3509 .res1(mask(13, 12) | mask(9, 0))
3510 .hyp().monNonSecure();
3511 InitReg(MISCREG_HSTR)
3512 .hyp().monNonSecure();
3513 InitReg(MISCREG_HACR)
3514 .unimplemented()
3515 .warnNotFail()
3516 .hyp().monNonSecure();
3517 InitReg(MISCREG_TTBR0)
3518 .banked();
3519 InitReg(MISCREG_TTBR0_NS)
3520 .bankedChild()
3521 .privSecure(!aarch32EL3)
3523 InitReg(MISCREG_TTBR0_S)
3524 .bankedChild()
3526 InitReg(MISCREG_TTBR1)
3527 .banked();
3528 InitReg(MISCREG_TTBR1_NS)
3529 .bankedChild()
3530 .privSecure(!aarch32EL3)
3532 InitReg(MISCREG_TTBR1_S)
3533 .bankedChild()
3535 InitReg(MISCREG_TTBCR)
3536 .banked();
3537 InitReg(MISCREG_TTBCR_NS)
3538 .bankedChild()
3539 .privSecure(!aarch32EL3)
3541 InitReg(MISCREG_TTBCR_S)
3542 .bankedChild()
3544 InitReg(MISCREG_HTCR)
3545 .hyp().monNonSecure();
3546 InitReg(MISCREG_VTCR)
3547 .hyp().monNonSecure();
3548 InitReg(MISCREG_DACR)
3549 .banked();
3550 InitReg(MISCREG_DACR_NS)
3551 .bankedChild()
3552 .privSecure(!aarch32EL3)
3554 InitReg(MISCREG_DACR_S)
3555 .bankedChild()
3557 InitReg(MISCREG_DFSR)
3558 .banked()
3559 .res0(mask(31, 14) | mask(8, 8));
3560 InitReg(MISCREG_DFSR_NS)
3561 .bankedChild()
3562 .privSecure(!aarch32EL3)
3564 InitReg(MISCREG_DFSR_S)
3565 .bankedChild()
3567 InitReg(MISCREG_IFSR)
3568 .banked()
3569 .res0(mask(31, 13) | mask(11, 11) | mask(8, 6));
3570 InitReg(MISCREG_IFSR_NS)
3571 .bankedChild()
3572 .privSecure(!aarch32EL3)
3574 InitReg(MISCREG_IFSR_S)
3575 .bankedChild()
3577 InitReg(MISCREG_ADFSR)
3578 .unimplemented()
3579 .warnNotFail()
3580 .banked();
3581 InitReg(MISCREG_ADFSR_NS)
3582 .unimplemented()
3583 .warnNotFail()
3584 .bankedChild()
3585 .privSecure(!aarch32EL3)
3587 InitReg(MISCREG_ADFSR_S)
3588 .unimplemented()
3589 .warnNotFail()
3590 .bankedChild()
3592 InitReg(MISCREG_AIFSR)
3593 .unimplemented()
3594 .warnNotFail()
3595 .banked();
3596 InitReg(MISCREG_AIFSR_NS)
3597 .unimplemented()
3598 .warnNotFail()
3599 .bankedChild()
3600 .privSecure(!aarch32EL3)
3602 InitReg(MISCREG_AIFSR_S)
3603 .unimplemented()
3604 .warnNotFail()
3605 .bankedChild()
3607 InitReg(MISCREG_HADFSR)
3608 .hyp().monNonSecure();
3609 InitReg(MISCREG_HAIFSR)
3610 .hyp().monNonSecure();
3611 InitReg(MISCREG_HSR)
3612 .hyp().monNonSecure();
3613 InitReg(MISCREG_DFAR)
3614 .banked();
3615 InitReg(MISCREG_DFAR_NS)
3616 .bankedChild()
3617 .privSecure(!aarch32EL3)
3619 InitReg(MISCREG_DFAR_S)
3620 .bankedChild()
3622 InitReg(MISCREG_IFAR)
3623 .banked();
3624 InitReg(MISCREG_IFAR_NS)
3625 .bankedChild()
3626 .privSecure(!aarch32EL3)
3628 InitReg(MISCREG_IFAR_S)
3629 .bankedChild()
3631 InitReg(MISCREG_HDFAR)
3632 .hyp().monNonSecure();
3633 InitReg(MISCREG_HIFAR)
3634 .hyp().monNonSecure();
3635 InitReg(MISCREG_HPFAR)
3636 .hyp().monNonSecure();
3637 InitReg(MISCREG_ICIALLUIS)
3638 .unimplemented()
3639 .warnNotFail()
3640 .writes(1).exceptUserMode();
3641 InitReg(MISCREG_BPIALLIS)
3642 .unimplemented()
3643 .warnNotFail()
3644 .writes(1).exceptUserMode();
3645 InitReg(MISCREG_PAR)
3646 .banked();
3647 InitReg(MISCREG_PAR_NS)
3648 .bankedChild()
3649 .privSecure(!aarch32EL3)
3651 InitReg(MISCREG_PAR_S)
3652 .bankedChild()
3654 InitReg(MISCREG_ICIALLU)
3655 .writes(1).exceptUserMode();
3656 InitReg(MISCREG_ICIMVAU)
3657 .unimplemented()
3658 .warnNotFail()
3659 .writes(1).exceptUserMode();
3660 InitReg(MISCREG_CP15ISB)
3661 .writes(1);
3662 InitReg(MISCREG_BPIALL)
3663 .unimplemented()
3664 .warnNotFail()
3665 .writes(1).exceptUserMode();
3666 InitReg(MISCREG_BPIMVA)
3667 .unimplemented()
3668 .warnNotFail()
3669 .writes(1).exceptUserMode();
3670 InitReg(MISCREG_DCIMVAC)
3671 .unimplemented()
3672 .warnNotFail()
3673 .writes(1).exceptUserMode();
3674 InitReg(MISCREG_DCISW)
3675 .unimplemented()
3676 .warnNotFail()
3677 .writes(1).exceptUserMode();
3678 InitReg(MISCREG_ATS1CPR)
3679 .writes(1).exceptUserMode();
3680 InitReg(MISCREG_ATS1CPW)
3681 .writes(1).exceptUserMode();
3682 InitReg(MISCREG_ATS1CUR)
3683 .writes(1).exceptUserMode();
3684 InitReg(MISCREG_ATS1CUW)
3685 .writes(1).exceptUserMode();
3686 InitReg(MISCREG_ATS12NSOPR)
3688 InitReg(MISCREG_ATS12NSOPW)
3690 InitReg(MISCREG_ATS12NSOUR)
3692 InitReg(MISCREG_ATS12NSOUW)
3694 InitReg(MISCREG_DCCMVAC)
3695 .writes(1).exceptUserMode();
3696 InitReg(MISCREG_DCCSW)
3697 .unimplemented()
3698 .warnNotFail()
3699 .writes(1).exceptUserMode();
3700 InitReg(MISCREG_CP15DSB)
3701 .writes(1);
3702 InitReg(MISCREG_CP15DMB)
3703 .writes(1);
3704 InitReg(MISCREG_DCCMVAU)
3705 .unimplemented()
3706 .warnNotFail()
3707 .writes(1).exceptUserMode();
3708 InitReg(MISCREG_DCCIMVAC)
3709 .unimplemented()
3710 .warnNotFail()
3711 .writes(1).exceptUserMode();
3712 InitReg(MISCREG_DCCISW)
3713 .unimplemented()
3714 .warnNotFail()
3715 .writes(1).exceptUserMode();
3716 InitReg(MISCREG_ATS1HR)
3718 InitReg(MISCREG_ATS1HW)
3720 InitReg(MISCREG_TLBIALLIS)
3721 .writes(1).exceptUserMode();
3722 InitReg(MISCREG_TLBIMVAIS)
3723 .writes(1).exceptUserMode();
3724 InitReg(MISCREG_TLBIASIDIS)
3725 .writes(1).exceptUserMode();
3726 InitReg(MISCREG_TLBIMVAAIS)
3727 .writes(1).exceptUserMode();
3728 InitReg(MISCREG_TLBIMVALIS)
3729 .writes(1).exceptUserMode();
3730 InitReg(MISCREG_TLBIMVAALIS)
3731 .writes(1).exceptUserMode();
3732 InitReg(MISCREG_ITLBIALL)
3733 .writes(1).exceptUserMode();
3734 InitReg(MISCREG_ITLBIMVA)
3735 .writes(1).exceptUserMode();
3736 InitReg(MISCREG_ITLBIASID)
3737 .writes(1).exceptUserMode();
3738 InitReg(MISCREG_DTLBIALL)
3739 .writes(1).exceptUserMode();
3740 InitReg(MISCREG_DTLBIMVA)
3741 .writes(1).exceptUserMode();
3742 InitReg(MISCREG_DTLBIASID)
3743 .writes(1).exceptUserMode();
3744 InitReg(MISCREG_TLBIALL)
3745 .writes(1).exceptUserMode();
3746 InitReg(MISCREG_TLBIMVA)
3747 .writes(1).exceptUserMode();
3748 InitReg(MISCREG_TLBIASID)
3749 .writes(1).exceptUserMode();
3750 InitReg(MISCREG_TLBIMVAA)
3751 .writes(1).exceptUserMode();
3752 InitReg(MISCREG_TLBIMVAL)
3753 .writes(1).exceptUserMode();
3754 InitReg(MISCREG_TLBIMVAAL)
3755 .writes(1).exceptUserMode();
3756 InitReg(MISCREG_TLBIIPAS2IS)
3758 InitReg(MISCREG_TLBIIPAS2LIS)
3760 InitReg(MISCREG_TLBIALLHIS)
3762 InitReg(MISCREG_TLBIMVAHIS)
3764 InitReg(MISCREG_TLBIALLNSNHIS)
3766 InitReg(MISCREG_TLBIMVALHIS)
3768 InitReg(MISCREG_TLBIIPAS2)
3770 InitReg(MISCREG_TLBIIPAS2L)
3772 InitReg(MISCREG_TLBIALLH)
3774 InitReg(MISCREG_TLBIMVAH)
3776 InitReg(MISCREG_TLBIALLNSNH)
3778 InitReg(MISCREG_TLBIMVALH)
3780 InitReg(MISCREG_PMCR)
3781 .allPrivileges();
3782 InitReg(MISCREG_PMCNTENSET)
3783 .allPrivileges();
3784 InitReg(MISCREG_PMCNTENCLR)
3785 .allPrivileges();
3786 InitReg(MISCREG_PMOVSR)
3787 .allPrivileges();
3788 InitReg(MISCREG_PMSWINC)
3789 .allPrivileges();
3790 InitReg(MISCREG_PMSELR)
3791 .allPrivileges();
3792 InitReg(MISCREG_PMCEID0)
3793 .allPrivileges();
3794 InitReg(MISCREG_PMCEID1)
3795 .allPrivileges();
3796 InitReg(MISCREG_PMCCNTR)
3797 .allPrivileges();
3798 InitReg(MISCREG_PMXEVTYPER)
3799 .allPrivileges();
3800 InitReg(MISCREG_PMCCFILTR)
3801 .allPrivileges();
3802 InitReg(MISCREG_PMXEVCNTR)
3803 .allPrivileges();
3804 InitReg(MISCREG_PMUSERENR)
3806 InitReg(MISCREG_PMINTENSET)
3808 InitReg(MISCREG_PMINTENCLR)
3810 InitReg(MISCREG_PMOVSSET)
3811 .unimplemented()
3812 .allPrivileges();
3813 InitReg(MISCREG_L2CTLR)
3815 InitReg(MISCREG_L2ECTLR)
3816 .unimplemented()
3818 InitReg(MISCREG_PRRR)
3819 .banked();
3820 InitReg(MISCREG_PRRR_NS)
3821 .bankedChild()
3822 .reset(
3823 (1 << 19) | // 19
3824 (0 << 18) | // 18
3825 (0 << 17) | // 17
3826 (1 << 16) | // 16
3827 (2 << 14) | // 15:14
3828 (0 << 12) | // 13:12
3829 (2 << 10) | // 11:10
3830 (2 << 8) | // 9:8
3831 (2 << 6) | // 7:6
3832 (2 << 4) | // 5:4
3833 (1 << 2) | // 3:2
3834 0)
3835 .privSecure(!aarch32EL3)
3837 InitReg(MISCREG_PRRR_S)
3838 .bankedChild()
3840 InitReg(MISCREG_MAIR0)
3841 .banked();
3842 InitReg(MISCREG_MAIR0_NS)
3843 .bankedChild()
3844 .privSecure(!aarch32EL3)
3846 InitReg(MISCREG_MAIR0_S)
3847 .bankedChild()
3849 InitReg(MISCREG_NMRR)
3850 .banked();
3851 InitReg(MISCREG_NMRR_NS)
3852 .bankedChild()
3853 .reset(
3854 (1 << 30) | // 31:30
3855 (0 << 26) | // 27:26
3856 (0 << 24) | // 25:24
3857 (3 << 22) | // 23:22
3858 (2 << 20) | // 21:20
3859 (0 << 18) | // 19:18
3860 (0 << 16) | // 17:16
3861 (1 << 14) | // 15:14
3862 (0 << 12) | // 13:12
3863 (2 << 10) | // 11:10
3864 (0 << 8) | // 9:8
3865 (3 << 6) | // 7:6
3866 (2 << 4) | // 5:4
3867 (0 << 2) | // 3:2
3868 0)
3869 .privSecure(!aarch32EL3)
3871 InitReg(MISCREG_NMRR_S)
3872 .bankedChild()
3874 InitReg(MISCREG_MAIR1)
3875 .banked();
3876 InitReg(MISCREG_MAIR1_NS)
3877 .bankedChild()
3878 .privSecure(!aarch32EL3)
3880 InitReg(MISCREG_MAIR1_S)
3881 .bankedChild()
3883 InitReg(MISCREG_AMAIR0)
3884 .res0(release->has(ArmExtension::LPAE) ? 0 : mask(31, 0))
3885 .banked();
3886 InitReg(MISCREG_AMAIR0_NS)
3887 .bankedChild()
3888 .privSecure(!aarch32EL3)
3890 InitReg(MISCREG_AMAIR0_S)
3891 .bankedChild()
3893 InitReg(MISCREG_AMAIR1)
3894 .res0(release->has(ArmExtension::LPAE) ? 0 : mask(31, 0))
3895 .banked();
3896 InitReg(MISCREG_AMAIR1_NS)
3897 .bankedChild()
3898 .privSecure(!aarch32EL3)
3900 InitReg(MISCREG_AMAIR1_S)
3901 .bankedChild()
3903 InitReg(MISCREG_HMAIR0)
3904 .hyp().monNonSecure();
3905 InitReg(MISCREG_HMAIR1)
3906 .hyp().monNonSecure();
3907 InitReg(MISCREG_HAMAIR0)
3908 .unimplemented()
3909 .warnNotFail()
3910 .hyp().monNonSecure();
3911 InitReg(MISCREG_HAMAIR1)
3912 .unimplemented()
3913 .warnNotFail()
3914 .hyp().monNonSecure();
3915 InitReg(MISCREG_VBAR)
3916 .banked();
3917 InitReg(MISCREG_VBAR_NS)
3918 .bankedChild()
3919 .privSecure(!aarch32EL3)
3921 InitReg(MISCREG_VBAR_S)
3922 .bankedChild()
3924 InitReg(MISCREG_MVBAR)
3925 .reset(FullSystem ? system->resetAddr() : 0)
3926 .mon().secure()
3927 .hypRead(FullSystem && system->highestEL() == EL2)
3928 .privRead(FullSystem && system->highestEL() == EL1)
3929 .exceptUserMode();
3930 InitReg(MISCREG_RMR)
3931 .unimplemented()
3932 .mon().secure().exceptUserMode();
3933 InitReg(MISCREG_ISR)
3935 InitReg(MISCREG_HVBAR)
3936 .hyp().monNonSecure()
3937 .res0(0x1f);
3938 InitReg(MISCREG_FCSEIDR)
3939 .unimplemented()
3940 .warnNotFail()
3942 InitReg(MISCREG_CONTEXTIDR)
3943 .banked();
3944 InitReg(MISCREG_CONTEXTIDR_NS)
3945 .bankedChild()
3946 .privSecure(!aarch32EL3)
3948 InitReg(MISCREG_CONTEXTIDR_S)
3949 .bankedChild()
3951 InitReg(MISCREG_TPIDRURW)
3952 .banked();
3953 InitReg(MISCREG_TPIDRURW_NS)
3954 .bankedChild()
3955 .allPrivileges()
3956 .privSecure(!aarch32EL3)
3957 .monSecure(0);
3958 InitReg(MISCREG_TPIDRURW_S)
3959 .bankedChild()
3960 .secure();
3961 InitReg(MISCREG_TPIDRURO)
3962 .banked();
3963 InitReg(MISCREG_TPIDRURO_NS)
3964 .bankedChild()
3965 .allPrivileges()
3967 .privSecure(!aarch32EL3)
3968 .monSecure(0);
3969 InitReg(MISCREG_TPIDRURO_S)
3970 .bankedChild()
3971 .secure().userSecureWrite(0);
3972 InitReg(MISCREG_TPIDRPRW)
3973 .banked();
3974 InitReg(MISCREG_TPIDRPRW_NS)
3975 .bankedChild()
3977 .privSecure(!aarch32EL3);
3978 InitReg(MISCREG_TPIDRPRW_S)
3979 .bankedChild()
3981 InitReg(MISCREG_HTPIDR)
3982 .hyp().monNonSecure();
3983 // BEGIN Generic Timer (AArch32)
3984 InitReg(MISCREG_CNTFRQ)
3985 .reads(1)
3986 .highest(system)
3987 .privSecureWrite(aarch32EL3);
3988 InitReg(MISCREG_CNTPCT)
3989 .unverifiable()
3990 .reads(1);
3991 InitReg(MISCREG_CNTVCT)
3992 .unverifiable()
3993 .reads(1);
3994 InitReg(MISCREG_CNTP_CTL)
3995 .banked();
3996 InitReg(MISCREG_CNTP_CTL_NS)
3997 .bankedChild()
3998 .nonSecure()
3999 .privSecure(!aarch32EL3)
4000 .userSecureRead(!aarch32EL3)
4001 .userSecureWrite(!aarch32EL3)
4002 .res0(0xfffffff8);
4003 InitReg(MISCREG_CNTP_CTL_S)
4004 .bankedChild()
4005 .secure()
4006 .privSecure(aarch32EL3)
4007 .res0(0xfffffff8);
4008 InitReg(MISCREG_CNTP_CVAL)
4009 .banked();
4010 InitReg(MISCREG_CNTP_CVAL_NS)
4011 .bankedChild()
4012 .nonSecure()
4013 .privSecure(!aarch32EL3)
4014 .userSecureRead(!aarch32EL3)
4015 .userSecureWrite(!aarch32EL3);
4016 InitReg(MISCREG_CNTP_CVAL_S)
4017 .bankedChild()
4018 .secure()
4019 .privSecure(aarch32EL3);
4020 InitReg(MISCREG_CNTP_TVAL)
4021 .banked();
4022 InitReg(MISCREG_CNTP_TVAL_NS)
4023 .bankedChild()
4024 .nonSecure()
4025 .privSecure(!aarch32EL3)
4026 .userSecureRead(!aarch32EL3)
4027 .userSecureWrite(!aarch32EL3);
4028 InitReg(MISCREG_CNTP_TVAL_S)
4029 .bankedChild()
4030 .secure()
4031 .privSecure(aarch32EL3);
4032 InitReg(MISCREG_CNTV_CTL)
4033 .allPrivileges()
4034 .res0(0xfffffff8);
4035 InitReg(MISCREG_CNTV_CVAL)
4036 .allPrivileges();
4037 InitReg(MISCREG_CNTV_TVAL)
4038 .allPrivileges();
4039 InitReg(MISCREG_CNTKCTL)
4040 .allPrivileges()
4042 .res0(0xfffdfc00);
4043 InitReg(MISCREG_CNTHCTL)
4044 .monNonSecure()
4045 .hyp()
4046 .res0(0xfffdff00);
4047 InitReg(MISCREG_CNTHP_CTL)
4048 .monNonSecure()
4049 .hyp()
4050 .res0(0xfffffff8);
4051 InitReg(MISCREG_CNTHP_CVAL)
4052 .monNonSecure()
4053 .hyp();
4054 InitReg(MISCREG_CNTHP_TVAL)
4055 .monNonSecure()
4056 .hyp();
4057 InitReg(MISCREG_CNTVOFF)
4058 .monNonSecure()
4059 .hyp();
4060 // END Generic Timer (AArch32)
4061 InitReg(MISCREG_IL1DATA0)
4062 .unimplemented()
4064 InitReg(MISCREG_IL1DATA1)
4065 .unimplemented()
4067 InitReg(MISCREG_IL1DATA2)
4068 .unimplemented()
4070 InitReg(MISCREG_IL1DATA3)
4071 .unimplemented()
4073 InitReg(MISCREG_DL1DATA0)
4074 .unimplemented()
4076 InitReg(MISCREG_DL1DATA1)
4077 .unimplemented()
4079 InitReg(MISCREG_DL1DATA2)
4080 .unimplemented()
4082 InitReg(MISCREG_DL1DATA3)
4083 .unimplemented()
4085 InitReg(MISCREG_DL1DATA4)
4086 .unimplemented()
4088 InitReg(MISCREG_RAMINDEX)
4089 .unimplemented()
4090 .writes(1).exceptUserMode();
4091 InitReg(MISCREG_L2ACTLR)
4092 .unimplemented()
4094 InitReg(MISCREG_CBAR)
4095 .unimplemented()
4097 InitReg(MISCREG_HTTBR)
4098 .hyp().monNonSecure();
4099 InitReg(MISCREG_VTTBR)
4100 .hyp().monNonSecure();
4101 InitReg(MISCREG_CPUMERRSR)
4102 .unimplemented()
4104 InitReg(MISCREG_L2MERRSR)
4105 .unimplemented()
4106 .warnNotFail()
4108
4109 // AArch64 registers (Op0=2);
4110 InitReg(MISCREG_MDCCINT_EL1)
4111 .fault(EL1, faultMdccsrEL1)
4112 .fault(EL2, faultMdccsrEL2)
4114 InitReg(MISCREG_OSDTRRX_EL1)
4117 InitReg(MISCREG_MDSCR_EL1)
4119 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::mdscrEL1>)
4120 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::mdscrEL1>)
4121 .fault(EL2, faultDebugEL2)
4123 InitReg(MISCREG_OSDTRTX_EL1)
4126 InitReg(MISCREG_OSECCR_EL1)
4128 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::oseccrEL1>)
4129 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::oseccrEL1>)
4130 .fault(EL2, faultDebugEL2)
4132 InitReg(MISCREG_DBGBVR0_EL1)
4134 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4135 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4136 .fault(EL2, faultDebugEL2)
4138 InitReg(MISCREG_DBGBVR1_EL1)
4140 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4141 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4142 .fault(EL2, faultDebugEL2)
4144 InitReg(MISCREG_DBGBVR2_EL1)
4146 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4147 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4148 .fault(EL2, faultDebugEL2)
4150 InitReg(MISCREG_DBGBVR3_EL1)
4152 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4153 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4154 .fault(EL2, faultDebugEL2)
4156 InitReg(MISCREG_DBGBVR4_EL1)
4158 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4159 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4160 .fault(EL2, faultDebugEL2)
4162 InitReg(MISCREG_DBGBVR5_EL1)
4164 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4165 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4166 .fault(EL2, faultDebugEL2)
4168 InitReg(MISCREG_DBGBVR6_EL1)
4170 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4171 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4172 .fault(EL2, faultDebugEL2)
4174 InitReg(MISCREG_DBGBVR7_EL1)
4176 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4177 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4178 .fault(EL2, faultDebugEL2)
4180 InitReg(MISCREG_DBGBVR8_EL1)
4182 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4183 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4184 .fault(EL2, faultDebugEL2)
4186 InitReg(MISCREG_DBGBVR9_EL1)
4188 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4189 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4190 .fault(EL2, faultDebugEL2)
4192 InitReg(MISCREG_DBGBVR10_EL1)
4194 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4195 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4196 .fault(EL2, faultDebugEL2)
4198 InitReg(MISCREG_DBGBVR11_EL1)
4200 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4201 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4202 .fault(EL2, faultDebugEL2)
4204 InitReg(MISCREG_DBGBVR12_EL1)
4206 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4207 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4208 .fault(EL2, faultDebugEL2)
4210 InitReg(MISCREG_DBGBVR13_EL1)
4212 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4213 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4214 .fault(EL2, faultDebugEL2)
4216 InitReg(MISCREG_DBGBVR14_EL1)
4218 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4219 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4220 .fault(EL2, faultDebugEL2)
4222 InitReg(MISCREG_DBGBVR15_EL1)
4224 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4225 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4226 .fault(EL2, faultDebugEL2)
4228 InitReg(MISCREG_DBGBCR0_EL1)
4230 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4231 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4232 .fault(EL2, faultDebugEL2)
4234 InitReg(MISCREG_DBGBCR1_EL1)
4236 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4237 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4238 .fault(EL2, faultDebugEL2)
4240 InitReg(MISCREG_DBGBCR2_EL1)
4242 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4243 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4244 .fault(EL2, faultDebugEL2)
4246 InitReg(MISCREG_DBGBCR3_EL1)
4248 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4249 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4250 .fault(EL2, faultDebugEL2)
4252 InitReg(MISCREG_DBGBCR4_EL1)
4254 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4255 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4256 .fault(EL2, faultDebugEL2)
4258 InitReg(MISCREG_DBGBCR5_EL1)
4260 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4261 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4262 .fault(EL2, faultDebugEL2)
4264 InitReg(MISCREG_DBGBCR6_EL1)
4266 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4267 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4268 .fault(EL2, faultDebugEL2)
4270 InitReg(MISCREG_DBGBCR7_EL1)
4272 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4273 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4274 .fault(EL2, faultDebugEL2)
4276 InitReg(MISCREG_DBGBCR8_EL1)
4278 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4279 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4280 .fault(EL2, faultDebugEL2)
4282 InitReg(MISCREG_DBGBCR9_EL1)
4284 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4285 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4286 .fault(EL2, faultDebugEL2)
4288 InitReg(MISCREG_DBGBCR10_EL1)
4290 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4291 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4292 .fault(EL2, faultDebugEL2)
4294 InitReg(MISCREG_DBGBCR11_EL1)
4296 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4297 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4298 .fault(EL2, faultDebugEL2)
4300 InitReg(MISCREG_DBGBCR12_EL1)
4302 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4303 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4304 .fault(EL2, faultDebugEL2)
4306 InitReg(MISCREG_DBGBCR13_EL1)
4308 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4309 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4310 .fault(EL2, faultDebugEL2)
4312 InitReg(MISCREG_DBGBCR14_EL1)
4314 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4315 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4316 .fault(EL2, faultDebugEL2)
4318 InitReg(MISCREG_DBGBCR15_EL1)
4320 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4321 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4322 .fault(EL2, faultDebugEL2)
4324 InitReg(MISCREG_DBGWVR0_EL1)
4326 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4327 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4328 .fault(EL2, faultDebugEL2)
4330 InitReg(MISCREG_DBGWVR1_EL1)
4332 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4333 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4334 .fault(EL2, faultDebugEL2)
4336 InitReg(MISCREG_DBGWVR2_EL1)
4338 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4339 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4340 .fault(EL2, faultDebugEL2)
4342 InitReg(MISCREG_DBGWVR3_EL1)
4344 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4345 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4346 .fault(EL2, faultDebugEL2)
4348 InitReg(MISCREG_DBGWVR4_EL1)
4350 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4351 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4352 .fault(EL2, faultDebugEL2)
4354 InitReg(MISCREG_DBGWVR5_EL1)
4356 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4357 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4358 .fault(EL2, faultDebugEL2)
4360 InitReg(MISCREG_DBGWVR6_EL1)
4362 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4363 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4364 .fault(EL2, faultDebugEL2)
4366 InitReg(MISCREG_DBGWVR7_EL1)
4368 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4369 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4370 .fault(EL2, faultDebugEL2)
4372 InitReg(MISCREG_DBGWVR8_EL1)
4374 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4375 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4376 .fault(EL2, faultDebugEL2)
4378 InitReg(MISCREG_DBGWVR9_EL1)
4380 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4381 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4382 .fault(EL2, faultDebugEL2)
4384 InitReg(MISCREG_DBGWVR10_EL1)
4386 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4387 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4388 .fault(EL2, faultDebugEL2)
4390 InitReg(MISCREG_DBGWVR11_EL1)
4392 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4393 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4394 .fault(EL2, faultDebugEL2)
4396 InitReg(MISCREG_DBGWVR12_EL1)
4398 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4399 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4400 .fault(EL2, faultDebugEL2)
4402 InitReg(MISCREG_DBGWVR13_EL1)
4404 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4405 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4406 .fault(EL2, faultDebugEL2)
4408 InitReg(MISCREG_DBGWVR14_EL1)
4410 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4411 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4412 .fault(EL2, faultDebugEL2)
4414 InitReg(MISCREG_DBGWVR15_EL1)
4416 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4417 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4418 .fault(EL2, faultDebugEL2)
4420 InitReg(MISCREG_DBGWCR0_EL1)
4422 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4423 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4424 .fault(EL2, faultDebugEL2)
4426 InitReg(MISCREG_DBGWCR1_EL1)
4428 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4429 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4430 .fault(EL2, faultDebugEL2)
4432 InitReg(MISCREG_DBGWCR2_EL1)
4434 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4435 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4436 .fault(EL2, faultDebugEL2)
4438 InitReg(MISCREG_DBGWCR3_EL1)
4440 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4441 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4442 .fault(EL2, faultDebugEL2)
4444 InitReg(MISCREG_DBGWCR4_EL1)
4446 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4447 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4448 .fault(EL2, faultDebugEL2)
4450 InitReg(MISCREG_DBGWCR5_EL1)
4452 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4453 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4454 .fault(EL2, faultDebugEL2)
4456 InitReg(MISCREG_DBGWCR6_EL1)
4458 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4459 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4460 .fault(EL2, faultDebugEL2)
4462 InitReg(MISCREG_DBGWCR7_EL1)
4464 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4465 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4466 .fault(EL2, faultDebugEL2)
4468 InitReg(MISCREG_DBGWCR8_EL1)
4470 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4471 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4472 .fault(EL2, faultDebugEL2)
4474 InitReg(MISCREG_DBGWCR9_EL1)
4476 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4477 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4478 .fault(EL2, faultDebugEL2)
4480 InitReg(MISCREG_DBGWCR10_EL1)
4482 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4483 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4484 .fault(EL2, faultDebugEL2)
4486 InitReg(MISCREG_DBGWCR11_EL1)
4488 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4489 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4490 .fault(EL2, faultDebugEL2)
4492 InitReg(MISCREG_DBGWCR12_EL1)
4494 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4495 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4496 .fault(EL2, faultDebugEL2)
4498 InitReg(MISCREG_DBGWCR13_EL1)
4500 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4501 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4502 .fault(EL2, faultDebugEL2)
4504 InitReg(MISCREG_DBGWCR14_EL1)
4506 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4507 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4508 .fault(EL2, faultDebugEL2)
4510 InitReg(MISCREG_DBGWCR15_EL1)
4512 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4513 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4514 .fault(EL2, faultDebugEL2)
4516 InitReg(MISCREG_MDCCSR_EL0)
4517 .allPrivileges().writes(0)
4518 .faultRead(EL0, faultMdccsrEL0)
4519 .faultRead(EL1, faultMdccsrEL1)
4520 .faultRead(EL2, faultMdccsrEL2)
4522 InitReg(MISCREG_MDDTR_EL0)
4523 .allPrivileges();
4524 InitReg(MISCREG_MDDTRTX_EL0)
4525 .allPrivileges();
4526 InitReg(MISCREG_MDDTRRX_EL0)
4527 .allPrivileges();
4528 InitReg(MISCREG_DBGVCR32_EL2)
4529 .hyp().mon()
4530 .fault(EL2, faultDebugEL2)
4532 InitReg(MISCREG_MDRAR_EL1)
4534 .faultRead(EL1, faultDebugEL1)
4535 .faultRead(EL2, faultDebugEL2)
4537 InitReg(MISCREG_OSLAR_EL1)
4539 .faultWrite(EL1, faultDebugOsEL1<false, &HDFGTR::oslarEL1>)
4540 .faultWrite(EL2, faultDebugOsEL2)
4542 InitReg(MISCREG_OSLSR_EL1)
4544 .faultRead(EL1, faultDebugOsEL1<true, &HDFGTR::oslsrEL1>)
4545 .faultRead(EL2, faultDebugOsEL2)
4547 InitReg(MISCREG_OSDLR_EL1)
4549 .faultRead(EL1, faultDebugOsEL1<true, &HDFGTR::osdlrEL1>)
4550 .faultWrite(EL1, faultDebugOsEL1<false, &HDFGTR::osdlrEL1>)
4551 .fault(EL2, faultDebugOsEL2)
4553 InitReg(MISCREG_DBGPRCR_EL1)
4555 .faultRead(EL1, faultDebugOsEL1<true, &HDFGTR::dbgprcrEL1>)
4556 .faultWrite(EL1, faultDebugOsEL1<false, &HDFGTR::dbgprcrEL1>)
4557 .fault(EL2, faultDebugOsEL2)
4561 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgclaim>)
4562 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgclaim>)
4563 .fault(EL2, faultDebugEL2)
4567 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgclaim>)
4568 .faultWrite(EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgclaim>)
4569 .fault(EL2, faultDebugEL2)
4573 .faultRead(EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgauthstatusEL1>)
4574 .faultRead(EL2, faultDebugEL2)
4576 InitReg(MISCREG_TEECR32_EL1);
4577 InitReg(MISCREG_TEEHBR32_EL1);
4578
4579 // AArch64 registers (Op0=1,3);
4580 InitReg(MISCREG_MIDR_EL1)
4581 .allPrivileges().exceptUserMode().writes(0)
4582 .faultRead(EL0, faultIdst)
4583 .faultRead(EL1, faultFgtEL1<true, &HFGTR::midrEL1>)
4584 .mapsTo(MISCREG_MIDR);
4585 InitReg(MISCREG_MPIDR_EL1)
4586 .allPrivileges().exceptUserMode().writes(0)
4587 .faultRead(EL0, faultIdst)
4588 .faultRead(EL1, faultFgtEL1<true, &HFGTR::mpidrEL1>)
4589 .mapsTo(MISCREG_MPIDR);
4590 InitReg(MISCREG_REVIDR_EL1)
4591 .faultRead(EL0, faultIdst)
4592 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::tid1, &HFGTR::revidrEL1>)
4593 .allPrivileges().exceptUserMode().writes(0);
4594 InitReg(MISCREG_ID_PFR0_EL1)
4595 .allPrivileges().exceptUserMode().writes(0)
4596 .faultRead(EL0, faultIdst)
4597 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4598 .mapsTo(MISCREG_ID_PFR0);
4599 InitReg(MISCREG_ID_PFR1_EL1)
4600 .allPrivileges().exceptUserMode().writes(0)
4601 .faultRead(EL0, faultIdst)
4602 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4603 .mapsTo(MISCREG_ID_PFR1);
4604 InitReg(MISCREG_ID_DFR0_EL1)
4605 .allPrivileges().exceptUserMode().writes(0)
4606 .faultRead(EL0, faultIdst)
4607 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4608 .mapsTo(MISCREG_ID_DFR0);
4609 InitReg(MISCREG_ID_AFR0_EL1)
4610 .allPrivileges().exceptUserMode().writes(0)
4611 .faultRead(EL0, faultIdst)
4612 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4613 .mapsTo(MISCREG_ID_AFR0);
4614 InitReg(MISCREG_ID_MMFR0_EL1)
4615 .allPrivileges().exceptUserMode().writes(0)
4616 .faultRead(EL0, faultIdst)
4617 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4618 .mapsTo(MISCREG_ID_MMFR0);
4619 InitReg(MISCREG_ID_MMFR1_EL1)
4620 .allPrivileges().exceptUserMode().writes(0)
4621 .faultRead(EL0, faultIdst)
4622 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4623 .mapsTo(MISCREG_ID_MMFR1);
4624 InitReg(MISCREG_ID_MMFR2_EL1)
4625 .allPrivileges().exceptUserMode().writes(0)
4626 .faultRead(EL0, faultIdst)
4627 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4628 .mapsTo(MISCREG_ID_MMFR2);
4629 InitReg(MISCREG_ID_MMFR3_EL1)
4630 .allPrivileges().exceptUserMode().writes(0)
4631 .faultRead(EL0, faultIdst)
4632 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4633 .mapsTo(MISCREG_ID_MMFR3);
4634 InitReg(MISCREG_ID_MMFR4_EL1)
4635 .allPrivileges().exceptUserMode().writes(0)
4636 .faultRead(EL0, faultIdst)
4637 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4638 .mapsTo(MISCREG_ID_MMFR4);
4639 InitReg(MISCREG_ID_ISAR0_EL1)
4640 .allPrivileges().exceptUserMode().writes(0)
4641 .faultRead(EL0, faultIdst)
4642 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4643 .mapsTo(MISCREG_ID_ISAR0);
4644 InitReg(MISCREG_ID_ISAR1_EL1)
4645 .allPrivileges().exceptUserMode().writes(0)
4646 .faultRead(EL0, faultIdst)
4647 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4648 .mapsTo(MISCREG_ID_ISAR1);
4649 InitReg(MISCREG_ID_ISAR2_EL1)
4650 .allPrivileges().exceptUserMode().writes(0)
4651 .faultRead(EL0, faultIdst)
4652 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4653 .mapsTo(MISCREG_ID_ISAR2);
4654 InitReg(MISCREG_ID_ISAR3_EL1)
4655 .allPrivileges().exceptUserMode().writes(0)
4656 .faultRead(EL0, faultIdst)
4657 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4658 .mapsTo(MISCREG_ID_ISAR3);
4659 InitReg(MISCREG_ID_ISAR4_EL1)
4660 .allPrivileges().exceptUserMode().writes(0)
4661 .faultRead(EL0, faultIdst)
4662 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4663 .mapsTo(MISCREG_ID_ISAR4);
4664 InitReg(MISCREG_ID_ISAR5_EL1)
4665 .allPrivileges().exceptUserMode().writes(0)
4666 .faultRead(EL0, faultIdst)
4667 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4668 .mapsTo(MISCREG_ID_ISAR5);
4669 InitReg(MISCREG_ID_ISAR6_EL1)
4670 .allPrivileges().exceptUserMode().writes(0)
4671 .faultRead(EL0, faultIdst)
4672 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4673 .mapsTo(MISCREG_ID_ISAR6);
4674 InitReg(MISCREG_MVFR0_EL1)
4675 .faultRead(EL0, faultIdst)
4676 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4677 .allPrivileges().exceptUserMode().writes(0)
4678 .mapsTo(MISCREG_MVFR0);
4679 InitReg(MISCREG_MVFR1_EL1)
4680 .faultRead(EL0, faultIdst)
4681 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4682 .allPrivileges().exceptUserMode().writes(0)
4683 .mapsTo(MISCREG_MVFR1);
4684 InitReg(MISCREG_MVFR2_EL1)
4685 .faultRead(EL0, faultIdst)
4686 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4687 .allPrivileges().exceptUserMode().writes(0);
4689 .reset([this,release=release,tc=tc](){
4690 AA64PFR0 pfr0_el1 = 0;
4691 pfr0_el1.el0 = 0x2;
4692 pfr0_el1.el1 = 0x2;
4693 pfr0_el1.el2 = release->has(ArmExtension::VIRTUALIZATION)
4694 ? 0x2 : 0x0;
4695 pfr0_el1.el3 = release->has(ArmExtension::SECURITY) ? 0x2 : 0x0;
4696 pfr0_el1.sve = release->has(ArmExtension::FEAT_SVE) ? 0x1 : 0x0;
4697 pfr0_el1.sel2 = release->has(ArmExtension::FEAT_SEL2) ? 0x1 : 0x0;
4698 // See MPAM frac in MISCREG_ID_AA64PFR1_EL1. Currently supporting
4699 // MPAMv0p1
4700 pfr0_el1.mpam = 0x0;
4701 pfr0_el1.gic = FullSystem && getGICv3CPUInterface(tc) ? 0x1 : 0;
4702 return pfr0_el1;
4703 }())
4704 .unserialize(0)
4705 .faultRead(EL0, faultIdst)
4706 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4707 .allPrivileges().writes(0);
4709 .reset([release=release](){
4710 AA64PFR1 pfr1_el1 = 0;
4711 pfr1_el1.sme = release->has(ArmExtension::FEAT_SME) ? 0x1 : 0x0;
4712 pfr1_el1.mpamFrac = release->has(ArmExtension::FEAT_MPAM) ?
4713 0x1 : 0x0;
4714 return pfr1_el1;
4715 }())
4716 .unserialize(0)
4717 .faultRead(EL0, faultIdst)
4718 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4719 .allPrivileges().writes(0);
4721 .reset([p](){
4722 AA64DFR0 dfr0_el1 = p.id_aa64dfr0_el1;
4723 dfr0_el1.pmuver = p.pmu ? 1 : 0; // Enable PMUv3
4724 return dfr0_el1;
4725 }())
4726 .faultRead(EL0, faultIdst)
4727 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4728 .allPrivileges().writes(0);
4730 .reset(p.id_aa64dfr1_el1)
4731 .faultRead(EL0, faultIdst)
4732 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4733 .allPrivileges().writes(0);
4735 .reset(p.id_aa64afr0_el1)
4736 .faultRead(EL0, faultIdst)
4737 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4738 .allPrivileges().writes(0);
4740 .reset(p.id_aa64afr1_el1)
4741 .faultRead(EL0, faultIdst)
4742 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4743 .allPrivileges().writes(0);
4745 .reset([p,release=release](){
4746 AA64ISAR0 isar0_el1 = p.id_aa64isar0_el1;
4747 isar0_el1.crc32 = release->has(ArmExtension::FEAT_CRC32) ? 0x1 : 0x0;
4748 isar0_el1.sha2 = release->has(ArmExtension::FEAT_SHA256) ? 0x1 : 0x0;
4749 isar0_el1.sha1 = release->has(ArmExtension::FEAT_SHA1) ? 0x1 : 0x0;
4750 isar0_el1.aes = release->has(ArmExtension::FEAT_PMULL) ?
4751 0x2 : release->has(ArmExtension::FEAT_AES) ?
4752 0x1 : 0x0;
4753 isar0_el1.dp = release->has(ArmExtension::FEAT_DOTPROD) ? 0x1 : 0x0;
4754 isar0_el1.atomic = release->has(ArmExtension::FEAT_LSE) ? 0x2 : 0x0;
4755 isar0_el1.rdm = release->has(ArmExtension::FEAT_RDM) ? 0x1 : 0x0;
4756 isar0_el1.tme = release->has(ArmExtension::TME) ? 0x1 : 0x0;
4757 isar0_el1.tlb = release->has(ArmExtension::FEAT_TLBIRANGE) ?
4758 0x2 : release->has(ArmExtension::FEAT_TLBIOS) ?
4759 0x1 : 0x0;
4760 isar0_el1.ts = release->has(ArmExtension::FEAT_FLAGM2) ?
4761 0x2 : release->has(ArmExtension::FEAT_FLAGM) ?
4762 0x1 : 0x0;
4763 isar0_el1.rndr = release->has(ArmExtension::FEAT_RNG) ? 0x1 : 0x0;
4764 return isar0_el1;
4765 }())
4766 .faultRead(EL0, faultIdst)
4767 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4768 .allPrivileges().writes(0);
4770 .reset([p,release=release](){
4771 AA64ISAR1 isar1_el1 = p.id_aa64isar1_el1;
4772 isar1_el1.i8mm = release->has(ArmExtension::FEAT_I8MM) ? 0x1 : 0x0;
4773 isar1_el1.apa = release->has(ArmExtension::FEAT_PAuth) ? 0x1 : 0x0;
4774 isar1_el1.jscvt = release->has(ArmExtension::FEAT_JSCVT) ? 0x1 : 0x0;
4775 isar1_el1.fcma = release->has(ArmExtension::FEAT_FCMA) ? 0x1 : 0x0;
4776 isar1_el1.gpa = release->has(ArmExtension::FEAT_PAuth) ? 0x1 : 0x0;
4777 return isar1_el1;
4778 }())
4779 .faultRead(EL0, faultIdst)
4780 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4781 .allPrivileges().writes(0);
4783 .reset([p,asidbits=haveLargeAsid64,parange=physAddrRange](){
4784 AA64MMFR0 mmfr0_el1 = p.id_aa64mmfr0_el1;
4785 mmfr0_el1.asidbits = asidbits ? 0x2 : 0x0;
4786 mmfr0_el1.parange = encodePhysAddrRange64(parange);
4787 return mmfr0_el1;
4788 }())
4789 .faultRead(EL0, faultIdst)
4790 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4791 .allPrivileges().writes(0);
4793 .reset([p,release=release](){
4794 AA64MMFR1 mmfr1_el1 = p.id_aa64mmfr1_el1;
4795 mmfr1_el1.vmidbits =
4796 release->has(ArmExtension::FEAT_VMID16) ? 0x2 : 0x0;
4797 mmfr1_el1.vh = release->has(ArmExtension::FEAT_VHE) ? 0x1 : 0x0;
4798 mmfr1_el1.hpds = release->has(ArmExtension::FEAT_HPDS) ? 0x1 : 0x0;
4799 mmfr1_el1.pan = release->has(ArmExtension::FEAT_PAN) ? 0x1 : 0x0;
4800 mmfr1_el1.hcx = release->has(ArmExtension::FEAT_HCX) ? 0x1 : 0x0;
4801 return mmfr1_el1;
4802 }())
4803 .faultRead(EL0, faultIdst)
4804 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4805 .allPrivileges().writes(0);
4807 .reset([p,release=release](){
4808 AA64MMFR2 mmfr2_el1 = p.id_aa64mmfr2_el1;
4809 mmfr2_el1.uao = release->has(ArmExtension::FEAT_UAO) ? 0x1 : 0x0;
4810 mmfr2_el1.varange = release->has(ArmExtension::FEAT_LVA) ? 0x1 : 0x0;
4811 mmfr2_el1.ids = release->has(ArmExtension::FEAT_IDST) ? 0x1 : 0x0;
4812 mmfr2_el1.evt = release->has(ArmExtension::FEAT_EVT) ? 0x2 : 0x0;
4813 return mmfr2_el1;
4814 }())
4815 .faultRead(EL0, faultIdst)
4816 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4817 .allPrivileges().writes(0);
4819 .reset([p,release=release](){
4820 AA64MMFR3 mmfr3_el1 = 0;
4821 mmfr3_el1.sctlrx =
4822 release->has(ArmExtension::FEAT_SCTLR2) ? 0x1 : 0x0;
4823 mmfr3_el1.tcrx = release->has(ArmExtension::FEAT_TCR2) ? 0x1 : 0x0;
4824 return mmfr3_el1;
4825 }())
4826 .faultRead(EL0, faultIdst)
4827 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
4828 .allPrivileges().writes(0);
4829
4830 InitReg(MISCREG_APDAKeyHi_EL1)
4831 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apdaKey>)
4832 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apdaKey>)
4833 .fault(EL2, faultPauthEL2)
4834 .allPrivileges().exceptUserMode();
4835 InitReg(MISCREG_APDAKeyLo_EL1)
4836 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apdaKey>)
4837 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apdaKey>)
4838 .fault(EL2, faultPauthEL2)
4839 .allPrivileges().exceptUserMode();
4840 InitReg(MISCREG_APDBKeyHi_EL1)
4841 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apdbKey>)
4842 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apdbKey>)
4843 .fault(EL2, faultPauthEL2)
4844 .allPrivileges().exceptUserMode();
4845 InitReg(MISCREG_APDBKeyLo_EL1)
4846 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apdbKey>)
4847 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apdbKey>)
4848 .fault(EL2, faultPauthEL2)
4849 .allPrivileges().exceptUserMode();
4850 InitReg(MISCREG_APGAKeyHi_EL1)
4851 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apgaKey>)
4852 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apgaKey>)
4853 .fault(EL2, faultPauthEL2)
4854 .allPrivileges().exceptUserMode();
4855 InitReg(MISCREG_APGAKeyLo_EL1)
4856 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apgaKey>)
4857 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apgaKey>)
4858 .fault(EL2, faultPauthEL2)
4859 .allPrivileges().exceptUserMode();
4860 InitReg(MISCREG_APIAKeyHi_EL1)
4861 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apiaKey>)
4862 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apiaKey>)
4863 .fault(EL2, faultPauthEL2)
4864 .allPrivileges().exceptUserMode();
4865 InitReg(MISCREG_APIAKeyLo_EL1)
4866 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apiaKey>)
4867 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apiaKey>)
4868 .fault(EL2, faultPauthEL2)
4869 .allPrivileges().exceptUserMode();
4870 InitReg(MISCREG_APIBKeyHi_EL1)
4871 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apibKey>)
4872 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apibKey>)
4873 .fault(EL2, faultPauthEL2)
4874 .allPrivileges().exceptUserMode();
4875 InitReg(MISCREG_APIBKeyLo_EL1)
4876 .faultRead(EL1, faultPauthEL1<true, &HFGTR::apibKey>)
4877 .faultWrite(EL1, faultPauthEL1<false, &HFGTR::apibKey>)
4878 .fault(EL2, faultPauthEL2)
4879 .allPrivileges().exceptUserMode();
4880
4881 InitReg(MISCREG_CCSIDR_EL1)
4882 .faultRead(EL0, faultIdst)
4883 .faultRead(EL1, faultCacheEL1<true, &HFGTR::ccsidrEL1>)
4884 .allPrivileges().writes(0);
4885 InitReg(MISCREG_CLIDR_EL1)
4886 .faultRead(EL0, faultIdst)
4887 .faultRead(EL1, faultCacheEL1<true, &HFGTR::clidrEL1>)
4888 .allPrivileges().writes(0);
4889 InitReg(MISCREG_AIDR_EL1)
4890 .faultRead(EL0, faultIdst)
4891 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::tid1, &HFGTR::aidrEL1>)
4892 .allPrivileges().writes(0);
4893 InitReg(MISCREG_CSSELR_EL1)
4894 .allPrivileges().exceptUserMode()
4895 .faultRead(EL1, faultCacheEL1<true, &HFGTR::csselrEL1>)
4896 .faultWrite(EL1, faultCacheEL1<false, &HFGTR::csselrEL1>)
4897 .mapsTo(MISCREG_CSSELR_NS);
4898 InitReg(MISCREG_CTR_EL0)
4899 .faultRead(EL0, faultCtrEL0)
4900 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::tid2, &HFGTR::ctrEL0>)
4901 .reads(1)
4902 .mapsTo(MISCREG_CTR);
4903 InitReg(MISCREG_DCZID_EL0)
4904 .reset(0x04) // DC ZVA clear 64-byte chunks
4905 .faultRead(EL0, faultFgtEL0<true, &HFGTR::dczidEL0>)
4906 .faultRead(EL1, faultFgtEL1<true, &HFGTR::dczidEL0>)
4907 .reads(1);
4908 InitReg(MISCREG_VPIDR_EL2)
4909 .hyp().mon()
4910 .mapsTo(MISCREG_VPIDR);
4911 InitReg(MISCREG_VMPIDR_EL2)
4912 .hyp().mon()
4913 .res0(mask(63, 40) | mask(29, 25))
4914 .res1(mask(31, 31))
4915 .mapsTo(MISCREG_VMPIDR);
4916 InitReg(MISCREG_SCTLR_EL1)
4917 .allPrivileges().exceptUserMode()
4918 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::sctlrEL1>)
4919 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::sctlrEL1>)
4920 .res0( 0x20440 | (EnDB ? 0 : 0x2000)
4921 | (IESB ? 0 : 0x200000)
4922 | (EnDA ? 0 : 0x8000000)
4923 | (EnIB ? 0 : 0x40000000)
4924 | (EnIA ? 0 : 0x80000000))
4925 .res1(0x500800 | (SPAN ? 0 : 0x800000)
4926 | (nTLSMD ? 0 : 0x8000000)
4927 | (LSMAOE ? 0 : 0x10000000))
4928 .mapsTo(MISCREG_SCTLR_NS);
4929 InitReg(MISCREG_SCTLR_EL12)
4930 .fault(EL2, defaultFaultE2H_EL2)
4931 .fault(EL3, defaultFaultE2H_EL3)
4932 .res0( 0x20440 | (EnDB ? 0 : 0x2000)
4933 | (IESB ? 0 : 0x200000)
4934 | (EnDA ? 0 : 0x8000000)
4935 | (EnIB ? 0 : 0x40000000)
4936 | (EnIA ? 0 : 0x80000000))
4937 .res1(0x500800 | (SPAN ? 0 : 0x800000)
4938 | (nTLSMD ? 0 : 0x8000000)
4939 | (LSMAOE ? 0 : 0x10000000))
4940 .mapsTo(MISCREG_SCTLR_EL1);
4941 InitReg(MISCREG_SCTLR2_EL1)
4942 .allPrivileges().exceptUserMode()
4943 .faultRead(EL1, faultSctlr2EL1<true, &HCR::trvm>)
4944 .faultWrite(EL1, faultSctlr2EL1<false, &HCR::tvm>)
4945 .fault(EL2,faultSctlr2EL2);
4946 InitReg(MISCREG_SCTLR2_EL12)
4947 .fault(EL2, faultSctlr2VheEL2)
4948 .fault(EL3, defaultFaultE2H_EL3)
4949 .mapsTo(MISCREG_SCTLR2_EL1);
4950 InitReg(MISCREG_ACTLR_EL1)
4951 .allPrivileges().exceptUserMode()
4952 .fault(EL1, faultHcrEL1<&HCR::tacr>)
4953 .mapsTo(MISCREG_ACTLR_NS);
4954 InitReg(MISCREG_CPACR_EL1)
4955 .allPrivileges().exceptUserMode()
4956 .faultRead(EL1, faultCpacrEL1<true, &HFGTR::cpacrEL1>)
4957 .faultWrite(EL1, faultCpacrEL1<false, &HFGTR::cpacrEL1>)
4958 .fault(EL2, faultCpacrEL2)
4959 .mapsTo(MISCREG_CPACR);
4960 InitReg(MISCREG_CPACR_EL12)
4961 .fault(EL2, faultCpacrVheEL2)
4962 .fault(EL3, defaultFaultE2H_EL3)
4963 .mapsTo(MISCREG_CPACR_EL1);
4964 InitReg(MISCREG_SCTLR_EL2)
4965 .hyp().mon()
4966 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
4967 | (IESB ? 0 : 0x200000)
4968 | (EnDA ? 0 : 0x8000000)
4969 | (EnIB ? 0 : 0x40000000)
4970 | (EnIA ? 0 : 0x80000000))
4971 .res1(0x30c50830)
4972 .mapsTo(MISCREG_HSCTLR);
4973 InitReg(MISCREG_SCTLR2_EL2)
4974 .hyp().mon()
4975 .fault(EL2, faultSctlr2EL2);
4976 InitReg(MISCREG_ACTLR_EL2)
4977 .hyp().mon()
4978 .mapsTo(MISCREG_HACTLR);
4979 InitReg(MISCREG_HCR_EL2)
4980 .hyp().mon()
4981 .mapsTo(MISCREG_HCR, MISCREG_HCR2);
4982 InitReg(MISCREG_HCRX_EL2)
4983 .hyp().mon()
4984 .fault(EL2, faultHcrxEL2);
4985 InitReg(MISCREG_MDCR_EL2)
4986 .hyp().mon()
4987 .fault(EL2, faultDebugEL2)
4988 .mapsTo(MISCREG_HDCR);
4989 InitReg(MISCREG_CPTR_EL2)
4990 .hyp().mon()
4991 .fault(EL2, faultCpacrEL2)
4992 .mapsTo(MISCREG_HCPTR);
4993 InitReg(MISCREG_HSTR_EL2)
4994 .hyp().mon()
4995 .mapsTo(MISCREG_HSTR);
4996 InitReg(MISCREG_HACR_EL2)
4997 .hyp().mon()
4998 .mapsTo(MISCREG_HACR);
4999 InitReg(MISCREG_SCTLR_EL3)
5000 .reset(0x30c50830)
5001 .mon()
5002 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
5003 | (IESB ? 0 : 0x200000)
5004 | (EnDA ? 0 : 0x8000000)
5005 | (EnIB ? 0 : 0x40000000)
5006 | (EnIA ? 0 : 0x80000000))
5007 .res1(0x30c50830);
5008 InitReg(MISCREG_SCTLR2_EL3)
5009 .mon();
5010 InitReg(MISCREG_ACTLR_EL3)
5011 .mon();
5012 InitReg(MISCREG_SCR_EL3)
5013 .mon()
5014 .mapsTo(MISCREG_SCR); // NAM D7-2005
5015 InitReg(MISCREG_SDER32_EL3)
5016 .mon()
5017 .mapsTo(MISCREG_SDER);
5018 InitReg(MISCREG_CPTR_EL3)
5019 .mon();
5020 InitReg(MISCREG_MDCR_EL3)
5021 .mon()
5022 .mapsTo(MISCREG_SDCR);
5023 InitReg(MISCREG_TTBR0_EL1)
5024 .allPrivileges().exceptUserMode()
5025 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::ttbr0EL1>)
5026 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::ttbr0EL1>)
5027 .mapsTo(MISCREG_TTBR0_NS);
5028 InitReg(MISCREG_TTBR0_EL12)
5029 .fault(EL2, defaultFaultE2H_EL2)
5030 .fault(EL3, defaultFaultE2H_EL3)
5031 .mapsTo(MISCREG_TTBR0_EL1);
5032 InitReg(MISCREG_TTBR1_EL1)
5033 .allPrivileges().exceptUserMode()
5034 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::ttbr1EL1>)
5035 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::ttbr1EL1>)
5036 .mapsTo(MISCREG_TTBR1_NS);
5037 InitReg(MISCREG_TTBR1_EL12)
5038 .fault(EL2, defaultFaultE2H_EL2)
5039 .fault(EL3, defaultFaultE2H_EL3)
5040 .mapsTo(MISCREG_TTBR1_EL1);
5041 InitReg(MISCREG_TCR_EL1)
5042 .allPrivileges().exceptUserMode()
5043 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::tcrEL1>)
5044 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::tcrEL1>)
5045 .mapsTo(MISCREG_TTBCR_NS);
5046 InitReg(MISCREG_TCR_EL12)
5047 .fault(EL2, defaultFaultE2H_EL2)
5048 .fault(EL3, defaultFaultE2H_EL3)
5049 .mapsTo(MISCREG_TTBCR_NS);
5050 InitReg(MISCREG_TCR2_EL1)
5051 .allPrivileges().exceptUserMode()
5052 .faultRead(EL1, faultTcr2EL1<true, &HCR::trvm>)
5053 .faultWrite(EL1, faultTcr2EL1<false, &HCR::tvm>)
5054 .fault(EL2, faultTcr2EL2);
5055 InitReg(MISCREG_TCR2_EL12)
5056 .fault(EL2, faultTcr2VheEL2)
5057 .fault(EL3, faultTcr2VheEL3)
5058 .mapsTo(MISCREG_TCR2_EL1);
5059 InitReg(MISCREG_TTBR0_EL2)
5060 .hyp().mon()
5061 .mapsTo(MISCREG_HTTBR);
5062 InitReg(MISCREG_TTBR1_EL2)
5063 .hyp().mon();
5064 InitReg(MISCREG_TCR_EL2)
5065 .hyp().mon()
5066 .mapsTo(MISCREG_HTCR);
5067 InitReg(MISCREG_TCR2_EL2)
5068 .hyp().mon()
5069 .fault(EL2, faultTcr2EL2);
5070 InitReg(MISCREG_VTTBR_EL2)
5071 .hyp().mon()
5072 .mapsTo(MISCREG_VTTBR);
5073 InitReg(MISCREG_VTCR_EL2)
5074 .hyp().mon()
5075 .mapsTo(MISCREG_VTCR);
5076 InitReg(MISCREG_VSTTBR_EL2)
5077 .hypSecure().mon();
5078 InitReg(MISCREG_VSTCR_EL2)
5079 .hypSecure().mon();
5080 InitReg(MISCREG_TTBR0_EL3)
5081 .mon();
5082 InitReg(MISCREG_TCR_EL3)
5083 .mon();
5084 InitReg(MISCREG_DACR32_EL2)
5085 .hyp().mon()
5086 .mapsTo(MISCREG_DACR_NS);
5087 InitReg(MISCREG_SPSR_EL1)
5088 .allPrivileges().exceptUserMode()
5089 .mapsTo(MISCREG_SPSR_SVC); // NAM C5.2.17 SPSR_EL1
5090 InitReg(MISCREG_SPSR_EL12)
5091 .fault(EL2, defaultFaultE2H_EL2)
5092 .fault(EL3, defaultFaultE2H_EL3)
5093 .mapsTo(MISCREG_SPSR_SVC);
5094 InitReg(MISCREG_ELR_EL1)
5095 .allPrivileges().exceptUserMode();
5096 InitReg(MISCREG_ELR_EL12)
5097 .fault(EL2, defaultFaultE2H_EL2)
5098 .fault(EL3, defaultFaultE2H_EL3)
5099 .mapsTo(MISCREG_ELR_EL1);
5100 InitReg(MISCREG_SP_EL0)
5101 .allPrivileges().exceptUserMode()
5102 .fault(EL1, faultSpEL0)
5103 .fault(EL2, faultSpEL0)
5104 .fault(EL3, faultSpEL0);
5105 InitReg(MISCREG_SPSEL)
5106 .allPrivileges().exceptUserMode();
5107 InitReg(MISCREG_CURRENTEL)
5108 .allPrivileges().exceptUserMode().writes(0);
5109 InitReg(MISCREG_PAN)
5110 .allPrivileges(release->has(ArmExtension::FEAT_PAN))
5111 .exceptUserMode();
5112 InitReg(MISCREG_UAO)
5113 .allPrivileges().exceptUserMode();
5114 InitReg(MISCREG_NZCV)
5115 .allPrivileges();
5116 InitReg(MISCREG_DAIF)
5117 .allPrivileges()
5118 .fault(EL0, faultDaif);
5119 InitReg(MISCREG_FPCR)
5120 .allPrivileges()
5121 .fault(EL0, faultFpcrEL0)
5122 .fault(EL1, faultFpcrEL1)
5123 .fault(EL2, faultFpcrEL2)
5124 .fault(EL3, faultFpcrEL3);
5125 InitReg(MISCREG_FPSR)
5126 .allPrivileges()
5127 .fault(EL0, faultFpcrEL0)
5128 .fault(EL1, faultFpcrEL1)
5129 .fault(EL2, faultFpcrEL2)
5130 .fault(EL3, faultFpcrEL3);
5131 InitReg(MISCREG_DSPSR_EL0)
5132 .allPrivileges();
5133 InitReg(MISCREG_DLR_EL0)
5134 .allPrivileges();
5135 InitReg(MISCREG_SPSR_EL2)
5136 .hyp().mon()
5137 .mapsTo(MISCREG_SPSR_HYP); // NAM C5.2.18 SPSR_EL2
5138 InitReg(MISCREG_ELR_EL2)
5139 .hyp().mon();
5140 InitReg(MISCREG_SP_EL1)
5141 .hyp().mon();
5142 InitReg(MISCREG_SPSR_IRQ_AA64)
5143 .hyp().mon();
5144 InitReg(MISCREG_SPSR_ABT_AA64)
5145 .hyp().mon();
5146 InitReg(MISCREG_SPSR_UND_AA64)
5147 .hyp().mon();
5148 InitReg(MISCREG_SPSR_FIQ_AA64)
5149 .hyp().mon();
5150 InitReg(MISCREG_SPSR_EL3)
5151 .mon()
5152 .mapsTo(MISCREG_SPSR_MON); // NAM C5.2.19 SPSR_EL3
5153 InitReg(MISCREG_ELR_EL3)
5154 .mon();
5155 InitReg(MISCREG_SP_EL2)
5156 .mon();
5157 InitReg(MISCREG_AFSR0_EL1)
5158 .allPrivileges().exceptUserMode()
5159 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::afsr0EL1>)
5160 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::afsr0EL1>)
5161 .mapsTo(MISCREG_ADFSR_NS);
5162 InitReg(MISCREG_AFSR0_EL12)
5163 .fault(EL2, defaultFaultE2H_EL2)
5164 .fault(EL3, defaultFaultE2H_EL3)
5165 .mapsTo(MISCREG_ADFSR_NS);
5166 InitReg(MISCREG_AFSR1_EL1)
5167 .allPrivileges().exceptUserMode()
5168 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::afsr1EL1>)
5169 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::afsr1EL1>)
5170 .mapsTo(MISCREG_AIFSR_NS);
5171 InitReg(MISCREG_AFSR1_EL12)
5172 .fault(EL2, defaultFaultE2H_EL2)
5173 .fault(EL3, defaultFaultE2H_EL3)
5174 .mapsTo(MISCREG_AIFSR_NS);
5175 InitReg(MISCREG_ESR_EL1)
5176 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::esrEL1>)
5177 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::esrEL1>)
5178 .allPrivileges().exceptUserMode();
5179 InitReg(MISCREG_ESR_EL12)
5180 .fault(EL2, defaultFaultE2H_EL2)
5181 .fault(EL3, defaultFaultE2H_EL3)
5182 .mapsTo(MISCREG_ESR_EL1);
5183 InitReg(MISCREG_IFSR32_EL2)
5184 .hyp().mon()
5185 .mapsTo(MISCREG_IFSR_NS);
5186 InitReg(MISCREG_AFSR0_EL2)
5187 .hyp().mon()
5188 .mapsTo(MISCREG_HADFSR);
5189 InitReg(MISCREG_AFSR1_EL2)
5190 .hyp().mon()
5191 .mapsTo(MISCREG_HAIFSR);
5192 InitReg(MISCREG_ESR_EL2)
5193 .hyp().mon()
5194 .mapsTo(MISCREG_HSR);
5195 InitReg(MISCREG_FPEXC32_EL2)
5196 .fault(EL2, faultFpcrEL2)
5197 .fault(EL3, faultFpcrEL3)
5198 .mapsTo(MISCREG_FPEXC);
5199 InitReg(MISCREG_AFSR0_EL3)
5200 .mon();
5201 InitReg(MISCREG_AFSR1_EL3)
5202 .mon();
5203 InitReg(MISCREG_ESR_EL3)
5204 .mon();
5205 InitReg(MISCREG_FAR_EL1)
5206 .allPrivileges().exceptUserMode()
5207 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::farEL1>)
5208 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::farEL1>)
5210 InitReg(MISCREG_FAR_EL12)
5211 .fault(EL2, defaultFaultE2H_EL2)
5212 .fault(EL3, defaultFaultE2H_EL3)
5214 InitReg(MISCREG_FAR_EL2)
5215 .hyp().mon()
5216 .mapsTo(MISCREG_HDFAR, MISCREG_HIFAR);
5217 InitReg(MISCREG_HPFAR_EL2)
5218 .hyp().mon()
5219 .mapsTo(MISCREG_HPFAR);
5220 InitReg(MISCREG_FAR_EL3)
5221 .mon();
5222 InitReg(MISCREG_IC_IALLUIS)
5223 .warnNotFail()
5224 .faultWrite(EL1, faultPouIsEL1<&HFGITR::icialluis>)
5225 .writes(1).exceptUserMode();
5226 InitReg(MISCREG_PAR_EL1)
5227 .allPrivileges().exceptUserMode()
5228 .mapsTo(MISCREG_PAR_NS);
5229 InitReg(MISCREG_IC_IALLU)
5230 .warnNotFail()
5231 .faultWrite(EL1, faultPouEL1<&HFGITR::iciallu>)
5232 .writes(1).exceptUserMode();
5233 InitReg(MISCREG_DC_IVAC_Xt)
5234 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::tpc, &HFGITR::dcivac>)
5235 .writes(1).exceptUserMode();
5236 InitReg(MISCREG_DC_ISW_Xt)
5237 .warnNotFail()
5238 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::tsw, &HFGITR::dcisw>)
5239 .writes(1).exceptUserMode();
5240 InitReg(MISCREG_AT_S1E1R_Xt)
5241 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e1r>)
5242 .writes(1).exceptUserMode();
5243 InitReg(MISCREG_AT_S1E1W_Xt)
5244 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e1w>)
5245 .writes(1).exceptUserMode();
5246 InitReg(MISCREG_AT_S1E0R_Xt)
5247 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e0r>)
5248 .writes(1).exceptUserMode();
5249 InitReg(MISCREG_AT_S1E0W_Xt)
5250 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e0w>)
5251 .writes(1).exceptUserMode();
5252 InitReg(MISCREG_DC_CSW_Xt)
5253 .warnNotFail()
5254 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::tsw, &HFGITR::dccsw>)
5255 .writes(1).exceptUserMode();
5256 InitReg(MISCREG_DC_CISW_Xt)
5257 .warnNotFail()
5258 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::tsw, &HFGITR::dccisw>)
5259 .writes(1).exceptUserMode();
5260 InitReg(MISCREG_DC_ZVA_Xt)
5261 .writes(1)
5262 .faultWrite(EL0, faultDczvaEL0)
5263 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::tdz, &HFGITR::dczva>);
5264 InitReg(MISCREG_IC_IVAU_Xt)
5265 .faultWrite(EL0, faultPouEL0)
5266 .faultWrite(EL1, faultPouEL1<&HFGITR::icivau>)
5267 .writes(1);
5268 InitReg(MISCREG_DC_CVAC_Xt)
5269 .faultWrite(EL0, faultCvacEL0)
5270 .faultWrite(EL1, faultHcrEL1<&HCR::tpc>)
5271 .writes(1);
5272 InitReg(MISCREG_DC_CVAU_Xt)
5273 .faultWrite(EL0, faultPouEL0)
5274 .faultWrite(EL1, faultPouEL1<&HFGITR::dccvau>)
5275 .writes(1);
5276 InitReg(MISCREG_DC_CIVAC_Xt)
5277 .faultWrite(EL0, faultCvacEL0)
5278 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::tpc, &HFGITR::dccivac>)
5279 .writes(1);
5280 InitReg(MISCREG_AT_S1E2R_Xt)
5281 .monNonSecureWrite().hypWrite();
5282 InitReg(MISCREG_AT_S1E2W_Xt)
5283 .monNonSecureWrite().hypWrite();
5284 InitReg(MISCREG_AT_S12E1R_Xt)
5285 .hypWrite().monSecureWrite().monNonSecureWrite();
5286 InitReg(MISCREG_AT_S12E1W_Xt)
5287 .hypWrite().monSecureWrite().monNonSecureWrite();
5288 InitReg(MISCREG_AT_S12E0R_Xt)
5289 .hypWrite().monSecureWrite().monNonSecureWrite();
5290 InitReg(MISCREG_AT_S12E0W_Xt)
5291 .hypWrite().monSecureWrite().monNonSecureWrite();
5292 InitReg(MISCREG_AT_S1E3R_Xt)
5293 .monSecureWrite().monNonSecureWrite();
5294 InitReg(MISCREG_AT_S1E3W_Xt)
5295 .monSecureWrite().monNonSecureWrite();
5296 InitReg(MISCREG_TLBI_VMALLE1OS)
5297 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbivmalle1os>)
5298 .writes(1).exceptUserMode();
5299 InitReg(MISCREG_TLBI_VAE1OS)
5300 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbivae1os>)
5301 .writes(1).exceptUserMode();
5302 InitReg(MISCREG_TLBI_ASIDE1OS)
5303 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbiaside1os>)
5304 .writes(1).exceptUserMode();
5305 InitReg(MISCREG_TLBI_VAAE1OS)
5306 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbivaae1os>)
5307 .writes(1).exceptUserMode();
5308 InitReg(MISCREG_TLBI_VALE1OS)
5309 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbivale1os>)
5310 .writes(1).exceptUserMode();
5311 InitReg(MISCREG_TLBI_VAALE1OS)
5312 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbivaale1os>)
5313 .writes(1).exceptUserMode();
5314 InitReg(MISCREG_TLBI_VMALLE1IS)
5315 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbivmalle1is>)
5316 .writes(1).exceptUserMode();
5317 InitReg(MISCREG_TLBI_VAE1IS)
5318 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbivae1is>)
5319 .writes(1).exceptUserMode();
5320 InitReg(MISCREG_TLBI_ASIDE1IS)
5321 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbiaside1is>)
5322 .writes(1).exceptUserMode();
5323 InitReg(MISCREG_TLBI_VAAE1IS)
5324 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbivaae1is>)
5325 .writes(1).exceptUserMode();
5326 InitReg(MISCREG_TLBI_VALE1IS)
5327 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbivale1is>)
5328 .writes(1).exceptUserMode();
5329 InitReg(MISCREG_TLBI_VAALE1IS)
5330 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbivaale1is>)
5331 .writes(1).exceptUserMode();
5332 InitReg(MISCREG_TLBI_VMALLE1)
5333 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivmalle1>)
5334 .writes(1).exceptUserMode();
5335 InitReg(MISCREG_TLBI_VAE1)
5336 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivae1>)
5337 .writes(1).exceptUserMode();
5338 InitReg(MISCREG_TLBI_ASIDE1)
5339 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbiaside1>)
5340 .writes(1).exceptUserMode();
5341 InitReg(MISCREG_TLBI_VAAE1)
5342 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivaae1>)
5343 .writes(1).exceptUserMode();
5344 InitReg(MISCREG_TLBI_VALE1)
5345 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivale1>)
5346 .writes(1).exceptUserMode();
5347 InitReg(MISCREG_TLBI_VAALE1)
5348 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivaale1>)
5349 .writes(1).exceptUserMode();
5350 InitReg(MISCREG_TLBI_IPAS2E1OS)
5351 .monWrite().hypWrite();
5353 .monWrite().hypWrite();
5354 InitReg(MISCREG_TLBI_ALLE2OS)
5355 .monWrite().hypWrite();
5356 InitReg(MISCREG_TLBI_VAE2OS)
5357 .monWrite().hypWrite();
5358 InitReg(MISCREG_TLBI_ALLE1OS)
5359 .monWrite().hypWrite();
5360 InitReg(MISCREG_TLBI_VALE2OS)
5361 .monWrite().hypWrite();
5363 .monWrite().hypWrite();
5364 InitReg(MISCREG_TLBI_IPAS2E1IS)
5365 .monWrite().hypWrite();
5367 .monWrite().hypWrite();
5368 InitReg(MISCREG_TLBI_ALLE2IS)
5369 .monWrite().hypWrite();
5370 InitReg(MISCREG_TLBI_VAE2IS)
5371 .monWrite().hypWrite();
5372 InitReg(MISCREG_TLBI_ALLE1IS)
5373 .monWrite().hypWrite();
5374 InitReg(MISCREG_TLBI_VALE2IS)
5375 .monWrite().hypWrite();
5377 .monWrite().hypWrite();
5378 InitReg(MISCREG_TLBI_IPAS2E1)
5379 .monWrite().hypWrite();
5380 InitReg(MISCREG_TLBI_IPAS2LE1)
5381 .monWrite().hypWrite();
5382 InitReg(MISCREG_TLBI_ALLE2)
5383 .monWrite().hypWrite();
5384 InitReg(MISCREG_TLBI_VAE2)
5385 .monWrite().hypWrite();
5386 InitReg(MISCREG_TLBI_ALLE1)
5387 .monWrite().hypWrite();
5388 InitReg(MISCREG_TLBI_VALE2)
5389 .monWrite().hypWrite();
5391 .monWrite().hypWrite();
5392 InitReg(MISCREG_TLBI_ALLE3OS)
5393 .monSecureWrite().monNonSecureWrite();
5394 InitReg(MISCREG_TLBI_VAE3OS)
5395 .monSecureWrite().monNonSecureWrite();
5396 InitReg(MISCREG_TLBI_VALE3OS)
5397 .monSecureWrite().monNonSecureWrite();
5398 InitReg(MISCREG_TLBI_ALLE3IS)
5399 .monSecureWrite().monNonSecureWrite();
5400 InitReg(MISCREG_TLBI_VAE3IS)
5401 .monSecureWrite().monNonSecureWrite();
5402 InitReg(MISCREG_TLBI_VALE3IS)
5403 .monSecureWrite().monNonSecureWrite();
5404 InitReg(MISCREG_TLBI_ALLE3)
5405 .monSecureWrite().monNonSecureWrite();
5406 InitReg(MISCREG_TLBI_VAE3)
5407 .monSecureWrite().monNonSecureWrite();
5408 InitReg(MISCREG_TLBI_VALE3)
5409 .monSecureWrite().monNonSecureWrite();
5410
5411 InitReg(MISCREG_TLBI_RVAE1)
5412 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvae1>)
5413 .writes(1).exceptUserMode();
5414 InitReg(MISCREG_TLBI_RVAAE1)
5415 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvaae1>)
5416 .writes(1).exceptUserMode();
5417 InitReg(MISCREG_TLBI_RVALE1)
5418 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvale1>)
5419 .writes(1).exceptUserMode();
5420 InitReg(MISCREG_TLBI_RVAALE1)
5421 .faultWrite(EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvaale1>)
5422 .writes(1).exceptUserMode();
5423 InitReg(MISCREG_TLBI_RIPAS2E1)
5424 .hypWrite().monWrite();
5425 InitReg(MISCREG_TLBI_RIPAS2LE1)
5426 .hypWrite().monWrite();
5427 InitReg(MISCREG_TLBI_RVAE2)
5428 .hypWrite().monWrite();
5429 InitReg(MISCREG_TLBI_RVALE2)
5430 .hypWrite().monWrite();
5431 InitReg(MISCREG_TLBI_RVAE3)
5432 .monWrite();
5433 InitReg(MISCREG_TLBI_RVALE3)
5434 .monWrite();
5435 InitReg(MISCREG_TLBI_RVAE1IS)
5436 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbirvae1is>)
5437 .writes(1).exceptUserMode();
5438 InitReg(MISCREG_TLBI_RVAAE1IS)
5439 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbirvaae1is>)
5440 .writes(1).exceptUserMode();
5441 InitReg(MISCREG_TLBI_RVALE1IS)
5442 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbirvale1is>)
5443 .writes(1).exceptUserMode();
5444 InitReg(MISCREG_TLBI_RVAALE1IS)
5445 .faultWrite(EL1, faultTlbiIsEL1<&HFGITR::tlbirvaale1is>)
5446 .writes(1).exceptUserMode();
5448 .hypWrite().monWrite();
5450 .hypWrite().monWrite();
5451 InitReg(MISCREG_TLBI_RVAE2IS)
5452 .hypWrite().monWrite();
5453 InitReg(MISCREG_TLBI_RVALE2IS)
5454 .hypWrite().monWrite();
5455 InitReg(MISCREG_TLBI_RVAE3IS)
5456 .monWrite();
5457 InitReg(MISCREG_TLBI_RVALE3IS)
5458 .monWrite();
5459 InitReg(MISCREG_TLBI_RVAE1OS)
5460 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbirvae1os>)
5461 .writes(1).exceptUserMode();
5462 InitReg(MISCREG_TLBI_RVAAE1OS)
5463 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbirvaae1os>)
5464 .writes(1).exceptUserMode();
5465 InitReg(MISCREG_TLBI_RVALE1OS)
5466 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbirvale1os>)
5467 .writes(1).exceptUserMode();
5468 InitReg(MISCREG_TLBI_RVAALE1OS)
5469 .faultWrite(EL1, faultTlbiOsEL1<&HFGITR::tlbirvaale1os>)
5470 .writes(1).exceptUserMode();
5472 .hypWrite().monWrite();
5474 .hypWrite().monWrite();
5475 InitReg(MISCREG_TLBI_RVAE2OS)
5476 .hypWrite().monWrite();
5477 InitReg(MISCREG_TLBI_RVALE2OS)
5478 .hypWrite().monWrite();
5479 InitReg(MISCREG_TLBI_RVAE3OS)
5480 .monWrite();
5481 InitReg(MISCREG_TLBI_RVALE3OS)
5482 .monWrite();
5483 InitReg(MISCREG_PMINTENSET_EL1)
5484 .allPrivileges().exceptUserMode()
5485 .mapsTo(MISCREG_PMINTENSET);
5486 InitReg(MISCREG_PMINTENCLR_EL1)
5487 .allPrivileges().exceptUserMode()
5488 .mapsTo(MISCREG_PMINTENCLR);
5489 InitReg(MISCREG_PMCR_EL0)
5490 .allPrivileges()
5491 .mapsTo(MISCREG_PMCR);
5492 InitReg(MISCREG_PMCNTENSET_EL0)
5493 .allPrivileges()
5494 .mapsTo(MISCREG_PMCNTENSET);
5495 InitReg(MISCREG_PMCNTENCLR_EL0)
5496 .allPrivileges()
5497 .mapsTo(MISCREG_PMCNTENCLR);
5498 InitReg(MISCREG_PMOVSCLR_EL0)
5499 .allPrivileges();
5500// .mapsTo(MISCREG_PMOVSCLR);
5501 InitReg(MISCREG_PMSWINC_EL0)
5502 .writes(1).user()
5503 .mapsTo(MISCREG_PMSWINC);
5504 InitReg(MISCREG_PMSELR_EL0)
5505 .allPrivileges()
5506 .mapsTo(MISCREG_PMSELR);
5507 InitReg(MISCREG_PMCEID0_EL0)
5508 .reads(1).user()
5509 .mapsTo(MISCREG_PMCEID0);
5510 InitReg(MISCREG_PMCEID1_EL0)
5511 .reads(1).user()
5512 .mapsTo(MISCREG_PMCEID1);
5513 InitReg(MISCREG_PMCCNTR_EL0)
5514 .allPrivileges()
5515 .mapsTo(MISCREG_PMCCNTR);
5516 InitReg(MISCREG_PMXEVTYPER_EL0)
5517 .allPrivileges()
5518 .mapsTo(MISCREG_PMXEVTYPER);
5519 InitReg(MISCREG_PMCCFILTR_EL0)
5520 .allPrivileges();
5521 InitReg(MISCREG_PMXEVCNTR_EL0)
5522 .allPrivileges()
5523 .mapsTo(MISCREG_PMXEVCNTR);
5524 InitReg(MISCREG_PMUSERENR_EL0)
5525 .allPrivileges().userNonSecureWrite(0).userSecureWrite(0)
5526 .mapsTo(MISCREG_PMUSERENR);
5527 InitReg(MISCREG_PMOVSSET_EL0)
5528 .allPrivileges()
5529 .mapsTo(MISCREG_PMOVSSET);
5530 InitReg(MISCREG_MAIR_EL1)
5531 .allPrivileges().exceptUserMode()
5532 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::mairEL1>)
5533 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::mairEL1>)
5535 InitReg(MISCREG_MAIR_EL12)
5536 .fault(EL2, defaultFaultE2H_EL2)
5537 .fault(EL3, defaultFaultE2H_EL3)
5539 InitReg(MISCREG_AMAIR_EL1)
5540 .allPrivileges().exceptUserMode()
5541 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::amairEL1>)
5542 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::amairEL1>)
5544 InitReg(MISCREG_AMAIR_EL12)
5545 .fault(EL2, defaultFaultE2H_EL2)
5546 .fault(EL3, defaultFaultE2H_EL3)
5548 InitReg(MISCREG_MAIR_EL2)
5549 .hyp().mon()
5551 InitReg(MISCREG_AMAIR_EL2)
5552 .hyp().mon()
5554 InitReg(MISCREG_MAIR_EL3)
5555 .mon();
5556 InitReg(MISCREG_AMAIR_EL3)
5557 .mon();
5558 InitReg(MISCREG_L2CTLR_EL1)
5559 .allPrivileges().exceptUserMode();
5560 InitReg(MISCREG_L2ECTLR_EL1)
5561 .allPrivileges().exceptUserMode();
5562 InitReg(MISCREG_VBAR_EL1)
5563 .allPrivileges().exceptUserMode()
5564 .faultRead(EL1, faultFgtEL1<true, &HFGTR::vbarEL1>)
5565 .faultWrite(EL1, faultFgtEL1<false, &HFGTR::vbarEL1>)
5566 .mapsTo(MISCREG_VBAR_NS);
5567 InitReg(MISCREG_VBAR_EL12)
5568 .fault(EL2, defaultFaultE2H_EL2)
5569 .fault(EL3, defaultFaultE2H_EL3)
5570 .mapsTo(MISCREG_VBAR_NS);
5571 InitReg(MISCREG_RVBAR_EL1)
5572 .reset(FullSystem && system->highestEL() == EL1 ?
5573 system->resetAddr() : 0)
5574 .privRead(FullSystem && system->highestEL() == EL1);
5575 InitReg(MISCREG_ISR_EL1)
5576 .allPrivileges().exceptUserMode().writes(0);
5577 InitReg(MISCREG_VBAR_EL2)
5578 .hyp().mon()
5579 .res0(0x7ff)
5580 .mapsTo(MISCREG_HVBAR);
5581 InitReg(MISCREG_RVBAR_EL2)
5582 .reset(FullSystem && system->highestEL() == EL2 ?
5583 system->resetAddr() : 0)
5584 .hypRead(FullSystem && system->highestEL() == EL2);
5585 InitReg(MISCREG_VBAR_EL3)
5586 .mon();
5587 InitReg(MISCREG_RVBAR_EL3)
5588 .reset(FullSystem && system->highestEL() == EL3 ?
5589 system->resetAddr() : 0)
5590 .mon().writes(0);
5591 InitReg(MISCREG_RMR_EL3)
5592 .mon();
5593 InitReg(MISCREG_CONTEXTIDR_EL1)
5594 .allPrivileges().exceptUserMode()
5595 .faultRead(EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::contextidrEL1>)
5596 .faultWrite(EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::contextidrEL1>)
5597 .mapsTo(MISCREG_CONTEXTIDR_NS);
5599 .fault(EL2, defaultFaultE2H_EL2)
5600 .fault(EL3, defaultFaultE2H_EL3)
5601 .mapsTo(MISCREG_CONTEXTIDR_NS);
5602 InitReg(MISCREG_TPIDR_EL1)
5603 .allPrivileges().exceptUserMode()
5604 .faultRead(EL1, faultFgtEL1<true, &HFGTR::tpidrEL1>)
5605 .faultWrite(EL1, faultFgtEL1<false, &HFGTR::tpidrEL1>)
5606 .mapsTo(MISCREG_TPIDRPRW_NS);
5607 InitReg(MISCREG_TPIDR_EL0)
5608 .allPrivileges()
5609 .faultRead(EL0, faultFgtEL0<true, &HFGTR::tpidrEL0>)
5610 .faultWrite(EL0, faultFgtEL0<false, &HFGTR::tpidrEL0>)
5611 .faultRead(EL1, faultFgtEL1<true, &HFGTR::tpidrEL0>)
5612 .faultWrite(EL1, faultFgtEL1<false, &HFGTR::tpidrEL0>)
5613 .mapsTo(MISCREG_TPIDRURW_NS);
5614 InitReg(MISCREG_TPIDRRO_EL0)
5615 .allPrivileges().userNonSecureWrite(0).userSecureWrite(0)
5616 .faultRead(EL0, faultFgtEL0<true, &HFGTR::tpidrroEL0>)
5617 .faultRead(EL1, faultFgtEL1<true, &HFGTR::tpidrroEL0>)
5618 .faultWrite(EL1, faultFgtEL1<false, &HFGTR::tpidrroEL0>)
5619 .mapsTo(MISCREG_TPIDRURO_NS);
5620 InitReg(MISCREG_TPIDR_EL2)
5621 .hyp().mon()
5622 .mapsTo(MISCREG_HTPIDR);
5623 InitReg(MISCREG_TPIDR_EL3)
5624 .mon();
5625 // BEGIN Generic Timer (AArch64)
5626 InitReg(MISCREG_CNTFRQ_EL0)
5627 .reads(1)
5628 .faultRead(EL0, faultGenericTimerEL0)
5629 .highest(system)
5630 .privSecureWrite(aarch32EL3)
5631 .mapsTo(MISCREG_CNTFRQ);
5632 InitReg(MISCREG_CNTPCT_EL0)
5633 .unverifiable()
5634 .faultRead(EL0, faultCntpctEL0)
5635 .faultRead(EL1, faultCntpctEL1)
5636 .reads(1)
5637 .mapsTo(MISCREG_CNTPCT);
5638 InitReg(MISCREG_CNTVCT_EL0)
5639 .unverifiable()
5640 .faultRead(EL0, faultCntvctEL0)
5641 .faultRead(EL1, faultCntvctEL1)
5642 .reads(1)
5643 .mapsTo(MISCREG_CNTVCT);
5644 InitReg(MISCREG_CNTP_CTL_EL0)
5645 .allPrivileges()
5646 .fault(EL0, faultCntpCtlEL0)
5647 .fault(EL1, faultCntpCtlEL1)
5648 .res0(0xfffffffffffffff8)
5649 .mapsTo(MISCREG_CNTP_CTL_NS);
5650 InitReg(MISCREG_CNTP_CVAL_EL0)
5651 .allPrivileges()
5652 .fault(EL0, faultCntpCtlEL0)
5653 .fault(EL1, faultCntpCtlEL1)
5654 .mapsTo(MISCREG_CNTP_CVAL_NS);
5655 InitReg(MISCREG_CNTP_TVAL_EL0)
5656 .allPrivileges()
5657 .fault(EL0, faultCntpCtlEL0)
5658 .fault(EL1, faultCntpCtlEL1)
5659 .res0(0xffffffff00000000)
5660 .mapsTo(MISCREG_CNTP_TVAL_NS);
5661 InitReg(MISCREG_CNTV_CTL_EL0)
5662 .allPrivileges()
5663 .fault(EL0, faultCntvCtlEL0)
5664 .fault(EL1, faultCntvCtlEL1)
5665 .res0(0xfffffffffffffff8)
5666 .mapsTo(MISCREG_CNTV_CTL);
5667 InitReg(MISCREG_CNTV_CVAL_EL0)
5668 .allPrivileges()
5669 .fault(EL0, faultCntvCtlEL0)
5670 .fault(EL1, faultCntvCtlEL1)
5671 .mapsTo(MISCREG_CNTV_CVAL);
5672 InitReg(MISCREG_CNTV_TVAL_EL0)
5673 .allPrivileges()
5674 .fault(EL0, faultCntvCtlEL0)
5675 .fault(EL1, faultCntvCtlEL1)
5676 .res0(0xffffffff00000000)
5677 .mapsTo(MISCREG_CNTV_TVAL);
5678 InitReg(MISCREG_CNTP_CTL_EL02)
5679 .fault(EL2, defaultFaultE2H_EL2)
5680 .fault(EL3, defaultFaultE2H_EL3)
5681 .res0(0xfffffffffffffff8)
5682 .mapsTo(MISCREG_CNTP_CTL_NS);
5683 InitReg(MISCREG_CNTP_CVAL_EL02)
5684 .fault(EL2, defaultFaultE2H_EL2)
5685 .fault(EL3, defaultFaultE2H_EL3)
5686 .mapsTo(MISCREG_CNTP_CVAL_NS);
5687 InitReg(MISCREG_CNTP_TVAL_EL02)
5688 .fault(EL2, defaultFaultE2H_EL2)
5689 .fault(EL3, defaultFaultE2H_EL3)
5690 .res0(0xffffffff00000000)
5691 .mapsTo(MISCREG_CNTP_TVAL_NS);
5692 InitReg(MISCREG_CNTV_CTL_EL02)
5693 .fault(EL2, defaultFaultE2H_EL2)
5694 .fault(EL3, defaultFaultE2H_EL3)
5695 .res0(0xfffffffffffffff8)
5696 .mapsTo(MISCREG_CNTV_CTL);
5697 InitReg(MISCREG_CNTV_CVAL_EL02)
5698 .fault(EL2, defaultFaultE2H_EL2)
5699 .fault(EL3, defaultFaultE2H_EL3)
5700 .mapsTo(MISCREG_CNTV_CVAL);
5701 InitReg(MISCREG_CNTV_TVAL_EL02)
5702 .fault(EL2, defaultFaultE2H_EL2)
5703 .fault(EL3, defaultFaultE2H_EL3)
5704 .res0(0xffffffff00000000)
5705 .mapsTo(MISCREG_CNTV_TVAL);
5706 InitReg(MISCREG_CNTKCTL_EL1)
5707 .allPrivileges()
5708 .exceptUserMode()
5709 .res0(0xfffffffffffdfc00)
5710 .mapsTo(MISCREG_CNTKCTL);
5711 InitReg(MISCREG_CNTKCTL_EL12)
5712 .fault(EL2, defaultFaultE2H_EL2)
5713 .fault(EL3, defaultFaultE2H_EL3)
5714 .res0(0xfffffffffffdfc00)
5715 .mapsTo(MISCREG_CNTKCTL);
5716 InitReg(MISCREG_CNTPS_CTL_EL1)
5717 .mon()
5718 .privSecure()
5719 .fault(EL1, faultCntpsCtlEL1)
5720 .res0(0xfffffffffffffff8);
5721 InitReg(MISCREG_CNTPS_CVAL_EL1)
5722 .mon()
5723 .privSecure()
5724 .fault(EL1, faultCntpsCtlEL1);
5725 InitReg(MISCREG_CNTPS_TVAL_EL1)
5726 .mon()
5727 .privSecure()
5728 .fault(EL1, faultCntpsCtlEL1)
5729 .res0(0xffffffff00000000);
5730 InitReg(MISCREG_CNTHCTL_EL2)
5731 .mon()
5732 .hyp()
5733 .res0(0xfffffffffffc0000)
5734 .mapsTo(MISCREG_CNTHCTL);
5735 InitReg(MISCREG_CNTHP_CTL_EL2)
5736 .mon()
5737 .hyp()
5738 .res0(0xfffffffffffffff8)
5739 .mapsTo(MISCREG_CNTHP_CTL);
5740 InitReg(MISCREG_CNTHP_CVAL_EL2)
5741 .mon()
5742 .hyp()
5743 .mapsTo(MISCREG_CNTHP_CVAL);
5744 InitReg(MISCREG_CNTHP_TVAL_EL2)
5745 .mon()
5746 .hyp()
5747 .res0(0xffffffff00000000)
5748 .mapsTo(MISCREG_CNTHP_TVAL);
5749 InitReg(MISCREG_CNTHPS_CTL_EL2)
5750 .mon(sel2_implemented)
5751 .hypSecure(sel2_implemented)
5752 .res0(0xfffffffffffffff8);
5754 .mon(sel2_implemented)
5755 .hypSecure(sel2_implemented);
5757 .mon(sel2_implemented)
5758 .hypSecure(sel2_implemented)
5759 .res0(0xffffffff00000000);
5760 InitReg(MISCREG_CNTHV_CTL_EL2)
5761 .mon(vhe_implemented)
5762 .hyp()
5763 .res0(0xfffffffffffffff8);
5764 InitReg(MISCREG_CNTHV_CVAL_EL2)
5765 .mon(vhe_implemented)
5766 .hyp(vhe_implemented);
5767 InitReg(MISCREG_CNTHV_TVAL_EL2)
5768 .mon(vhe_implemented)
5769 .hyp(vhe_implemented)
5770 .res0(0xffffffff00000000);
5771 InitReg(MISCREG_CNTHVS_CTL_EL2)
5772 .mon(vhe_implemented && sel2_implemented)
5773 .hypSecure(vhe_implemented && sel2_implemented)
5774 .res0(0xfffffffffffffff8);
5776 .mon(vhe_implemented && sel2_implemented)
5777 .hypSecure(vhe_implemented && sel2_implemented);
5779 .mon(vhe_implemented && sel2_implemented)
5780 .hypSecure(vhe_implemented && sel2_implemented)
5781 .res0(0xffffffff00000000);
5782 // ENDIF Armv8.1-VHE
5783 InitReg(MISCREG_CNTVOFF_EL2)
5784 .mon()
5785 .hyp()
5786 .mapsTo(MISCREG_CNTVOFF);
5787 // END Generic Timer (AArch64)
5788 InitReg(MISCREG_PMEVCNTR0_EL0)
5789 .allPrivileges();
5790// .mapsTo(MISCREG_PMEVCNTR0);
5791 InitReg(MISCREG_PMEVCNTR1_EL0)
5792 .allPrivileges();
5793// .mapsTo(MISCREG_PMEVCNTR1);
5794 InitReg(MISCREG_PMEVCNTR2_EL0)
5795 .allPrivileges();
5796// .mapsTo(MISCREG_PMEVCNTR2);
5797 InitReg(MISCREG_PMEVCNTR3_EL0)
5798 .allPrivileges();
5799// .mapsTo(MISCREG_PMEVCNTR3);
5800 InitReg(MISCREG_PMEVCNTR4_EL0)
5801 .allPrivileges();
5802// .mapsTo(MISCREG_PMEVCNTR4);
5803 InitReg(MISCREG_PMEVCNTR5_EL0)
5804 .allPrivileges();
5805// .mapsTo(MISCREG_PMEVCNTR5);
5806 InitReg(MISCREG_PMEVTYPER0_EL0)
5807 .allPrivileges();
5808// .mapsTo(MISCREG_PMEVTYPER0);
5809 InitReg(MISCREG_PMEVTYPER1_EL0)
5810 .allPrivileges();
5811// .mapsTo(MISCREG_PMEVTYPER1);
5812 InitReg(MISCREG_PMEVTYPER2_EL0)
5813 .allPrivileges();
5814// .mapsTo(MISCREG_PMEVTYPER2);
5815 InitReg(MISCREG_PMEVTYPER3_EL0)
5816 .allPrivileges();
5817// .mapsTo(MISCREG_PMEVTYPER3);
5818 InitReg(MISCREG_PMEVTYPER4_EL0)
5819 .allPrivileges();
5820// .mapsTo(MISCREG_PMEVTYPER4);
5821 InitReg(MISCREG_PMEVTYPER5_EL0)
5822 .allPrivileges();
5823// .mapsTo(MISCREG_PMEVTYPER5);
5824 InitReg(MISCREG_IL1DATA0_EL1)
5825 .allPrivileges().exceptUserMode();
5826 InitReg(MISCREG_IL1DATA1_EL1)
5827 .allPrivileges().exceptUserMode();
5828 InitReg(MISCREG_IL1DATA2_EL1)
5829 .allPrivileges().exceptUserMode();
5830 InitReg(MISCREG_IL1DATA3_EL1)
5831 .allPrivileges().exceptUserMode();
5832 InitReg(MISCREG_DL1DATA0_EL1)
5833 .allPrivileges().exceptUserMode();
5834 InitReg(MISCREG_DL1DATA1_EL1)
5835 .allPrivileges().exceptUserMode();
5836 InitReg(MISCREG_DL1DATA2_EL1)
5837 .allPrivileges().exceptUserMode();
5838 InitReg(MISCREG_DL1DATA3_EL1)
5839 .allPrivileges().exceptUserMode();
5840 InitReg(MISCREG_DL1DATA4_EL1)
5841 .allPrivileges().exceptUserMode();
5842 InitReg(MISCREG_L2ACTLR_EL1)
5843 .allPrivileges().exceptUserMode();
5844 InitReg(MISCREG_CPUACTLR_EL1)
5845 .allPrivileges().exceptUserMode();
5846 InitReg(MISCREG_CPUECTLR_EL1)
5847 .allPrivileges().exceptUserMode();
5848 InitReg(MISCREG_CPUMERRSR_EL1)
5849 .allPrivileges().exceptUserMode();
5850 InitReg(MISCREG_L2MERRSR_EL1)
5851 .warnNotFail()
5852 .fault(faultUnimplemented);
5853 InitReg(MISCREG_CBAR_EL1)
5854 .allPrivileges().exceptUserMode().writes(0);
5855 InitReg(MISCREG_CONTEXTIDR_EL2)
5856 .mon().hyp();
5857
5858 // GICv3 AArch64
5859 InitReg(MISCREG_ICC_PMR_EL1)
5860 .res0(0xffffff00) // [31:8]
5861 .allPrivileges().exceptUserMode()
5862 .mapsTo(MISCREG_ICC_PMR);
5863 InitReg(MISCREG_ICC_IAR0_EL1)
5864 .allPrivileges().exceptUserMode().writes(0)
5865 .mapsTo(MISCREG_ICC_IAR0);
5866 InitReg(MISCREG_ICC_EOIR0_EL1)
5867 .allPrivileges().exceptUserMode().reads(0)
5868 .mapsTo(MISCREG_ICC_EOIR0);
5869 InitReg(MISCREG_ICC_HPPIR0_EL1)
5870 .allPrivileges().exceptUserMode().writes(0)
5871 .mapsTo(MISCREG_ICC_HPPIR0);
5872 InitReg(MISCREG_ICC_BPR0_EL1)
5873 .res0(0xfffffff8) // [31:3]
5874 .allPrivileges().exceptUserMode()
5875 .mapsTo(MISCREG_ICC_BPR0);
5876 InitReg(MISCREG_ICC_AP0R0_EL1)
5877 .allPrivileges().exceptUserMode()
5878 .mapsTo(MISCREG_ICC_AP0R0);
5879 InitReg(MISCREG_ICC_AP0R1_EL1)
5880 .allPrivileges().exceptUserMode()
5881 .mapsTo(MISCREG_ICC_AP0R1);
5882 InitReg(MISCREG_ICC_AP0R2_EL1)
5883 .allPrivileges().exceptUserMode()
5884 .mapsTo(MISCREG_ICC_AP0R2);
5885 InitReg(MISCREG_ICC_AP0R3_EL1)
5886 .allPrivileges().exceptUserMode()
5887 .mapsTo(MISCREG_ICC_AP0R3);
5888 InitReg(MISCREG_ICC_AP1R0_EL1)
5889 .banked64()
5890 .mapsTo(MISCREG_ICC_AP1R0);
5892 .bankedChild()
5893 .allPrivileges().exceptUserMode()
5894 .mapsTo(MISCREG_ICC_AP1R0_NS);
5896 .bankedChild()
5897 .allPrivileges().exceptUserMode()
5898 .mapsTo(MISCREG_ICC_AP1R0_S);
5899 InitReg(MISCREG_ICC_AP1R1_EL1)
5900 .banked64()
5901 .mapsTo(MISCREG_ICC_AP1R1);
5903 .bankedChild()
5904 .allPrivileges().exceptUserMode()
5905 .mapsTo(MISCREG_ICC_AP1R1_NS);
5907 .bankedChild()
5908 .allPrivileges().exceptUserMode()
5909 .mapsTo(MISCREG_ICC_AP1R1_S);
5910 InitReg(MISCREG_ICC_AP1R2_EL1)
5911 .banked64()
5912 .mapsTo(MISCREG_ICC_AP1R2);
5914 .bankedChild()
5915 .allPrivileges().exceptUserMode()
5916 .mapsTo(MISCREG_ICC_AP1R2_NS);
5918 .bankedChild()
5919 .allPrivileges().exceptUserMode()
5920 .mapsTo(MISCREG_ICC_AP1R2_S);
5921 InitReg(MISCREG_ICC_AP1R3_EL1)
5922 .banked64()
5923 .mapsTo(MISCREG_ICC_AP1R3);
5925 .bankedChild()
5926 .allPrivileges().exceptUserMode()
5927 .mapsTo(MISCREG_ICC_AP1R3_NS);
5929 .bankedChild()
5930 .allPrivileges().exceptUserMode()
5931 .mapsTo(MISCREG_ICC_AP1R3_S);
5932 InitReg(MISCREG_ICC_DIR_EL1)
5933 .res0(0xFF000000) // [31:24]
5934 .allPrivileges().exceptUserMode().reads(0)
5935 .mapsTo(MISCREG_ICC_DIR);
5936 InitReg(MISCREG_ICC_RPR_EL1)
5937 .allPrivileges().exceptUserMode().writes(0)
5938 .mapsTo(MISCREG_ICC_RPR);
5939 InitReg(MISCREG_ICC_SGI1R_EL1)
5940 .allPrivileges().exceptUserMode().reads(0)
5941 .faultWrite(EL1, faultIccSgiEL1)
5942 .faultWrite(EL2, faultIccSgiEL2)
5943 .mapsTo(MISCREG_ICC_SGI1R);
5944 InitReg(MISCREG_ICC_ASGI1R_EL1)
5945 .allPrivileges().exceptUserMode().reads(0)
5946 .faultWrite(EL1, faultIccSgiEL1)
5947 .faultWrite(EL2, faultIccSgiEL2)
5948 .mapsTo(MISCREG_ICC_ASGI1R);
5949 InitReg(MISCREG_ICC_SGI0R_EL1)
5950 .allPrivileges().exceptUserMode().reads(0)
5951 .faultWrite(EL1, faultIccSgiEL1)
5952 .faultWrite(EL2, faultIccSgiEL2)
5953 .mapsTo(MISCREG_ICC_SGI0R);
5954 InitReg(MISCREG_ICC_IAR1_EL1)
5955 .allPrivileges().exceptUserMode().writes(0)
5956 .mapsTo(MISCREG_ICC_IAR1);
5957 InitReg(MISCREG_ICC_EOIR1_EL1)
5958 .res0(0xFF000000) // [31:24]
5959 .allPrivileges().exceptUserMode().reads(0)
5960 .mapsTo(MISCREG_ICC_EOIR1);
5961 InitReg(MISCREG_ICC_HPPIR1_EL1)
5962 .allPrivileges().exceptUserMode().writes(0)
5963 .mapsTo(MISCREG_ICC_HPPIR1);
5964 InitReg(MISCREG_ICC_BPR1_EL1)
5965 .banked64()
5966 .mapsTo(MISCREG_ICC_BPR1);
5968 .bankedChild()
5969 .res0(0xfffffff8) // [31:3]
5970 .allPrivileges().exceptUserMode()
5971 .mapsTo(MISCREG_ICC_BPR1_NS);
5972 InitReg(MISCREG_ICC_BPR1_EL1_S)
5973 .bankedChild()
5974 .res0(0xfffffff8) // [31:3]
5975 .secure().exceptUserMode()
5976 .mapsTo(MISCREG_ICC_BPR1_S);
5977 InitReg(MISCREG_ICC_CTLR_EL1)
5978 .banked64()
5979 .mapsTo(MISCREG_ICC_CTLR);
5981 .bankedChild()
5982 .res0(0xFFFB00BC) // [31:19, 17:16, 7, 5:2]
5983 .allPrivileges().exceptUserMode()
5984 .mapsTo(MISCREG_ICC_CTLR_NS);
5985 InitReg(MISCREG_ICC_CTLR_EL1_S)
5986 .bankedChild()
5987 .res0(0xFFFB00BC) // [31:19, 17:16, 7, 5:2]
5988 .secure().exceptUserMode()
5989 .mapsTo(MISCREG_ICC_CTLR_S);
5990 InitReg(MISCREG_ICC_SRE_EL1)
5991 .banked()
5992 .mapsTo(MISCREG_ICC_SRE);
5993 InitReg(MISCREG_ICC_SRE_EL1_NS)
5994 .bankedChild()
5995 .res0(0xFFFFFFF8) // [31:3]
5996 .allPrivileges().exceptUserMode()
5997 .mapsTo(MISCREG_ICC_SRE_NS);
5998 InitReg(MISCREG_ICC_SRE_EL1_S)
5999 .bankedChild()
6000 .res0(0xFFFFFFF8) // [31:3]
6001 .secure().exceptUserMode()
6002 .mapsTo(MISCREG_ICC_SRE_S);
6004 .res0(0xFFFFFFFE) // [31:1]
6005 .allPrivileges().exceptUserMode()
6006 .faultRead(EL1, faultFgtEL1<true, &HFGTR::iccIgrpEnEL1>)
6007 .faultWrite(EL1, faultFgtEL1<false, &HFGTR::iccIgrpEnEL1>)
6008 .mapsTo(MISCREG_ICC_IGRPEN0);
6010 .banked64()
6011 .faultRead(EL1, faultFgtEL1<true, &HFGTR::iccIgrpEnEL1>)
6012 .faultWrite(EL1, faultFgtEL1<false, &HFGTR::iccIgrpEnEL1>)
6013 .mapsTo(MISCREG_ICC_IGRPEN1);
6015 .bankedChild()
6016 .res0(0xFFFFFFFE) // [31:1]
6017 .allPrivileges().exceptUserMode()
6018 .mapsTo(MISCREG_ICC_IGRPEN1_NS);
6020 .bankedChild()
6021 .res0(0xFFFFFFFE) // [31:1]
6022 .secure().exceptUserMode()
6023 .mapsTo(MISCREG_ICC_IGRPEN1_S);
6024 InitReg(MISCREG_ICC_SRE_EL2)
6025 .hyp().mon()
6026 .mapsTo(MISCREG_ICC_HSRE);
6027 InitReg(MISCREG_ICC_CTLR_EL3)
6028 .mon()
6029 .mapsTo(MISCREG_ICC_MCTLR);
6030 InitReg(MISCREG_ICC_SRE_EL3)
6031 .mon()
6032 .mapsTo(MISCREG_ICC_MSRE);
6034 .mon()
6035 .mapsTo(MISCREG_ICC_MGRPEN1);
6036
6037 InitReg(MISCREG_ICH_AP0R0_EL2)
6038 .hyp().mon()
6039 .mapsTo(MISCREG_ICH_AP0R0);
6040 InitReg(MISCREG_ICH_AP0R1_EL2)
6041 .hyp().mon()
6042 .mapsTo(MISCREG_ICH_AP0R1);
6043 InitReg(MISCREG_ICH_AP0R2_EL2)
6044 .hyp().mon()
6045 .mapsTo(MISCREG_ICH_AP0R2);
6046 InitReg(MISCREG_ICH_AP0R3_EL2)
6047 .hyp().mon()
6048 .mapsTo(MISCREG_ICH_AP0R3);
6049 InitReg(MISCREG_ICH_AP1R0_EL2)
6050 .hyp().mon()
6051 .mapsTo(MISCREG_ICH_AP1R0);
6052 InitReg(MISCREG_ICH_AP1R1_EL2)
6053 .hyp().mon()
6054 .mapsTo(MISCREG_ICH_AP1R1);
6055 InitReg(MISCREG_ICH_AP1R2_EL2)
6056 .hyp().mon()
6057 .mapsTo(MISCREG_ICH_AP1R2);
6058 InitReg(MISCREG_ICH_AP1R3_EL2)
6059 .hyp().mon()
6060 .mapsTo(MISCREG_ICH_AP1R3);
6061 InitReg(MISCREG_ICH_HCR_EL2)
6062 .hyp().mon()
6063 .mapsTo(MISCREG_ICH_HCR);
6064 InitReg(MISCREG_ICH_VTR_EL2)
6065 .hyp().mon().writes(0)
6066 .mapsTo(MISCREG_ICH_VTR);
6067 InitReg(MISCREG_ICH_MISR_EL2)
6068 .hyp().mon().writes(0)
6069 .mapsTo(MISCREG_ICH_MISR);
6070 InitReg(MISCREG_ICH_EISR_EL2)
6071 .hyp().mon().writes(0)
6072 .mapsTo(MISCREG_ICH_EISR);
6073 InitReg(MISCREG_ICH_ELRSR_EL2)
6074 .hyp().mon().writes(0)
6075 .mapsTo(MISCREG_ICH_ELRSR);
6076 InitReg(MISCREG_ICH_VMCR_EL2)
6077 .hyp().mon()
6078 .mapsTo(MISCREG_ICH_VMCR);
6079 InitReg(MISCREG_ICH_LR0_EL2)
6080 .hyp().mon()
6082 InitReg(MISCREG_ICH_LR1_EL2)
6083 .hyp().mon()
6085 InitReg(MISCREG_ICH_LR2_EL2)
6086 .hyp().mon()
6088 InitReg(MISCREG_ICH_LR3_EL2)
6089 .hyp().mon()
6091 InitReg(MISCREG_ICH_LR4_EL2)
6092 .hyp().mon()
6094 InitReg(MISCREG_ICH_LR5_EL2)
6095 .hyp().mon()
6097 InitReg(MISCREG_ICH_LR6_EL2)
6098 .hyp().mon()
6100 InitReg(MISCREG_ICH_LR7_EL2)
6101 .hyp().mon()
6103 InitReg(MISCREG_ICH_LR8_EL2)
6104 .hyp().mon()
6106 InitReg(MISCREG_ICH_LR9_EL2)
6107 .hyp().mon()
6109 InitReg(MISCREG_ICH_LR10_EL2)
6110 .hyp().mon()
6112 InitReg(MISCREG_ICH_LR11_EL2)
6113 .hyp().mon()
6115 InitReg(MISCREG_ICH_LR12_EL2)
6116 .hyp().mon()
6118 InitReg(MISCREG_ICH_LR13_EL2)
6119 .hyp().mon()
6121 InitReg(MISCREG_ICH_LR14_EL2)
6122 .hyp().mon()
6124 InitReg(MISCREG_ICH_LR15_EL2)
6125 .hyp().mon()
6127
6128 // GICv3 AArch32
6129 InitReg(MISCREG_ICC_AP0R0)
6130 .allPrivileges().exceptUserMode();
6131 InitReg(MISCREG_ICC_AP0R1)
6132 .allPrivileges().exceptUserMode();
6133 InitReg(MISCREG_ICC_AP0R2)
6134 .allPrivileges().exceptUserMode();
6135 InitReg(MISCREG_ICC_AP0R3)
6136 .allPrivileges().exceptUserMode();
6137 InitReg(MISCREG_ICC_AP1R0)
6138 .allPrivileges().exceptUserMode();
6139 InitReg(MISCREG_ICC_AP1R0_NS)
6140 .allPrivileges().exceptUserMode();
6141 InitReg(MISCREG_ICC_AP1R0_S)
6142 .allPrivileges().exceptUserMode();
6143 InitReg(MISCREG_ICC_AP1R1)
6144 .allPrivileges().exceptUserMode();
6145 InitReg(MISCREG_ICC_AP1R1_NS)
6146 .allPrivileges().exceptUserMode();
6147 InitReg(MISCREG_ICC_AP1R1_S)
6148 .allPrivileges().exceptUserMode();
6149 InitReg(MISCREG_ICC_AP1R2)
6150 .allPrivileges().exceptUserMode();
6151 InitReg(MISCREG_ICC_AP1R2_NS)
6152 .allPrivileges().exceptUserMode();
6153 InitReg(MISCREG_ICC_AP1R2_S)
6154 .allPrivileges().exceptUserMode();
6155 InitReg(MISCREG_ICC_AP1R3)
6156 .allPrivileges().exceptUserMode();
6157 InitReg(MISCREG_ICC_AP1R3_NS)
6158 .allPrivileges().exceptUserMode();
6159 InitReg(MISCREG_ICC_AP1R3_S)
6160 .allPrivileges().exceptUserMode();
6161 InitReg(MISCREG_ICC_ASGI1R)
6162 .allPrivileges().exceptUserMode().reads(0);
6163 InitReg(MISCREG_ICC_BPR0)
6164 .allPrivileges().exceptUserMode();
6165 InitReg(MISCREG_ICC_BPR1)
6166 .allPrivileges().exceptUserMode();
6167 InitReg(MISCREG_ICC_BPR1_NS)
6168 .allPrivileges().exceptUserMode();
6169 InitReg(MISCREG_ICC_BPR1_S)
6170 .allPrivileges().exceptUserMode();
6171 InitReg(MISCREG_ICC_CTLR)
6172 .allPrivileges().exceptUserMode();
6173 InitReg(MISCREG_ICC_CTLR_NS)
6174 .allPrivileges().exceptUserMode();
6175 InitReg(MISCREG_ICC_CTLR_S)
6176 .allPrivileges().exceptUserMode();
6177 InitReg(MISCREG_ICC_DIR)
6178 .allPrivileges().exceptUserMode().reads(0);
6179 InitReg(MISCREG_ICC_EOIR0)
6180 .allPrivileges().exceptUserMode().reads(0);
6181 InitReg(MISCREG_ICC_EOIR1)
6182 .allPrivileges().exceptUserMode().reads(0);
6183 InitReg(MISCREG_ICC_HPPIR0)
6184 .allPrivileges().exceptUserMode().writes(0);
6185 InitReg(MISCREG_ICC_HPPIR1)
6186 .allPrivileges().exceptUserMode().writes(0);
6187 InitReg(MISCREG_ICC_HSRE)
6188 .hyp().mon();
6189 InitReg(MISCREG_ICC_IAR0)
6190 .allPrivileges().exceptUserMode().writes(0);
6191 InitReg(MISCREG_ICC_IAR1)
6192 .allPrivileges().exceptUserMode().writes(0);
6193 InitReg(MISCREG_ICC_IGRPEN0)
6194 .allPrivileges().exceptUserMode();
6195 InitReg(MISCREG_ICC_IGRPEN1)
6196 .allPrivileges().exceptUserMode();
6197 InitReg(MISCREG_ICC_IGRPEN1_NS)
6198 .allPrivileges().exceptUserMode();
6199 InitReg(MISCREG_ICC_IGRPEN1_S)
6200 .allPrivileges().exceptUserMode();
6201 InitReg(MISCREG_ICC_MCTLR)
6202 .mon();
6203 InitReg(MISCREG_ICC_MGRPEN1)
6204 .mon();
6205 InitReg(MISCREG_ICC_MSRE)
6206 .mon();
6207 InitReg(MISCREG_ICC_PMR)
6208 .allPrivileges().exceptUserMode();
6209 InitReg(MISCREG_ICC_RPR)
6210 .allPrivileges().exceptUserMode().writes(0);
6211 InitReg(MISCREG_ICC_SGI0R)
6212 .allPrivileges().exceptUserMode().reads(0);
6213 InitReg(MISCREG_ICC_SGI1R)
6214 .allPrivileges().exceptUserMode().reads(0);
6215 InitReg(MISCREG_ICC_SRE)
6216 .allPrivileges().exceptUserMode();
6217 InitReg(MISCREG_ICC_SRE_NS)
6218 .allPrivileges().exceptUserMode();
6219 InitReg(MISCREG_ICC_SRE_S)
6220 .allPrivileges().exceptUserMode();
6221
6222 InitReg(MISCREG_ICH_AP0R0)
6223 .hyp().mon();
6224 InitReg(MISCREG_ICH_AP0R1)
6225 .hyp().mon();
6226 InitReg(MISCREG_ICH_AP0R2)
6227 .hyp().mon();
6228 InitReg(MISCREG_ICH_AP0R3)
6229 .hyp().mon();
6230 InitReg(MISCREG_ICH_AP1R0)
6231 .hyp().mon();
6232 InitReg(MISCREG_ICH_AP1R1)
6233 .hyp().mon();
6234 InitReg(MISCREG_ICH_AP1R2)
6235 .hyp().mon();
6236 InitReg(MISCREG_ICH_AP1R3)
6237 .hyp().mon();
6238 InitReg(MISCREG_ICH_HCR)
6239 .hyp().mon();
6240 InitReg(MISCREG_ICH_VTR)
6241 .hyp().mon().writes(0);
6242 InitReg(MISCREG_ICH_MISR)
6243 .hyp().mon().writes(0);
6244 InitReg(MISCREG_ICH_EISR)
6245 .hyp().mon().writes(0);
6246 InitReg(MISCREG_ICH_ELRSR)
6247 .hyp().mon().writes(0);
6248 InitReg(MISCREG_ICH_VMCR)
6249 .hyp().mon();
6250 InitReg(MISCREG_ICH_LR0)
6251 .hyp().mon();
6252 InitReg(MISCREG_ICH_LR1)
6253 .hyp().mon();
6254 InitReg(MISCREG_ICH_LR2)
6255 .hyp().mon();
6256 InitReg(MISCREG_ICH_LR3)
6257 .hyp().mon();
6258 InitReg(MISCREG_ICH_LR4)
6259 .hyp().mon();
6260 InitReg(MISCREG_ICH_LR5)
6261 .hyp().mon();
6262 InitReg(MISCREG_ICH_LR6)
6263 .hyp().mon();
6264 InitReg(MISCREG_ICH_LR7)
6265 .hyp().mon();
6266 InitReg(MISCREG_ICH_LR8)
6267 .hyp().mon();
6268 InitReg(MISCREG_ICH_LR9)
6269 .hyp().mon();
6270 InitReg(MISCREG_ICH_LR10)
6271 .hyp().mon();
6272 InitReg(MISCREG_ICH_LR11)
6273 .hyp().mon();
6274 InitReg(MISCREG_ICH_LR12)
6275 .hyp().mon();
6276 InitReg(MISCREG_ICH_LR13)
6277 .hyp().mon();
6278 InitReg(MISCREG_ICH_LR14)
6279 .hyp().mon();
6280 InitReg(MISCREG_ICH_LR15)
6281 .hyp().mon();
6282 InitReg(MISCREG_ICH_LRC0)
6283 .hyp().mon();
6284 InitReg(MISCREG_ICH_LRC1)
6285 .hyp().mon();
6286 InitReg(MISCREG_ICH_LRC2)
6287 .hyp().mon();
6288 InitReg(MISCREG_ICH_LRC3)
6289 .hyp().mon();
6290 InitReg(MISCREG_ICH_LRC4)
6291 .hyp().mon();
6292 InitReg(MISCREG_ICH_LRC5)
6293 .hyp().mon();
6294 InitReg(MISCREG_ICH_LRC6)
6295 .hyp().mon();
6296 InitReg(MISCREG_ICH_LRC7)
6297 .hyp().mon();
6298 InitReg(MISCREG_ICH_LRC8)
6299 .hyp().mon();
6300 InitReg(MISCREG_ICH_LRC9)
6301 .hyp().mon();
6302 InitReg(MISCREG_ICH_LRC10)
6303 .hyp().mon();
6304 InitReg(MISCREG_ICH_LRC11)
6305 .hyp().mon();
6306 InitReg(MISCREG_ICH_LRC12)
6307 .hyp().mon();
6308 InitReg(MISCREG_ICH_LRC13)
6309 .hyp().mon();
6310 InitReg(MISCREG_ICH_LRC14)
6311 .hyp().mon();
6312 InitReg(MISCREG_ICH_LRC15)
6313 .hyp().mon();
6314
6315 // SVE
6317 .reset([this](){
6318 AA64ZFR0 zfr0_el1 = 0;
6319 zfr0_el1.f32mm = release->has(ArmExtension::FEAT_F32MM) ? 1 : 0;
6320 zfr0_el1.f64mm = release->has(ArmExtension::FEAT_F64MM) ? 1 : 0;
6321 zfr0_el1.i8mm = release->has(ArmExtension::FEAT_I8MM) ? 1 : 0;
6322 return zfr0_el1;
6323 }())
6324 .faultRead(EL0, faultIdst)
6325 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
6326 .allPrivileges().exceptUserMode().writes(0);
6327 InitReg(MISCREG_ZCR_EL3)
6328 .reset(sveVL - 1)
6329 .fault(EL3, faultZcrEL3)
6330 .mon();
6331 InitReg(MISCREG_ZCR_EL2)
6332 .reset(sveVL - 1)
6333 .fault(EL2, faultZcrEL2)
6334 .fault(EL3, faultZcrEL3)
6335 .hyp().mon();
6336 InitReg(MISCREG_ZCR_EL12)
6337 .fault(EL2, defaultFaultE2H_EL2)
6338 .fault(EL3, defaultFaultE2H_EL3)
6339 .mapsTo(MISCREG_ZCR_EL1);
6340 InitReg(MISCREG_ZCR_EL1)
6341 .reset(sveVL - 1)
6342 .fault(EL1, faultZcrEL1)
6343 .fault(EL2, faultZcrEL2)
6344 .fault(EL3, faultZcrEL3)
6345 .allPrivileges().exceptUserMode();
6346
6347 // SME
6349 .reset([](){
6350 AA64SMFR0 smfr0_el1 = 0;
6351 smfr0_el1.f32f32 = 0x1;
6352 // The following BF16F32 is actually not implemented due to a
6353 // lack of BF16 support in gem5's fplib. However, as per the
6354 // SME spec the _only_ allowed value is 0x1.
6355 smfr0_el1.b16f32 = 0x1;
6356 smfr0_el1.f16f32 = 0x1;
6357 smfr0_el1.i8i32 = 0xF;
6358 smfr0_el1.f64f64 = 0x1;
6359 smfr0_el1.i16i64 = 0xF;
6360 smfr0_el1.smEver = 0;
6361 smfr0_el1.fa64 = 0x1;
6362 return smfr0_el1;
6363 }())
6364 .faultRead(EL0, faultIdst)
6365 .faultRead(EL1, faultHcrEL1<&HCR::tid3>)
6366 .allPrivileges().writes(0);
6367 InitReg(MISCREG_SVCR)
6368 .res0([](){
6369 SVCR svcr_mask = 0;
6370 svcr_mask.sm = 1;
6371 svcr_mask.za = 1;
6372 return ~svcr_mask;
6373 }())
6374 .fault(EL0, faultSmenEL0)
6375 .fault(EL1, faultSmenEL1)
6376 .fault(EL2, faultTsmSmen)
6377 .fault(EL3, faultEsm)
6378 .allPrivileges();
6379 InitReg(MISCREG_SMIDR_EL1)
6380 .reset([](){
6381 SMIDR smidr_el1 = 0;
6382 smidr_el1.affinity = 0;
6383 smidr_el1.smps = 0;
6384 smidr_el1.implementer = 0x41;
6385 return smidr_el1;
6386 }())
6387 .faultRead(EL0, faultIdst)
6388 .faultRead(EL1, faultHcrEL1<&HCR::tid1>)
6389 .allPrivileges().writes(0);
6390 InitReg(MISCREG_SMPRI_EL1)
6391 .res0(mask(63, 4))
6392 .fault(EL1, faultEsm)
6393 .fault(EL2, faultEsm)
6394 .fault(EL3, faultEsm)
6395 .allPrivileges().exceptUserMode();
6396 InitReg(MISCREG_SMPRIMAP_EL2)
6397 .fault(EL2, faultEsm)
6398 .fault(EL3, faultEsm)
6399 .hyp().mon();
6400 InitReg(MISCREG_SMCR_EL3)
6401 .reset([this](){
6402 // We want to support FEAT_SME_FA64. Therefore, we enable it in
6403 // all SMCR_ELx registers by default. Runtime software might
6404 // change this later, but given that gem5 doesn't disable
6405 // instructions based on this flag we default to the most
6406 // representative value.
6407 SMCR smcr_el3 = 0;
6408 smcr_el3.fa64 = 1;
6409 smcr_el3.len = smeVL - 1;
6410 return smcr_el3;
6411 }())
6412 .fault(EL3, faultEsm)
6413 .mon();
6414 InitReg(MISCREG_SMCR_EL2)
6415 .reset([this](){
6416 // We want to support FEAT_SME_FA64. Therefore, we enable it in
6417 // all SMCR_ELx registers by default. Runtime software might
6418 // change this later, but given that gem5 doesn't disable
6419 // instructions based on this flag we default to the most
6420 // representative value.
6421 SMCR smcr_el2 = 0;
6422 smcr_el2.fa64 = 1;
6423 smcr_el2.len = smeVL - 1;
6424 return smcr_el2;
6425 }())
6426 .fault(EL2, faultTsmSmen)
6427 .fault(EL3, faultEsm)
6428 .hyp().mon();
6429 InitReg(MISCREG_SMCR_EL12)
6430 .allPrivileges().exceptUserMode();
6431 InitReg(MISCREG_SMCR_EL1)
6432 .reset([this](){
6433 // We want to support FEAT_SME_FA64. Therefore, we enable it in
6434 // all SMCR_ELx registers by default. Runtime software might
6435 // change this later, but given that gem5 doesn't disable
6436 // instructions based on this flag we default to the most
6437 // representative value.
6438 SMCR smcr_el1 = 0;
6439 smcr_el1.fa64 = 1;
6440 smcr_el1.len = smeVL - 1;
6441 return smcr_el1;
6442 }())
6443 .fault(EL1, faultSmenEL1)
6444 .fault(EL2, faultTsmSmen)
6445 .fault(EL3, faultEsm)
6446 .allPrivileges().exceptUserMode();
6447 InitReg(MISCREG_TPIDR2_EL0)
6448 .allPrivileges();
6449
6450 InitReg(MISCREG_RNDR)
6451 .faultRead(EL0, faultRng)
6452 .faultRead(EL1, faultRng)
6453 .faultRead(EL2, faultRng)
6454 .faultRead(EL3, faultRng)
6455 .unverifiable()
6456 .allPrivileges().writes(0);
6457 InitReg(MISCREG_RNDRRS)
6458 .faultRead(EL0, faultRng)
6459 .faultRead(EL1, faultRng)
6460 .faultRead(EL2, faultRng)
6461 .faultRead(EL3, faultRng)
6462 .unverifiable()
6463 .allPrivileges().writes(0);
6464
6465 // FEAT_FGT extension
6466 InitReg(MISCREG_HFGRTR_EL2)
6467 .fault(EL2, faultFgtCtrlRegs)
6468 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6469 InitReg(MISCREG_HFGWTR_EL2)
6470 .fault(EL2, faultFgtCtrlRegs)
6471 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6472 InitReg(MISCREG_HFGITR_EL2)
6473 .fault(EL2, faultFgtCtrlRegs)
6474 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6475 InitReg(MISCREG_HDFGRTR_EL2)
6476 .fault(EL2, faultFgtCtrlRegs)
6477 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6478 InitReg(MISCREG_HDFGWTR_EL2)
6479 .fault(EL2, faultFgtCtrlRegs)
6480 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6481
6482 // Dummy registers
6483 InitReg(MISCREG_NOP)
6484 .allPrivileges();
6485 InitReg(MISCREG_RAZ)
6486 .allPrivileges().exceptUserMode().writes(0);
6487 InitReg(MISCREG_UNKNOWN);
6488 InitReg(MISCREG_IMPDEF_UNIMPL)
6489 .fault(EL1, faultImpdefUnimplEL1)
6490 .fault(EL2, faultUnimplemented)
6491 .fault(EL3, faultUnimplemented)
6492 .warnNotFail(impdefAsNop);
6493
6494 // RAS extension (unimplemented)
6495 InitReg(MISCREG_ERRIDR_EL1)
6496 .warnNotFail()
6497 .fault(faultUnimplemented);
6498 InitReg(MISCREG_ERRSELR_EL1)
6499 .warnNotFail()
6500 .fault(faultUnimplemented);
6501 InitReg(MISCREG_ERXFR_EL1)
6502 .warnNotFail()
6503 .fault(faultUnimplemented);
6504 InitReg(MISCREG_ERXCTLR_EL1)
6505 .warnNotFail()
6506 .fault(faultUnimplemented);
6507 InitReg(MISCREG_ERXSTATUS_EL1)
6508 .warnNotFail()
6509 .fault(faultUnimplemented);
6510 InitReg(MISCREG_ERXADDR_EL1)
6511 .warnNotFail()
6512 .fault(faultUnimplemented);
6513 InitReg(MISCREG_ERXMISC0_EL1)
6514 .warnNotFail()
6515 .fault(faultUnimplemented);
6516 InitReg(MISCREG_ERXMISC1_EL1)
6517 .warnNotFail()
6518 .fault(faultUnimplemented);
6519 InitReg(MISCREG_DISR_EL1)
6520 .warnNotFail()
6521 .fault(faultUnimplemented);
6522 InitReg(MISCREG_VSESR_EL2)
6523 .warnNotFail()
6524 .fault(faultUnimplemented);
6525 InitReg(MISCREG_VDISR_EL2)
6526 .warnNotFail()
6527 .fault(faultUnimplemented);
6528
6529 // MPAM extension
6530 InitReg(MISCREG_MPAMIDR_EL1)
6531 .reset(p.mpamidr_el1)
6532 .res0(mask(63, 62) | mask(56, 40) | mask(31, 21) | mask(16, 16))
6533 .faultRead(EL1, faultMpamIdrEL1)
6534 .faultRead(EL2, faultMpamEL2)
6535 .allPrivileges().exceptUserMode().writes(0);
6536 InitReg(MISCREG_MPAM0_EL1)
6537 .res0(mask(63, 48))
6538 .fault(EL1, faultMpam0EL1)
6539 .fault(EL2, faultMpamEL2)
6540 .priv().hyp().mon();
6541 InitReg(MISCREG_MPAM1_EL1)
6542 .res0(mask(62, 61) | mask(59, 48))
6543 .fault(EL1, faultMpam1EL1)
6544 .fault(EL2, faultMpamEL2)
6545 .priv().hyp().mon();
6546 InitReg(MISCREG_MPAM1_EL12)
6547 .res0(mask(59, 48))
6548 .fault(EL2, faultMpam12EL2)
6549 .fault(EL3, defaultFaultE2H_EL3)
6550 .hyp().mon();
6551 InitReg(MISCREG_MPAM2_EL2)
6552 .res0(mask(62, 59) | mask(57, 50))
6553 .fault(EL2, faultMpamEL2)
6554 .hyp().mon();
6555 InitReg(MISCREG_MPAMHCR_EL2)
6556 .res0(mask(63, 32) | mask(30, 9) | mask(7, 2))
6557 .fault(EL2, faultMpamEL2)
6558 .hyp().mon();
6559 InitReg(MISCREG_MPAMVPM0_EL2)
6560 .fault(EL2, faultMpamEL2)
6561 .hyp().mon();
6562 InitReg(MISCREG_MPAMVPM1_EL2)
6563 .fault(EL2, faultMpamEL2)
6564 .hyp().mon();
6565 InitReg(MISCREG_MPAMVPM2_EL2)
6566 .fault(EL2, faultMpamEL2)
6567 .hyp().mon();
6568 InitReg(MISCREG_MPAMVPM3_EL2)
6569 .fault(EL2, faultMpamEL2)
6570 .hyp().mon();
6571 InitReg(MISCREG_MPAMVPM4_EL2)
6572 .fault(EL2, faultMpamEL2)
6573 .hyp().mon();
6574 InitReg(MISCREG_MPAMVPM5_EL2)
6575 .fault(EL2, faultMpamEL2)
6576 .hyp().mon();
6577 InitReg(MISCREG_MPAMVPM6_EL2)
6578 .fault(EL2, faultMpamEL2)
6579 .hyp().mon();
6580 InitReg(MISCREG_MPAMVPM7_EL2)
6581 .fault(EL2, faultMpamEL2)
6582 .hyp().mon();
6583 InitReg(MISCREG_MPAMVPMV_EL2)
6584 .res0(mask(63, 32))
6585 .fault(EL2, faultMpamEL2)
6586 .hyp().mon();
6587 InitReg(MISCREG_MPAM3_EL3)
6588 .res0(mask(59, 48))
6589 .mon();
6590 InitReg(MISCREG_MPAMSM_EL1)
6591 .res0(mask(63, 48) | mask(39, 32) | mask(15, 0))
6592 .fault(EL1, faultMpamsmEL1)
6593 .fault(EL2, faultMpamEL2)
6594 .allPrivileges().exceptUserMode();
6595
6596 // Register mappings for some unimplemented registers:
6597 // ESR_EL1 -> DFSR
6598 // RMR_EL1 -> RMR
6599 // RMR_EL2 -> HRMR
6600 // DBGDTR_EL0 -> DBGDTR{R or T}Xint
6601 // DBGDTRRX_EL0 -> DBGDTRRXint
6602 // DBGDTRTX_EL0 -> DBGDTRRXint
6603 // MDCR_EL3 -> SDCR, NAM D7-2108 (the latter is unimpl. in gem5)
6604
6605 // Populate the idxToMiscRegNum map
6606 assert(idxToMiscRegNum.empty());
6607 for (const auto& [key, val] : miscRegNumToIdx) {
6608 idxToMiscRegNum.insert({val, key});
6609 }
6610
6611 completed = true;
6612}
6613
6614} // namespace ArmISA
6615} // namespace gem5
Fault undefined(bool disabled=false) const
ArmSystem * system
Definition isa.hh:74
const MiscRegLUTEntryInitializer InitReg(uint32_t reg)
Definition isa.hh:115
void initializeMiscRegMetadata()
Definition misc.cc:2876
const ArmRelease * release
This could be either a FS or a SE release.
Definition isa.hh:104
bool highestELIs64
Definition isa.hh:92
Metadata table accessible via the value of the register.
Definition misc.hh:1300
chain userNonSecureWrite(bool v=true) const
Definition misc.hh:1401
chain userSecureWrite(bool v=true) const
Definition misc.hh:1413
chain warnNotFail(bool v=true) const
Definition misc.hh:1365
chain mapsTo(uint32_t l, uint32_t u=0) const
Definition misc.hh:1305
chain fault(ExceptionLevel el, MiscRegLUTEntry::FaultCB cb) const
Definition misc.hh:1675
chain userSecureRead(bool v=true) const
Definition misc.hh:1407
chain highest(ArmSystem *const sys) const
Definition misc.cc:2831
chain secure(bool v=true) const
Definition misc.hh:1618
chain mutex(bool v=true) const
Definition misc.hh:1371
chain raz(uint64_t mask=(uint64_t) -1) const
Definition misc.hh:1330
chain monSecure(bool v=true) const
Definition misc.hh:1572
chain privSecure(bool v=true) const
Definition misc.hh:1459
chain nonSecure(bool v=true) const
Definition misc.hh:1605
chain monNonSecureWrite(bool v=true) const
Definition misc.hh:1550
chain reset(uint64_t res_val) const
Definition misc.hh:1312
chain monNonSecureRead(bool v=true) const
Definition misc.hh:1544
chain unverifiable(bool v=true) const
Definition misc.hh:1353
chain banked(bool v=true) const
Definition misc.hh:1377
chain res0(uint64_t mask) const
Definition misc.hh:1318
chain bankedChild(bool v=true) const
Definition misc.hh:1389
chain hypWrite(bool v=true) const
Definition misc.hh:1511
chain allPrivileges(bool v=true) const
Definition misc.hh:1586
chain monSecureRead(bool v=true) const
Definition misc.hh:1532
chain privSecureWrite(bool v=true) const
Definition misc.hh:1453
chain res1(uint64_t mask) const
Definition misc.hh:1324
chain faultRead(ExceptionLevel el, MiscRegLUTEntry::FaultCB cb) const
Definition misc.hh:1661
chain monNonSecure(bool v=true) const
Definition misc.hh:1579
chain monSecureWrite(bool v=true) const
Definition misc.hh:1538
chain mon(bool v=true) const
Definition misc.hh:1556
chain privNonSecureWrite(bool v=true) const
Definition misc.hh:1434
chain unserialize(bool v=true) const
Definition misc.hh:1359
chain faultWrite(ExceptionLevel el, MiscRegLUTEntry::FaultCB cb) const
Definition misc.hh:1668
chain hyp(bool v=true) const
Definition misc.hh:1525
bool has(ArmExtension ext) const
Definition system.hh:76
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
Definition system.hh:187
ArmISA::ExceptionLevel highestEL() const
Returns the highest implemented exception level.
Definition system.hh:191
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Definition system.cc:132
This class is implementing the Base class for a generic AArch64 instruction which is making use of sy...
Definition misc64.hh:158
bool miscRead() const
Definition misc64.hh:174
SimObjectParams Params
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual BaseISA * getIsaPtr() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
STL vector class.
Definition stl.hh:37
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
const Params & params() const
#define warn(...)
Definition logging.hh:256
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
Definition utility.cc:282
static CPSR resetCPSR(ArmSystem *system)
Definition misc.cc:2843
@ MODE_UNDEFINED
Definition types.hh:303
int unflattenResultMiscReg[NUM_MISCREGS]
If the reg is a child reg of a banked set, then the parent is the last banked one in the list.
Definition misc.cc:705
Bitfield< 7, 4 > asidbits
bool AArch32isUndefinedGenericTimer(MiscRegIndex reg, ThreadContext *tc)
Definition misc.cc:660
uint8_t encodePhysAddrRange64(int pa_size)
Returns the encoding corresponding to the specified n.
Definition utility.cc:1311
bool ELIsInHost(ThreadContext *tc, ExceptionLevel el)
Returns true if the current exception level el is executing a Host OS or an application of a Host OS ...
Definition utility.cc:290
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Definition utility.cc:133
MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1, unsigned crn, unsigned crm, unsigned op2)
Definition misc.cc:2749
Bitfield< 7 > i
Definition misc_types.hh:67
Bitfield< 27, 24 > gic
MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
Definition misc.cc:535
Fault checkFaultAccessAArch64SysReg(MiscRegIndex reg, CPSR cpsr, ThreadContext *tc, const MiscRegOp64 &inst)
Definition misc.cc:730
Bitfield< 3, 0 > parange
Bitfield< 7, 5 > opc2
Definition types.hh:106
bool isSecureBelowEL3(ThreadContext *tc)
Definition utility.cc:86
Bitfield< 0 > ns
bool fgtEnabled(ThreadContext *tc)
Definition utility.cc:1360
bool EL2Enabled(ThreadContext *tc)
Definition utility.cc:267
void preUnflattenMiscReg()
Definition misc.cc:708
bool isHcrxEL2Enabled(ThreadContext *tc)
Definition utility.cc:1368
@ MISCREG_TLBI_VAE3
Definition misc.hh:738
@ MISCREG_PMXEVTYPER_EL0
Definition misc.hh:781
@ MISCREG_ERXSTATUS_EL1
Definition misc.hh:1185
@ MISCREG_AMAIR_EL3
Definition misc.hh:793
@ MISCREG_DBGWVR1_EL1
Definition misc.hh:497
@ MISCREG_DBGDRAR
Definition misc.hh:176
@ MISCREG_NSACR
Definition misc.hh:251
@ MISCREG_DL1DATA1
Definition misc.hh:446
@ MISCREG_ID_AA64PFR0_EL1
Definition misc.hh:567
@ MISCREG_DBGWCR5
Definition misc.hh:165
@ MISCREG_ICH_VMCR
Definition misc.hh:1080
@ MISCREG_CSSELR_NS
Definition misc.hh:237
@ MISCREG_HSTR_EL2
Definition misc.hh:599
@ MISCREG_DBGWVR13_EL1
Definition misc.hh:509
@ MISCREG_PMUSERENR
Definition misc.hh:369
@ MISCREG_DBGBCR15
Definition misc.hh:143
@ MISCREG_TLBI_VALE2OS
Definition misc.hh:721
@ MISCREG_DBGOSLSR
Definition misc.hh:194
@ MISCREG_DBGDTRRXext
Definition misc.hh:108
@ MISCREG_ID_MMFR2_EL1
Definition misc.hh:554
@ MISCREG_TTBR1_EL12
Definition misc.hh:611
@ MISCREG_DCCISW
Definition misc.hh:324
@ MISCREG_ERRIDR_EL1
Definition misc.hh:1181
@ MISCREG_DACR_S
Definition misc.hh:273
@ MISCREG_CNTV_CTL_EL0
Definition misc.hh:819
@ MISCREG_ICH_LR7
Definition misc.hh:1088
@ MISCREG_DBGWCR8
Definition misc.hh:168
@ MISCREG_HCR
Definition misc.hh:254
@ MISCREG_ICC_BPR1_EL1_NS
Definition misc.hh:928
@ MISCREG_NMRR_NS
Definition misc.hh:382
@ MISCREG_CPSR_MODE
Definition misc.hh:84
@ MISCREG_TLBI_RVALE2IS
Definition misc.hh:757
@ MISCREG_PRRR_MAIR0
Definition misc.hh:90
@ MISCREG_TLBI_ALLE3
Definition misc.hh:737
@ MISCREG_ICC_IGRPEN1_EL1_NS
Definition misc.hh:938
@ MISCREG_TLBI_ALLE1IS
Definition misc.hh:718
@ MISCREG_ICH_AP0R2_EL2
Definition misc.hh:948
@ MISCREG_VSTCR_EL2
Definition misc.hh:622
@ MISCREG_DBGWVR14
Definition misc.hh:158
@ MISCREG_TLBI_VMALLE1OS
Definition misc.hh:693
@ MISCREG_HDFAR
Definition misc.hh:295
@ MISCREG_MPIDR_EL1
Definition misc.hh:546
@ MISCREG_ICC_IGRPEN1
Definition misc.hh:1053
@ MISCREG_DFSR_S
Definition misc.hh:276
@ MISCREG_IL1DATA1
Definition misc.hh:442
@ MISCREG_DBGWVR10_EL1
Definition misc.hh:506
@ MISCREG_DL1DATA0
Definition misc.hh:445
@ MISCREG_TLBI_RVAE1IS
Definition misc.hh:750
@ MISCREG_CPUECTLR_EL1
Definition misc.hh:873
@ MISCREG_ATS1HR
Definition misc.hh:325
@ MISCREG_ERXCTLR_EL1
Definition misc.hh:1184
@ MISCREG_SCTLR_EL2
Definition misc.hh:592
@ MISCREG_PMSELR_EL0
Definition misc.hh:777
@ MISCREG_TLBI_ALLE2OS
Definition misc.hh:715
@ MISCREG_ID_DFR0_EL1
Definition misc.hh:550
@ MISCREG_CNTV_CVAL_EL02
Definition misc.hh:826
@ MISCREG_CP15ISB
Definition misc.hh:305
@ MISCREG_CNTP_CTL_EL0
Definition misc.hh:816
@ MISCREG_DFAR_NS
Definition misc.hh:290
@ MISCREG_DBGBXVR8
Definition misc.hh:185
@ MISCREG_TLBIMVALIS
Definition misc.hh:331
@ MISCREG_PMOVSSET
Definition misc.hh:372
@ MISCREG_FPEXC
Definition misc.hh:81
@ MISCREG_DBGWCR1
Definition misc.hh:161
@ MISCREG_MPAMVPM2_EL2
Definition misc.hh:1156
@ MISCREG_NMRR_MAIR1_S
Definition misc.hh:95
@ MISCREG_ICH_LR7_EL2
Definition misc.hh:967
@ MISCREG_CNTP_CTL_EL02
Definition misc.hh:822
@ MISCREG_ICC_IAR1_EL1
Definition misc.hh:924
@ MISCREG_TLBI_VALE2IS
Definition misc.hh:720
@ MISCREG_SPSEL
Definition misc.hh:631
@ MISCREG_TLBI_VAALE1OS
Definition misc.hh:703
@ MISCREG_TCR_EL2
Definition misc.hh:617
@ MISCREG_AT_S1E1W_Xt
Definition misc.hh:674
@ MISCREG_ID_ISAR0_EL1
Definition misc.hh:557
@ MISCREG_DBGWCR5_EL1
Definition misc.hh:517
@ MISCREG_RNDRRS
Definition misc.hh:1136
@ MISCREG_TLBI_ASIDE1
Definition misc.hh:706
@ MISCREG_DBGWVR2
Definition misc.hh:146
@ MISCREG_ICH_LR6_EL2
Definition misc.hh:966
@ MISCREG_TLBI_RVAE3IS
Definition misc.hh:758
@ MISCREG_TLBI_RVAE3OS
Definition misc.hh:768
@ MISCREG_ICH_AP1R1
Definition misc.hh:1072
@ MISCREG_DBGDSCRint
Definition misc.hh:102
@ MISCREG_TLBI_IPAS2E1IS
Definition misc.hh:710
@ MISCREG_MVFR1
Definition misc.hh:79
@ MISCREG_IL1DATA0_EL1
Definition misc.hh:862
@ MISCREG_MIDR_EL1
Definition misc.hh:545
@ MISCREG_TLBI_RIPAS2E1
Definition misc.hh:744
@ MISCREG_SDER
Definition misc.hh:250
@ MISCREG_DBGWCR12_EL1
Definition misc.hh:524
@ MISCREG_OSDLR_EL1
Definition misc.hh:536
@ MISCREG_DL1DATA3
Definition misc.hh:448
@ MISCREG_HTPIDR
Definition misc.hh:417
@ MISCREG_DBGBXVR15
Definition misc.hh:192
@ MISCREG_TLBIMVAALIS
Definition misc.hh:332
@ MISCREG_TLBI_RVALE3IS
Definition misc.hh:759
@ MISCREG_ICC_MGRPEN1
Definition misc.hh:1057
@ MISCREG_ZCR_EL2
Definition misc.hh:1117
@ MISCREG_ICC_IGRPEN1_EL3
Definition misc.hh:943
@ MISCREG_SPSR_HYP
Definition misc.hh:74
@ MISCREG_ID_AA64ZFR0_EL1
Definition misc.hh:1115
@ MISCREG_MPAMVPM7_EL2
Definition misc.hh:1161
@ MISCREG_TLBI_VAE3OS
Definition misc.hh:734
@ MISCREG_TLBI_RVAAE1
Definition misc.hh:741
@ MISCREG_DBGDEVID0
Definition misc.hh:203
@ MISCREG_TLBI_IPAS2E1OS
Definition misc.hh:711
@ MISCREG_CNTFRQ
Definition misc.hh:419
@ MISCREG_DBGDSAR
Definition misc.hh:197
@ MISCREG_AFSR1_EL12
Definition misc.hh:652
@ MISCREG_CPUMERRSR
Definition misc.hh:455
@ MISCREG_CPSR_Q
Definition misc.hh:85
@ MISCREG_DBGBVR5_EL1
Definition misc.hh:469
@ MISCREG_MAIR_EL1
Definition misc.hh:786
@ MISCREG_DBGBCR2_EL1
Definition misc.hh:482
@ MISCREG_ID_ISAR2_EL1
Definition misc.hh:559
@ MISCREG_TLBIMVAAL
Definition misc.hh:344
@ MISCREG_DBGBVR1_EL1
Definition misc.hh:465
@ MISCREG_PAR_NS
Definition misc.hh:301
@ MISCREG_ICC_IGRPEN1_EL1_S
Definition misc.hh:939
@ MISCREG_HAMAIR1
Definition misc.hh:396
@ MISCREG_PMXEVCNTR_EL0
Definition misc.hh:783
@ MISCREG_ICC_IGRPEN1_NS
Definition misc.hh:1054
@ MISCREG_ICC_PMR_EL1
Definition misc.hh:898
@ MISCREG_CONTEXTIDR_EL1
Definition misc.hh:805
@ MISCREG_CNTV_TVAL
Definition misc.hh:433
@ MISCREG_VBAR_EL3
Definition misc.hh:802
@ MISCREG_AIFSR_NS
Definition misc.hh:284
@ MISCREG_DBGWCR10
Definition misc.hh:170
@ MISCREG_DBGBXVR9
Definition misc.hh:186
@ MISCREG_ICC_CTLR_NS
Definition misc.hh:1042
@ MISCREG_CNTPS_TVAL_EL1
Definition misc.hh:832
@ MISCREG_ICC_AP1R3
Definition misc.hh:1033
@ MISCREG_ICC_MCTLR
Definition misc.hh:1056
@ MISCREG_HCPTR
Definition misc.hh:257
@ MISCREG_SPSR_EL2
Definition misc.hh:639
@ MISCREG_ICH_LR8
Definition misc.hh:1089
@ MISCREG_MPAMVPM4_EL2
Definition misc.hh:1158
@ MISCREG_ICC_AP1R0_EL1
Definition misc.hh:907
@ MISCREG_TLBI_IPAS2LE1IS
Definition misc.hh:712
@ MISCREG_ICC_BPR0_EL1
Definition misc.hh:902
@ MISCREG_DBGWFAR
Definition misc.hh:106
@ MISCREG_IFAR
Definition misc.hh:292
@ MISCREG_TLBI_ALLE1
Definition misc.hh:728
@ MISCREG_FCSEIDR
Definition misc.hh:404
@ MISCREG_DBGWVR7
Definition misc.hh:151
@ MISCREG_TLBI_RVALE1
Definition misc.hh:742
@ MISCREG_ID_MMFR1
Definition misc.hh:222
@ MISCREG_AT_S1E2W_Xt
Definition misc.hh:685
@ MISCREG_PMEVTYPER1_EL0
Definition misc.hh:857
@ MISCREG_LOCKFLAG
Definition misc.hh:89
@ MISCREG_ICH_LR15_EL2
Definition misc.hh:975
@ MISCREG_FPSID
Definition misc.hh:77
@ MISCREG_MPAM3_EL3
Definition misc.hh:1150
@ MISCREG_DBGBXVR12
Definition misc.hh:189
@ MISCREG_ICH_MISR
Definition misc.hh:1077
@ MISCREG_DBGWCR6_EL1
Definition misc.hh:518
@ MISCREG_ID_AFR0_EL1
Definition misc.hh:551
@ MISCREG_DBGBVR2
Definition misc.hh:114
@ MISCREG_TLBI_RVALE3OS
Definition misc.hh:769
@ MISCREG_MAIR_EL12
Definition misc.hh:787
@ MISCREG_DBGBVR7_EL1
Definition misc.hh:471
@ MISCREG_ICH_LRC0
Definition misc.hh:1097
@ MISCREG_SMIDR_EL1
Definition misc.hh:1124
@ MISCREG_TLBI_VMALLS12E1OS
Definition misc.hh:723
@ MISCREG_SCTLR
Definition misc.hh:241
@ MISCREG_PAR_EL1
Definition misc.hh:669
@ MISCREG_TTBCR
Definition misc.hh:266
@ MISCREG_DBGWVR3_EL1
Definition misc.hh:499
@ MISCREG_ICH_LR5
Definition misc.hh:1086
@ MISCREG_AT_S12E1W_Xt
Definition misc.hh:687
@ MISCREG_TLBIIPAS2
Definition misc.hh:351
@ MISCREG_ATS12NSOUW
Definition misc.hh:317
@ MISCREG_MAIR_EL2
Definition misc.hh:790
@ MISCREG_CNTV_CVAL
Definition misc.hh:432
@ MISCREG_APDBKeyLo_EL1
Definition misc.hh:889
@ MISCREG_MDRAR_EL1
Definition misc.hh:533
@ MISCREG_CSSELR
Definition misc.hh:236
@ MISCREG_CPACR
Definition misc.hh:247
@ MISCREG_HAMAIR0
Definition misc.hh:395
@ MISCREG_TLBIIPAS2L
Definition misc.hh:352
@ MISCREG_ICC_BPR1_S
Definition misc.hh:1040
@ MISCREG_DBGBVR8
Definition misc.hh:120
@ MISCREG_ADFSR_S
Definition misc.hh:282
@ MISCREG_ICH_LRC11
Definition misc.hh:1108
@ MISCREG_SCR_EL3
Definition misc.hh:604
@ MISCREG_TTBR0_S
Definition misc.hh:262
@ MISCREG_TLBIALLHIS
Definition misc.hh:347
@ MISCREG_IL1DATA1_EL1
Definition misc.hh:863
@ MISCREG_CNTKCTL_EL12
Definition misc.hh:829
@ MISCREG_APDAKeyHi_EL1
Definition misc.hh:886
@ MISCREG_TLBIIPAS2LIS
Definition misc.hh:346
@ MISCREG_TLBIASIDIS
Definition misc.hh:329
@ MISCREG_ID_AA64DFR0_EL1
Definition misc.hh:569
@ MISCREG_ID_ISAR6
Definition misc.hh:232
@ MISCREG_DBGCLAIMCLR
Definition misc.hh:199
@ MISCREG_TPIDRRO_EL0
Definition misc.hh:809
@ MISCREG_DBGBVR3
Definition misc.hh:115
@ MISCREG_DBGWVR5_EL1
Definition misc.hh:501
@ MISCREG_DBGOSLAR
Definition misc.hh:193
@ MISCREG_PMEVTYPER3_EL0
Definition misc.hh:859
@ MISCREG_ICC_SRE_EL1_NS
Definition misc.hh:934
@ MISCREG_DBGBCR10
Definition misc.hh:138
@ MISCREG_SPSR_SVC
Definition misc.hh:71
@ MISCREG_REVIDR_EL1
Definition misc.hh:547
@ MISCREG_DBGDSCRext
Definition misc.hh:109
@ MISCREG_SCTLR2_EL12
Definition misc.hh:588
@ MISCREG_SCTLR2_EL1
Definition misc.hh:587
@ MISCREG_TLBI_VAE2
Definition misc.hh:727
@ MISCREG_TCR_EL3
Definition misc.hh:624
@ MISCREG_SCTLR2_EL3
Definition misc.hh:602
@ MISCREG_SMCR_EL1
Definition misc.hh:1130
@ MISCREG_FPSR
Definition misc.hh:636
@ MISCREG_TLBI_RVALE3
Definition misc.hh:749
@ MISCREG_DBGDIDR
Definition misc.hh:101
@ MISCREG_DBGBVR9_EL1
Definition misc.hh:473
@ MISCREG_ICH_HCR_EL2
Definition misc.hh:954
@ MISCREG_CPACR_EL12
Definition misc.hh:591
@ MISCREG_HDCR
Definition misc.hh:256
@ MISCREG_AIFSR_S
Definition misc.hh:285
@ MISCREG_ESR_EL1
Definition misc.hh:653
@ MISCREG_DISR_EL1
Definition misc.hh:1189
@ MISCREG_ADFSR
Definition misc.hh:280
@ MISCREG_ICC_AP1R3_EL1_NS
Definition misc.hh:917
@ MISCREG_PMCCNTR_EL0
Definition misc.hh:780
@ MISCREG_CNTP_TVAL
Definition misc.hh:428
@ MISCREG_MDCCSR_EL0
Definition misc.hh:528
@ MISCREG_DTLBIMVA
Definition misc.hh:337
@ MISCREG_SPSR_UND_AA64
Definition misc.hh:644
@ MISCREG_TLBI_IPAS2E1
Definition misc.hh:724
@ MISCREG_DBGWVR13
Definition misc.hh:157
@ MISCREG_TLBI_RVAE1OS
Definition misc.hh:760
@ MISCREG_TLBI_VALE3
Definition misc.hh:739
@ MISCREG_AT_S12E0W_Xt
Definition misc.hh:689
@ MISCREG_DBGBXVR4
Definition misc.hh:181
@ MISCREG_TCR_EL1
Definition misc.hh:612
@ MISCREG_PMINTENSET
Definition misc.hh:370
@ MISCREG_TTBCR_NS
Definition misc.hh:267
@ MISCREG_PMXEVTYPER
Definition misc.hh:366
@ MISCREG_DBGBCR13_EL1
Definition misc.hh:493
@ MISCREG_TPIDR_EL3
Definition misc.hh:811
@ MISCREG_DBGBVR11
Definition misc.hh:123
@ MISCREG_HFGRTR_EL2
Definition misc.hh:1140
@ MISCREG_ICC_AP0R3
Definition misc.hh:1023
@ MISCREG_VMPIDR
Definition misc.hh:240
@ MISCREG_TPIDRURW_S
Definition misc.hh:410
@ MISCREG_CCSIDR_EL1
Definition misc.hh:577
@ MISCREG_DBGBXVR5
Definition misc.hh:182
@ MISCREG_CNTVCT
Definition misc.hh:421
@ MISCREG_ESR_EL12
Definition misc.hh:654
@ MISCREG_TLBIMVALH
Definition misc.hh:356
@ MISCREG_DL1DATA1_EL1
Definition misc.hh:867
@ MISCREG_ICC_AP1R0_EL1_S
Definition misc.hh:909
@ MISCREG_DBGWCR8_EL1
Definition misc.hh:520
@ MISCREG_ICC_IGRPEN1_S
Definition misc.hh:1055
@ MISCREG_AFSR0_EL1
Definition misc.hh:649
@ MISCREG_ICC_AP1R0_S
Definition misc.hh:1026
@ MISCREG_SPSR_UND
Definition misc.hh:75
@ MISCREG_TLBI_VAAE1OS
Definition misc.hh:699
@ MISCREG_TCMTR
Definition misc.hh:213
@ MISCREG_DBGWCR13_EL1
Definition misc.hh:525
@ MISCREG_DBGOSDLR
Definition misc.hh:195
@ MISCREG_DBGBXVR3
Definition misc.hh:180
@ MISCREG_DBGWCR11_EL1
Definition misc.hh:523
@ MISCREG_DBGWVR11_EL1
Definition misc.hh:507
@ MISCREG_TLBI_ALLE2IS
Definition misc.hh:714
@ MISCREG_TLBI_ALLE1OS
Definition misc.hh:719
@ MISCREG_SPSR_IRQ
Definition misc.hh:70
@ MISCREG_ID_ISAR5
Definition misc.hh:231
@ MISCREG_BPIALL
Definition misc.hh:306
@ MISCREG_DBGBVR10_EL1
Definition misc.hh:474
@ MISCREG_ID_ISAR3_EL1
Definition misc.hh:560
@ MISCREG_PMEVTYPER4_EL0
Definition misc.hh:860
@ MISCREG_ATS1CUR
Definition misc.hh:312
@ MISCREG_ICH_ELRSR_EL2
Definition misc.hh:958
@ MISCREG_DC_CVAC_Xt
Definition misc.hh:681
@ MISCREG_VPIDR_EL2
Definition misc.hh:583
@ MISCREG_DBGWCR2
Definition misc.hh:162
@ MISCREG_OSLAR_EL1
Definition misc.hh:534
@ MISCREG_CNTPCT_EL0
Definition misc.hh:814
@ MISCREG_DBGWCR4_EL1
Definition misc.hh:516
@ MISCREG_ERXADDR_EL1
Definition misc.hh:1186
@ MISCREG_TLBI_RVAALE1OS
Definition misc.hh:763
@ MISCREG_AMAIR0_NS
Definition misc.hh:388
@ MISCREG_DBGBCR14_EL1
Definition misc.hh:494
@ MISCREG_ICH_AP1R3
Definition misc.hh:1074
@ MISCREG_MPAM1_EL1
Definition misc.hh:1148
@ MISCREG_SPSR_ABT
Definition misc.hh:73
@ MISCREG_DBGWVR0_EL1
Definition misc.hh:496
@ MISCREG_AFSR1_EL2
Definition misc.hh:657
@ MISCREG_CNTV_CTL_EL02
Definition misc.hh:825
@ MISCREG_CP15DMB
Definition misc.hh:321
@ MISCREG_DBGBCR0_EL1
Definition misc.hh:480
@ MISCREG_SCTLR2_EL2
Definition misc.hh:593
@ MISCREG_DBGWVR15
Definition misc.hh:159
@ MISCREG_TLBIMVA
Definition misc.hh:340
@ MISCREG_PMEVCNTR4_EL0
Definition misc.hh:854
@ MISCREG_CONTEXTIDR_NS
Definition misc.hh:406
@ MISCREG_ICH_AP1R3_EL2
Definition misc.hh:953
@ MISCREG_DBGBCR6_EL1
Definition misc.hh:486
@ MISCREG_HFGITR_EL2
Definition misc.hh:1139
@ MISCREG_ID_ISAR4
Definition misc.hh:230
@ MISCREG_DBGBCR3_EL1
Definition misc.hh:483
@ MISCREG_TLBI_VAAE1IS
Definition misc.hh:698
@ MISCREG_ICC_AP1R1_EL1_S
Definition misc.hh:912
@ MISCREG_SCTLR_EL1
Definition misc.hh:585
@ MISCREG_CNTP_TVAL_EL02
Definition misc.hh:824
@ MISCREG_ICH_AP0R3
Definition misc.hh:1070
@ MISCREG_DBGWVR4_EL1
Definition misc.hh:500
@ MISCREG_TPIDRPRW_NS
Definition misc.hh:415
@ MISCREG_AIDR_EL1
Definition misc.hh:579
@ MISCREG_DC_CIVAC_Xt
Definition misc.hh:683
@ MISCREG_DBGDEVID1
Definition misc.hh:202
@ MISCREG_TLBI_ASIDE1OS
Definition misc.hh:697
@ MISCREG_PRRR
Definition misc.hh:375
@ MISCREG_ICC_IGRPEN0
Definition misc.hh:1052
@ MISCREG_ICH_LRC7
Definition misc.hh:1104
@ MISCREG_TEECR
Definition misc.hh:204
@ MISCREG_DC_CVAU_Xt
Definition misc.hh:682
@ MISCREG_DBGBXVR7
Definition misc.hh:184
@ MISCREG_AMAIR1_S
Definition misc.hh:392
@ MISCREG_DBGWVR7_EL1
Definition misc.hh:503
@ MISCREG_DBGBVR9
Definition misc.hh:121
@ MISCREG_PMEVTYPER0_EL0
Definition misc.hh:856
@ MISCREG_ICH_LRC8
Definition misc.hh:1105
@ MISCREG_TLBI_VAE2OS
Definition misc.hh:717
@ MISCREG_CPTR_EL2
Definition misc.hh:598
@ MISCREG_ICH_LR9_EL2
Definition misc.hh:969
@ MISCREG_DBGBCR8_EL1
Definition misc.hh:488
@ MISCREG_CCSIDR
Definition misc.hh:233
@ MISCREG_FAR_EL1
Definition misc.hh:663
@ MISCREG_ERXMISC0_EL1
Definition misc.hh:1187
@ MISCREG_TLBI_IPAS2LE1
Definition misc.hh:725
@ MISCREG_TPIDR_EL1
Definition misc.hh:807
@ MISCREG_PMUSERENR_EL0
Definition misc.hh:784
@ MISCREG_APIAKeyLo_EL1
Definition misc.hh:893
@ MISCREG_DBGWCR0
Definition misc.hh:160
@ MISCREG_AT_S1E2R_Xt
Definition misc.hh:684
@ MISCREG_PMCR
Definition misc.hh:357
@ MISCREG_CNTHV_CTL_EL2
Definition misc.hh:841
@ MISCREG_TLBI_VAALE1
Definition misc.hh:709
@ MISCREG_ICC_DIR
Definition misc.hh:1044
@ MISCREG_CNTP_TVAL_NS
Definition misc.hh:429
@ MISCREG_TLBI_RVAE2OS
Definition misc.hh:766
@ MISCREG_CNTV_CTL
Definition misc.hh:431
@ MISCREG_AFSR1_EL3
Definition misc.hh:661
@ MISCREG_ADFSR_NS
Definition misc.hh:281
@ MISCREG_APIBKeyLo_EL1
Definition misc.hh:895
@ MISCREG_DFAR
Definition misc.hh:289
@ MISCREG_ID_AA64DFR1_EL1
Definition misc.hh:570
@ MISCREG_DC_CSW_Xt
Definition misc.hh:677
@ MISCREG_JMCR
Definition misc.hh:208
@ MISCREG_RMR_EL3
Definition misc.hh:804
@ MISCREG_ID_AA64ISAR1_EL1
Definition misc.hh:574
@ MISCREG_TLBIMVAL
Definition misc.hh:343
@ MISCREG_SMCR_EL3
Definition misc.hh:1127
@ MISCREG_ELR_EL12
Definition misc.hh:629
@ MISCREG_DL1DATA2_EL1
Definition misc.hh:868
@ MISCREG_DBGBVR0
Definition misc.hh:112
@ MISCREG_ICC_HSRE
Definition misc.hh:1049
@ MISCREG_ICH_LR1
Definition misc.hh:1082
@ MISCREG_PMEVCNTR0_EL0
Definition misc.hh:850
@ MISCREG_TEECR32_EL1
Definition misc.hh:541
@ MISCREG_AFSR0_EL3
Definition misc.hh:660
@ MISCREG_CSSELR_EL1
Definition misc.hh:580
@ MISCREG_VBAR_EL12
Definition misc.hh:797
@ MISCREG_MAIR_EL3
Definition misc.hh:792
@ MISCREG_ITLBIALL
Definition misc.hh:333
@ MISCREG_L2MERRSR
Definition misc.hh:456
@ MISCREG_ID_AA64MMFR1_EL1
Definition misc.hh:576
@ MISCREG_DBGPRCR_EL1
Definition misc.hh:537
@ MISCREG_NMRR_MAIR1
Definition misc.hh:93
@ MISCREG_ICH_LR4_EL2
Definition misc.hh:964
@ MISCREG_UNKNOWN
Definition misc.hh:1173
@ MISCREG_PMOVSR
Definition misc.hh:360
@ MISCREG_ICH_ELRSR
Definition misc.hh:1079
@ MISCREG_TLBIALLNSNH
Definition misc.hh:355
@ MISCREG_TTBR0_EL12
Definition misc.hh:609
@ MISCREG_CNTHP_TVAL
Definition misc.hh:438
@ MISCREG_ATS12NSOUR
Definition misc.hh:316
@ MISCREG_ELR_HYP
Definition misc.hh:76
@ MISCREG_TLBI_RVALE1OS
Definition misc.hh:762
@ MISCREG_DBGWCR10_EL1
Definition misc.hh:522
@ MISCREG_CNTVCT_EL0
Definition misc.hh:815
@ MISCREG_DBGBVR14
Definition misc.hh:126
@ MISCREG_TLBI_VMALLE1
Definition misc.hh:704
@ MISCREG_DBGBVR8_EL1
Definition misc.hh:472
@ MISCREG_ICH_LR11_EL2
Definition misc.hh:971
@ MISCREG_CBAR_EL1
Definition misc.hh:876
@ MISCREG_ICC_AP1R1_EL1
Definition misc.hh:910
@ MISCREG_DL1DATA3_EL1
Definition misc.hh:869
@ MISCREG_RVBAR_EL2
Definition misc.hh:801
@ MISCREG_DBGDEVID2
Definition misc.hh:201
@ MISCREG_SP_EL0
Definition misc.hh:630
@ MISCREG_PMCNTENCLR
Definition misc.hh:359
@ MISCREG_ERRSELR_EL1
Definition misc.hh:1182
@ MISCREG_TLBI_VMALLS12E1
Definition misc.hh:730
@ MISCREG_DFAR_S
Definition misc.hh:291
@ MISCREG_DBGBVR0_EL1
Definition misc.hh:464
@ MISCREG_ICC_AP1R2_NS
Definition misc.hh:1031
@ MISCREG_DBGBCR4_EL1
Definition misc.hh:484
@ MISCREG_CPSR
Definition misc.hh:67
@ MISCREG_FPCR
Definition misc.hh:635
@ MISCREG_SDCR
Definition misc.hh:248
@ MISCREG_DBGWCR4
Definition misc.hh:164
@ MISCREG_ICH_LR14_EL2
Definition misc.hh:974
@ MISCREG_TLBI_VAE2IS
Definition misc.hh:716
@ MISCREG_RMR
Definition misc.hh:401
@ MISCREG_CPACR_EL1
Definition misc.hh:590
@ MISCREG_HACR
Definition misc.hh:259
@ MISCREG_ICC_RPR_EL1
Definition misc.hh:920
@ MISCREG_DBGBXVR13
Definition misc.hh:190
@ MISCREG_IFSR_NS
Definition misc.hh:278
@ MISCREG_SMPRI_EL1
Definition misc.hh:1125
@ MISCREG_ID_MMFR0
Definition misc.hh:221
@ MISCREG_PMEVTYPER5_EL0
Definition misc.hh:861
@ MISCREG_CNTP_CVAL
Definition misc.hh:425
@ MISCREG_ID_ISAR0
Definition misc.hh:226
@ MISCREG_DBGBVR2_EL1
Definition misc.hh:466
@ MISCREG_ICC_AP1R3_EL1_S
Definition misc.hh:918
@ MISCREG_DL1DATA4
Definition misc.hh:449
@ MISCREG_CNTKCTL_EL1
Definition misc.hh:828
@ MISCREG_HMAIR0
Definition misc.hh:393
@ MISCREG_DBGWVR11
Definition misc.hh:155
@ MISCREG_ICC_AP0R3_EL1
Definition misc.hh:906
@ MISCREG_MPAMHCR_EL2
Definition misc.hh:1152
@ MISCREG_ICC_BPR1_NS
Definition misc.hh:1039
@ MISCREG_CNTPCT
Definition misc.hh:420
@ MISCREG_ICH_LR10_EL2
Definition misc.hh:970
@ MISCREG_SP_EL2
Definition misc.hh:648
@ MISCREG_ICC_AP0R1
Definition misc.hh:1021
@ MISCREG_PMCCFILTR_EL0
Definition misc.hh:782
@ MISCREG_ICH_LR10
Definition misc.hh:1091
@ MISCREG_CNTPS_CTL_EL1
Definition misc.hh:830
@ MISCREG_TLBI_VMALLS12E1IS
Definition misc.hh:722
@ MISCREG_ID_AA64MMFR3_EL1
Definition misc.hh:883
@ MISCREG_NMRR
Definition misc.hh:381
@ MISCREG_MPAMVPMV_EL2
Definition misc.hh:1153
@ MISCREG_ICC_SRE_EL1
Definition misc.hh:933
@ MISCREG_DBGBVR12_EL1
Definition misc.hh:476
@ MISCREG_PMSWINC_EL0
Definition misc.hh:776
@ MISCREG_SCTLR_EL12
Definition misc.hh:586
@ MISCREG_DBGBVR10
Definition misc.hh:122
@ MISCREG_TTBR1_EL1
Definition misc.hh:610
@ MISCREG_PMEVTYPER2_EL0
Definition misc.hh:858
@ MISCREG_MAIR1
Definition misc.hh:384
@ MISCREG_DAIF
Definition misc.hh:634
@ MISCREG_SPSR_ABT_AA64
Definition misc.hh:643
@ MISCREG_SEV_MAILBOX
Definition misc.hh:97
@ MISCREG_SPSR_EL12
Definition misc.hh:627
@ MISCREG_CNTP_CVAL_EL02
Definition misc.hh:823
@ MISCREG_ACTLR_NS
Definition misc.hh:245
@ MISCREG_PMINTENSET_EL1
Definition misc.hh:770
@ MISCREG_ICC_AP1R1_S
Definition misc.hh:1029
@ MISCREG_PMINTENCLR_EL1
Definition misc.hh:771
@ MISCREG_CNTHPS_CVAL_EL2
Definition misc.hh:838
@ MISCREG_REVIDR
Definition misc.hh:216
@ MISCREG_DBGBCR9
Definition misc.hh:137
@ MISCREG_MPAMVPM0_EL2
Definition misc.hh:1154
@ MISCREG_DL1DATA0_EL1
Definition misc.hh:866
@ MISCREG_PMCCFILTR
Definition misc.hh:367
@ MISCREG_ACTLR_EL3
Definition misc.hh:603
@ MISCREG_ID_PFR1_EL1
Definition misc.hh:549
@ MISCREG_DBGBCR11_EL1
Definition misc.hh:491
@ MISCREG_DBGBCR1_EL1
Definition misc.hh:481
@ MISCREG_TLBIIPAS2IS
Definition misc.hh:345
@ MISCREG_DBGBVR11_EL1
Definition misc.hh:475
@ MISCREG_DBGBCR14
Definition misc.hh:142
@ MISCREG_DBGBCR11
Definition misc.hh:139
@ MISCREG_APDBKeyHi_EL1
Definition misc.hh:888
@ MISCREG_TEEHBR32_EL1
Definition misc.hh:542
@ MISCREG_DBGBVR13
Definition misc.hh:125
@ MISCREG_ID_MMFR3
Definition misc.hh:224
@ MISCREG_CSSELR_S
Definition misc.hh:238
@ MISCREG_DBGBCR12
Definition misc.hh:140
@ MISCREG_ICH_LRC15
Definition misc.hh:1112
@ MISCREG_ICC_SRE_EL2
Definition misc.hh:940
@ MISCREG_ICH_HCR
Definition misc.hh:1075
@ MISCREG_MPAMSM_EL1
Definition misc.hh:1132
@ MISCREG_ICC_IAR0
Definition misc.hh:1050
@ MISCREG_ICC_ASGI1R_EL1
Definition misc.hh:922
@ MISCREG_DBGVCR32_EL2
Definition misc.hh:532
@ MISCREG_DBGWVR9_EL1
Definition misc.hh:505
@ MISCREG_L2ECTLR
Definition misc.hh:374
@ MISCREG_TCR2_EL12
Definition misc.hh:615
@ MISCREG_ID_PFR0_EL1
Definition misc.hh:548
@ MISCREG_ICC_CTLR
Definition misc.hh:1041
@ MISCREG_ICH_LR2_EL2
Definition misc.hh:962
@ MISCREG_DL1DATA4_EL1
Definition misc.hh:870
@ MISCREG_TLBIMVAAIS
Definition misc.hh:330
@ MISCREG_SMPRIMAP_EL2
Definition misc.hh:1126
@ MISCREG_ICC_EOIR0
Definition misc.hh:1045
@ MISCREG_CNTP_CVAL_NS
Definition misc.hh:426
@ MISCREG_OSECCR_EL1
Definition misc.hh:463
@ MISCREG_RVBAR_EL1
Definition misc.hh:798
@ MISCREG_ISR
Definition misc.hh:402
@ MISCREG_DBGWCR7_EL1
Definition misc.hh:519
@ MISCREG_HAIFSR
Definition misc.hh:287
@ MISCREG_TCR2_EL2
Definition misc.hh:618
@ MISCREG_ID_ISAR5_EL1
Definition misc.hh:562
@ MISCREG_CONTEXTIDR
Definition misc.hh:405
@ MISCREG_PMCEID1
Definition misc.hh:364
@ MISCREG_TLBI_ALLE3IS
Definition misc.hh:731
@ MISCREG_DBGBVR15_EL1
Definition misc.hh:479
@ MISCREG_ID_ISAR4_EL1
Definition misc.hh:561
@ MISCREG_CNTHPS_TVAL_EL2
Definition misc.hh:839
@ MISCREG_SCR
Definition misc.hh:249
@ MISCREG_DC_IVAC_Xt
Definition misc.hh:671
@ MISCREG_TLBI_VALE1OS
Definition misc.hh:701
@ MISCREG_ICC_AP1R0
Definition misc.hh:1024
@ MISCREG_TPIDR2_EL0
Definition misc.hh:1131
@ MISCREG_ICC_HPPIR0_EL1
Definition misc.hh:901
@ MISCREG_PMCNTENSET
Definition misc.hh:358
@ MISCREG_DBGBVR7
Definition misc.hh:119
@ MISCREG_ICC_SGI1R_EL1
Definition misc.hh:921
@ MISCREG_TLBI_RVAE3
Definition misc.hh:748
@ MISCREG_DBGWVR9
Definition misc.hh:153
@ MISCREG_ELR_EL2
Definition misc.hh:640
@ MISCREG_HDFGWTR_EL2
Definition misc.hh:1143
@ MISCREG_MAIR0_S
Definition misc.hh:380
@ MISCREG_ICH_LR5_EL2
Definition misc.hh:965
@ MISCREG_CONTEXTIDR_EL2
Definition misc.hh:877
@ MISCREG_CNTP_TVAL_S
Definition misc.hh:430
@ MISCREG_TCR_EL12
Definition misc.hh:613
@ MISCREG_CNTHCTL_EL2
Definition misc.hh:833
@ MISCREG_DBGBXVR6
Definition misc.hh:183
@ MISCREG_TLBI_VALE1
Definition misc.hh:708
@ MISCREG_DBGBXVR0
Definition misc.hh:177
@ MISCREG_TEEHBR
Definition misc.hh:206
@ MISCREG_ERXMISC1_EL1
Definition misc.hh:1188
@ MISCREG_MDSCR_EL1
Definition misc.hh:461
@ MISCREG_AMAIR1_NS
Definition misc.hh:391
@ MISCREG_DL1DATA2
Definition misc.hh:447
@ MISCREG_DBGWCR2_EL1
Definition misc.hh:514
@ MISCREG_TLBI_RVAE2IS
Definition misc.hh:756
@ MISCREG_ID_MMFR4_EL1
Definition misc.hh:556
@ MISCREG_PAR_S
Definition misc.hh:302
@ MISCREG_DBGBCR12_EL1
Definition misc.hh:492
@ MISCREG_ID_DFR0
Definition misc.hh:219
@ MISCREG_CNTP_CTL_S
Definition misc.hh:424
@ MISCREG_ICC_AP1R1_EL1_NS
Definition misc.hh:911
@ MISCREG_TTBR1_EL2
Definition misc.hh:880
@ MISCREG_ICC_SGI1R
Definition misc.hh:1062
@ MISCREG_DBGDTRTXint
Definition misc.hh:104
@ MISCREG_ID_AA64MMFR0_EL1
Definition misc.hh:575
@ MISCREG_HPFAR
Definition misc.hh:297
@ MISCREG_ICC_PMR
Definition misc.hh:1059
@ MISCREG_ICH_LRC5
Definition misc.hh:1102
@ MISCREG_TPIDRPRW_S
Definition misc.hh:416
@ MISCREG_ICH_LR6
Definition misc.hh:1087
@ MISCREG_TLBIMVAHIS
Definition misc.hh:348
@ MISCREG_IC_IALLU
Definition misc.hh:670
@ MISCREG_ICC_AP1R2
Definition misc.hh:1030
@ MISCREG_DBGWCR9
Definition misc.hh:169
@ MISCREG_APIAKeyHi_EL1
Definition misc.hh:892
@ MISCREG_MPAMIDR_EL1
Definition misc.hh:1146
@ MISCREG_SPSR_EL3
Definition misc.hh:646
@ MISCREG_APDAKeyLo_EL1
Definition misc.hh:887
@ MISCREG_AT_S1E1R_Xt
Definition misc.hh:673
@ MISCREG_ICH_AP1R2_EL2
Definition misc.hh:952
@ MISCREG_DTLBIALL
Definition misc.hh:336
@ MISCREG_TLBIALLIS
Definition misc.hh:327
@ MISCREG_AMAIR_EL1
Definition misc.hh:788
@ MISCREG_ICC_CTLR_EL1_NS
Definition misc.hh:931
@ MISCREG_ICC_CTLR_S
Definition misc.hh:1043
@ MISCREG_ESR_EL3
Definition misc.hh:662
@ MISCREG_IL1DATA0
Definition misc.hh:441
@ MISCREG_ATS1HW
Definition misc.hh:326
@ MISCREG_ICH_VTR
Definition misc.hh:1076
@ MISCREG_VBAR_S
Definition misc.hh:399
@ MISCREG_TLBI_RIPAS2E1IS
Definition misc.hh:754
@ MISCREG_ICH_AP0R1_EL2
Definition misc.hh:947
@ MISCREG_AT_S1E3R_Xt
Definition misc.hh:690
@ MISCREG_ICC_SRE
Definition misc.hh:1063
@ MISCREG_DC_ZVA_Xt
Definition misc.hh:679
@ MISCREG_CNTHVS_TVAL_EL2
Definition misc.hh:846
@ MISCREG_ATS1CPR
Definition misc.hh:310
@ MISCREG_TLBIASID
Definition misc.hh:341
@ MISCREG_TLBI_RIPAS2LE1IS
Definition misc.hh:755
@ MISCREG_ICH_LRC12
Definition misc.hh:1109
@ MISCREG_DBGBXVR10
Definition misc.hh:187
@ MISCREG_APGAKeyLo_EL1
Definition misc.hh:891
@ MISCREG_ITLBIMVA
Definition misc.hh:334
@ MISCREG_NZCV
Definition misc.hh:633
@ MISCREG_HTTBR
Definition misc.hh:453
@ MISCREG_IFSR32_EL2
Definition misc.hh:655
@ MISCREG_ICH_LRC9
Definition misc.hh:1106
@ MISCREG_SPSR_EL1
Definition misc.hh:626
@ MISCREG_APIBKeyHi_EL1
Definition misc.hh:894
@ MISCREG_FAR_EL12
Definition misc.hh:664
@ MISCREG_MAIR0_NS
Definition misc.hh:379
@ MISCREG_CP15DSB
Definition misc.hh:320
@ MISCREG_ICH_LR13_EL2
Definition misc.hh:973
@ MISCREG_ICC_CTLR_EL3
Definition misc.hh:941
@ MISCREG_DBGDCCINT
Definition misc.hh:103
@ MISCREG_ICC_CTLR_EL1
Definition misc.hh:930
@ MISCREG_TLBIALLNSNHIS
Definition misc.hh:349
@ MISCREG_CNTP_CVAL_EL0
Definition misc.hh:817
@ MISCREG_HCR_EL2
Definition misc.hh:595
@ MISCREG_CNTHVS_CVAL_EL2
Definition misc.hh:845
@ MISCREG_SMCR_EL2
Definition misc.hh:1128
@ MISCREG_L2ACTLR_EL1
Definition misc.hh:871
@ MISCREG_DCIMVAC
Definition misc.hh:308
@ MISCREG_ATS1CPW
Definition misc.hh:311
@ MISCREG_TTBR1
Definition misc.hh:263
@ MISCREG_AT_S12E0R_Xt
Definition misc.hh:688
@ MISCREG_ICH_AP1R0
Definition misc.hh:1071
@ MISCREG_MPIDR
Definition misc.hh:215
@ MISCREG_ICC_AP0R2
Definition misc.hh:1022
@ MISCREG_TLBI_RVAALE1
Definition misc.hh:743
@ MISCREG_DBGCLAIMSET
Definition misc.hh:198
@ MISCREG_TLBIMVALHIS
Definition misc.hh:350
@ MISCREG_MPAMVPM3_EL2
Definition misc.hh:1157
@ MISCREG_PRRR_NS
Definition misc.hh:376
@ MISCREG_ZCR_EL1
Definition misc.hh:1119
@ MISCREG_PMCEID0_EL0
Definition misc.hh:778
@ MISCREG_ID_AA64MMFR2_EL1
Definition misc.hh:882
@ MISCREG_ICC_DIR_EL1
Definition misc.hh:919
@ MISCREG_SDER32_EL3
Definition misc.hh:605
@ MISCREG_TPIDR_EL0
Definition misc.hh:808
@ MISCREG_DBGDTRTXext
Definition misc.hh:110
@ MISCREG_DBGOSECCR
Definition misc.hh:111
@ MISCREG_ICC_SRE_EL3
Definition misc.hh:942
@ MISCREG_VTCR_EL2
Definition misc.hh:620
@ MISCREG_DBGWCR3
Definition misc.hh:163
@ MISCREG_ELR_EL3
Definition misc.hh:647
@ MISCREG_ITLBIASID
Definition misc.hh:335
@ MISCREG_TLBI_VALE3IS
Definition misc.hh:735
@ MISCREG_ICH_LR12
Definition misc.hh:1093
@ MISCREG_DBGWCR11
Definition misc.hh:171
@ MISCREG_DBGCLAIMSET_EL1
Definition misc.hh:538
@ MISCREG_ICH_LR3_EL2
Definition misc.hh:963
@ MISCREG_VTTBR
Definition misc.hh:454
@ MISCREG_MDDTRRX_EL0
Definition misc.hh:531
@ MISCREG_HDFGRTR_EL2
Definition misc.hh:1142
@ MISCREG_CNTVOFF_EL2
Definition misc.hh:848
@ MISCREG_AIFSR
Definition misc.hh:283
@ MISCREG_DBGWCR6
Definition misc.hh:166
@ MISCREG_TLBI_RIPAS2E1OS
Definition misc.hh:764
@ MISCREG_ICH_AP1R1_EL2
Definition misc.hh:951
@ MISCREG_VPIDR
Definition misc.hh:239
@ MISCREG_ICH_AP1R2
Definition misc.hh:1073
@ MISCREG_BPIALLIS
Definition misc.hh:299
@ MISCREG_ICC_AP1R0_EL1_NS
Definition misc.hh:908
@ MISCREG_TLBI_VAE1IS
Definition misc.hh:694
@ MISCREG_DBGWCR15
Definition misc.hh:175
@ MISCREG_CNTHCTL
Definition misc.hh:435
@ MISCREG_ICC_EOIR0_EL1
Definition misc.hh:900
@ MISCREG_TTBR1_NS
Definition misc.hh:264
@ MISCREG_FAR_EL3
Definition misc.hh:667
@ MISCREG_ACTLR_EL1
Definition misc.hh:589
@ MISCREG_TLBI_RVAE2
Definition misc.hh:746
@ MISCREG_ICH_LR8_EL2
Definition misc.hh:968
@ MISCREG_CNTHPS_CTL_EL2
Definition misc.hh:837
@ MISCREG_DBGBVR3_EL1
Definition misc.hh:467
@ MISCREG_DBGVCR
Definition misc.hh:107
@ MISCREG_MDCCINT_EL1
Definition misc.hh:459
@ MISCREG_DBGBVR6_EL1
Definition misc.hh:470
@ MISCREG_DBGWCR9_EL1
Definition misc.hh:521
@ MISCREG_ICC_IAR1
Definition misc.hh:1051
@ MISCREG_IL1DATA3_EL1
Definition misc.hh:865
@ MISCREG_ICH_LR15
Definition misc.hh:1096
@ MISCREG_DC_CISW_Xt
Definition misc.hh:678
@ MISCREG_ICH_AP0R0
Definition misc.hh:1067
@ MISCREG_VBAR_EL2
Definition misc.hh:800
@ MISCREG_ICC_AP1R2_EL1_S
Definition misc.hh:915
@ MISCREG_DBGBCR7_EL1
Definition misc.hh:487
@ MISCREG_ICC_EOIR1_EL1
Definition misc.hh:925
@ MISCREG_ICIMVAU
Definition misc.hh:304
@ MISCREG_ICH_AP0R3_EL2
Definition misc.hh:949
@ MISCREG_DBGWCR14
Definition misc.hh:174
@ MISCREG_DBGBCR5_EL1
Definition misc.hh:485
@ MISCREG_L2ACTLR
Definition misc.hh:451
@ MISCREG_ACTLR_EL2
Definition misc.hh:594
@ MISCREG_CPUMERRSR_EL1
Definition misc.hh:874
@ MISCREG_IFAR_NS
Definition misc.hh:293
@ MISCREG_DBGWVR15_EL1
Definition misc.hh:511
@ MISCREG_CTR
Definition misc.hh:212
@ MISCREG_HPFAR_EL2
Definition misc.hh:666
@ MISCREG_TLBI_RVAAE1OS
Definition misc.hh:761
@ MISCREG_TPIDRURW
Definition misc.hh:408
@ MISCREG_DBGBXVR11
Definition misc.hh:188
@ MISCREG_ICH_LRC6
Definition misc.hh:1103
@ MISCREG_ICH_LR1_EL2
Definition misc.hh:961
@ MISCREG_CLIDR
Definition misc.hh:234
@ MISCREG_TLBI_RVAAE1IS
Definition misc.hh:751
@ MISCREG_SCTLR_S
Definition misc.hh:243
@ MISCREG_DBGDTRRXint
Definition misc.hh:105
@ MISCREG_ICH_AP0R1
Definition misc.hh:1068
@ MISCREG_MDCR_EL2
Definition misc.hh:597
@ MISCREG_VBAR
Definition misc.hh:397
@ MISCREG_IFSR
Definition misc.hh:277
@ MISCREG_PMSELR
Definition misc.hh:362
@ MISCREG_ICIALLUIS
Definition misc.hh:298
@ MISCREG_HACTLR
Definition misc.hh:253
@ MISCREG_TLBI_VALE3OS
Definition misc.hh:736
@ MISCREG_ID_MMFR0_EL1
Definition misc.hh:552
@ MISCREG_AMAIR1
Definition misc.hh:390
@ MISCREG_CNTHV_TVAL_EL2
Definition misc.hh:843
@ MISCREG_VBAR_EL1
Definition misc.hh:796
@ MISCREG_MIDR
Definition misc.hh:211
@ MISCREG_ICH_EISR
Definition misc.hh:1078
@ MISCREG_PMEVCNTR2_EL0
Definition misc.hh:852
@ MISCREG_CNTPS_CVAL_EL1
Definition misc.hh:831
@ MISCREG_HTCR
Definition misc.hh:269
@ MISCREG_AMAIR_EL2
Definition misc.hh:791
@ MISCREG_ICC_BPR0
Definition misc.hh:1037
@ MISCREG_TLBIMVAIS
Definition misc.hh:328
@ MISCREG_TLBI_RVALE1IS
Definition misc.hh:752
@ MISCREG_TTBR1_S
Definition misc.hh:265
@ MISCREG_ICH_LR2
Definition misc.hh:1083
@ MISCREG_HVBAR
Definition misc.hh:403
@ MISCREG_MPAM0_EL1
Definition misc.hh:1147
@ MISCREG_JIDR
Definition misc.hh:205
@ MISCREG_DC_ISW_Xt
Definition misc.hh:672
@ MISCREG_L2CTLR
Definition misc.hh:373
@ MISCREG_DBGPRCR
Definition misc.hh:196
@ MISCREG_DBGWVR10
Definition misc.hh:154
@ MISCREG_CNTP_CTL
Definition misc.hh:422
@ MISCREG_TTBR0_EL3
Definition misc.hh:623
@ MISCREG_ICC_AP0R0_EL1
Definition misc.hh:903
@ MISCREG_ICC_IGRPEN0_EL1
Definition misc.hh:936
@ MISCREG_DBGWCR0_EL1
Definition misc.hh:512
@ MISCREG_TLBI_RIPAS2LE1OS
Definition misc.hh:765
@ MISCREG_ICC_AP1R2_S
Definition misc.hh:1032
@ MISCREG_DCZID_EL0
Definition misc.hh:582
@ MISCREG_ICH_LRC13
Definition misc.hh:1110
@ MISCREG_TLBIALLH
Definition misc.hh:353
@ MISCREG_ICC_AP1R2_EL1_NS
Definition misc.hh:914
@ MISCREG_ICH_VMCR_EL2
Definition misc.hh:959
@ MISCREG_TLBI_RVALE2OS
Definition misc.hh:767
@ MISCREG_ATS12NSOPW
Definition misc.hh:315
@ MISCREG_ICH_LRC14
Definition misc.hh:1111
@ MISCREG_DACR_NS
Definition misc.hh:272
@ MISCREG_TLBIMVAH
Definition misc.hh:354
@ MISCREG_ICC_EOIR1
Definition misc.hh:1046
@ MISCREG_DBGWVR12
Definition misc.hh:156
@ MISCREG_ISR_EL1
Definition misc.hh:799
@ MISCREG_ICC_SGI0R_EL1
Definition misc.hh:923
@ MISCREG_HACR_EL2
Definition misc.hh:600
@ MISCREG_DBGBCR4
Definition misc.hh:132
@ MISCREG_OSDTRTX_EL1
Definition misc.hh:462
@ MISCREG_CNTVOFF
Definition misc.hh:439
@ MISCREG_ICH_LR12_EL2
Definition misc.hh:972
@ MISCREG_TLBI_VAE1
Definition misc.hh:705
@ MISCREG_DBGCLAIMCLR_EL1
Definition misc.hh:539
@ MISCREG_ICH_LRC3
Definition misc.hh:1100
@ MISCREG_AT_S1E0W_Xt
Definition misc.hh:676
@ MISCREG_AMAIR0_S
Definition misc.hh:389
@ MISCREG_DCCSW
Definition misc.hh:319
@ MISCREG_AT_S12E1R_Xt
Definition misc.hh:686
@ MISCREG_DBGBXVR2
Definition misc.hh:179
@ MISCREG_TLBTR
Definition misc.hh:214
@ MISCREG_DBGWVR0
Definition misc.hh:144
@ MISCREG_ID_AA64AFR1_EL1
Definition misc.hh:572
@ MISCREG_DBGWCR12
Definition misc.hh:172
@ MISCREG_AFSR0_EL12
Definition misc.hh:650
@ MISCREG_DCCMVAU
Definition misc.hh:322
@ MISCREG_IL1DATA2_EL1
Definition misc.hh:864
@ MISCREG_ICH_LR3
Definition misc.hh:1084
@ MISCREG_DBGBVR14_EL1
Definition misc.hh:478
@ MISCREG_DTLBIASID
Definition misc.hh:338
@ MISCREG_TLBINEEDSYNC
Definition misc.hh:98
@ MISCREG_ID_ISAR6_EL1
Definition misc.hh:563
@ MISCREG_ELR_EL1
Definition misc.hh:628
@ MISCREG_AMAIR_EL12
Definition misc.hh:789
@ MISCREG_PMXEVCNTR
Definition misc.hh:368
@ MISCREG_DBGBVR1
Definition misc.hh:113
@ MISCREG_CNTHP_CTL
Definition misc.hh:436
@ MISCREG_TLBI_VAE3IS
Definition misc.hh:733
@ MISCREG_DBGWCR15_EL1
Definition misc.hh:527
@ MISCREG_PMCEID0
Definition misc.hh:363
@ MISCREG_ICH_LR9
Definition misc.hh:1090
@ MISCREG_TPIDR_EL2
Definition misc.hh:810
@ MISCREG_DBGBXVR14
Definition misc.hh:191
@ MISCREG_ICC_SRE_NS
Definition misc.hh:1064
@ MISCREG_TCR2_EL1
Definition misc.hh:614
@ MISCREG_DFSR_NS
Definition misc.hh:275
@ MISCREG_ID_PFR1
Definition misc.hh:218
@ MISCREG_CNTHP_CVAL_EL2
Definition misc.hh:835
@ MISCREG_CNTV_TVAL_EL0
Definition misc.hh:821
@ MISCREG_HFGWTR_EL2
Definition misc.hh:1141
@ MISCREG_MPAM2_EL2
Definition misc.hh:1149
@ MISCREG_ZCR_EL3
Definition misc.hh:1116
@ MISCREG_DBGBCR2
Definition misc.hh:130
@ MISCREG_DBGWCR14_EL1
Definition misc.hh:526
@ MISCREG_SPSR_MON
Definition misc.hh:72
@ MISCREG_DCCIMVAC
Definition misc.hh:323
@ MISCREG_L2CTLR_EL1
Definition misc.hh:794
@ MISCREG_VTCR
Definition misc.hh:270
@ MISCREG_FPSCR
Definition misc.hh:78
@ MISCREG_TTBR0
Definition misc.hh:260
@ MISCREG_DBGWVR14_EL1
Definition misc.hh:510
@ MISCREG_DBGWVR1
Definition misc.hh:145
@ MISCREG_DACR
Definition misc.hh:271
@ MISCREG_TTBR0_EL2
Definition misc.hh:616
@ MISCREG_HSCTLR
Definition misc.hh:252
@ MISCREG_SCTLR_NS
Definition misc.hh:242
@ MISCREG_DBGWVR2_EL1
Definition misc.hh:498
@ MISCREG_ICC_IGRPEN1_EL1
Definition misc.hh:937
@ MISCREG_ICC_AP0R0
Definition misc.hh:1020
@ MISCREG_ACTLR_S
Definition misc.hh:246
@ MISCREG_BPIMVA
Definition misc.hh:307
@ MISCREG_PMINTENCLR
Definition misc.hh:371
@ MISCREG_PMCNTENCLR_EL0
Definition misc.hh:774
@ MISCREG_MPAMVPM6_EL2
Definition misc.hh:1160
@ MISCREG_IL1DATA2
Definition misc.hh:443
@ MISCREG_TTBR0_EL1
Definition misc.hh:608
@ MISCREG_ICC_HPPIR0
Definition misc.hh:1047
@ MISCREG_JOSCR
Definition misc.hh:207
@ MISCREG_TLBI_VAALE1IS
Definition misc.hh:702
@ MISCREG_ICIALLU
Definition misc.hh:303
@ MISCREG_IL1DATA3
Definition misc.hh:444
@ MISCREG_CNTP_CTL_NS
Definition misc.hh:423
@ MISCREG_HCRX_EL2
Definition misc.hh:596
@ MISCREG_PMEVCNTR5_EL0
Definition misc.hh:855
@ MISCREG_TLBIALL
Definition misc.hh:339
@ MISCREG_ICC_AP0R2_EL1
Definition misc.hh:905
@ MISCREG_SCTLR_EL3
Definition misc.hh:601
@ MISCREG_CNTP_TVAL_EL0
Definition misc.hh:818
@ MISCREG_FPSCR_QC
Definition misc.hh:87
@ MISCREG_CURRENTEL
Definition misc.hh:632
@ MISCREG_DBGBVR13_EL1
Definition misc.hh:477
@ MISCREG_DBGWVR6
Definition misc.hh:150
@ MISCREG_VSESR_EL2
Definition misc.hh:1190
@ MISCREG_DBGAUTHSTATUS
Definition misc.hh:200
@ MISCREG_ICC_SGI0R
Definition misc.hh:1061
@ MISCREG_MVFR0_EL1
Definition misc.hh:564
@ MISCREG_ICH_AP0R0_EL2
Definition misc.hh:946
@ MISCREG_ID_ISAR1
Definition misc.hh:227
@ MISCREG_DBGBCR0
Definition misc.hh:128
@ MISCREG_ICH_MISR_EL2
Definition misc.hh:956
@ MISCREG_TTBCR_S
Definition misc.hh:268
@ MISCREG_IFSR_S
Definition misc.hh:279
@ MISCREG_TLBI_IPAS2LE1OS
Definition misc.hh:713
@ MISCREG_PMSWINC
Definition misc.hh:361
@ MISCREG_MVFR1_EL1
Definition misc.hh:565
@ MISCREG_ID_AA64AFR0_EL1
Definition misc.hh:571
@ MISCREG_ATS12NSOPR
Definition misc.hh:314
@ MISCREG_MVFR2_EL1
Definition misc.hh:566
@ MISCREG_SMCR_EL12
Definition misc.hh:1129
@ MISCREG_DBGBCR3
Definition misc.hh:131
@ MISCREG_OSLSR_EL1
Definition misc.hh:535
@ MISCREG_DBGBCR9_EL1
Definition misc.hh:489
@ MISCREG_PMCNTENSET_EL0
Definition misc.hh:773
@ MISCREG_ID_ISAR1_EL1
Definition misc.hh:558
@ MISCREG_AIDR
Definition misc.hh:235
@ MISCREG_DFSR
Definition misc.hh:274
@ MISCREG_DBGWVR12_EL1
Definition misc.hh:508
@ MISCREG_TLBI_RVAALE1IS
Definition misc.hh:753
@ MISCREG_ICC_AP1R1
Definition misc.hh:1027
@ MISCREG_CPUACTLR_EL1
Definition misc.hh:872
@ MISCREG_DBGBCR15_EL1
Definition misc.hh:495
@ MISCREG_DLR_EL0
Definition misc.hh:638
@ MISCREG_DBGBVR5
Definition misc.hh:117
@ MISCREG_MVFR0
Definition misc.hh:80
@ MISCREG_ICH_LR0
Definition misc.hh:1081
@ MISCREG_ICH_LRC2
Definition misc.hh:1099
@ MISCREG_DBGWVR5
Definition misc.hh:149
@ MISCREG_MPAMVPM1_EL2
Definition misc.hh:1155
@ MISCREG_ID_MMFR1_EL1
Definition misc.hh:553
@ MISCREG_PRRR_MAIR0_S
Definition misc.hh:92
@ MISCREG_TLBI_VALE1IS
Definition misc.hh:700
@ MISCREG_ICC_AP1R3_S
Definition misc.hh:1035
@ MISCREG_MAIR1_S
Definition misc.hh:386
@ MISCREG_TLBI_VMALLE1IS
Definition misc.hh:692
@ MISCREG_DACR32_EL2
Definition misc.hh:625
@ MISCREG_ID_AA64ISAR0_EL1
Definition misc.hh:573
@ MISCREG_HIFAR
Definition misc.hh:296
@ MISCREG_DBGWVR8
Definition misc.hh:152
@ MISCREG_ICC_SRE_EL1_S
Definition misc.hh:935
@ MISCREG_ICH_EISR_EL2
Definition misc.hh:957
@ MISCREG_CNTHP_TVAL_EL2
Definition misc.hh:836
@ MISCREG_AT_S1E3W_Xt
Definition misc.hh:691
@ MISCREG_ICC_BPR1_EL1
Definition misc.hh:927
@ MISCREG_ICC_AP0R1_EL1
Definition misc.hh:904
@ MISCREG_TLBI_ALLE2
Definition misc.hh:726
@ MISCREG_TLBI_VALE2
Definition misc.hh:729
@ MISCREG_DBGWCR1_EL1
Definition misc.hh:513
@ MISCREG_DCISW
Definition misc.hh:309
@ MISCREG_ID_MMFR2
Definition misc.hh:223
@ MISCREG_HMAIR1
Definition misc.hh:394
@ MISCREG_ICH_LR0_EL2
Definition misc.hh:960
@ MISCREG_APGAKeyHi_EL1
Definition misc.hh:890
@ MISCREG_VMPIDR_EL2
Definition misc.hh:584
@ MISCREG_IC_IVAU_Xt
Definition misc.hh:680
@ MISCREG_ICC_IAR0_EL1
Definition misc.hh:899
@ MISCREG_TLBI_VAE1OS
Definition misc.hh:695
@ MISCREG_MPAMVPM5_EL2
Definition misc.hh:1159
@ MISCREG_ICC_BPR1_EL1_S
Definition misc.hh:929
@ MISCREG_DBGBCR8
Definition misc.hh:136
@ MISCREG_AMAIR0
Definition misc.hh:387
@ MISCREG_VBAR_NS
Definition misc.hh:398
@ MISCREG_DBGWCR3_EL1
Definition misc.hh:515
@ MISCREG_PMOVSCLR_EL0
Definition misc.hh:775
@ MISCREG_ICC_MSRE
Definition misc.hh:1058
@ MISCREG_DBGBCR5
Definition misc.hh:133
@ MISCREG_PMCCNTR
Definition misc.hh:365
@ MISCREG_ICC_AP1R0_NS
Definition misc.hh:1025
@ MISCREG_HSR
Definition misc.hh:288
@ MISCREG_ICC_AP1R2_EL1
Definition misc.hh:913
@ MISCREG_TPIDRURO
Definition misc.hh:411
@ MISCREG_ICH_LRC1
Definition misc.hh:1098
@ MISCREG_HCR2
Definition misc.hh:255
@ MISCREG_DSPSR_EL0
Definition misc.hh:637
@ MISCREG_TLBI_VAAE1
Definition misc.hh:707
@ MISCREG_ICC_HPPIR1_EL1
Definition misc.hh:926
@ MISCREG_L2MERRSR_EL1
Definition misc.hh:875
@ MISCREG_ICC_AP1R3_EL1
Definition misc.hh:916
@ MISCREG_CNTHP_CVAL
Definition misc.hh:437
@ MISCREG_TTBR0_NS
Definition misc.hh:261
@ MISCREG_ICC_RPR
Definition misc.hh:1060
@ MISCREG_FAR_EL2
Definition misc.hh:665
@ MISCREG_CNTHVS_CTL_EL2
Definition misc.hh:844
@ MISCREG_DBGBCR7
Definition misc.hh:135
@ MISCREG_DBGWVR3
Definition misc.hh:147
@ MISCREG_ID_AA64SMFR0_EL1
Definition misc.hh:1122
@ MISCREG_ICC_ASGI1R
Definition misc.hh:1036
@ MISCREG_ICH_AP1R0_EL2
Definition misc.hh:950
@ MISCREG_PMEVCNTR3_EL0
Definition misc.hh:853
@ MISCREG_FPSCR_EXC
Definition misc.hh:86
@ MISCREG_CNTV_TVAL_EL02
Definition misc.hh:827
@ MISCREG_RVBAR_EL3
Definition misc.hh:803
@ MISCREG_TLBI_ASIDE1IS
Definition misc.hh:696
@ MISCREG_ICH_VTR_EL2
Definition misc.hh:955
@ MISCREG_DBGBCR10_EL1
Definition misc.hh:490
@ MISCREG_OSDTRRX_EL1
Definition misc.hh:460
@ MISCREG_AT_S1E0R_Xt
Definition misc.hh:675
@ MISCREG_TLBI_RIPAS2LE1
Definition misc.hh:745
@ MISCREG_MPAM1_EL12
Definition misc.hh:1151
@ MISCREG_MDDTRTX_EL0
Definition misc.hh:530
@ MISCREG_ICC_SRE_S
Definition misc.hh:1065
@ MISCREG_DBGWVR6_EL1
Definition misc.hh:502
@ MISCREG_ID_ISAR3
Definition misc.hh:229
@ MISCREG_CNTHP_CTL_EL2
Definition misc.hh:834
@ MISCREG_ICH_LR14
Definition misc.hh:1095
@ MISCREG_IMPDEF_UNIMPL
Definition misc.hh:1178
@ MISCREG_ICH_LRC10
Definition misc.hh:1107
@ MISCREG_MVBAR
Definition misc.hh:400
@ MISCREG_DBGBCR6
Definition misc.hh:134
@ MISCREG_DBGWVR8_EL1
Definition misc.hh:504
@ MISCREG_ERXFR_EL1
Definition misc.hh:1183
@ MISCREG_PMCR_EL0
Definition misc.hh:772
@ MISCREG_PAR
Definition misc.hh:300
@ MISCREG_CBAR
Definition misc.hh:452
@ MISCREG_CONTEXTIDR_EL12
Definition misc.hh:806
@ MISCREG_CPTR_EL3
Definition misc.hh:606
@ MISCREG_ESR_EL2
Definition misc.hh:658
@ MISCREG_HADFSR
Definition misc.hh:286
@ MISCREG_SPSR_FIQ_AA64
Definition misc.hh:645
@ MISCREG_TLBI_RVAE1
Definition misc.hh:740
@ MISCREG_IC_IALLUIS
Definition misc.hh:668
@ MISCREG_NMRR_MAIR1_NS
Definition misc.hh:94
@ MISCREG_ICH_LR4
Definition misc.hh:1085
@ MISCREG_ID_PFR0
Definition misc.hh:217
@ MISCREG_CLIDR_EL1
Definition misc.hh:578
@ MISCREG_ICH_LRC4
Definition misc.hh:1101
@ MISCREG_DBGBVR6
Definition misc.hh:118
@ MISCREG_NMRR_S
Definition misc.hh:383
@ MISCREG_DCCMVAC
Definition misc.hh:318
@ MISCREG_L2ECTLR_EL1
Definition misc.hh:795
@ MISCREG_ICC_BPR1
Definition misc.hh:1038
@ MISCREG_ICH_LR11
Definition misc.hh:1092
@ MISCREG_IFAR_S
Definition misc.hh:294
@ MISCREG_ICH_AP0R2
Definition misc.hh:1069
@ MISCREG_ID_MMFR3_EL1
Definition misc.hh:555
@ MISCREG_SPSR_IRQ_AA64
Definition misc.hh:642
@ MISCREG_ID_MMFR4
Definition misc.hh:225
@ MISCREG_DBGBXVR1
Definition misc.hh:178
@ MISCREG_AFSR1_EL1
Definition misc.hh:651
@ MISCREG_CNTP_CVAL_S
Definition misc.hh:427
@ MISCREG_ICH_LR13
Definition misc.hh:1094
@ MISCREG_TPIDRURO_S
Definition misc.hh:413
@ MISCREG_DBGBVR4_EL1
Definition misc.hh:468
@ MISCREG_VSTTBR_EL2
Definition misc.hh:621
@ MISCREG_CNTKCTL
Definition misc.hh:434
@ MISCREG_PRRR_MAIR0_NS
Definition misc.hh:91
@ MISCREG_DBGWVR4
Definition misc.hh:148
@ MISCREG_CONTEXTIDR_S
Definition misc.hh:407
@ MISCREG_CNTHV_CVAL_EL2
Definition misc.hh:842
@ MISCREG_LOCKADDR
Definition misc.hh:88
@ MISCREG_PMCEID1_EL0
Definition misc.hh:779
@ MISCREG_TPIDRURW_NS
Definition misc.hh:409
@ MISCREG_CTR_EL0
Definition misc.hh:581
@ MISCREG_CNTFRQ_EL0
Definition misc.hh:813
@ MISCREG_ID_AFR0
Definition misc.hh:220
@ MISCREG_ICC_CTLR_EL1_S
Definition misc.hh:932
@ MISCREG_DBGAUTHSTATUS_EL1
Definition misc.hh:540
@ MISCREG_DBGBCR1
Definition misc.hh:129
@ MISCREG_FPEXC32_EL2
Definition misc.hh:659
@ MISCREG_TLBI_RVALE2
Definition misc.hh:747
@ MISCREG_TPIDRURO_NS
Definition misc.hh:412
@ MISCREG_DBGBCR13
Definition misc.hh:141
@ MISCREG_MDDTR_EL0
Definition misc.hh:529
@ MISCREG_TLBIMVAA
Definition misc.hh:342
@ MISCREG_ICC_AP1R1_NS
Definition misc.hh:1028
@ MISCREG_PMEVCNTR1_EL0
Definition misc.hh:851
@ MISCREG_SPSR
Definition misc.hh:68
@ MISCREG_TPIDRPRW
Definition misc.hh:414
@ MISCREG_ACTLR
Definition misc.hh:244
@ MISCREG_DBGBVR12
Definition misc.hh:124
@ MISCREG_VTTBR_EL2
Definition misc.hh:619
@ MISCREG_DBGWCR7
Definition misc.hh:167
@ MISCREG_PMXEVTYPER_PMCCFILTR
Definition misc.hh:96
@ MISCREG_MAIR1_NS
Definition misc.hh:385
@ MISCREG_ICC_HPPIR1
Definition misc.hh:1048
@ MISCREG_VDISR_EL2
Definition misc.hh:1191
@ MISCREG_DBGBVR15
Definition misc.hh:127
@ MISCREG_DBGBVR4
Definition misc.hh:116
@ MISCREG_ID_AA64PFR1_EL1
Definition misc.hh:568
@ MISCREG_RAMINDEX
Definition misc.hh:450
@ MISCREG_HSTR
Definition misc.hh:258
@ MISCREG_MDCR_EL3
Definition misc.hh:607
@ MISCREG_TLBI_ALLE3OS
Definition misc.hh:732
@ MISCREG_AFSR0_EL2
Definition misc.hh:656
@ MISCREG_ID_ISAR2
Definition misc.hh:228
@ MISCREG_SPSR_FIQ
Definition misc.hh:69
@ MISCREG_PRRR_S
Definition misc.hh:377
@ MISCREG_ICC_AP1R3_NS
Definition misc.hh:1034
@ MISCREG_CNTV_CVAL_EL0
Definition misc.hh:820
@ MISCREG_ZCR_EL12
Definition misc.hh:1118
@ MISCREG_DBGWCR13
Definition misc.hh:173
@ MISCREG_SP_EL1
Definition misc.hh:641
@ MISCREG_ATS1CUW
Definition misc.hh:313
@ MISCREG_MAIR0
Definition misc.hh:378
@ MISCREG_PMOVSSET_EL0
Definition misc.hh:785
std::optional< MiscRegNum64 > encodeAArch64SysReg(MiscRegIndex misc_reg)
Definition misc.cc:2775
Bitfield< 3, 2 > el
Definition misc_types.hh:73
@ MISCREG_USR_S_RD
Definition misc.hh:1226
@ MISCREG_BANKED_CHILD
Definition misc.hh:1218
@ MISCREG_MON_NS1_RD
Definition misc.hh:1242
@ MISCREG_PRI_NS_WR
Definition misc.hh:1230
@ MISCREG_PRI_S_WR
Definition misc.hh:1232
@ MISCREG_MON_NS0_RD
Definition misc.hh:1239
@ MISCREG_BANKED
Definition misc.hh:1212
@ MISCREG_WARN_NOT_FAIL
Definition misc.hh:1207
@ MISCREG_MON_NS1_WR
Definition misc.hh:1243
@ MISCREG_HYP_NS_WR
Definition misc.hh:1235
@ MISCREG_PRI_S_RD
Definition misc.hh:1231
@ MISCREG_PRI_NS_RD
Definition misc.hh:1229
@ MISCREG_USR_NS_WR
Definition misc.hh:1225
@ MISCREG_USR_S_WR
Definition misc.hh:1227
@ MISCREG_USR_NS_RD
Definition misc.hh:1224
@ MISCREG_MON_NS0_WR
Definition misc.hh:1240
@ MISCREG_HYP_NS_RD
Definition misc.hh:1234
MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
Definition misc.cc:521
bool condGenericTimerSystemAccessTrapEL1(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition utility.cc:897
int unflattenMiscReg(int reg)
Definition misc.cc:724
int snsBankedIndex(MiscRegIndex reg, ThreadContext *tc)
Definition misc.cc:672
Bitfield< 34 > aarch64
Definition types.hh:81
std::tuple< bool, bool > canWriteCoprocReg(MiscRegIndex reg, SCR scr, CPSR cpsr, ThreadContext *tc)
Check for permission to write coprocessor registers.
Definition misc.cc:613
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Definition utility.cc:231
int snsBankedIndex64(MiscRegIndex reg, ThreadContext *tc)
Definition misc.cc:690
MiscRegIndex decodeCP15Reg64(unsigned crm, unsigned opc1)
Definition misc.cc:554
std::vector< struct MiscRegLUTEntry > lookUpMiscReg(NUM_MISCREGS)
Definition misc.hh:1694
static Fault defaultFaultE2H_EL2(const MiscRegLUTEntry &entry, ThreadContext *tc, const MiscRegOp64 &inst)
Definition misc.cc:2806
std::tuple< bool, bool > canReadCoprocReg(MiscRegIndex reg, SCR scr, CPSR cpsr, ThreadContext *tc)
Check for permission to read coprocessor registers.
Definition misc.cc:566
static Fault defaultFaultE2H_EL3(const MiscRegLUTEntry &entry, ThreadContext *tc, const MiscRegOp64 &inst)
Definition misc.cc:2818
Bitfield< 0 > p
Bitfield< 2 > priv
Definition misc.hh:131
Bitfield< 5, 3 > reg
Definition types.hh:92
Bitfield< 15 > system
Definition misc.hh:1032
Bitfield< 63 > val
Definition misc.hh:804
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
uint64_t RegVal
Definition types.hh:173
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition root.cc:220
Bitfield< 9 > hyp
constexpr decltype(nullptr) NoFault
Definition types.hh:253
MiscReg metadata.
Definition misc.hh:1250
static Fault defaultFault(const MiscRegLUTEntry &entry, ThreadContext *tc, const MiscRegOp64 &inst)
Definition misc.cc:2795
std::array< FaultCB, EL3+1 > faultRead
Definition misc.hh:1265
std::bitset< NUM_MISCREG_INFOS > info
Definition misc.hh:1258
std::array< FaultCB, EL3+1 > faultWrite
Definition misc.hh:1266
Fault checkFault(ThreadContext *tc, const MiscRegOp64 &inst, ExceptionLevel el)
Definition misc.cc:2786

Generated on Tue Jun 18 2024 16:23:57 for gem5 by doxygen 1.11.0