gem5 v24.1.0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
faults.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010, 2012-2013, 2016-2019, 2022, 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 * 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#ifndef __ARM_FAULTS_HH__
43#define __ARM_FAULTS_HH__
44
45#include "arch/arm/pagetable.hh"
46#include "arch/arm/regs/misc.hh"
47#include "arch/arm/types.hh"
48#include "base/logging.hh"
50#include "sim/faults.hh"
51#include "sim/full_system.hh"
52
53namespace gem5
54{
55
56// The design of the "name" and "vect" functions is in sim/faults.hh
57
58namespace ArmISA
59{
61
62class ArmStaticInst;
63
64class ArmFault : public FaultBase
65{
66 protected:
68 uint32_t issRaw;
69
70 // Helper variables for ARMv8 exception handling
71 bool bStep; // True if the Arm Faul exception is a software Step exception
72 bool from64; // True if the exception is generated from the AArch64 state
73 bool to64; // True if the exception is taken in AArch64 state
74 ExceptionLevel fromEL; // Source exception level
75 ExceptionLevel toEL; // Target exception level
76 OperatingMode fromMode; // Source operating mode (aarch32)
77 OperatingMode toMode; // Next operating mode (aarch32)
78
79 // This variable is true if the above fault specific informations
80 // have been updated. This is to prevent that a client is using their
81 // un-updated default constructed value.
83
84 bool hypRouted; // True if the fault has been routed to Hypervisor
85 bool span; // True if the fault is setting the PSTATE.PAN bit
86
87 virtual Addr getVector(ThreadContext *tc);
89
90 public:
96 {
98 InstructionCacheMaintenance, // Short-desc. format only
107 TLBConflictAbort, // Requires LPAE
111 AddressSizeLL, // AArch64 only
112
113 // Not real faults. These are faults to allow the translation function
114 // to inform the memory access function not to proceed for a prefetch
115 // that misses in the TLB or that targets an uncacheable address
118
120 FaultSourceInvalid = 0xff
121 };
122
131
133 {
134 S1PTW, // DataAbort, PrefetchAbort: Stage 1 Page Table Walk,
135 OVA, // DataAbort, PrefetchAbort: stage 1 Virtual Address for stage 2 faults
136 SAS, // DataAbort: Syndrome Access Size
137 SSE, // DataAbort: Syndrome Sign Extend
138 SRT, // DataAbort: Syndrome Register Transfer
139 CM, // DataAbort: Cache Maintenance/Address Translation Op
140 OFA, // DataAbort: Override fault Address. This is needed when
141 // the abort is triggered by a CMO. The faulting address is
142 // then the address specified in the register argument of the
143 // instruction and not the cacheline address (See FAR doc)
144 WnR, // Write or Read. it should be forced to 1 when
145 // Cache maintainance and address translation instruction.
146
147 // AArch64 only
148 SF, // DataAbort: width of the accessed register is SixtyFour
149 AR // DataAbort: Acquire/Release semantics
150 };
151
160
162 {
164
166
167 // Offsets used for exceptions taken in AArch64 state
168 const uint16_t currELTOffset;
169 const uint16_t currELHOffset;
170 const uint16_t lowerEL64Offset;
171 const uint16_t lowerEL32Offset;
172
174
175 const uint8_t armPcOffset;
176 const uint8_t thumbPcOffset;
177 // The following two values are used in place of armPcOffset and
178 // thumbPcOffset when the exception return address is saved into ELR
179 // registers (exceptions taken in HYP mode or in AArch64 state)
180 const uint8_t armPcElrOffset;
181 const uint8_t thumbPcElrOffset;
182
183 const bool hypTrappable;
184 const bool abortDisable;
185 const bool fiqDisable;
186
187 // Exception class used to appropriately set the syndrome register
188 // (exceptions taken in HYP mode or in AArch64 state)
190
191 FaultVals(const FaultName& name_, FaultOffset offset_,
192 uint16_t curr_elt_offset, uint16_t curr_elh_offset,
193 uint16_t lower_el64_offset,
194 uint16_t lower_el32_offset,
195 OperatingMode next_mode, uint8_t arm_pc_offset,
196 uint8_t thumb_pc_offset, uint8_t arm_pc_elr_offset,
197 uint8_t thumb_pc_elr_offset, bool hyp_trappable,
198 bool abort_disable, bool fiq_disable,
199 ExceptionClass ec_)
200 : name(name_), offset(offset_), currELTOffset(curr_elt_offset),
201 currELHOffset(curr_elh_offset), lowerEL64Offset(lower_el64_offset),
202 lowerEL32Offset(lower_el32_offset), nextMode(next_mode),
203 armPcOffset(arm_pc_offset), thumbPcOffset(thumb_pc_offset),
204 armPcElrOffset(arm_pc_elr_offset),
205 thumbPcElrOffset(thumb_pc_elr_offset),
206 hypTrappable(hyp_trappable), abortDisable(abort_disable),
207 fiqDisable(fiq_disable), ec(ec_) {}
208 };
209
210 ArmFault(ExtMachInst mach_inst = 0, uint32_t _iss = 0) :
211 machInst(mach_inst), issRaw(_iss), bStep(false), from64(false),
213 faultUpdated(false), hypRouted(false), span(false) {}
214
215 // Returns the actual syndrome register to use based on the target
216 // exception level
218
219 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
220 nullStaticInstPtr) override;
221 void invoke32(ThreadContext *tc, const StaticInstPtr &inst =
223 void invoke64(ThreadContext *tc, const StaticInstPtr &inst =
225 virtual void update(ThreadContext *tc);
226 bool isResetSPSR(){ return bStep; }
227
229
231 virtual void annotate(AnnotationIDs id, uint64_t val) {}
234 virtual OperatingMode nextMode() = 0;
235 virtual bool routeToMonitor(ThreadContext *tc) const = 0;
236 virtual bool routeToHyp(ThreadContext *tc) const { return false; }
237 virtual uint8_t armPcOffset(bool is_hyp) = 0;
238 virtual uint8_t thumbPcOffset(bool is_hyp) = 0;
239 virtual uint8_t armPcElrOffset() = 0;
240 virtual uint8_t thumbPcElrOffset() = 0;
241 virtual bool abortDisable(ThreadContext *tc) = 0;
242 virtual bool fiqDisable(ThreadContext *tc) = 0;
243 virtual ExceptionClass ec(ThreadContext *tc) const = 0;
244 virtual bool il(ThreadContext *tc) const = 0;
245 virtual uint32_t iss() const = 0;
246 virtual uint32_t vectorCatchFlag() const { return 0x0; }
247 virtual bool isStage2() const { return false; }
248 virtual FSR getFsr(ThreadContext *tc) const { return 0; }
249 virtual void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg);
250 virtual bool getFaultVAddr(Addr &va) const { return false; }
251 OperatingMode getToMode() const { return toMode; }
252 virtual bool isExternalAbort() const { return false; }
253};
254
255template<typename T>
256class ArmFaultVals : public ArmFault
257{
258 protected:
260
261 public:
262 ArmFaultVals(ExtMachInst mach_inst = 0, uint32_t _iss = 0) :
263 ArmFault(mach_inst, _iss) {}
264 FaultName name() const override { return vals.name; }
265 FaultOffset offset(ThreadContext *tc) override;
266
267 FaultOffset offset64(ThreadContext *tc) override;
268
269 OperatingMode nextMode() override { return vals.nextMode; }
270
271 virtual bool
272 routeToMonitor(ThreadContext *tc) const override
273 {
274 return false;
275 }
276
277 uint8_t
278 armPcOffset(bool is_hyp) override
279 {
280 return is_hyp ? vals.armPcElrOffset
282 }
283
284 uint8_t
285 thumbPcOffset(bool is_hyp) override
286 {
287 return is_hyp ? vals.thumbPcElrOffset
289 }
290
291 uint8_t armPcElrOffset() override { return vals.armPcElrOffset; }
292 uint8_t thumbPcElrOffset() override { return vals.thumbPcElrOffset; }
293 bool abortDisable(ThreadContext* tc) override { return vals.abortDisable; }
294 bool fiqDisable(ThreadContext* tc) override { return vals.fiqDisable; }
295
297 ExceptionClass ec(ThreadContext *tc) const override { return vals.ec; }
298 bool
299 il(ThreadContext *tc) const override
300 {
301 // ESR.IL = 1 if exception cause is unknown (EC = 0)
302 return ec(tc) == ExceptionClass::UNKNOWN ||
303 !machInst.thumb || machInst.bigThumb;
304 }
305 uint32_t iss() const override { return issRaw; }
306};
307
308class Reset : public ArmFaultVals<Reset>
309{
310 protected:
311 Addr getVector(ThreadContext *tc) override;
312
313 public:
314 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
315 nullStaticInstPtr) override;
316};
317
318class UndefinedInstruction : public ArmFaultVals<UndefinedInstruction>
319{
320 protected:
324 const char *mnemonic;
325
326 public:
328 bool _unknown,
329 const char *_mnemonic = NULL,
330 bool _disabled = false) :
332 unknown(_unknown), disabled(_disabled),
334 {}
335 UndefinedInstruction(ExtMachInst mach_inst, uint32_t _iss,
336 ExceptionClass _overrideEc, const char *_mnemonic = NULL) :
337 ArmFaultVals<UndefinedInstruction>(mach_inst, _iss),
338 unknown(false), disabled(true), overrideEc(_overrideEc),
339 mnemonic(_mnemonic)
340 {}
341
342 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
343 nullStaticInstPtr) override;
344 bool routeToHyp(ThreadContext *tc) const override;
345 uint32_t vectorCatchFlag() const override { return 0x02000002; }
346
348 ExceptionClass ec(ThreadContext *tc) const override;
349 uint32_t iss() const override;
350};
351
352class SupervisorCall : public ArmFaultVals<SupervisorCall>
353{
354 protected:
356 public:
357 SupervisorCall(ExtMachInst mach_inst, uint32_t _iss,
359 ArmFaultVals<SupervisorCall>(mach_inst, _iss),
360 overrideEc(_overrideEc)
361 {
362 bStep = true;
363 }
364
365 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
366 nullStaticInstPtr) override;
367 bool routeToHyp(ThreadContext *tc) const override;
368 uint32_t vectorCatchFlag() const override { return 0x04000404; }
369
371 ExceptionClass ec(ThreadContext *tc) const override;
372 uint32_t iss() const override;
373};
374
375class SecureMonitorCall : public ArmFaultVals<SecureMonitorCall>
376{
377 public:
380 {
381 bStep = true;
382 }
383
384 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
385 nullStaticInstPtr) override;
386 uint32_t vectorCatchFlag() const override { return 0x00000400; }
387
389 ExceptionClass ec(ThreadContext *tc) const override;
390 uint32_t iss() const override;
391};
392
393class SupervisorTrap : public ArmFaultVals<SupervisorTrap>
394{
395 protected:
398
399 public:
400 SupervisorTrap(ExtMachInst mach_inst, uint32_t _iss,
402 ArmFaultVals<SupervisorTrap>(mach_inst, _iss),
403 overrideEc(_overrideEc)
404 {}
405
406 bool routeToHyp(ThreadContext *tc) const override;
407
409 ExceptionClass ec(ThreadContext *tc) const override;
410 uint32_t iss() const override;
411};
412
413class SecureMonitorTrap : public ArmFaultVals<SecureMonitorTrap>
414{
415 protected:
418
419 public:
420 SecureMonitorTrap(ExtMachInst mach_inst, uint32_t _iss,
422 ArmFaultVals<SecureMonitorTrap>(mach_inst, _iss),
423 overrideEc(_overrideEc)
424 {}
425
427 ExceptionClass ec(ThreadContext *tc) const override;
428};
429
430class HypervisorCall : public ArmFaultVals<HypervisorCall>
431{
432 public:
433 HypervisorCall(ExtMachInst mach_inst, uint32_t _imm);
434
435 bool routeToHyp(ThreadContext *tc) const override;
436 bool routeToMonitor(ThreadContext *tc) const override;
437 uint32_t vectorCatchFlag() const override { return 0xFFFFFFFF; }
438
440 ExceptionClass ec(ThreadContext *tc) const override;
441};
442
443class HypervisorTrap : public ArmFaultVals<HypervisorTrap>
444{
445 protected:
448
449 public:
450 HypervisorTrap(ExtMachInst mach_inst, uint32_t _iss,
452 ArmFaultVals<HypervisorTrap>(mach_inst, _iss),
453 overrideEc(_overrideEc)
454 {}
455
457 ExceptionClass ec(ThreadContext *tc) const override;
458};
459
460template <class T>
461class AbortFault : public ArmFaultVals<T>
462{
463 protected:
477 bool write;
479 uint8_t source;
480 uint8_t srcEncoded;
481 bool stage2;
482 bool s1ptw;
485
486 public:
487 AbortFault(Addr _faultAddr, bool _write, DomainType _domain,
488 uint8_t _source, bool _stage2,
491 faultAddr(_faultAddr), OVAddr(0), write(_write),
492 domain(_domain), source(_source), srcEncoded(0),
493 stage2(_stage2), s1ptw(false), tranMethod(_tranMethod),
494 debugType(_debug)
495 {}
496
497 bool getFaultVAddr(Addr &va) const override;
498
499 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
500 nullStaticInstPtr) override;
501 void update(ThreadContext *tc) override;
502
503 FSR getFsr(ThreadContext *tc) const override;
504 uint8_t getFaultStatusCode(ThreadContext *tc) const;
505 bool abortDisable(ThreadContext *tc) override;
506 bool isStage2() const override { return stage2; }
507 void annotate(ArmFault::AnnotationIDs id, uint64_t val) override;
508 void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg) override;
509 bool isMMUFault() const;
510 bool isExternalAbort() const override;
511};
512
513class PrefetchAbort : public AbortFault<PrefetchAbort>
514{
515 public:
519
520 PrefetchAbort(Addr _addr, uint8_t _source, bool _stage2 = false,
521 TranMethod _tran_method = TranMethod::UnknownTran,
524 _source, _stage2, _tran_method, _debug)
525 {}
526
527 // @todo: external aborts should be routed if SCR.EA == 1
528 bool routeToMonitor(ThreadContext *tc) const override;
529 bool routeToHyp(ThreadContext *tc) const override;
530 uint32_t vectorCatchFlag() const override { return 0x08000808; }
531
533 ExceptionClass ec(ThreadContext *tc) const override;
534 bool il(ThreadContext *tc) const override { return true; }
535 uint32_t iss() const override;
536};
537
538class DataAbort : public AbortFault<DataAbort>
539{
540 public:
544 bool isv;
545 uint8_t sas;
546 uint8_t sse;
547 uint8_t srt;
548 uint8_t cm;
549
550 // AArch64 only
551 bool sf;
552 bool ar;
553
554 DataAbort(Addr _addr, DomainType _domain, bool _write, uint8_t _source,
555 bool _stage2=false,
558 AbortFault<DataAbort>(_addr, _write, _domain, _source, _stage2,
559 _tran_method, _debug_type),
560 isv(false), sas (0), sse(0), srt(0), cm(0), sf(false), ar(false)
561 {}
562
563 // @todo: external aborts should be routed if SCR.EA == 1
564 bool routeToMonitor(ThreadContext *tc) const override;
565 bool routeToHyp(ThreadContext *tc) const override;
566 void annotate(AnnotationIDs id, uint64_t val) override;
567 uint32_t vectorCatchFlag() const override { return 0x10001010; }
568
570 ExceptionClass ec(ThreadContext *tc) const override;
571 bool il(ThreadContext *tc) const override;
572 uint32_t iss() const override;
573};
574
575class VirtualDataAbort : public AbortFault<VirtualDataAbort>
576{
577 public:
581
582 VirtualDataAbort(Addr _addr, DomainType _domain, bool _write,
583 uint8_t _source) :
584 AbortFault<VirtualDataAbort>(_addr, _write, _domain, _source, false)
585 {}
586
587 void invoke(ThreadContext *tc, const StaticInstPtr &inst) override;
588};
589
590class Interrupt : public ArmFaultVals<Interrupt>
591{
592 public:
593 bool routeToMonitor(ThreadContext *tc) const override;
594 bool routeToHyp(ThreadContext *tc) const override;
595 bool abortDisable(ThreadContext *tc) override;
596 uint32_t vectorCatchFlag() const override { return 0x40004040; }
597};
598
599class VirtualInterrupt : public ArmFaultVals<VirtualInterrupt>
600{
601 public:
603};
604
605class FastInterrupt : public ArmFaultVals<FastInterrupt>
606{
607 public:
608 bool routeToMonitor(ThreadContext *tc) const override;
609 bool routeToHyp(ThreadContext *tc) const override;
610 bool abortDisable(ThreadContext *tc) override;
611 bool fiqDisable(ThreadContext *tc) override;
612 uint32_t vectorCatchFlag() const override { return 0x80008080; }
613};
614
615class VirtualFastInterrupt : public ArmFaultVals<VirtualFastInterrupt>
616{
617 public:
619};
620
622class PCAlignmentFault : public ArmFaultVals<PCAlignmentFault>
623{
624 protected:
627 public:
628 PCAlignmentFault(Addr fault_pc) : faultPC(fault_pc)
629 {}
630 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
631 nullStaticInstPtr) override;
632 bool routeToHyp(ThreadContext *tc) const override;
633
635 bool il(ThreadContext *tc) const override { return true; }
636};
637
639class SPAlignmentFault : public ArmFaultVals<SPAlignmentFault>
640{
641 public:
643 bool routeToHyp(ThreadContext *tc) const override;
644
646 bool il(ThreadContext *tc) const override { return true; }
647};
648
650class SystemError : public ArmFaultVals<SystemError>
651{
652 public:
653 SystemError();
654 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
655 nullStaticInstPtr) override;
656 bool routeToMonitor(ThreadContext *tc) const override;
657 bool routeToHyp(ThreadContext *tc) const override;
658
660 bool il(ThreadContext *tc) const override { return true; }
661};
662
664class SoftwareBreakpoint : public ArmFaultVals<SoftwareBreakpoint>
665{
666 public:
667 SoftwareBreakpoint(ExtMachInst mach_inst, uint32_t _iss);
668 bool routeToHyp(ThreadContext *tc) const override;
669
671 ExceptionClass ec(ThreadContext *tc) const override;
672};
673
674class HardwareBreakpoint : public ArmFaultVals<HardwareBreakpoint>
675{
676 private:
678 public:
679 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
680 nullStaticInstPtr) override;
681 HardwareBreakpoint(Addr _vaddr, uint32_t _iss);
682 bool routeToHyp(ThreadContext *tc) const override;
683
685 ExceptionClass ec(ThreadContext *tc) const override;
686 bool il(ThreadContext *tc) const override { return true; }
687};
688
689class Watchpoint : public ArmFaultVals<Watchpoint>
690{
691 private:
693 bool write;
694 bool cm;
695
696 public:
697 Watchpoint(ExtMachInst mach_inst, Addr vaddr, bool _write, bool _cm);
698 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
699 nullStaticInstPtr) override;
700 bool routeToHyp(ThreadContext *tc) const override;
701 void annotate(AnnotationIDs id, uint64_t val) override;
702
704 ExceptionClass ec(ThreadContext *tc) const override;
705 bool il(ThreadContext *tc) const override { return true; }
706 uint32_t iss() const override;
707};
708
709class SoftwareStepFault : public ArmFaultVals<SoftwareStepFault>
710{
711 private:
712 bool isldx;
714
715 public:
716 SoftwareStepFault(ExtMachInst mach_inst, bool is_ldx, bool stepped);
717 bool routeToHyp(ThreadContext *tc) const override;
718
720 ExceptionClass ec(ThreadContext *tc) const override;
721 bool il(ThreadContext *tc) const override { return true; }
722 uint32_t iss() const override;
723};
724
725// A fault that flushes the pipe, excluding the faulting instructions
726class ArmSev : public ArmFaultVals<ArmSev>
727{
728 public:
730 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
731 nullStaticInstPtr) override;
732};
733
735class IllegalInstSetStateFault : public ArmFaultVals<IllegalInstSetStateFault>
736{
737 public:
739 bool routeToHyp(ThreadContext *tc) const override;
740
742 bool il(ThreadContext *tc) const override { return true; }
743};
744
745/*
746 * Explicitly declare template static member variables to avoid warnings
747 * in some clang versions
748 */
773
784bool getFaultVAddr(Fault fault, Addr &va);
785
786} // namespace ArmISA
787} // namespace gem5
788
789#endif // __ARM_FAULTS_HH__
Addr OVAddr
Original virtual address.
Definition faults.hh:476
Addr faultAddr
The virtual address the fault occured at.
Definition faults.hh:470
void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg) override
Definition faults.cc:1121
uint8_t getFaultStatusCode(ThreadContext *tc) const
Definition faults.cc:1132
void update(ThreadContext *tc) override
Definition faults.cc:1093
ArmFault::DebugType debugType
Definition faults.hh:484
AbortFault(Addr _faultAddr, bool _write, DomainType _domain, uint8_t _source, bool _stage2, TranMethod _tranMethod=TranMethod::UnknownTran, ArmFault::DebugType _debug=ArmFault::NODEBUG)
Definition faults.hh:487
bool isStage2() const override
Definition faults.hh:506
void annotate(ArmFault::AnnotationIDs id, uint64_t val) override
Definition faults.cc:1194
bool abortDisable(ThreadContext *tc) override
Definition faults.cc:1183
bool getFaultVAddr(Addr &va) const override
Definition faults.cc:1241
bool isExternalAbort() const override
Definition faults.cc:1230
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1032
FSR getFsr(ThreadContext *tc) const override
Definition faults.cc:1158
bool isMMUFault() const
Definition faults.cc:1213
virtual bool routeToMonitor(ThreadContext *tc) const override
Definition faults.hh:272
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:297
ArmFaultVals(ExtMachInst mach_inst=0, uint32_t _iss=0)
Definition faults.hh:262
FaultOffset offset64(ThreadContext *tc) override
Definition faults.cc:942
bool il(ThreadContext *tc) const override
Definition faults.hh:299
uint8_t armPcOffset(bool is_hyp) override
Definition faults.hh:278
bool fiqDisable(ThreadContext *tc) override
Definition faults.hh:294
uint32_t iss() const override
Definition faults.hh:305
uint8_t armPcElrOffset() override
Definition faults.hh:291
bool abortDisable(ThreadContext *tc) override
Definition faults.hh:293
OperatingMode nextMode() override
Definition faults.hh:269
FaultName name() const override
Definition faults.hh:264
static FaultVals vals
Definition faults.hh:259
uint8_t thumbPcOffset(bool is_hyp) override
Definition faults.hh:285
uint8_t thumbPcElrOffset() override
Definition faults.hh:292
virtual FaultOffset offset(ThreadContext *tc)=0
ExceptionLevel toEL
Definition faults.hh:75
virtual FSR getFsr(ThreadContext *tc) const
Definition faults.hh:248
OperatingMode toMode
Definition faults.hh:77
virtual bool routeToMonitor(ThreadContext *tc) const =0
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:462
FaultSource
Generic fault source enums used to index into {short/long/aarch64}DescFaultSources[] to get the actua...
Definition faults.hh:96
virtual uint32_t iss() const =0
static uint8_t shortDescFaultSources[NumFaultSources]
Encodings of the fault sources when the short-desc.
Definition faults.hh:125
virtual bool routeToHyp(ThreadContext *tc) const
Definition faults.hh:236
void invoke32(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
Definition faults.cc:489
virtual uint8_t thumbPcOffset(bool is_hyp)=0
MiscRegIndex getSyndromeReg64() const
Definition faults.cc:367
virtual void annotate(AnnotationIDs id, uint64_t val)
Definition faults.hh:231
virtual Addr getVector(ThreadContext *tc)
Definition faults.cc:312
virtual bool isExternalAbort() const
Definition faults.hh:252
virtual bool il(ThreadContext *tc) const =0
ArmStaticInst * instrAnnotate(const StaticInstPtr &inst)
Definition faults.cc:711
virtual FaultOffset offset64(ThreadContext *tc)=0
virtual bool abortDisable(ThreadContext *tc)=0
virtual uint32_t vectorCatchFlag() const
Definition faults.hh:246
virtual void update(ThreadContext *tc)
Definition faults.cc:413
static uint8_t longDescFaultSources[NumFaultSources]
Encodings of the fault sources when the long-desc.
Definition faults.hh:128
void invoke64(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
Definition faults.cc:616
virtual bool isStage2() const
Definition faults.hh:247
virtual uint8_t armPcOffset(bool is_hyp)=0
virtual uint8_t thumbPcElrOffset()=0
ExtMachInst machInst
Definition faults.hh:67
virtual bool fiqDisable(ThreadContext *tc)=0
OperatingMode getToMode() const
Definition faults.hh:251
virtual bool getFaultVAddr(Addr &va) const
Definition faults.hh:250
bool vectorCatch(ThreadContext *tc, const StaticInstPtr &inst)
static uint8_t aarch64FaultSources[NumFaultSources]
Encodings of the fault sources in AArch64 state.
Definition faults.hh:130
ExceptionLevel fromEL
Definition faults.hh:74
virtual uint8_t armPcElrOffset()=0
virtual OperatingMode nextMode()=0
virtual ExceptionClass ec(ThreadContext *tc) const =0
Addr getVector64(ThreadContext *tc)
Definition faults.cc:344
virtual void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg)
Definition faults.cc:383
ArmFault(ExtMachInst mach_inst=0, uint32_t _iss=0)
Definition faults.hh:210
OperatingMode fromMode
Definition faults.hh:76
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1749
static const MiscRegIndex FarIndex
Definition faults.hh:542
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1349
uint32_t iss() const override
Definition faults.cc:1373
void annotate(AnnotationIDs id, uint64_t val) override
Definition faults.cc:1402
uint32_t vectorCatchFlag() const override
Definition faults.hh:567
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1342
DataAbort(Addr _addr, DomainType _domain, bool _write, uint8_t _source, bool _stage2=false, TranMethod _tran_method=TranMethod::UnknownTran, ArmFault::DebugType _debug_type=ArmFault::NODEBUG)
Definition faults.hh:554
static const MiscRegIndex HFarIndex
Definition faults.hh:543
static const MiscRegIndex FsrIndex
Definition faults.hh:541
bool fiqDisable(ThreadContext *tc) override
Definition faults.cc:1507
bool abortDisable(ThreadContext *tc) override
Definition faults.cc:1497
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1481
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1489
uint32_t vectorCatchFlag() const override
Definition faults.hh:612
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1623
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1604
bool il(ThreadContext *tc) const override
Definition faults.hh:686
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:897
uint32_t vectorCatchFlag() const override
Definition faults.hh:437
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:903
ExceptionClass overrideEc
Definition faults.hh:447
HypervisorTrap(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:450
Illegal Instruction Set State fault (AArch64 only)
Definition faults.hh:736
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:742
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1795
uint32_t vectorCatchFlag() const override
Definition faults.hh:596
bool abortDisable(ThreadContext *tc) override
Definition faults.cc:1468
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1460
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1452
PC alignment fault (AArch64 only)
Definition faults.hh:623
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1522
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:635
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1531
Addr faultPC
The unaligned value of the PC.
Definition faults.hh:626
PCAlignmentFault(Addr fault_pc)
Definition faults.hh:628
uint32_t iss() const override
Definition faults.cc:1273
static const MiscRegIndex FarIndex
Definition faults.hh:517
bool il(ThreadContext *tc) const override
Definition faults.hh:534
PrefetchAbort(Addr _addr, uint8_t _source, bool _stage2=false, TranMethod _tran_method=TranMethod::UnknownTran, ArmFault::DebugType _debug=ArmFault::NODEBUG)
Definition faults.hh:520
uint32_t vectorCatchFlag() const override
Definition faults.hh:530
static const MiscRegIndex HFarIndex
Definition faults.hh:518
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1292
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1285
static const MiscRegIndex FsrIndex
Definition faults.hh:516
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:741
Addr getVector(ThreadContext *tc) override
Definition faults.cc:723
Stack pointer alignment fault (AArch64 only)
Definition faults.hh:640
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1541
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:646
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:983
uint32_t iss() const override
Definition faults.cc:871
uint32_t vectorCatchFlag() const override
Definition faults.hh:386
SecureMonitorCall(ExtMachInst mach_inst)
Definition faults.hh:378
SecureMonitorTrap(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:420
Software Breakpoint (AArch64 only)
Definition faults.hh:665
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1584
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1718
bool il(ThreadContext *tc) const override
Definition faults.hh:721
uint32_t iss() const override
Definition faults.cc:1738
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:829
uint32_t vectorCatchFlag() const override
Definition faults.hh:368
ExceptionClass overrideEc
Definition faults.hh:355
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:848
uint32_t iss() const override
Definition faults.cc:863
SupervisorCall(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:357
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:998
SupervisorTrap(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:400
ExceptionClass overrideEc
Definition faults.hh:397
uint32_t iss() const override
Definition faults.cc:1005
System error (AArch64 only)
Definition faults.hh:651
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1552
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:660
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1559
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1568
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:769
UndefinedInstruction(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc, const char *_mnemonic=NULL)
Definition faults.hh:335
UndefinedInstruction(ExtMachInst mach_inst, bool _unknown, const char *_mnemonic=NULL, bool _disabled=false)
Definition faults.hh:327
uint32_t vectorCatchFlag() const override
Definition faults.hh:345
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:792
uint32_t iss() const override
Definition faults.cc:800
static const MiscRegIndex FsrIndex
Definition faults.hh:578
VirtualDataAbort(Addr _addr, DomainType _domain, bool _write, uint8_t _source)
Definition faults.hh:582
void invoke(ThreadContext *tc, const StaticInstPtr &inst) override
Definition faults.cc:1443
static const MiscRegIndex FarIndex
Definition faults.hh:579
static const MiscRegIndex HFarIndex
Definition faults.hh:580
bool il(ThreadContext *tc) const override
Definition faults.hh:705
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1675
void annotate(AnnotationIDs id, uint64_t val) override
Definition faults.cc:1685
uint32_t iss() const override
Definition faults.cc:1656
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1667
ThreadContext is the external interface to all thread state for anything outside of the CPU.
@ MODE_UNDEFINED
Definition types.hh:332
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:1802
Bitfield< 20 > il
Definition misc_types.hh:61
Bitfield< 23, 0 > offset
Definition types.hh:144
@ MISCREG_HDFAR
Definition misc.hh:307
@ MISCREG_IFAR
Definition misc.hh:304
@ MISCREG_DFAR
Definition misc.hh:301
@ MISCREG_IFSR
Definition misc.hh:289
@ MISCREG_DFSR
Definition misc.hh:286
@ MISCREG_HIFAR
Definition misc.hh:308
Addr FaultOffset
Definition faults.hh:60
Bitfield< 8 > va
Bitfield< 63 > val
Definition misc.hh:804
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
const char * FaultName
Definition faults.hh:55
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
const OperatingMode nextMode
Definition faults.hh:173
FaultVals(const FaultName &name_, FaultOffset offset_, uint16_t curr_elt_offset, uint16_t curr_elh_offset, uint16_t lower_el64_offset, uint16_t lower_el32_offset, OperatingMode next_mode, uint8_t arm_pc_offset, uint8_t thumb_pc_offset, uint8_t arm_pc_elr_offset, uint8_t thumb_pc_elr_offset, bool hyp_trappable, bool abort_disable, bool fiq_disable, ExceptionClass ec_)
Definition faults.hh:191
const ExceptionClass ec
Definition faults.hh:189

Generated on Mon Jan 13 2025 04:28:21 for gem5 by doxygen 1.9.8