gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
faults.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, 2012-2014, 2016-2019, 2022 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  * Copyright (c) 2003-2005 The Regents of The University of Michigan
15  * Copyright (c) 2007-2008 The Florida State University
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "arch/arm/faults.hh"
43 
45 #include "arch/arm/interrupts.hh"
46 #include "arch/arm/isa.hh"
47 #include "arch/arm/self_debug.hh"
48 #include "arch/arm/system.hh"
49 #include "arch/arm/utility.hh"
50 #include "base/compiler.hh"
51 #include "base/trace.hh"
52 #include "cpu/base.hh"
53 #include "cpu/thread_context.hh"
54 #include "debug/Faults.hh"
55 #include "sim/full_system.hh"
56 
57 namespace gem5
58 {
59 
60 namespace ArmISA
61 {
62 
63 const uint32_t HighVecs = 0xFFFF0000;
64 
66  0x01, // AlignmentFault
67  0x04, // InstructionCacheMaintenance
68  0xff, // SynchExtAbtOnTranslTableWalkL0 (INVALID)
69  0x0c, // SynchExtAbtOnTranslTableWalkL1
70  0x0e, // SynchExtAbtOnTranslTableWalkL2
71  0xff, // SynchExtAbtOnTranslTableWalkL3 (INVALID)
72  0xff, // SynchPtyErrOnTranslTableWalkL0 (INVALID)
73  0x1c, // SynchPtyErrOnTranslTableWalkL1
74  0x1e, // SynchPtyErrOnTranslTableWalkL2
75  0xff, // SynchPtyErrOnTranslTableWalkL3 (INVALID)
76  0xff, // TranslationL0 (INVALID)
77  0x05, // TranslationL1
78  0x07, // TranslationL2
79  0xff, // TranslationL3 (INVALID)
80  0xff, // AccessFlagL0 (INVALID)
81  0x03, // AccessFlagL1
82  0x06, // AccessFlagL2
83  0xff, // AccessFlagL3 (INVALID)
84  0xff, // DomainL0 (INVALID)
85  0x09, // DomainL1
86  0x0b, // DomainL2
87  0xff, // DomainL3 (INVALID)
88  0xff, // PermissionL0 (INVALID)
89  0x0d, // PermissionL1
90  0x0f, // PermissionL2
91  0xff, // PermissionL3 (INVALID)
92  0x02, // DebugEvent
93  0x08, // SynchronousExternalAbort
94  0x10, // TLBConflictAbort
95  0x19, // SynchPtyErrOnMemoryAccess
96  0x16, // AsynchronousExternalAbort
97  0x18, // AsynchPtyErrOnMemoryAccess
98  0xff, // AddressSizeL0 (INVALID)
99  0xff, // AddressSizeL1 (INVALID)
100  0xff, // AddressSizeL2 (INVALID)
101  0xff, // AddressSizeL3 (INVALID)
102  0x40, // PrefetchTLBMiss
103  0x80 // PrefetchUncacheable
104 };
105 
106 static_assert(sizeof(ArmFault::shortDescFaultSources) ==
108  "Invalid size of ArmFault::shortDescFaultSources[]");
109 
110 uint8_t ArmFault::longDescFaultSources[] = {
111  0x21, // AlignmentFault
112  0xff, // InstructionCacheMaintenance (INVALID)
113  0xff, // SynchExtAbtOnTranslTableWalkL0 (INVALID)
114  0x15, // SynchExtAbtOnTranslTableWalkL1
115  0x16, // SynchExtAbtOnTranslTableWalkL2
116  0x17, // SynchExtAbtOnTranslTableWalkL3
117  0xff, // SynchPtyErrOnTranslTableWalkL0 (INVALID)
118  0x1d, // SynchPtyErrOnTranslTableWalkL1
119  0x1e, // SynchPtyErrOnTranslTableWalkL2
120  0x1f, // SynchPtyErrOnTranslTableWalkL3
121  0xff, // TranslationL0 (INVALID)
122  0x05, // TranslationL1
123  0x06, // TranslationL2
124  0x07, // TranslationL3
125  0xff, // AccessFlagL0 (INVALID)
126  0x09, // AccessFlagL1
127  0x0a, // AccessFlagL2
128  0x0b, // AccessFlagL3
129  0xff, // DomainL0 (INVALID)
130  0x3d, // DomainL1
131  0x3e, // DomainL2
132  0xff, // DomainL3 (RESERVED)
133  0xff, // PermissionL0 (INVALID)
134  0x0d, // PermissionL1
135  0x0e, // PermissionL2
136  0x0f, // PermissionL3
137  0x22, // DebugEvent
138  0x10, // SynchronousExternalAbort
139  0x30, // TLBConflictAbort
140  0x18, // SynchPtyErrOnMemoryAccess
141  0x11, // AsynchronousExternalAbort
142  0x19, // AsynchPtyErrOnMemoryAccess
143  0xff, // AddressSizeL0 (INVALID)
144  0xff, // AddressSizeL1 (INVALID)
145  0xff, // AddressSizeL2 (INVALID)
146  0xff, // AddressSizeL3 (INVALID)
147  0x40, // PrefetchTLBMiss
148  0x80 // PrefetchUncacheable
149 };
150 
151 static_assert(sizeof(ArmFault::longDescFaultSources) ==
153  "Invalid size of ArmFault::longDescFaultSources[]");
154 
155 uint8_t ArmFault::aarch64FaultSources[] = {
156  0x21, // AlignmentFault
157  0xff, // InstructionCacheMaintenance (INVALID)
158  0x14, // SynchExtAbtOnTranslTableWalkL0
159  0x15, // SynchExtAbtOnTranslTableWalkL1
160  0x16, // SynchExtAbtOnTranslTableWalkL2
161  0x17, // SynchExtAbtOnTranslTableWalkL3
162  0x1c, // SynchPtyErrOnTranslTableWalkL0
163  0x1d, // SynchPtyErrOnTranslTableWalkL1
164  0x1e, // SynchPtyErrOnTranslTableWalkL2
165  0x1f, // SynchPtyErrOnTranslTableWalkL3
166  0x04, // TranslationL0
167  0x05, // TranslationL1
168  0x06, // TranslationL2
169  0x07, // TranslationL3
170  0x08, // AccessFlagL0
171  0x09, // AccessFlagL1
172  0x0a, // AccessFlagL2
173  0x0b, // AccessFlagL3
174  // @todo: Section & Page Domain Fault in AArch64?
175  0xff, // DomainL0 (INVALID)
176  0xff, // DomainL1 (INVALID)
177  0xff, // DomainL2 (INVALID)
178  0xff, // DomainL3 (INVALID)
179  0x0c, // PermissionL0
180  0x0d, // PermissionL1
181  0x0e, // PermissionL2
182  0x0f, // PermissionL3
183  0x22, // DebugEvent
184  0x10, // SynchronousExternalAbort
185  0x30, // TLBConflictAbort
186  0x18, // SynchPtyErrOnMemoryAccess
187  0xff, // AsynchronousExternalAbort (INVALID)
188  0xff, // AsynchPtyErrOnMemoryAccess (INVALID)
189  0x00, // AddressSizeL0
190  0x01, // AddressSizeL1
191  0x02, // AddressSizeL2
192  0x03, // AddressSizeL3
193  0x40, // PrefetchTLBMiss
194  0x80 // PrefetchUncacheable
195 };
196 
197 static_assert(sizeof(ArmFault::aarch64FaultSources) ==
199  "Invalid size of ArmFault::aarch64FaultSources[]");
200 
201 // Fields: name, offset, cur{ELT,ELH}Offset, lowerEL{64,32}Offset, next mode,
202 // {ARM, Thumb, ARM_ELR, Thumb_ELR} PC offset, hyp trap,
203 // {A, F} disable, class, stat
205  // Some dummy values (the reset vector has an IMPLEMENTATION DEFINED
206  // location in AArch64)
207  "Reset", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC,
208  0, 0, 0, 0, false, true, true, ExceptionClass::UNKNOWN
209 );
211  "Undefined Instruction", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_UNDEFINED,
212  4, 2, 0, 0, true, false, false, ExceptionClass::UNKNOWN
213 );
215  "Supervisor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
216  4, 2, 4, 2, true, false, false, ExceptionClass::SVC_TO_HYP
217 );
219  "Secure Monitor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_MON,
220  4, 4, 4, 4, false, true, true, ExceptionClass::SMC_TO_HYP
221 );
223  "Hypervisor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_HYP,
224  4, 4, 4, 4, true, false, false, ExceptionClass::HVC
225 );
227  "Prefetch Abort", 0x00C, 0x000, 0x200, 0x400, 0x600, MODE_ABORT,
228  4, 4, 0, 0, true, true, false, ExceptionClass::PREFETCH_ABORT_TO_HYP
229 );
231  "Data Abort", 0x010, 0x000, 0x200, 0x400, 0x600, MODE_ABORT,
232  8, 8, 0, 0, true, true, false, ExceptionClass::DATA_ABORT_TO_HYP
233 );
235  "Virtual Data Abort", 0x010, 0x000, 0x200, 0x400, 0x600, MODE_ABORT,
236  8, 8, 0, 0, true, true, false, ExceptionClass::INVALID
237 );
239  // @todo: double check these values
240  "Hypervisor Trap", 0x014, 0x000, 0x200, 0x400, 0x600, MODE_HYP,
241  0, 0, 0, 0, false, false, false, ExceptionClass::UNKNOWN
242 );
244  "Secure Monitor Trap", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_MON,
245  4, 2, 0, 0, false, false, false, ExceptionClass::UNKNOWN
246 );
248  "IRQ", 0x018, 0x080, 0x280, 0x480, 0x680, MODE_IRQ,
249  4, 4, 0, 0, false, true, false, ExceptionClass::UNKNOWN
250 );
252  "Virtual IRQ", 0x018, 0x080, 0x280, 0x480, 0x680, MODE_IRQ,
253  4, 4, 0, 0, false, true, false, ExceptionClass::INVALID
254 );
256  "FIQ", 0x01C, 0x100, 0x300, 0x500, 0x700, MODE_FIQ,
257  4, 4, 0, 0, false, true, true, ExceptionClass::UNKNOWN
258 );
260  "Virtual FIQ", 0x01C, 0x100, 0x300, 0x500, 0x700, MODE_FIQ,
261  4, 4, 0, 0, false, true, true, ExceptionClass::INVALID
262 );
264  "Illegal Inst Set State Fault", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_UNDEFINED,
265  4, 2, 0, 0, true, false, false, ExceptionClass::ILLEGAL_INST
266 );
268  // Some dummy values (SupervisorTrap is AArch64-only)
269  "Supervisor Trap", 0x014, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
270  0, 0, 0, 0, false, false, false, ExceptionClass::UNKNOWN
271 );
273  // Some dummy values (PCAlignmentFault is AArch64-only)
274  "PC Alignment Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
275  0, 0, 0, 0, true, false, false, ExceptionClass::PC_ALIGNMENT
276 );
278  // Some dummy values (SPAlignmentFault is AArch64-only)
279  "SP Alignment Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
280  0, 0, 0, 0, true, false, false, ExceptionClass::STACK_PTR_ALIGNMENT
281 );
283  // Some dummy values (SError is AArch64-only)
284  "SError", 0x000, 0x180, 0x380, 0x580, 0x780, MODE_SVC,
285  0, 0, 0, 0, false, true, true, ExceptionClass::SERROR
286 );
288  // Some dummy values (SoftwareBreakpoint is AArch64-only)
289  "Software Breakpoint", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
290  0, 0, 0, 0, true, false, false, ExceptionClass::SOFTWARE_BREAKPOINT
291 );
293  "Hardware Breakpoint", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
294  0, 0, 0, 0, true, false, false, ExceptionClass::HW_BREAKPOINT
295 );
297  "Watchpoint", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
298  0, 0, 0, 0, true, false, false, ExceptionClass::WATCHPOINT
299 );
301  "SoftwareStep", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC,
302  0, 0, 0, 0, true, false, false, ExceptionClass::SOFTWARE_STEP
303 );
305  // Some dummy values
306  "ArmSev Flush", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC,
307  0, 0, 0, 0, false, true, true, ExceptionClass::UNKNOWN
308 );
309 
310 Addr
312 {
313  Addr base;
314 
315  // Check for invalid modes
316  CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR);
317  assert(ArmSystem::haveEL(tc, EL3) || cpsr.mode != MODE_MON);
318  assert(ArmSystem::haveEL(tc, EL2) || cpsr.mode != MODE_HYP);
319 
320  switch (cpsr.mode)
321  {
322  case MODE_MON:
324  break;
325  case MODE_HYP:
327  break;
328  default:
329  SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR);
330  if (sctlr.v) {
331  base = HighVecs;
332  } else {
333  base = ArmSystem::haveEL(tc, EL3) ?
334  tc->readMiscReg(MISCREG_VBAR) : 0;
335  }
336  break;
337  }
338 
339  return base + offset(tc);
340 }
341 
342 Addr
344 {
345  Addr vbar;
346  switch (toEL) {
347  case EL3:
348  assert(ArmSystem::haveEL(tc, EL3));
349  vbar = tc->readMiscReg(MISCREG_VBAR_EL3);
350  break;
351  case EL2:
352  assert(ArmSystem::haveEL(tc, EL2));
353  vbar = tc->readMiscReg(MISCREG_VBAR_EL2);
354  break;
355  case EL1:
356  vbar = tc->readMiscReg(MISCREG_VBAR_EL1);
357  break;
358  default:
359  panic("Invalid target exception level");
360  break;
361  }
362  return vbar + offset64(tc);
363 }
364 
367 {
368  switch (toEL) {
369  case EL1:
370  return MISCREG_ESR_EL1;
371  case EL2:
372  return MISCREG_ESR_EL2;
373  case EL3:
374  return MISCREG_ESR_EL3;
375  default:
376  panic("Invalid exception level");
377  break;
378  }
379 }
380 
383 {
384  switch (toEL) {
385  case EL1:
386  return MISCREG_FAR_EL1;
387  case EL2:
388  return MISCREG_FAR_EL2;
389  case EL3:
390  return MISCREG_FAR_EL3;
391  default:
392  panic("Invalid exception level");
393  break;
394  }
395 }
396 
397 void
399 {
400  ESR esr = 0;
401  uint32_t exc_class = (uint32_t) ec(tc);
402  uint32_t iss_val = iss();
403 
404  assert(!from64 || ArmSystem::highestELIs64(tc));
405 
406  esr.ec = exc_class;
407  esr.il = il(tc);
408 
409  // Condition code valid for EC[5:4] nonzero
410  if (!from64 && ((bits(exc_class, 5, 4) == 0) &&
411  (bits(exc_class, 3, 0) != 0))) {
412 
413  if (!machInst.thumb) {
414  ConditionCode cond_code = (ConditionCode) (uint32_t) machInst.condCode;
415  // If its on unconditional instruction report with a cond code of
416  // 0xE, ie the unconditional code
417  esr.cond_iss.cv = 1;
418  esr.cond_iss.cond = (cond_code == COND_UC) ? COND_AL : cond_code;
419  }
420  esr.cond_iss.iss = bits(iss_val, 19, 0);
421  } else {
422  esr.iss = iss_val;
423  }
424  tc->setMiscReg(syndrome_reg, esr);
425 }
426 
427 void
429 {
430  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
431 
432  // Determine source exception level and mode
433  fromMode = (OperatingMode) (uint8_t) cpsr.mode;
435  if (opModeIs64(fromMode))
436  from64 = true;
437 
438  // Determine target exception level (aarch64) or target execution
439  // mode (aarch32).
440  if (ArmSystem::haveEL(tc, EL3) && routeToMonitor(tc)) {
441  toMode = MODE_MON;
442  toEL = EL3;
443  } else if (ArmSystem::haveEL(tc, EL2) && routeToHyp(tc)) {
444  toMode = MODE_HYP;
445  toEL = EL2;
446  hypRouted = true;
447  } else {
448  toMode = nextMode();
450  }
451 
452  if (fromEL > toEL)
453  toEL = fromEL;
454 
455  // Check for Set Priviledge Access Never, if PAN is supported
456  if (HaveExt(tc, ArmExtension::FEAT_PAN)) {
457  if (toEL == EL1) {
458  const SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR_EL1);
459  span = !sctlr.span;
460  }
461 
462  const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
463  if (toEL == EL2 && hcr.e2h && hcr.tge) {
464  const SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR_EL2);
465  span = !sctlr.span;
466  }
467  }
468 
469  to64 = ELIs64(tc, toEL);
470 
471  // The fault specific informations have been updated; it is
472  // now possible to use them inside the fault.
473  faultUpdated = true;
474 }
475 
476 void
478 {
479  // Update fault state informations, like the starting mode (aarch32)
480  // or EL (aarch64) and the ending mode or EL.
481  // From the update function we are also evaluating if the fault must
482  // be handled in AArch64 mode (to64).
483  update(tc);
484 
485  if (from64 != to64) {
486  // Switching modes, sync up versions of the vector register file.
487  if (from64) {
488  syncVecRegsToElems(tc);
489  } else {
490  syncVecElemsToRegs(tc);
491  }
492  }
493 
494  if (to64) {
495  // Invoke exception handler in AArch64 state
496  invoke64(tc, inst);
497  } else {
498  // Invoke exception handler in AArch32 state
499  invoke32(tc, inst);
500  }
501 }
502 
503 void
505 {
506  // ARMv7 (ARM ARM issue C B1.9)
507  bool have_security = ArmSystem::haveEL(tc, EL3);
508 
509  FaultBase::invoke(tc);
510  if (!FullSystem)
511  return;
512 
513  SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR);
514  SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
515  CPSR saved_cpsr = tc->readMiscReg(MISCREG_CPSR);
516  saved_cpsr.nz = tc->getReg(cc_reg::Nz);
517  saved_cpsr.c = tc->getReg(cc_reg::C);
518  saved_cpsr.v = tc->getReg(cc_reg::V);
519  saved_cpsr.ge = tc->getReg(cc_reg::Ge);
520 
521  [[maybe_unused]] Addr cur_pc = tc->pcState().as<PCState>().pc();
522  ITSTATE it = tc->pcState().as<PCState>().itstate();
523  saved_cpsr.it2 = it.top6;
524  saved_cpsr.it1 = it.bottom2;
525 
526  // if we have a valid instruction then use it to annotate this fault with
527  // extra information. This is used to generate the correct fault syndrome
528  // information
529  [[maybe_unused]] ArmStaticInst *arm_inst = instrAnnotate(inst);
530 
531  // Ensure Secure state if initially in Monitor mode
532  if (have_security && saved_cpsr.mode == MODE_MON) {
533  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
534  if (scr.ns) {
535  scr.ns = 0;
537  }
538  }
539 
540  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
541  cpsr.mode = toMode;
542 
543  // some bits are set differently if we have been routed to hyp mode
544  if (cpsr.mode == MODE_HYP) {
545  SCTLR hsctlr = tc->readMiscReg(MISCREG_HSCTLR);
546  cpsr.t = hsctlr.te;
547  cpsr.e = hsctlr.ee;
548  if (!scr.ea) {cpsr.a = 1;}
549  if (!scr.fiq) {cpsr.f = 1;}
550  if (!scr.irq) {cpsr.i = 1;}
551  } else if (cpsr.mode == MODE_MON) {
552  // Special case handling when entering monitor mode
553  cpsr.t = sctlr.te;
554  cpsr.e = sctlr.ee;
555  cpsr.a = 1;
556  cpsr.f = 1;
557  cpsr.i = 1;
558  } else {
559  cpsr.t = sctlr.te;
560  cpsr.e = sctlr.ee;
561 
562  // The *Disable functions are virtual and different per fault
563  cpsr.a = cpsr.a | abortDisable(tc);
564  cpsr.f = cpsr.f | fiqDisable(tc);
565  cpsr.i = 1;
566  }
567  cpsr.it1 = cpsr.it2 = 0;
568  cpsr.j = 0;
569  cpsr.pan = span ? 1 : saved_cpsr.pan;
570  tc->setMiscReg(MISCREG_CPSR, cpsr);
571 
572  // Make sure mailbox sets to one always
574 
575  // Clear the exclusive monitor
577 
578  if (cpsr.mode == MODE_HYP) {
579  tc->setMiscReg(MISCREG_ELR_HYP, cur_pc +
580  (saved_cpsr.t ? thumbPcOffset(true) : armPcOffset(true)));
581  } else {
582  tc->setReg(int_reg::Lr, cur_pc +
583  (saved_cpsr.t ? thumbPcOffset(false) : armPcOffset(false)));
584  }
585 
586  switch (cpsr.mode) {
587  case MODE_FIQ:
588  tc->setMiscReg(MISCREG_SPSR_FIQ, saved_cpsr);
589  break;
590  case MODE_IRQ:
591  tc->setMiscReg(MISCREG_SPSR_IRQ, saved_cpsr);
592  break;
593  case MODE_SVC:
594  tc->setMiscReg(MISCREG_SPSR_SVC, saved_cpsr);
595  break;
596  case MODE_MON:
597  assert(have_security);
598  tc->setMiscReg(MISCREG_SPSR_MON, saved_cpsr);
599  break;
600  case MODE_ABORT:
601  tc->setMiscReg(MISCREG_SPSR_ABT, saved_cpsr);
602  break;
603  case MODE_UNDEFINED:
604  tc->setMiscReg(MISCREG_SPSR_UND, saved_cpsr);
605  if (ec(tc) != ExceptionClass::UNKNOWN)
607  break;
608  case MODE_HYP:
609  assert(ArmSystem::haveEL(tc, EL2));
610  tc->setMiscReg(MISCREG_SPSR_HYP, saved_cpsr);
612  break;
613  default:
614  panic("unknown Mode\n");
615  }
616 
617  Addr new_pc = getVector(tc);
618  DPRINTF(Faults, "Invoking Fault:%s cpsr:%#x PC:%#x lr:%#x newVec: %#x "
619  "%s\n", name(), cpsr, cur_pc, tc->getReg(int_reg::Lr),
620  new_pc, arm_inst ? csprintf("inst: %#x", arm_inst->encoding()) :
621  std::string());
622  PCState pc(new_pc);
623  pc.thumb(cpsr.t);
624  pc.nextThumb(pc.thumb());
625  pc.jazelle(cpsr.j);
626  pc.nextJazelle(pc.jazelle());
627  pc.aarch64(!cpsr.width);
628  pc.nextAArch64(!cpsr.width);
629  pc.illegalExec(false);
630  tc->pcState(pc);
631 }
632 
633 void
635 {
636  // Determine actual misc. register indices for ELR_ELx and SPSR_ELx
637  MiscRegIndex elr_idx, spsr_idx;
638  switch (toEL) {
639  case EL1:
640  elr_idx = MISCREG_ELR_EL1;
641  spsr_idx = MISCREG_SPSR_EL1;
642  break;
643  case EL2:
644  assert(ArmSystem::haveEL(tc, EL2));
645  elr_idx = MISCREG_ELR_EL2;
646  spsr_idx = MISCREG_SPSR_EL2;
647  break;
648  case EL3:
649  assert(ArmSystem::haveEL(tc, EL3));
650  elr_idx = MISCREG_ELR_EL3;
651  spsr_idx = MISCREG_SPSR_EL3;
652  break;
653  default:
654  panic("Invalid target exception level");
655  break;
656  }
657 
658  // Save process state into SPSR_ELx
659  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
660  CPSR spsr = cpsr;
661  spsr.nz = tc->getReg(cc_reg::Nz);
662  spsr.c = tc->getReg(cc_reg::C);
663  spsr.v = tc->getReg(cc_reg::V);
664  spsr.ss = isResetSPSR() ? 0: cpsr.ss;
665  if (from64) {
666  // Force some bitfields to 0
667  spsr.q = 0;
668  spsr.it1 = 0;
669  spsr.j = 0;
670  spsr.ge = 0;
671  spsr.it2 = 0;
672  spsr.t = 0;
673  } else {
674  spsr.ge = tc->getReg(cc_reg::Ge);
675  ITSTATE it = tc->pcState().as<PCState>().itstate();
676  spsr.it2 = it.top6;
677  spsr.it1 = it.bottom2;
678  spsr.uao = 0;
679  }
680  tc->setMiscReg(spsr_idx, spsr);
681 
682  // Save preferred return address into ELR_ELx
683  Addr curr_pc = tc->pcState().instAddr();
684  Addr ret_addr = curr_pc;
685  if (from64)
686  ret_addr += armPcElrOffset();
687  else
688  ret_addr += spsr.t ? thumbPcElrOffset() : armPcElrOffset();
689  tc->setMiscReg(elr_idx, ret_addr);
690 
691  Addr vec_address = getVector64(tc);
692 
693  // Update process state
694  OperatingMode64 mode = 0;
695  mode.spX = 1;
696  mode.el = toEL;
697  mode.width = 0;
698  cpsr.mode = mode;
699  cpsr.daif = 0xf;
700  cpsr.il = 0;
701  cpsr.ss = 0;
702  cpsr.pan = span ? 1 : spsr.pan;
703  cpsr.uao = 0;
704  tc->setMiscReg(MISCREG_CPSR, cpsr);
705 
706  // If we have a valid instruction then use it to annotate this fault with
707  // extra information. This is used to generate the correct fault syndrome
708  // information
709  [[maybe_unused]] ArmStaticInst *arm_inst = instrAnnotate(inst);
710 
711  // Set PC to start of exception handler
712  Addr new_pc = purifyTaggedAddr(vec_address, tc, toEL, true);
713  DPRINTF(Faults, "Invoking Fault (AArch64 target EL):%s cpsr:%#x PC:%#x "
714  "elr:%#x newVec: %#x %s\n", name(), cpsr, curr_pc, ret_addr,
715  new_pc, arm_inst ? csprintf("inst: %#x", arm_inst->encoding()) :
716  std::string());
717  PCState pc(new_pc);
718  pc.aarch64(!cpsr.width);
719  pc.nextAArch64(!cpsr.width);
720  pc.illegalExec(false);
721  pc.stepped(false);
722  tc->pcState(pc);
723 
724  // Save exception syndrome
725  if ((nextMode() != MODE_IRQ) && (nextMode() != MODE_FIQ))
727 }
728 
731 {
732  if (inst) {
733  auto arm_inst = static_cast<ArmStaticInst *>(inst.get());
734  arm_inst->annotateFault(this);
735  return arm_inst;
736  } else {
737  return nullptr;
738  }
739 }
740 
741 Addr
743 {
744  Addr base;
745 
746  // Check for invalid modes
747  [[maybe_unused]] CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR);
748  assert(ArmSystem::haveEL(tc, EL3) || cpsr.mode != MODE_MON);
749  assert(ArmSystem::haveEL(tc, EL2) || cpsr.mode != MODE_HYP);
750 
751  // RVBAR is aliased (implemented as) MVBAR in gem5, since the two
752  // are mutually exclusive; there is no need to check here for
753  // which register to use since they hold the same value
755 
756  return base + offset(tc);
757 }
758 
759 void
761 {
762  if (FullSystem) {
763  tc->getCpuPtr()->clearInterrupts(tc->threadId());
764  tc->clearArchRegs();
765  }
766  if (!ArmSystem::highestELIs64(tc)) {
767  ArmFault::invoke(tc, inst);
769  getMPIDR(dynamic_cast<ArmSystem*>(tc->getSystemPtr()), tc));
770 
771  // Unless we have SMC code to get us there, boot in HYP!
772  if (ArmSystem::haveEL(tc, EL2) &&
773  !ArmSystem::haveEL(tc, EL3)) {
774  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
775  cpsr.mode = MODE_HYP;
776  tc->setMiscReg(MISCREG_CPSR, cpsr);
777  }
778  } else {
779  // Advance the PC to the IMPLEMENTATION DEFINED reset value
781  pc.aarch64(true);
782  pc.nextAArch64(true);
783  tc->pcState(pc);
784  }
785 }
786 
787 void
789 {
790  if (FullSystem) {
791  ArmFault::invoke(tc, inst);
792  return;
793  }
794 
795  // If the mnemonic isn't defined this has to be an unknown instruction.
796  assert(unknown || mnemonic != NULL);
797  auto arm_inst = static_cast<ArmStaticInst *>(inst.get());
798  if (disabled) {
799  panic("Attempted to execute disabled instruction "
800  "'%s' (inst 0x%08x)", mnemonic, arm_inst->encoding());
801  } else if (unknown) {
802  panic("Attempted to execute unknown instruction (inst 0x%08x)",
803  arm_inst->encoding());
804  } else {
805  panic("Attempted to execute unimplemented instruction "
806  "'%s' (inst 0x%08x)", mnemonic, arm_inst->encoding());
807  }
808 }
809 
810 bool
812 {
813  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
814  return fromEL == EL2 ||
815  (EL2Enabled(tc) && (fromEL == EL0) && hcr.tge);
816 }
817 
818 uint32_t
820 {
821 
822  // If UndefinedInstruction is routed to hypervisor, iss field is 0.
823  if (hypRouted) {
824  return 0;
825  }
826 
828  return issRaw;
829 
830  uint32_t new_iss = 0;
831  uint32_t op0, op1, op2, CRn, CRm, Rt, dir;
832 
833  dir = bits(machInst, 21, 21);
834  op0 = bits(machInst, 20, 19);
835  op1 = bits(machInst, 18, 16);
836  CRn = bits(machInst, 15, 12);
837  CRm = bits(machInst, 11, 8);
838  op2 = bits(machInst, 7, 5);
839  Rt = bits(machInst, 4, 0);
840 
841  new_iss = op0 << 20 | op2 << 17 | op1 << 14 | CRn << 10 |
842  Rt << 5 | CRm << 1 | dir;
843 
844  return new_iss;
845 }
846 
847 void
849 {
850  if (FullSystem) {
851  ArmFault::invoke(tc, inst);
852  return;
853  }
854 
855  // Advance the PC since that won't happen automatically.
856  PCState pc = tc->pcState().as<PCState>();
857  assert(inst);
858  inst->advancePC(pc);
859  tc->pcState(pc);
860 
861  // As of now, there isn't a 32 bit thumb version of this instruction.
862  assert(!machInst.bigThumb);
863  tc->getSystemPtr()->workload->syscall(tc);
864 }
865 
866 bool
868 {
869  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
870  return fromEL == EL2 ||
871  (EL2Enabled(tc) && fromEL == EL0 && hcr.tge);
872 }
873 
876 {
879 }
880 
881 uint32_t
883 {
884  // Even if we have a 24 bit imm from an arm32 instruction then we only use
885  // the bottom 16 bits for the ISS value (it doesn't hurt for AArch64 SVC).
886  return issRaw & 0xFFFF;
887 }
888 
889 uint32_t
891 {
892  if (from64)
893  return bits(machInst, 20, 5);
894  return 0;
895 }
896 
899 {
900  // If UndefinedInstruction is routed to hypervisor,
901  // HSR.EC field is 0.
902  if (hypRouted)
904  else
906 }
907 
908 
909 HypervisorCall::HypervisorCall(ExtMachInst mach_inst, uint32_t _imm) :
910  ArmFaultVals<HypervisorCall>(mach_inst, _imm)
911 {
912  bStep = true;
913 }
914 
915 bool
917 {
918  return from64 && fromEL == EL3;
919 }
920 
921 bool
923 {
924  return !from64 || fromEL != EL3;
925 }
926 
929 {
931 }
932 
935 {
937 }
938 
939 template<class T>
942 {
943  bool isHypTrap = false;
944 
945  // Normally we just use the exception vector from the table at the top if
946  // this file, however if this exception has caused a transition to hype
947  // mode, and its an exception type that would only do this if it has been
948  // trapped then we use the hyp trap vector instead of the normal vector
949  if (vals.hypTrappable) {
950  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
951  if (cpsr.mode == MODE_HYP) {
952  CPSR spsr = tc->readMiscReg(MISCREG_SPSR_HYP);
953  isHypTrap = spsr.mode != MODE_HYP;
954  }
955  }
956  return isHypTrap ? 0x14 : vals.offset;
957 }
958 
959 template<class T>
962 {
963  if (toEL == fromEL) {
964  if (opModeIsT(fromMode))
965  return vals.currELTOffset;
966  return vals.currELHOffset;
967  } else {
968  bool lower_32 = false;
969  if (toEL == EL3) {
970  if (EL2Enabled(tc))
971  lower_32 = ELIs32(tc, EL2);
972  else
973  lower_32 = ELIs32(tc, EL1);
974  } else if (ELIsInHost(tc, fromEL) && fromEL == EL0 && toEL == EL2) {
975  lower_32 = ELIs32(tc, EL0);
976  } else {
977  lower_32 = ELIs32(tc, static_cast<ExceptionLevel>(toEL - 1));
978  }
979 
980  if (lower_32)
981  return vals.lowerEL32Offset;
982  return vals.lowerEL64Offset;
983  }
984 }
985 
986 // void
987 // SupervisorCall::setSyndrome64(ThreadContext *tc, MiscRegIndex esr_idx)
988 // {
989 // ESR esr = 0;
990 // esr.ec = machInst.aarch64 ? SvcAArch64 : SvcAArch32;
991 // esr.il = !machInst.thumb;
992 // if (machInst.aarch64)
993 // esr.imm16 = bits(machInst.instBits, 20, 5);
994 // else if (machInst.thumb)
995 // esr.imm16 = bits(machInst.instBits, 7, 0);
996 // else
997 // esr.imm16 = bits(machInst.instBits, 15, 0);
998 // tc->setMiscReg(esr_idx, esr);
999 // }
1000 
1001 void
1003 {
1004  if (FullSystem) {
1005  ArmFault::invoke(tc, inst);
1006  return;
1007  }
1008 }
1009 
1012 {
1013  return (from64 ? ExceptionClass::SMC_64 : vals.ec);
1014 }
1015 
1016 bool
1018 {
1019  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1020  return EL2Enabled(tc) && currEL(tc) <= EL1 && hcr.tge;
1021 }
1022 
1023 uint32_t
1025 {
1026  // If SupervisorTrap is routed to hypervisor, iss field is 0.
1027  if (hypRouted) {
1028  return 0;
1029  }
1030  return issRaw;
1031 }
1032 
1035 {
1036  if (hypRouted)
1037  return ExceptionClass::UNKNOWN;
1038  else
1040 }
1041 
1044 {
1047 }
1048 
1049 template<class T>
1050 void
1052 {
1053  if (tranMethod == ArmFault::UnknownTran) {
1054  tranMethod = longDescFormatInUse(tc) ? ArmFault::LpaeTran
1056 
1057  if ((tranMethod == ArmFault::VmsaTran) && this->routeToMonitor(tc)) {
1058  // See ARM ARM B3-1416
1059  bool override_LPAE = false;
1060  TTBCR ttbcr_s = tc->readMiscReg(MISCREG_TTBCR_S);
1061  [[maybe_unused]] TTBCR ttbcr_ns =
1063  if (ttbcr_s.eae) {
1064  override_LPAE = true;
1065  } else {
1066  // Unimplemented code option, not seen in testing. May need
1067  // extension according to the manual exceprt above.
1068  DPRINTF(Faults, "Warning: Incomplete translation method "
1069  "override detected.\n");
1070  }
1071  if (override_LPAE)
1072  tranMethod = ArmFault::LpaeTran;
1073  }
1074  }
1075 
1076  if (source == ArmFault::AsynchronousExternalAbort) {
1077  tc->getCpuPtr()->clearInterrupt(tc->threadId(), INT_ABT, 0);
1078  }
1079  // Get effective fault source encoding
1080  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
1081 
1082  // source must be determined BEFORE invoking generic routines which will
1083  // try to set hsr etc. and are based upon source!
1084  ArmFaultVals<T>::invoke(tc, inst);
1085 
1086  if (!this->to64) { // AArch32
1087  FSR fsr = getFsr(tc);
1088  if (cpsr.mode == MODE_HYP) {
1089  tc->setMiscReg(T::HFarIndex, faultAddr);
1090  } else if (stage2) {
1091  tc->setMiscReg(MISCREG_HPFAR, (faultAddr >> 8) & ~0xf);
1092  tc->setMiscReg(T::HFarIndex, OVAddr);
1093  } else if (debugType > ArmFault::NODEBUG) {
1094  DBGDS32 Rext = tc->readMiscReg(MISCREG_DBGDSCRext);
1095  tc->setMiscReg(T::FarIndex, faultAddr);
1096  if (debugType == ArmFault::BRKPOINT){
1097  Rext.moe = 0x1;
1098  } else if (debugType == ArmFault::VECTORCATCH){
1099  Rext.moe = 0x5;
1100  } else if (debugType > ArmFault::VECTORCATCH) {
1101  Rext.moe = 0xa;
1102  fsr.cm = (debugType == ArmFault::WPOINT_CM)? 1 : 0;
1103  }
1104 
1105  tc->setMiscReg(T::FsrIndex, fsr);
1106  tc->setMiscReg(MISCREG_DBGDSCRext, Rext);
1107 
1108  } else {
1109  tc->setMiscReg(T::FsrIndex, fsr);
1110  tc->setMiscReg(T::FarIndex, faultAddr);
1111  }
1112  DPRINTF(Faults, "Abort Fault source=%#x fsr=%#x faultAddr=%#x "\
1113  "tranMethod=%#x\n", source, fsr, faultAddr, tranMethod);
1114  } else { // AArch64
1115  // Set the FAR register. Nothing else to do if we are in AArch64 state
1116  // because the syndrome register has already been set inside invoke64()
1117  if (stage2) {
1118  // stage 2 fault, set HPFAR_EL2 to the faulting IPA
1119  // and FAR_EL2 to the Original VA
1121  tc->setMiscReg(MISCREG_HPFAR_EL2, bits(faultAddr, 47, 12) << 4);
1122 
1123  DPRINTF(Faults, "Abort Fault (Stage 2) VA: 0x%x IPA: 0x%x\n",
1124  OVAddr, faultAddr);
1125  } else {
1126  tc->setMiscReg(AbortFault<T>::getFaultAddrReg64(), faultAddr);
1127  }
1128  }
1129 }
1130 
1131 template<class T>
1132 void
1134 {
1135  srcEncoded = getFaultStatusCode(tc);
1136  if (srcEncoded == ArmFault::FaultSourceInvalid) {
1137  panic("Invalid fault source\n");
1138  }
1139  ArmFault::setSyndrome(tc, syndrome_reg);
1140 }
1141 
1142 template<class T>
1143 uint8_t
1145 {
1146 
1147  panic_if(!this->faultUpdated,
1148  "Trying to use un-updated ArmFault internal variables\n");
1149 
1150  uint8_t fsc = 0;
1151 
1152  if (!this->to64) {
1153  // AArch32
1154  assert(tranMethod != ArmFault::UnknownTran);
1155  if (tranMethod == ArmFault::LpaeTran) {
1156  fsc = ArmFault::longDescFaultSources[source];
1157  } else {
1158  fsc = ArmFault::shortDescFaultSources[source];
1159  }
1160  } else {
1161  // AArch64
1162  fsc = ArmFault::aarch64FaultSources[source];
1163  }
1164 
1165  return fsc;
1166 }
1167 
1168 template<class T>
1169 FSR
1171 {
1172  FSR fsr = 0;
1173 
1174  auto fsc = getFaultStatusCode(tc);
1175 
1176  // AArch32
1177  assert(tranMethod != ArmFault::UnknownTran);
1178  if (tranMethod == ArmFault::LpaeTran) {
1179  fsr.status = fsc;
1180  fsr.lpae = 1;
1181  } else {
1182  fsr.fsLow = bits(fsc, 3, 0);
1183  fsr.fsHigh = bits(fsc, 4);
1184  fsr.domain = static_cast<uint8_t>(domain);
1185  }
1186 
1187  fsr.wnr = (write ? 1 : 0);
1188  fsr.ext = 0;
1189 
1190  return fsr;
1191 }
1192 
1193 template<class T>
1194 bool
1196 {
1197  if (ArmSystem::haveEL(tc, EL3)) {
1198  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1199  return (!scr.ns || scr.aw);
1200  }
1201  return true;
1202 }
1203 
1204 template<class T>
1205 void
1207 {
1208  switch (id)
1209  {
1210  case ArmFault::S1PTW:
1211  s1ptw = val;
1212  break;
1213  case ArmFault::OVA:
1214  OVAddr = val;
1215  break;
1216 
1217  // Just ignore unknown ID's
1218  default:
1219  break;
1220  }
1221 }
1222 
1223 template<class T>
1224 bool
1226 {
1227  // NOTE: Not relying on LL information being aligned to lowest bits here
1228  return
1229  (source == ArmFault::AlignmentFault) ||
1230  ((source >= ArmFault::TranslationLL) &&
1231  (source < ArmFault::TranslationLL + 4)) ||
1232  ((source >= ArmFault::AccessFlagLL) &&
1233  (source < ArmFault::AccessFlagLL + 4)) ||
1234  ((source >= ArmFault::DomainLL) &&
1235  (source < ArmFault::DomainLL + 4)) ||
1236  ((source >= ArmFault::PermissionLL) &&
1237  (source < ArmFault::PermissionLL + 4));
1238 }
1239 
1240 template<class T>
1241 bool
1243 {
1244  va = (stage2 ? OVAddr : faultAddr);
1245  return true;
1246 }
1247 
1250 {
1251  if (to64) {
1252  // AArch64
1253  if (toEL == fromEL)
1255  else
1257  } else {
1258  // AArch32
1259  // Abort faults have different EC codes depending on whether
1260  // the fault originated within HYP mode, or not. So override
1261  // the method and add the extra adjustment of the EC value.
1262 
1264 
1265  CPSR spsr = tc->readMiscReg(MISCREG_SPSR_HYP);
1266  if (spsr.mode == MODE_HYP) {
1267  ec = ((ExceptionClass) (((uint32_t) ec) + 1));
1268  }
1269  return ec;
1270  }
1271 }
1272 
1273 uint32_t
1275 {
1276  ESR esr = 0;
1277  auto& iss = esr.instruction_abort_iss;
1278 
1279  iss.ifsc = srcEncoded & 0x3F;
1280  iss.s1ptw = s1ptw;
1281 
1282  return iss;
1283 }
1284 
1285 bool
1287 {
1288  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1289  return scr.ea && !isMMUFault();
1290 }
1291 
1292 bool
1294 {
1295  bool toHyp;
1296 
1297  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1298  HDCR hdcr = tc->readMiscRegNoEffect(MISCREG_HDCR);
1299 
1300  toHyp = fromEL == EL2;
1301  toHyp |= ArmSystem::haveEL(tc, EL2) && !isSecure(tc) &&
1302  currEL(tc) <= EL1 && (hcr.tge || stage2 ||
1303  (source == DebugEvent && hdcr.tde));
1304  return toHyp;
1305 }
1306 
1309 {
1310  if (to64) {
1311  // AArch64
1313  panic("Asynchronous External Abort should be handled with "
1314  "SystemErrors (SErrors)!");
1315  }
1316  if (toEL == fromEL)
1318  else
1320  } else {
1321  // AArch32
1322  // Abort faults have different EC codes depending on whether
1323  // the fault originated within HYP mode, or not. So override
1324  // the method and add the extra adjustment of the EC value.
1325 
1327 
1328  CPSR spsr = tc->readMiscReg(MISCREG_SPSR_HYP);
1329  if (spsr.mode == MODE_HYP) {
1330  ec = ((ExceptionClass) (((uint32_t) ec) + 1));
1331  }
1332  return ec;
1333  }
1334 }
1335 
1336 bool
1338 {
1339  return !isv? true : AbortFault<DataAbort>::il(tc);
1340 }
1341 
1342 bool
1344 {
1345  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1346  return scr.ea && !isMMUFault();
1347 }
1348 
1349 bool
1351 {
1352  bool toHyp;
1353 
1354  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1355  HDCR hdcr = tc->readMiscRegNoEffect(MISCREG_HDCR);
1356 
1357  bool amo = hcr.amo;
1358  if (hcr.tge == 1)
1359  amo = (!HaveExt(tc, ArmExtension::FEAT_VHE) || hcr.e2h == 0);
1360 
1361  // if in Hyp mode then stay in Hyp mode
1362  toHyp = fromEL == EL2 ||
1363  (EL2Enabled(tc) && fromEL <= EL1
1364  && (hcr.tge || stage2 ||
1365  ((source == AsynchronousExternalAbort) && amo) ||
1366  ((fromEL == EL0) && hcr.tge &&
1367  ((source == AlignmentFault) ||
1369  ((source == DebugEvent) && (hdcr.tde || hcr.tge))));
1370  return toHyp;
1371 }
1372 
1373 uint32_t
1375 {
1376  ESR esr = 0;
1377  auto& iss = esr.data_abort_iss;
1378 
1379  iss.dfsc = srcEncoded & 0x3F;
1380  iss.wnr = write;
1381  iss.s1ptw = s1ptw;
1382  iss.cm = cm;
1383 
1384  // ISS is valid if not caused by a stage 1 page table walk, and when taken
1385  // to AArch64 only when directed to EL2
1386  if (!s1ptw && stage2 && (!to64 || toEL == EL2)) {
1387  iss.isv = isv;
1388  if (isv) {
1389  iss.sas = sas;
1390  iss.sse = sse;
1391  iss.srt = srt;
1392  // AArch64 only. These assignments are safe on AArch32 as well
1393  // because these vars are initialized to false
1394  iss.sf = sf;
1395  iss.ar = ar;
1396  }
1397  }
1398  return iss;
1399 }
1400 
1401 void
1403 {
1405  switch (id)
1406  {
1407  case SAS:
1408  isv = true;
1409  sas = val;
1410  break;
1411  case SSE:
1412  isv = true;
1413  sse = val;
1414  break;
1415  case SRT:
1416  isv = true;
1417  srt = val;
1418  break;
1419  case SF:
1420  isv = true;
1421  sf = val;
1422  break;
1423  case AR:
1424  isv = true;
1425  ar = val;
1426  break;
1427  case CM:
1428  cm = val;
1429  break;
1430  case OFA:
1431  faultAddr = val;
1432  break;
1433  // Just ignore unknown ID's
1434  default:
1435  break;
1436  }
1437 }
1438 
1439 void
1441 {
1443  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1444  hcr.va = 0;
1446 }
1447 
1448 bool
1450 {
1451  assert(ArmSystem::haveEL(tc, EL3));
1452  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1453  return scr.irq;
1454 }
1455 
1456 bool
1458 {
1459  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1460  return fromEL == EL2 ||
1461  (EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || hcr.imo));
1462 }
1463 
1464 bool
1466 {
1467  if (ArmSystem::haveEL(tc, EL3)) {
1468  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1469  return (!scr.ns || scr.aw);
1470  }
1471  return true;
1472 }
1473 
1475 {}
1476 
1477 bool
1479 {
1480  assert(ArmSystem::haveEL(tc, EL3));
1481  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1482  return scr.fiq;
1483 }
1484 
1485 bool
1487 {
1488  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1489  return fromEL == EL2 ||
1490  (EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || hcr.fmo));
1491 }
1492 
1493 bool
1495 {
1496  if (ArmSystem::haveEL(tc, EL3)) {
1497  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1498  return (!scr.ns || scr.aw);
1499  }
1500  return true;
1501 }
1502 
1503 bool
1505 {
1506  if (ArmSystem::haveEL(tc, EL2)) {
1507  return true;
1508  } else if (ArmSystem::haveEL(tc, EL3)) {
1509  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1510  return (!scr.ns || scr.fw);
1511  }
1512  return true;
1513 }
1514 
1516 {}
1517 
1518 void
1520 {
1522  assert(from64);
1523  // Set the FAR
1525 }
1526 
1527 bool
1529 {
1530  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1531  return fromEL == EL2 || (EL2Enabled(tc) && fromEL <= EL1 && hcr.tge);
1532 }
1533 
1535 {}
1536 
1537 bool
1539 {
1540  assert(from64);
1541  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1542  return EL2Enabled(tc) && currEL(tc) <= EL1 && hcr.tge == 1;
1543 }
1544 
1546 {}
1547 
1548 void
1550 {
1551  tc->getCpuPtr()->clearInterrupt(tc->threadId(), INT_ABT, 0);
1552  ArmFault::invoke(tc, inst);
1553 }
1554 
1555 bool
1557 {
1558  assert(ArmSystem::haveEL(tc, EL3));
1559  assert(from64);
1560  SCR scr = tc->readMiscRegNoEffect(MISCREG_SCR_EL3);
1561  return scr.ea || fromEL == EL3;
1562 }
1563 
1564 bool
1566 {
1567  assert(from64);
1568 
1569  HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1570 
1571  return fromEL == EL2 ||
1572  (EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || hcr.amo));
1573 }
1574 
1575 
1577  : ArmFaultVals<SoftwareBreakpoint>(mach_inst, _iss)
1578 {}
1579 
1580 bool
1582 {
1583  const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1584  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
1585 
1586  return fromEL == EL2 ||
1587  (EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || mdcr.tde));
1588 }
1589 
1592 {
1594 }
1595 
1597  : ArmFaultVals<HardwareBreakpoint>(0x0, _iss), vAddr(vaddr)
1598 {}
1599 
1600 bool
1602 {
1603  const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1604  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
1605 
1606  return EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || mdcr.tde);
1607 }
1608 
1611 {
1612  // AArch64
1613  if (toEL == fromEL)
1615  else
1617 }
1618 
1619 void
1621 {
1622 
1624  MiscRegIndex elr_idx;
1625  switch (toEL) {
1626  case EL1:
1627  elr_idx = MISCREG_ELR_EL1;
1628  break;
1629  case EL2:
1630  assert(ArmSystem::haveEL(tc, EL2));
1631  elr_idx = MISCREG_ELR_EL2;
1632  break;
1633  case EL3:
1634  assert(ArmSystem::haveEL(tc, EL3));
1635  elr_idx = MISCREG_ELR_EL3;
1636  break;
1637  default:
1638  panic("Invalid target exception level");
1639  break;
1640  }
1641 
1642  tc->setMiscReg(elr_idx, vAddr);
1643 
1644 }
1645 
1647  bool _write, bool _cm)
1648  : ArmFaultVals<Watchpoint>(mach_inst), vAddr(_vaddr),
1649  write(_write), cm(_cm)
1650 {}
1651 
1652 uint32_t
1654 {
1655  ESR esr = 0;
1656  auto& iss = esr.watchpoint_iss;
1657  iss.dfsc = 0b100010;
1658  iss.cm = cm;
1659  iss.wnr = write;
1660  return iss;
1661 }
1662 
1663 void
1665 {
1667  // Set the FAR
1669 
1670 }
1671 
1672 bool
1674 {
1675  const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1676  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
1677 
1678  return fromEL == EL2 ||
1679  (EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || mdcr.tde));
1680 }
1681 
1682 void
1684 {
1686  switch (id)
1687  {
1688  case OFA:
1689  vAddr = val;
1690  break;
1691  // Just ignore unknown ID's
1692  default:
1693  break;
1694  }
1695 }
1696 
1699 {
1700  // AArch64
1701  if (toEL == fromEL)
1703  else
1705 }
1706 
1708  bool _stepped)
1709  : ArmFaultVals<SoftwareStepFault>(mach_inst), isldx(is_ldx),
1710  stepped(_stepped)
1711 {
1712  bStep = true;
1713 }
1714 
1715 bool
1717 {
1718  const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1719  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
1720 
1721  return fromEL == EL2 ||
1722  (EL2Enabled(tc) && fromEL <= EL1 && (hcr.tge || mdcr.tde));
1723 }
1724 
1727 {
1728  // AArch64
1729  if (toEL == fromEL)
1731  else
1733 }
1734 
1735 uint32_t
1737 {
1738  ESR esr = 0;
1739  auto& iss = esr.software_step_iss;
1740  iss.ifsc = 0b100010;
1741  iss.isv = stepped;
1742  iss.ex = isldx;
1743  return iss;
1744 }
1745 
1746 void
1748 {
1749  DPRINTF(Faults, "Invoking ArmSev Fault\n");
1750  if (!FullSystem)
1751  return;
1752 
1753  // Set sev_mailbox to 1, clear the pending interrupt from remote
1754  // SEV execution and let pipeline continue as pcState is still
1755  // valid.
1757  tc->getCpuPtr()->clearInterrupt(tc->threadId(), INT_SEV, 0);
1758 }
1759 
1760 // Instantiate all the templates to make the linker happy
1761 template class ArmFaultVals<Reset>;
1762 template class ArmFaultVals<UndefinedInstruction>;
1763 template class ArmFaultVals<SupervisorCall>;
1764 template class ArmFaultVals<SecureMonitorCall>;
1765 template class ArmFaultVals<HypervisorCall>;
1766 template class ArmFaultVals<PrefetchAbort>;
1767 template class ArmFaultVals<DataAbort>;
1768 template class ArmFaultVals<VirtualDataAbort>;
1769 template class ArmFaultVals<HypervisorTrap>;
1770 template class ArmFaultVals<Interrupt>;
1771 template class ArmFaultVals<VirtualInterrupt>;
1772 template class ArmFaultVals<FastInterrupt>;
1773 template class ArmFaultVals<VirtualFastInterrupt>;
1774 template class ArmFaultVals<SupervisorTrap>;
1775 template class ArmFaultVals<SecureMonitorTrap>;
1776 template class ArmFaultVals<PCAlignmentFault>;
1777 template class ArmFaultVals<SPAlignmentFault>;
1778 template class ArmFaultVals<SystemError>;
1779 template class ArmFaultVals<SoftwareBreakpoint>;
1780 template class ArmFaultVals<HardwareBreakpoint>;
1781 template class ArmFaultVals<Watchpoint>;
1782 template class ArmFaultVals<SoftwareStepFault>;
1783 template class ArmFaultVals<ArmSev>;
1784 template class AbortFault<PrefetchAbort>;
1785 template class AbortFault<DataAbort>;
1786 template class AbortFault<VirtualDataAbort>;
1787 
1788 
1790 {}
1791 
1792 bool
1794 {
1795  const HCR hcr = tc->readMiscRegNoEffect(MISCREG_HCR_EL2);
1796  return EL2Enabled(tc) && fromEL == EL0 && hcr.tge;
1797 }
1798 
1799 bool
1801 {
1802  auto arm_fault = dynamic_cast<ArmFault *>(fault.get());
1803 
1804  if (arm_fault) {
1805  return arm_fault->getFaultVAddr(va);
1806  } else {
1807  auto pgt_fault = dynamic_cast<GenericPageTableFault *>(fault.get());
1808  if (pgt_fault) {
1809  va = pgt_fault->getFaultVAddr();
1810  return true;
1811  }
1812 
1813  auto align_fault = dynamic_cast<GenericAlignmentFault *>(fault.get());
1814  if (align_fault) {
1815  va = align_fault->getFaultVAddr();
1816  return true;
1817  }
1818 
1819  // Return false since it's not an address triggered exception
1820  return false;
1821  }
1822 }
1823 
1824 } // namespace ArmISA
1825 } // namespace gem5
gem5::ArmISA::MISCREG_FAR_EL1
@ MISCREG_FAR_EL1
Definition: misc.hh:655
gem5::ArmISA::MISCREG_CPSR
@ MISCREG_CPSR
Definition: misc.hh:66
gem5::ArmISA::ArmFault::NODEBUG
@ NODEBUG
Definition: faults.hh:159
gem5::ArmISA::ArmFault::fromEL
ExceptionLevel fromEL
Definition: faults.hh:74
gem5::ArmISA::AbortFault::annotate
void annotate(ArmFault::AnnotationIDs id, uint64_t val) override
Definition: faults.cc:1206
gem5::ArmISA::AbortFault::setSyndrome
void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg) override
Definition: faults.cc:1133
gem5::ArmISA::ArmFault::FaultVals::ec
const ExceptionClass ec
Definition: faults.hh:194
gem5::ArmISA::ArmFault::NumFaultSources
@ NumFaultSources
Definition: faults.hh:119
gem5::ArmISA::SupervisorTrap::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1034
gem5::PCStateBase::instAddr
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
Definition: pcstate.hh:107
gem5::ArmISA::ExceptionClass::PC_ALIGNMENT
@ PC_ALIGNMENT
gem5::ArmISA::MISCREG_VBAR_EL3
@ MISCREG_VBAR_EL3
Definition: misc.hh:764
gem5::ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
gem5::ArmISA::UndefinedInstruction::mnemonic
const char * mnemonic
Definition: faults.hh:331
gem5::ArmISA::SPAlignmentFault::SPAlignmentFault
SPAlignmentFault()
Definition: faults.cc:1534
gem5::ArmISA::MODE_SVC
@ MODE_SVC
Definition: types.hh:291
gem5::ArmISA::DataAbort::routeToMonitor
bool routeToMonitor(ThreadContext *tc) const override
Definition: faults.cc:1343
gem5::ArmISA::MISCREG_TTBCR_S
@ MISCREG_TTBCR_S
Definition: misc.hh:267
gem5::ThreadContext::getSystemPtr
virtual System * getSystemPtr()=0
gem5::ArmISA::MODE_MON
@ MODE_MON
Definition: types.hh:292
gem5::ArmISA::ExceptionClass::HW_BREAKPOINT_CURR_EL
@ HW_BREAKPOINT_CURR_EL
gem5::ArmISA::UndefinedInstruction::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:898
gem5::ArmISA::ELIs64
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:267
gem5::ArmISA::SoftwareBreakpoint::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1581
gem5::ArmISA::DataAbort::sf
bool sf
Definition: faults.hh:556
gem5::ArmISA::MODE_FIQ
@ MODE_FIQ
Definition: types.hh:289
gem5::ArmISA::ArmFault::bStep
bool bStep
Definition: faults.hh:71
gem5::ArmSystem::highestELIs64
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
Definition: system.hh:187
gem5::ArmISA::ArmFault::FaultSourceInvalid
@ FaultSourceInvalid
Definition: faults.hh:120
gem5::ArmISA::ExceptionClass::PREFETCH_ABORT_CURR_EL
@ PREFETCH_ABORT_CURR_EL
gem5::ArmISA::PCAlignmentFault::faultPC
Addr faultPC
The unaligned value of the PC.
Definition: faults.hh:631
gem5::ArmISA::ArmFault::abortDisable
virtual bool abortDisable(ThreadContext *tc)=0
gem5::ArmISA::cc_reg::V
constexpr RegId V
Definition: cc.hh:96
gem5::ArmISA::ArmStaticInst
Definition: static_inst.hh:65
gem5::ArmISA::ArmFault::BRKPOINT
@ BRKPOINT
Definition: faults.hh:160
gem5::ArmISA::HypervisorCall
Definition: faults.hh:437
gem5::ArmISA::ExceptionClass::SOFTWARE_BREAKPOINT
@ SOFTWARE_BREAKPOINT
gem5::ArmISA::ArmFault::issRaw
uint32_t issRaw
Definition: faults.hh:68
gem5::ArmISA::ArmFaultVals::il
bool il(ThreadContext *tc) const override
Definition: faults.hh:306
gem5::ArmISA::ArmFault::AR
@ AR
Definition: faults.hh:147
gem5::ArmISA::MISCREG_SPSR_FIQ
@ MISCREG_SPSR_FIQ
Definition: misc.hh:68
gem5::ArmISA::SystemError::SystemError
SystemError()
Definition: faults.cc:1545
gem5::ThreadContext::getReg
virtual RegVal getReg(const RegId &reg) const
Definition: thread_context.cc:180
gem5::ArmISA::HypervisorTrap::overrideEc
ExceptionClass overrideEc
Definition: faults.hh:454
gem5::ArmISA::MISCREG_MDCR_EL2
@ MISCREG_MDCR_EL2
Definition: misc.hh:593
gem5::ArmISA::ArmFaultVals::vals
static FaultVals vals
Definition: faults.hh:266
gem5::ArmISA::SecureMonitorCall::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1011
gem5::ArmISA::ArmFault::from64
bool from64
Definition: faults.hh:72
gem5::ArmISA::MODE_UNDEFINED
@ MODE_UNDEFINED
Definition: types.hh:295
gem5::ArmISA::HardwareBreakpoint::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1601
gem5::PCStateBase::as
Target & as()
Definition: pcstate.hh:72
gem5::ArmISA::MODE_IRQ
@ MODE_IRQ
Definition: types.hh:290
gem5::ArmISA::ArmFault::VECTORCATCH
@ VECTORCATCH
Definition: faults.hh:161
gem5::ArmISA::MISCREG_SCR_EL3
@ MISCREG_SCR_EL3
Definition: misc.hh:599
gem5::ArmISA::domain
Bitfield< 7, 4 > domain
Definition: misc_types.hh:481
gem5::ArmISA::HypervisorTrap::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:934
gem5::ThreadContext::pcState
virtual const PCStateBase & pcState() const =0
gem5::ArmISA::UndefinedInstruction::overrideEc
ExceptionClass overrideEc
Definition: faults.hh:330
gem5::ArmISA::UndefinedInstruction::disabled
bool disabled
Definition: faults.hh:329
gem5::ArmISA::ArmFault::SynchronousExternalAbort
@ SynchronousExternalAbort
Definition: faults.hh:106
gem5::ArmISA::ArmFault::LpaeTran
@ LpaeTran
Definition: faults.hh:152
gem5::ArmISA::ArmFault::faultUpdated
bool faultUpdated
Definition: faults.hh:82
gem5::ArmISA::ArmFault::SSE
@ SSE
Definition: faults.hh:137
gem5::ArmISA::MISCREG_VBAR_EL2
@ MISCREG_VBAR_EL2
Definition: misc.hh:762
gem5::ArmISA::UndefinedInstruction::unknown
bool unknown
Definition: faults.hh:328
gem5::ArmISA::MISCREG_HSCTLR
@ MISCREG_HSCTLR
Definition: misc.hh:251
gem5::ArmISA::MISCREG_ESR_EL2
@ MISCREG_ESR_EL2
Definition: misc.hh:650
gem5::ArmISA::DataAbort::iss
uint32_t iss() const override
Definition: faults.cc:1374
gem5::ArmISA::ExceptionClass::SMC_TO_HYP
@ SMC_TO_HYP
gem5::ArmISA::PCAlignmentFault::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1528
gem5::ArmISA::HypervisorCall::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:922
gem5::ArmISA::ExceptionClass::HVC_64
@ HVC_64
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:776
gem5::ArmISA::ExceptionClass::INVALID
@ INVALID
gem5::ArmISA::ArmFault::armPcElrOffset
virtual uint8_t armPcElrOffset()=0
gem5::ArmISA::Watchpoint::vAddr
Addr vAddr
Definition: faults.hh:697
gem5::ArmISA::AbortFault::getFaultStatusCode
uint8_t getFaultStatusCode(ThreadContext *tc) const
Definition: faults.cc:1144
gem5::ArmISA::PrefetchAbort::routeToMonitor
bool routeToMonitor(ThreadContext *tc) const override
Definition: faults.cc:1286
gem5::ArmISA::opModeIsT
static bool opModeIsT(OperatingMode mode)
Definition: types.hh:384
gem5::ArmISA::ArmFault::DomainLL
@ DomainLL
Definition: faults.hh:103
gem5::ArmISA::MISCREG_LOCKFLAG
@ MISCREG_LOCKFLAG
Definition: misc.hh:88
gem5::ArmISA::Interrupt::routeToMonitor
bool routeToMonitor(ThreadContext *tc) const override
Definition: faults.cc:1449
gem5::ArmISA::EL1
@ EL1
Definition: types.hh:274
gem5::ArmISA::ArmFault::offset64
virtual FaultOffset offset64(ThreadContext *tc)=0
gem5::ArmISA::ArmFault::DebugEvent
@ DebugEvent
Definition: faults.hh:105
gem5::System::workload
Workload * workload
OS kernel.
Definition: system.hh:326
gem5::ArmISA::Watchpoint::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1673
gem5::ArmISA::opModeToEL
static ExceptionLevel opModeToEL(OperatingMode mode)
Definition: types.hh:391
gem5::ArmISA::MISCREG_SPSR_MON
@ MISCREG_SPSR_MON
Definition: misc.hh:71
gem5::ArmISA::ELIsInHost
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:281
gem5::ArmISA::Watchpoint
Definition: faults.hh:694
gem5::csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
gem5::ArmISA::ExceptionClass::SMC_64
@ SMC_64
gem5::ArmISA::SupervisorTrap::iss
uint32_t iss() const override
Definition: faults.cc:1024
gem5::RefCountingPtr::get
T * get() const
Directly access the pointer itself without taking a reference.
Definition: refcnt.hh:227
gem5::ArmISA::ExceptionClass::ILLEGAL_INST
@ ILLEGAL_INST
gem5::X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
gem5::ArmISA::HardwareBreakpoint::vAddr
Addr vAddr
Definition: faults.hh:682
gem5::ArmISA::ArmFault::thumbPcOffset
virtual uint8_t thumbPcOffset(bool is_hyp)=0
gem5::ArmISA::VirtualDataAbort::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst) override
Definition: faults.cc:1440
gem5::ArmISA::SoftwareStepFault::isldx
bool isldx
Definition: faults.hh:717
system.hh
gem5::ArmISA::ArmStaticInst::encoding
MachInst encoding() const
Returns the real encoding of the instruction: the machInst field is in fact always 64 bit wide and co...
Definition: static_inst.hh:589
gem5::ArmISA::ArmFault::setSyndrome
virtual void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg)
Definition: faults.cc:398
gem5::ArmISA::ArmFault::to64
bool to64
Definition: faults.hh:73
gem5::ArmISA::MISCREG_SCTLR
@ MISCREG_SCTLR
Definition: misc.hh:240
gem5::ArmISA::getFaultVAddr
bool getFaultVAddr(Fault fault, Addr &va)
Returns true if the fault passed as a first argument was triggered by a memory access,...
Definition: faults.cc:1800
gem5::ArmISA::ExceptionClass::SVC_64
@ SVC_64
gem5::ArmISA::ExceptionClass::SVC_TO_HYP
@ SVC_TO_HYP
gem5::PowerISA::PCState
Definition: pcstate.hh:42
gem5::ArmISA::SoftwareBreakpoint::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1591
gem5::ArmISA::SystemError::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1565
gem5::ArmISA::ArmFault::getVector64
Addr getVector64(ThreadContext *tc)
Definition: faults.cc:343
gem5::ArmISA::SystemError::routeToMonitor
bool routeToMonitor(ThreadContext *tc) const override
Definition: faults.cc:1556
gem5::StaticInst::advancePC
virtual void advancePC(PCStateBase &pc_state) const =0
gem5::ArmISA::ArmFault::PermissionLL
@ PermissionLL
Definition: faults.hh:104
gem5::FaultBase::name
virtual FaultName name() const =0
gem5::ArmISA::ArmFault::AsynchronousExternalAbort
@ AsynchronousExternalAbort
Definition: faults.hh:109
gem5::ArmISA::PCAlignmentFault::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1519
gem5::RefCountingPtr< StaticInst >
gem5::ArmISA::ExceptionClass::WATCHPOINT_LOWER_EL
@ WATCHPOINT_LOWER_EL
gem5::ArmISA::ArmFault::VmsaTran
@ VmsaTran
Definition: faults.hh:153
gem5::ArmISA::ExceptionClass::WATCHPOINT
@ WATCHPOINT
gem5::ArmISA::AbortFault::getFsr
FSR getFsr(ThreadContext *tc) const override
Definition: faults.cc:1170
gem5::ArmISA::MISCREG_DBGDSCRext
@ MISCREG_DBGDSCRext
Definition: misc.hh:108
gem5::ArmISA::purifyTaggedAddr
Addr purifyTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, TCR tcr, bool is_instr)
Removes the tag from tagged addresses if that mode is enabled.
Definition: utility.cc:464
gem5::ArmISA::SupervisorCall::iss
uint32_t iss() const override
Definition: faults.cc:882
gem5::ArmISA::ArmFault::OFA
@ OFA
Definition: faults.hh:140
gem5::ArmISA::ArmFault::iss
virtual uint32_t iss() const =0
gem5::GenericPageTableFault
Definition: faults.hh:116
gem5::ArmISA::FastInterrupt::abortDisable
bool abortDisable(ThreadContext *tc) override
Definition: faults.cc:1494
gem5::ArmISA::INT_ABT
@ INT_ABT
Definition: interrupts.hh:62
gem5::ArmISA::Watchpoint::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1664
gem5::ArmISA::amo
Bitfield< 5 > amo
Definition: misc_types.hh:334
gem5::ArmISA::ArmFault::instrAnnotate
ArmStaticInst * instrAnnotate(const StaticInstPtr &inst)
Definition: faults.cc:730
gem5::ArmISA::MISCREG_ELR_EL1
@ MISCREG_ELR_EL1
Definition: misc.hh:620
gem5::ArmISA::ExceptionClass::SERROR
@ SERROR
gem5::ArmISA::ArmFault::thumbPcElrOffset
virtual uint8_t thumbPcElrOffset()=0
gem5::ArmISA::ArmFaultVals
Definition: faults.hh:263
interrupts.hh
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
gem5::ArmISA::MODE_HYP
@ MODE_HYP
Definition: types.hh:294
gem5::ArmISA::ArmFault::offset
virtual FaultOffset offset(ThreadContext *tc)=0
gem5::ArmISA::MISCREG_SCTLR_EL1
@ MISCREG_SCTLR_EL1
Definition: misc.hh:584
gem5::ArmISA::SoftwareStepFault
Definition: faults.hh:714
gem5::ArmISA::HardwareBreakpoint
Definition: faults.hh:679
gem5::Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:248
gem5::ArmISA::MISCREG_HDCR
@ MISCREG_HDCR
Definition: misc.hh:255
gem5::ArmISA::ArmFault::getSyndromeReg64
MiscRegIndex getSyndromeReg64() const
Definition: faults.cc:366
gem5::ArmISA::SecureMonitorCall::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1002
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:210
gem5::ArmISA::ArmFault::toEL
ExceptionLevel toEL
Definition: faults.hh:75
gem5::ArmISA::MISCREG_MVBAR
@ MISCREG_MVBAR
Definition: misc.hh:399
gem5::ArmISA::DataAbort::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1308
gem5::ArmISA::ExceptionClass::SOFTWARE_BREAKPOINT_64
@ SOFTWARE_BREAKPOINT_64
gem5::ArmISA::ExceptionClass::DATA_ABORT_CURR_EL
@ DATA_ABORT_CURR_EL
gem5::ArmISA::SecureMonitorTrap::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1043
gem5::ArmISA::cc_reg::C
constexpr RegId C
Definition: cc.hh:95
gem5::ArmISA::FastInterrupt::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1486
gem5::ArmISA::ArmFault::hypRouted
bool hypRouted
Definition: faults.hh:84
gem5::ArmISA::EL2
@ EL2
Definition: types.hh:275
gem5::ArmISA::MISCREG_SPSR_IRQ
@ MISCREG_SPSR_IRQ
Definition: misc.hh:69
gem5::ArmISA::SupervisorCall::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:848
gem5::ArmISA::MISCREG_SCTLR_EL2
@ MISCREG_SCTLR_EL2
Definition: misc.hh:589
gem5::ArmISA::COND_UC
@ COND_UC
Definition: cc.hh:120
gem5::ArmISA::ArmFault::shortDescFaultSources
static uint8_t shortDescFaultSources[NumFaultSources]
Encodings of the fault sources when the short-desc.
Definition: faults.hh:125
gem5::ArmISA::DataAbort::sas
uint8_t sas
Definition: faults.hh:550
isa.hh
gem5::ArmISA::s1ptw
Bitfield< 7 > s1ptw
Definition: misc_types.hh:754
gem5::ArmISA::ELIs32
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:273
gem5::ArmISA::ArmFault::update
void update(ThreadContext *tc)
Definition: faults.cc:428
gem5::ArmISA::ArmFaultVals::offset64
FaultOffset offset64(ThreadContext *tc) override
Definition: faults.cc:961
gem5::ArmISA::syncVecElemsToRegs
void syncVecElemsToRegs(ThreadContext *tc)
Definition: utility.cc:1337
gem5::BaseCPU::clearInterrupt
void clearInterrupt(ThreadID tid, int int_num, int index)
Definition: base.hh:242
gem5::ArmISA::ArmFault::getFaultVAddr
virtual bool getFaultVAddr(Addr &va) const
Definition: faults.hh:258
gem5::ArmISA::MISCREG_VMPIDR
@ MISCREG_VMPIDR
Definition: misc.hh:239
gem5::ArmISA::Watchpoint::cm
bool cm
Definition: faults.hh:699
gem5::ArmISA::ArmFault::armPcOffset
virtual uint8_t armPcOffset(bool is_hyp)=0
gem5::ArmISA::SecureMonitorCall::iss
uint32_t iss() const override
Definition: faults.cc:890
gem5::ArmISA::UndefinedInstruction::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:811
gem5::ArmISA::AbortFault::abortDisable
bool abortDisable(ThreadContext *tc) override
Definition: faults.cc:1195
gem5::ArmISA::UndefinedInstruction::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:788
gem5::ArmISA::EL2Enabled
bool EL2Enabled(ThreadContext *tc)
Definition: utility.cc:258
gem5::ArmISA::SupervisorTrap::overrideEc
ExceptionClass overrideEc
Definition: faults.hh:404
gem5::PowerISA::AlignmentFault
Definition: faults.hh:82
gem5::ArmISA::MISCREG_SPSR_EL2
@ MISCREG_SPSR_EL2
Definition: misc.hh:631
gem5::ArmISA::DataAbort::srt
uint8_t srt
Definition: faults.hh:552
gem5::ArmISA::VirtualInterrupt::VirtualInterrupt
VirtualInterrupt()
Definition: faults.cc:1474
gem5::ArmISA::DataAbort::annotate
void annotate(AnnotationIDs id, uint64_t val) override
Definition: faults.cc:1402
gem5::ArmISA::ArmFault::SF
@ SF
Definition: faults.hh:146
gem5::bits
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:76
compiler.hh
gem5::GenericAlignmentFault
Definition: faults.hh:128
gem5::ArmISA::EL3
@ EL3
Definition: types.hh:276
gem5::ArmISA::DataAbort::il
bool il(ThreadContext *tc) const override
Definition: faults.cc:1337
gem5::ArmISA::ArmFault::nextMode
virtual OperatingMode nextMode()=0
gem5::ArmISA::FastInterrupt::fiqDisable
bool fiqDisable(ThreadContext *tc) override
Definition: faults.cc:1504
gem5::ThreadContext::readMiscRegNoEffect
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
faults.hh
gem5::ArmISA::PrefetchAbort::iss
uint32_t iss() const override
Definition: faults.cc:1274
gem5::ArmISA::DataAbort::cm
uint8_t cm
Definition: faults.hh:553
gem5::ArmISA::MISCREG_SPSR_EL1
@ MISCREG_SPSR_EL1
Definition: misc.hh:618
gem5::ArmISA::ExceptionClass::SOFTWARE_STEP_CURR_EL
@ SOFTWARE_STEP_CURR_EL
gem5::ArmISA::COND_AL
@ COND_AL
Definition: cc.hh:119
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::ArmISA::SoftwareBreakpoint
Software Breakpoint (AArch64 only)
Definition: faults.hh:669
gem5::ArmISA::ArmFaultVals< Reset >::offset
FaultOffset offset(ThreadContext *tc) override
Definition: faults.cc:941
gem5::ArmISA::SoftwareStepFault::iss
uint32_t iss() const override
Definition: faults.cc:1736
gem5::ArmISA::HypervisorCall::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:928
gem5::ArmISA::ExceptionClass::STACK_PTR_ALIGNMENT
@ STACK_PTR_ALIGNMENT
gem5::ArmISA::MiscRegIndex
MiscRegIndex
Definition: misc.hh:64
gem5::ArmISA::HardwareBreakpoint::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1610
gem5::ArmISA::isSecure
bool isSecure(ThreadContext *tc)
Definition: utility.cc:74
gem5::ArmISA::va
Bitfield< 8 > va
Definition: misc_types.hh:330
gem5::FaultBase::invoke
virtual void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
Definition: faults.cc:58
gem5::ArmISA::AbortFault::getFaultVAddr
bool getFaultVAddr(Addr &va) const override
Definition: faults.cc:1242
utility.hh
gem5::ArmISA::ExceptionClass
ExceptionClass
Definition: types.hh:300
gem5::ArmISA::SoftwareStepFault::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1716
gem5::ArmISA::ExceptionClass::HVC
@ HVC
full_system.hh
gem5::ArmISA::ArmFault::getFaultAddrReg64
MiscRegIndex getFaultAddrReg64() const
Definition: faults.cc:382
gem5::ArmISA::HardwareBreakpoint::HardwareBreakpoint
HardwareBreakpoint(Addr _vaddr, uint32_t _iss)
Definition: faults.cc:1596
gem5::ArmISA::Reset::getVector
Addr getVector(ThreadContext *tc) override
Definition: faults.cc:742
gem5::ArmISA::currEL
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Definition: utility.cc:124
gem5::ArmISA::AbortFault< PrefetchAbort >::srcEncoded
uint8_t srcEncoded
Definition: faults.hh:487
gem5::ArmISA::ArmFault
Definition: faults.hh:64
gem5::ArmISA::AbortFault< DataAbort >::faultAddr
Addr faultAddr
The virtual address the fault occured at.
Definition: faults.hh:477
gem5::ArmISA::FaultOffset
Addr FaultOffset
Definition: faults.hh:60
gem5::X86ISA::ExtMachInst
Definition: types.hh:212
gem5::FullSystem
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:220
gem5::MipsISA::FaultVals
MipsFaultBase::FaultVals FaultVals
Definition: faults.cc:46
gem5::ArmISA::ArmFault::aarch64FaultSources
static uint8_t aarch64FaultSources[NumFaultSources]
Encodings of the fault sources in AArch64 state.
Definition: faults.hh:130
gem5::ArmISA::MISCREG_SPSR_EL3
@ MISCREG_SPSR_EL3
Definition: misc.hh:638
gem5::ArmISA::SupervisorCall::overrideEc
ExceptionClass overrideEc
Definition: faults.hh:362
gem5::ArmISA::Watchpoint::Watchpoint
Watchpoint(ExtMachInst mach_inst, Addr vaddr, bool _write, bool _cm)
Definition: faults.cc:1646
gem5::ArmISA::PrefetchAbort::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1293
gem5::ArmISA::EL0
@ EL0
Definition: types.hh:273
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:214
gem5::ArmSystem
Definition: system.hh:92
gem5::ArmISA::SupervisorCall::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:867
gem5::ArmISA::ArmFault::invoke64
void invoke64(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
Definition: faults.cc:634
gem5::ArmISA::ArmFault::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:477
gem5::ArmISA::SupervisorTrap::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1017
gem5::ArmISA::syncVecRegsToElems
void syncVecRegsToElems(ThreadContext *tc)
Definition: utility.cc:1325
gem5::ArmISA::DataAbort::isv
bool isv
Definition: faults.hh:549
gem5::ArmISA::MISCREG_TTBCR_NS
@ MISCREG_TTBCR_NS
Definition: misc.hh:266
gem5::ArmISA::Watchpoint::annotate
void annotate(AnnotationIDs id, uint64_t val) override
Definition: faults.cc:1683
gem5::ArmISA::ArmFault::AlignmentFault
@ AlignmentFault
Definition: faults.hh:97
gem5::ArmISA::cc_reg::Ge
constexpr RegId Ge
Definition: cc.hh:97
gem5::ArmISA::AbortFault::isMMUFault
bool isMMUFault() const
Definition: faults.cc:1225
gem5::ArmISA::ArmFault::getVector
virtual Addr getVector(ThreadContext *tc)
Definition: faults.cc:311
gem5::ArmISA::ArmFault::isResetSPSR
bool isResetSPSR()
Definition: faults.hh:234
gem5::ArmISA::int_reg::Lr
constexpr auto & Lr
Definition: int.hh:275
gem5::ArmISA::MISCREG_SPSR_SVC
@ MISCREG_SPSR_SVC
Definition: misc.hh:70
gem5::ArmISA::ArmFault::CM
@ CM
Definition: faults.hh:139
base.hh
gem5::ArmISA::Watchpoint::iss
uint32_t iss() const override
Definition: faults.cc:1653
gem5::ArmISA::AbortFault::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1051
gem5::ArmISA::HighVecs
const uint32_t HighVecs
Definition: faults.cc:63
gem5::ArmISA::ArmFault::span
bool span
Definition: faults.hh:85
gem5::ArmISA::ArmFault::TranslationLL
@ TranslationLL
Definition: faults.hh:101
gem5::ArmISA::AbortFault< PrefetchAbort >::stage2
bool stage2
Definition: faults.hh:488
gem5::ArmISA::ArmFault::WPOINT_CM
@ WPOINT_CM
Definition: faults.hh:162
gem5::ArmISA::ConditionCode
ConditionCode
Definition: cc.hh:103
gem5::ArmISA::ArmFaultVals::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.hh:304
gem5::ThreadContext::setMiscReg
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
static_inst.hh
gem5::ArmISA::ExceptionClass::UNKNOWN
@ UNKNOWN
gem5::ArmISA::ArmFault::ec
virtual ExceptionClass ec(ThreadContext *tc) const =0
gem5::ArmISA::SoftwareBreakpoint::SoftwareBreakpoint
SoftwareBreakpoint(ExtMachInst mach_inst, uint32_t _iss)
Definition: faults.cc:1576
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::ArmISA::ArmFault::AnnotationIDs
AnnotationIDs
Definition: faults.hh:132
gem5::ArmISA::MISCREG_ESR_EL3
@ MISCREG_ESR_EL3
Definition: misc.hh:654
gem5::ArmISA::MISCREG_ELR_EL2
@ MISCREG_ELR_EL2
Definition: misc.hh:632
gem5::ArmISA::longDescFormatInUse
bool longDescFormatInUse(ThreadContext *tc)
Definition: utility.cc:131
gem5::ArmISA::ArmFault::annotate
virtual void annotate(AnnotationIDs id, uint64_t val)
Definition: faults.hh:239
gem5::ArmISA::ExceptionClass::DATA_ABORT_LOWER_EL
@ DATA_ABORT_LOWER_EL
gem5::ArmSystem::resetAddr
Addr resetAddr() const
Returns the reset address if the highest implemented exception level is 64 bits (ARMv8)
Definition: system.hh:202
gem5::ArmISA::ArmFault::il
virtual bool il(ThreadContext *tc) const =0
gem5::ArmISA::ExceptionClass::DATA_ABORT_TO_HYP
@ DATA_ABORT_TO_HYP
gem5::ArmISA::ArmFault::AccessFlagLL
@ AccessFlagLL
Definition: faults.hh:102
gem5::ArmISA::SoftwareStepFault::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1726
gem5::ArmISA::UndefinedInstruction::iss
uint32_t iss() const override
Definition: faults.cc:819
gem5::ArmISA::MISCREG_SPSR_ABT
@ MISCREG_SPSR_ABT
Definition: misc.hh:72
gem5::ArmISA::ExceptionClass::PREFETCH_ABORT_LOWER_EL
@ PREFETCH_ABORT_LOWER_EL
gem5::ArmISA::MISCREG_ELR_HYP
@ MISCREG_ELR_HYP
Definition: misc.hh:75
gem5::ArmISA::FastInterrupt::routeToMonitor
bool routeToMonitor(ThreadContext *tc) const override
Definition: faults.cc:1478
gem5::ArmISA::ArmFault::S1PTW
@ S1PTW
Definition: faults.hh:134
gem5::ArmISA::Reset::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:760
gem5::ArmISA::cc_reg::Nz
constexpr RegId Nz
Definition: cc.hh:94
gem5::ArmISA::MISCREG_HVBAR
@ MISCREG_HVBAR
Definition: misc.hh:402
gem5::ThreadContext::getCpuPtr
virtual BaseCPU * getCpuPtr()=0
gem5::ArmISA::cm
Bitfield< 13 > cm
Definition: misc_types.hh:486
gem5::ArmISA::ArmSev::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1747
gem5::ArmISA::MISCREG_VBAR
@ MISCREG_VBAR
Definition: misc.hh:396
gem5::ArmISA::ArmFault::toMode
OperatingMode toMode
Definition: faults.hh:77
gem5::ArmISA::ArmFault::routeToHyp
virtual bool routeToHyp(ThreadContext *tc) const
Definition: faults.hh:244
gem5::ThreadContext::clearArchRegs
virtual void clearArchRegs()=0
gem5::ArmISA::MISCREG_HSR
@ MISCREG_HSR
Definition: misc.hh:287
gem5::ArmISA::MISCREG_SEV_MAILBOX
@ MISCREG_SEV_MAILBOX
Definition: misc.hh:96
gem5::ArmISA::ArmFault::SRT
@ SRT
Definition: faults.hh:138
gem5::ArmISA::HardwareBreakpoint::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1620
gem5::ThreadContext::threadId
virtual int threadId() const =0
gem5::ArmISA::DataAbort::sse
uint8_t sse
Definition: faults.hh:551
trace.hh
gem5::ArmISA::MISCREG_ELR_EL3
@ MISCREG_ELR_EL3
Definition: misc.hh:639
gem5::ArmISA::Interrupt::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1457
gem5::ArmISA::AbortFault< DataAbort >::write
bool write
Definition: faults.hh:484
gem5::MipsISA::vaddr
vaddr
Definition: pra_constants.hh:278
gem5::ArmISA::PrefetchAbort::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1249
gem5::ArmISA::DataAbort::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1350
gem5::ArmISA::HypervisorCall::routeToMonitor
bool routeToMonitor(ThreadContext *tc) const override
Definition: faults.cc:916
gem5::ArmISA::DataAbort::ar
bool ar
Definition: faults.hh:557
gem5::ArmISA::ExceptionClass::PREFETCH_ABORT_TO_HYP
@ PREFETCH_ABORT_TO_HYP
gem5::ArmISA::IllegalInstSetStateFault::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1793
gem5::ArmISA::SystemError::invoke
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition: faults.cc:1549
self_debug.hh
gem5::ArmISA::ArmFault::machInst
ExtMachInst machInst
Definition: faults.hh:67
gem5::ArmSystem::haveEL
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Definition: system.cc:132
gem5::ArmISA::MODE_ABORT
@ MODE_ABORT
Definition: types.hh:293
gem5::ArmISA::MISCREG_HCR_EL2
@ MISCREG_HCR_EL2
Definition: misc.hh:591
gem5::ArmISA::SPAlignmentFault::routeToHyp
bool routeToHyp(ThreadContext *tc) const override
Definition: faults.cc:1538
gem5::ArmISA::ArmFault::fromMode
OperatingMode fromMode
Definition: faults.hh:76
gem5::ArmISA::MISCREG_FAR_EL2
@ MISCREG_FAR_EL2
Definition: misc.hh:657
gem5::ArmISA::MISCREG_FAR_EL3
@ MISCREG_FAR_EL3
Definition: misc.hh:659
gem5::ArmISA::SupervisorCall::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:875
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ArmISA::ArmFault::invoke32
void invoke32(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
Definition: faults.cc:504
gem5::ArmISA::MISCREG_HPFAR_EL2
@ MISCREG_HPFAR_EL2
Definition: misc.hh:658
gem5::ArmISA::ArmFault::routeToMonitor
virtual bool routeToMonitor(ThreadContext *tc) const =0
gem5::ArmISA::IllegalInstSetStateFault::IllegalInstSetStateFault
IllegalInstSetStateFault()
Definition: faults.cc:1789
gem5::ArmISA::itstate
Bitfield< 55, 48 > itstate
Definition: types.hh:70
gem5::ArmISA::AbortFault< PrefetchAbort >::source
uint8_t source
Definition: faults.hh:486
gem5::ArmISA::ExceptionClass::WATCHPOINT_CURR_EL
@ WATCHPOINT_CURR_EL
gem5::ArmISA::MISCREG_HPFAR
@ MISCREG_HPFAR
Definition: misc.hh:296
gem5::ArmISA::MISCREG_ESR_EL1
@ MISCREG_ESR_EL1
Definition: misc.hh:645
gem5::ArmISA::ExceptionClass::SOFTWARE_STEP_LOWER_EL
@ SOFTWARE_STEP_LOWER_EL
gem5::ArmISA::MISCREG_VBAR_EL1
@ MISCREG_VBAR_EL1
Definition: misc.hh:758
gem5::ArmISA::ArmFault::longDescFaultSources
static uint8_t longDescFaultSources[NumFaultSources]
Encodings of the fault sources when the long-desc.
Definition: faults.hh:128
gem5::ArmISA::AbortFault
Definition: faults.hh:468
gem5::ArmISA::ArmFault::SAS
@ SAS
Definition: faults.hh:136
gem5::BaseCPU::clearInterrupts
void clearInterrupts(ThreadID tid)
Definition: base.hh:248
gem5::ArmISA::ExceptionClass::HW_BREAKPOINT
@ HW_BREAKPOINT
gem5::ArmISA::HaveExt
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Definition: utility.cc:222
gem5::ArmISA::ExceptionClass::SOFTWARE_STEP
@ SOFTWARE_STEP
gem5::ArmISA::MISCREG_SPSR_HYP
@ MISCREG_SPSR_HYP
Definition: misc.hh:73
gem5::ArmISA::ArmStaticInst::annotateFault
virtual void annotateFault(ArmFault *fault)
Definition: static_inst.hh:567
thread_context.hh
gem5::ArmISA::ArmFault::UnknownTran
@ UnknownTran
Definition: faults.hh:154
gem5::ArmISA::OperatingMode
OperatingMode
Definition: types.hh:279
gem5::ArmISA::ArmFault::OVA
@ OVA
Definition: faults.hh:135
gem5::ArmISA::ExceptionClass::HW_BREAKPOINT_LOWER_EL
@ HW_BREAKPOINT_LOWER_EL
gem5::ArmISA::SoftwareStepFault::stepped
bool stepped
Definition: faults.hh:718
gem5::Workload::syscall
virtual void syscall(ThreadContext *tc)
Definition: workload.hh:111
gem5::ArmISA::AbortFault< PrefetchAbort >::s1ptw
bool s1ptw
Definition: faults.hh:489
gem5::ArmISA::VirtualFastInterrupt::VirtualFastInterrupt
VirtualFastInterrupt()
Definition: faults.cc:1515
gem5::ArmISA::SecureMonitorTrap::overrideEc
ExceptionClass overrideEc
Definition: faults.hh:424
gem5::ArmISA::SoftwareStepFault::SoftwareStepFault
SoftwareStepFault(ExtMachInst mach_inst, bool is_ldx, bool stepped)
Definition: faults.cc:1707
gem5::ArmISA::getMPIDR
RegVal getMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
This helper function is returning the value of MPIDR_EL1.
Definition: utility.cc:164
gem5::ArmISA::Interrupt::abortDisable
bool abortDisable(ThreadContext *tc) override
Definition: faults.cc:1465
gem5::ArmISA::ExceptionLevel
ExceptionLevel
Definition: types.hh:271
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:188
gem5::ArmISA::Watchpoint::ec
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition: faults.cc:1698
gem5::ArmISA::mode
Bitfield< 4, 0 > mode
Definition: misc_types.hh:74
gem5::ArmISA::HypervisorCall::HypervisorCall
HypervisorCall(ExtMachInst mach_inst, uint32_t _imm)
Definition: faults.cc:909
gem5::ArmISA::INT_SEV
@ INT_SEV
Definition: interrupts.hh:65
gem5::ThreadContext::setMiscRegNoEffect
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
gem5::ArmISA::ArmFault::fiqDisable
virtual bool fiqDisable(ThreadContext *tc)=0
gem5::ThreadContext::setReg
virtual void setReg(const RegId &reg, RegVal val)
Definition: thread_context.cc:188
gem5::ArmISA::Watchpoint::write
bool write
Definition: faults.hh:698
gem5::ArmISA::MISCREG_SPSR_UND
@ MISCREG_SPSR_UND
Definition: misc.hh:74

Generated on Sun Jul 30 2023 01:56:46 for gem5 by doxygen 1.8.17