gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
145 // AArch64 only
146 SF, // DataAbort: width of the accessed register is SixtyFour
147 AR // DataAbort: Acquire/Release semantics
148 };
149
156
165
167 {
169
171
172 // Offsets used for exceptions taken in AArch64 state
173 const uint16_t currELTOffset;
174 const uint16_t currELHOffset;
175 const uint16_t lowerEL64Offset;
176 const uint16_t lowerEL32Offset;
177
179
180 const uint8_t armPcOffset;
181 const uint8_t thumbPcOffset;
182 // The following two values are used in place of armPcOffset and
183 // thumbPcOffset when the exception return address is saved into ELR
184 // registers (exceptions taken in HYP mode or in AArch64 state)
185 const uint8_t armPcElrOffset;
186 const uint8_t thumbPcElrOffset;
187
188 const bool hypTrappable;
189 const bool abortDisable;
190 const bool fiqDisable;
191
192 // Exception class used to appropriately set the syndrome register
193 // (exceptions taken in HYP mode or in AArch64 state)
195
196 FaultVals(const FaultName& name_, FaultOffset offset_,
197 uint16_t curr_elt_offset, uint16_t curr_elh_offset,
198 uint16_t lower_el64_offset,
199 uint16_t lower_el32_offset,
200 OperatingMode next_mode, uint8_t arm_pc_offset,
201 uint8_t thumb_pc_offset, uint8_t arm_pc_elr_offset,
202 uint8_t thumb_pc_elr_offset, bool hyp_trappable,
203 bool abort_disable, bool fiq_disable,
204 ExceptionClass ec_)
205 : name(name_), offset(offset_), currELTOffset(curr_elt_offset),
206 currELHOffset(curr_elh_offset), lowerEL64Offset(lower_el64_offset),
207 lowerEL32Offset(lower_el32_offset), nextMode(next_mode),
208 armPcOffset(arm_pc_offset), thumbPcOffset(thumb_pc_offset),
209 armPcElrOffset(arm_pc_elr_offset),
210 thumbPcElrOffset(thumb_pc_elr_offset),
211 hypTrappable(hyp_trappable), abortDisable(abort_disable),
212 fiqDisable(fiq_disable), ec(ec_) {}
213 };
214
215 ArmFault(ExtMachInst mach_inst = 0, uint32_t _iss = 0) :
216 machInst(mach_inst), issRaw(_iss), bStep(false), from64(false),
218 faultUpdated(false), hypRouted(false), span(false) {}
219
220 // Returns the actual syndrome register to use based on the target
221 // exception level
223
224 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
225 nullStaticInstPtr) override;
226 void invoke32(ThreadContext *tc, const StaticInstPtr &inst =
228 void invoke64(ThreadContext *tc, const StaticInstPtr &inst =
230 void update(ThreadContext *tc);
231 bool isResetSPSR(){ return bStep; }
232
234
236 virtual void annotate(AnnotationIDs id, uint64_t val) {}
239 virtual OperatingMode nextMode() = 0;
240 virtual bool routeToMonitor(ThreadContext *tc) const = 0;
241 virtual bool routeToHyp(ThreadContext *tc) const { return false; }
242 virtual uint8_t armPcOffset(bool is_hyp) = 0;
243 virtual uint8_t thumbPcOffset(bool is_hyp) = 0;
244 virtual uint8_t armPcElrOffset() = 0;
245 virtual uint8_t thumbPcElrOffset() = 0;
246 virtual bool abortDisable(ThreadContext *tc) = 0;
247 virtual bool fiqDisable(ThreadContext *tc) = 0;
248 virtual ExceptionClass ec(ThreadContext *tc) const = 0;
249 virtual bool il(ThreadContext *tc) const = 0;
250 virtual uint32_t iss() const = 0;
251 virtual uint32_t vectorCatchFlag() const { return 0x0; }
252 virtual bool isStage2() const { return false; }
253 virtual FSR getFsr(ThreadContext *tc) const { return 0; }
254 virtual void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg);
255 virtual bool getFaultVAddr(Addr &va) const { return false; }
256 OperatingMode getToMode() const { return toMode; }
257};
258
259template<typename T>
260class ArmFaultVals : public ArmFault
261{
262 protected:
264
265 public:
266 ArmFaultVals<T>(ExtMachInst mach_inst = 0, uint32_t _iss = 0) :
267 ArmFault(mach_inst, _iss) {}
268 FaultName name() const override { return vals.name; }
269 FaultOffset offset(ThreadContext *tc) override;
270
271 FaultOffset offset64(ThreadContext *tc) override;
272
273 OperatingMode nextMode() override { return vals.nextMode; }
274
275 virtual bool
276 routeToMonitor(ThreadContext *tc) const override
277 {
278 return false;
279 }
280
281 uint8_t
282 armPcOffset(bool is_hyp) override
283 {
284 return is_hyp ? vals.armPcElrOffset
286 }
287
288 uint8_t
289 thumbPcOffset(bool is_hyp) override
290 {
291 return is_hyp ? vals.thumbPcElrOffset
293 }
294
295 uint8_t armPcElrOffset() override { return vals.armPcElrOffset; }
296 uint8_t thumbPcElrOffset() override { return vals.thumbPcElrOffset; }
297 bool abortDisable(ThreadContext* tc) override { return vals.abortDisable; }
298 bool fiqDisable(ThreadContext* tc) override { return vals.fiqDisable; }
299
301 ExceptionClass ec(ThreadContext *tc) const override { return vals.ec; }
302 bool
303 il(ThreadContext *tc) const override
304 {
305 // ESR.IL = 1 if exception cause is unknown (EC = 0)
306 return ec(tc) == ExceptionClass::UNKNOWN ||
307 !machInst.thumb || machInst.bigThumb;
308 }
309 uint32_t iss() const override { return issRaw; }
310};
311
312class Reset : public ArmFaultVals<Reset>
313{
314 protected:
315 Addr getVector(ThreadContext *tc) override;
316
317 public:
318 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
319 nullStaticInstPtr) override;
320};
321
322class UndefinedInstruction : public ArmFaultVals<UndefinedInstruction>
323{
324 protected:
328 const char *mnemonic;
329
330 public:
332 bool _unknown,
333 const char *_mnemonic = NULL,
334 bool _disabled = false) :
336 unknown(_unknown), disabled(_disabled),
338 {}
339 UndefinedInstruction(ExtMachInst mach_inst, uint32_t _iss,
340 ExceptionClass _overrideEc, const char *_mnemonic = NULL) :
341 ArmFaultVals<UndefinedInstruction>(mach_inst, _iss),
342 unknown(false), disabled(true), overrideEc(_overrideEc),
343 mnemonic(_mnemonic)
344 {}
345
346 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
347 nullStaticInstPtr) override;
348 bool routeToHyp(ThreadContext *tc) const override;
349 uint32_t vectorCatchFlag() const override { return 0x02000002; }
350
352 ExceptionClass ec(ThreadContext *tc) const override;
353 uint32_t iss() const override;
354};
355
356class SupervisorCall : public ArmFaultVals<SupervisorCall>
357{
358 protected:
360 public:
361 SupervisorCall(ExtMachInst mach_inst, uint32_t _iss,
363 ArmFaultVals<SupervisorCall>(mach_inst, _iss),
364 overrideEc(_overrideEc)
365 {
366 bStep = true;
367 }
368
369 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
370 nullStaticInstPtr) override;
371 bool routeToHyp(ThreadContext *tc) const override;
372 uint32_t vectorCatchFlag() const override { return 0x04000404; }
373
375 ExceptionClass ec(ThreadContext *tc) const override;
376 uint32_t iss() const override;
377};
378
379class SecureMonitorCall : public ArmFaultVals<SecureMonitorCall>
380{
381 public:
384 {
385 bStep = true;
386 }
387
388 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
389 nullStaticInstPtr) override;
390 uint32_t vectorCatchFlag() const override { return 0x00000400; }
391
393 ExceptionClass ec(ThreadContext *tc) const override;
394 uint32_t iss() const override;
395};
396
397class SupervisorTrap : public ArmFaultVals<SupervisorTrap>
398{
399 protected:
402
403 public:
404 SupervisorTrap(ExtMachInst mach_inst, uint32_t _iss,
406 ArmFaultVals<SupervisorTrap>(mach_inst, _iss),
407 overrideEc(_overrideEc)
408 {}
409
410 bool routeToHyp(ThreadContext *tc) const override;
411
413 ExceptionClass ec(ThreadContext *tc) const override;
414 uint32_t iss() const override;
415};
416
417class SecureMonitorTrap : public ArmFaultVals<SecureMonitorTrap>
418{
419 protected:
422
423 public:
424 SecureMonitorTrap(ExtMachInst mach_inst, uint32_t _iss,
426 ArmFaultVals<SecureMonitorTrap>(mach_inst, _iss),
427 overrideEc(_overrideEc)
428 {}
429
431 ExceptionClass ec(ThreadContext *tc) const override;
432};
433
434class HypervisorCall : public ArmFaultVals<HypervisorCall>
435{
436 public:
437 HypervisorCall(ExtMachInst mach_inst, uint32_t _imm);
438
439 bool routeToHyp(ThreadContext *tc) const override;
440 bool routeToMonitor(ThreadContext *tc) const override;
441 uint32_t vectorCatchFlag() const override { return 0xFFFFFFFF; }
442
444 ExceptionClass ec(ThreadContext *tc) const override;
445};
446
447class HypervisorTrap : public ArmFaultVals<HypervisorTrap>
448{
449 protected:
452
453 public:
454 HypervisorTrap(ExtMachInst mach_inst, uint32_t _iss,
456 ArmFaultVals<HypervisorTrap>(mach_inst, _iss),
457 overrideEc(_overrideEc)
458 {}
459
461 ExceptionClass ec(ThreadContext *tc) const override;
462};
463
464template <class T>
465class AbortFault : public ArmFaultVals<T>
466{
467 protected:
481 bool write;
483 uint8_t source;
484 uint8_t srcEncoded;
485 bool stage2;
486 bool s1ptw;
489
490 public:
491 AbortFault(Addr _faultAddr, bool _write, TlbEntry::DomainType _domain,
492 uint8_t _source, bool _stage2,
495 faultAddr(_faultAddr), OVAddr(0), write(_write),
496 domain(_domain), source(_source), srcEncoded(0),
497 stage2(_stage2), s1ptw(false), tranMethod(_tranMethod),
498 debugType(_debug)
499 {}
500
501 bool getFaultVAddr(Addr &va) const override;
502
503 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
504 nullStaticInstPtr) override;
505
506 FSR getFsr(ThreadContext *tc) const override;
507 uint8_t getFaultStatusCode(ThreadContext *tc) const;
508 bool abortDisable(ThreadContext *tc) override;
509 bool isStage2() const override { return stage2; }
510 void annotate(ArmFault::AnnotationIDs id, uint64_t val) override;
511 void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg) override;
512 bool isMMUFault() const;
513};
514
515class PrefetchAbort : public AbortFault<PrefetchAbort>
516{
517 public:
521
522 PrefetchAbort(Addr _addr, uint8_t _source, bool _stage2 = false,
525 AbortFault<PrefetchAbort>(_addr, false, TlbEntry::DomainType::NoAccess,
526 _source, _stage2, _tranMethod, _debug)
527 {}
528
529 // @todo: external aborts should be routed if SCR.EA == 1
530 bool routeToMonitor(ThreadContext *tc) const override;
531 bool routeToHyp(ThreadContext *tc) const override;
532 uint32_t vectorCatchFlag() const override { return 0x08000808; }
533
535 ExceptionClass ec(ThreadContext *tc) const override;
536 bool il(ThreadContext *tc) const override { return true; }
537 uint32_t iss() const override;
538};
539
540class DataAbort : public AbortFault<DataAbort>
541{
542 public:
546 bool isv;
547 uint8_t sas;
548 uint8_t sse;
549 uint8_t srt;
550 uint8_t cm;
551
552 // AArch64 only
553 bool sf;
554 bool ar;
555
556 DataAbort(Addr _addr, TlbEntry::DomainType _domain, bool _write, uint8_t _source,
557 bool _stage2=false,
560 AbortFault<DataAbort>(_addr, _write, _domain, _source, _stage2,
561 _tranMethod, _debug_type),
562 isv(false), sas (0), sse(0), srt(0), cm(0), sf(false), ar(false)
563 {}
564
565 // @todo: external aborts should be routed if SCR.EA == 1
566 bool routeToMonitor(ThreadContext *tc) const override;
567 bool routeToHyp(ThreadContext *tc) const override;
568 void annotate(AnnotationIDs id, uint64_t val) override;
569 uint32_t vectorCatchFlag() const override { return 0x10001010; }
570
572 ExceptionClass ec(ThreadContext *tc) const override;
573 bool il(ThreadContext *tc) const override;
574 uint32_t iss() const override;
575};
576
577class VirtualDataAbort : public AbortFault<VirtualDataAbort>
578{
579 public:
583
584 VirtualDataAbort(Addr _addr, TlbEntry::DomainType _domain, bool _write,
585 uint8_t _source) :
586 AbortFault<VirtualDataAbort>(_addr, _write, _domain, _source, false)
587 {}
588
589 void invoke(ThreadContext *tc, const StaticInstPtr &inst) override;
590};
591
592class Interrupt : public ArmFaultVals<Interrupt>
593{
594 public:
595 bool routeToMonitor(ThreadContext *tc) const override;
596 bool routeToHyp(ThreadContext *tc) const override;
597 bool abortDisable(ThreadContext *tc) override;
598 uint32_t vectorCatchFlag() const override { return 0x40004040; }
599};
600
601class VirtualInterrupt : public ArmFaultVals<VirtualInterrupt>
602{
603 public:
605};
606
607class FastInterrupt : public ArmFaultVals<FastInterrupt>
608{
609 public:
610 bool routeToMonitor(ThreadContext *tc) const override;
611 bool routeToHyp(ThreadContext *tc) const override;
612 bool abortDisable(ThreadContext *tc) override;
613 bool fiqDisable(ThreadContext *tc) override;
614 uint32_t vectorCatchFlag() const override { return 0x80008080; }
615};
616
617class VirtualFastInterrupt : public ArmFaultVals<VirtualFastInterrupt>
618{
619 public:
621};
622
624class PCAlignmentFault : public ArmFaultVals<PCAlignmentFault>
625{
626 protected:
629 public:
630 PCAlignmentFault(Addr fault_pc) : faultPC(fault_pc)
631 {}
632 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
633 nullStaticInstPtr) override;
634 bool routeToHyp(ThreadContext *tc) const override;
635
637 bool il(ThreadContext *tc) const override { return true; }
638};
639
641class SPAlignmentFault : public ArmFaultVals<SPAlignmentFault>
642{
643 public:
645 bool routeToHyp(ThreadContext *tc) const override;
646
648 bool il(ThreadContext *tc) const override { return true; }
649};
650
652class SystemError : public ArmFaultVals<SystemError>
653{
654 public:
655 SystemError();
656 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
657 nullStaticInstPtr) override;
658 bool routeToMonitor(ThreadContext *tc) const override;
659 bool routeToHyp(ThreadContext *tc) const override;
660
662 bool il(ThreadContext *tc) const override { return true; }
663};
664
666class SoftwareBreakpoint : public ArmFaultVals<SoftwareBreakpoint>
667{
668 public:
669 SoftwareBreakpoint(ExtMachInst mach_inst, uint32_t _iss);
670 bool routeToHyp(ThreadContext *tc) const override;
671
673 ExceptionClass ec(ThreadContext *tc) const override;
674};
675
676class HardwareBreakpoint : public ArmFaultVals<HardwareBreakpoint>
677{
678 private:
680 public:
681 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
682 nullStaticInstPtr) override;
683 HardwareBreakpoint(Addr _vaddr, uint32_t _iss);
684 bool routeToHyp(ThreadContext *tc) const override;
685
687 ExceptionClass ec(ThreadContext *tc) const override;
688 bool il(ThreadContext *tc) const override { return true; }
689};
690
691class Watchpoint : public ArmFaultVals<Watchpoint>
692{
693 private:
695 bool write;
696 bool cm;
697
698 public:
699 Watchpoint(ExtMachInst mach_inst, Addr vaddr, bool _write, bool _cm);
700 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
701 nullStaticInstPtr) override;
702 bool routeToHyp(ThreadContext *tc) const override;
703 void annotate(AnnotationIDs id, uint64_t val) override;
704
706 ExceptionClass ec(ThreadContext *tc) const override;
707 bool il(ThreadContext *tc) const override { return true; }
708 uint32_t iss() const override;
709};
710
711class SoftwareStepFault : public ArmFaultVals<SoftwareStepFault>
712{
713 private:
714 bool isldx;
716
717 public:
718 SoftwareStepFault(ExtMachInst mach_inst, bool is_ldx, bool stepped);
719 bool routeToHyp(ThreadContext *tc) const override;
720
722 ExceptionClass ec(ThreadContext *tc) const override;
723 bool il(ThreadContext *tc) const override { return true; }
724 uint32_t iss() const override;
725};
726
727// A fault that flushes the pipe, excluding the faulting instructions
728class ArmSev : public ArmFaultVals<ArmSev>
729{
730 public:
732 void invoke(ThreadContext *tc, const StaticInstPtr &inst =
733 nullStaticInstPtr) override;
734};
735
737class IllegalInstSetStateFault : public ArmFaultVals<IllegalInstSetStateFault>
738{
739 public:
741 bool routeToHyp(ThreadContext *tc) const override;
742
744 bool il(ThreadContext *tc) const override { return true; }
745};
746
747/*
748 * Explicitly declare template static member variables to avoid warnings
749 * in some clang versions
750 */
775
786bool getFaultVAddr(Fault fault, Addr &va);
787
788} // namespace ArmISA
789} // namespace gem5
790
791#endif // __ARM_FAULTS_HH__
ArmFault::TranMethod tranMethod
Definition faults.hh:487
AbortFault(Addr _faultAddr, bool _write, TlbEntry::DomainType _domain, uint8_t _source, bool _stage2, ArmFault::TranMethod _tranMethod=ArmFault::UnknownTran, ArmFault::DebugType _debug=ArmFault::NODEBUG)
Definition faults.hh:491
Addr OVAddr
Original virtual address.
Definition faults.hh:480
Addr faultAddr
The virtual address the fault occured at.
Definition faults.hh:474
void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg) override
Definition faults.cc:1116
uint8_t getFaultStatusCode(ThreadContext *tc) const
Definition faults.cc:1127
TlbEntry::DomainType domain
Definition faults.hh:482
ArmFault::DebugType debugType
Definition faults.hh:488
bool isStage2() const override
Definition faults.hh:509
void annotate(ArmFault::AnnotationIDs id, uint64_t val) override
Definition faults.cc:1189
bool abortDisable(ThreadContext *tc) override
Definition faults.cc:1178
bool getFaultVAddr(Addr &va) const override
Definition faults.cc:1225
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1032
FSR getFsr(ThreadContext *tc) const override
Definition faults.cc:1153
bool isMMUFault() const
Definition faults.cc:1208
virtual bool routeToMonitor(ThreadContext *tc) const override
Definition faults.hh:276
ExceptionClass ec(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:301
ArmFaultVals(ExtMachInst mach_inst=0, uint32_t _iss=0)
Definition faults.hh:266
FaultOffset offset64(ThreadContext *tc) override
Definition faults.cc:942
bool il(ThreadContext *tc) const override
Definition faults.hh:303
uint8_t armPcOffset(bool is_hyp) override
Definition faults.hh:282
bool fiqDisable(ThreadContext *tc) override
Definition faults.hh:298
uint32_t iss() const override
Definition faults.hh:309
uint8_t armPcElrOffset() override
Definition faults.hh:295
bool abortDisable(ThreadContext *tc) override
Definition faults.hh:297
OperatingMode nextMode() override
Definition faults.hh:273
FaultName name() const override
Definition faults.hh:268
static FaultVals vals
Definition faults.hh:263
uint8_t thumbPcOffset(bool is_hyp) override
Definition faults.hh:289
uint8_t thumbPcElrOffset() override
Definition faults.hh:296
virtual FaultOffset offset(ThreadContext *tc)=0
ExceptionLevel toEL
Definition faults.hh:75
virtual FSR getFsr(ThreadContext *tc) const
Definition faults.hh:253
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:241
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:236
virtual Addr getVector(ThreadContext *tc)
Definition faults.cc:312
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:251
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:252
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:256
virtual bool getFaultVAddr(Addr &va) const
Definition faults.hh:255
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:215
OperatingMode fromMode
Definition faults.hh:76
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1729
static const MiscRegIndex FarIndex
Definition faults.hh:544
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1333
uint32_t iss() const override
Definition faults.cc:1357
void annotate(AnnotationIDs id, uint64_t val) override
Definition faults.cc:1385
DataAbort(Addr _addr, TlbEntry::DomainType _domain, bool _write, uint8_t _source, bool _stage2=false, ArmFault::TranMethod _tranMethod=ArmFault::UnknownTran, ArmFault::DebugType _debug_type=ArmFault::NODEBUG)
Definition faults.hh:556
uint32_t vectorCatchFlag() const override
Definition faults.hh:569
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1326
static const MiscRegIndex HFarIndex
Definition faults.hh:545
static const MiscRegIndex FsrIndex
Definition faults.hh:543
bool fiqDisable(ThreadContext *tc) override
Definition faults.cc:1487
bool abortDisable(ThreadContext *tc) override
Definition faults.cc:1477
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1461
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1469
uint32_t vectorCatchFlag() const override
Definition faults.hh:614
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1603
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1584
bool il(ThreadContext *tc) const override
Definition faults.hh:688
HardwareBreakpoint(Addr _vaddr, uint32_t _iss)
Definition faults.cc:1579
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:897
HypervisorCall(ExtMachInst mach_inst, uint32_t _imm)
Definition faults.cc:890
uint32_t vectorCatchFlag() const override
Definition faults.hh:441
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:903
ExceptionClass overrideEc
Definition faults.hh:451
HypervisorTrap(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:454
Illegal Instruction Set State fault (AArch64 only)
Definition faults.hh:738
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:744
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1775
uint32_t vectorCatchFlag() const override
Definition faults.hh:598
bool abortDisable(ThreadContext *tc) override
Definition faults.cc:1448
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1440
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1432
PC alignment fault (AArch64 only)
Definition faults.hh:625
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1502
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:637
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1511
Addr faultPC
The unaligned value of the PC.
Definition faults.hh:628
PCAlignmentFault(Addr fault_pc)
Definition faults.hh:630
PrefetchAbort(Addr _addr, uint8_t _source, bool _stage2=false, ArmFault::TranMethod _tranMethod=ArmFault::UnknownTran, ArmFault::DebugType _debug=ArmFault::NODEBUG)
Definition faults.hh:522
uint32_t iss() const override
Definition faults.cc:1257
static const MiscRegIndex FarIndex
Definition faults.hh:519
bool il(ThreadContext *tc) const override
Definition faults.hh:536
uint32_t vectorCatchFlag() const override
Definition faults.hh:532
static const MiscRegIndex HFarIndex
Definition faults.hh:520
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1276
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1269
static const MiscRegIndex FsrIndex
Definition faults.hh:518
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:642
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1521
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:648
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:390
SecureMonitorCall(ExtMachInst mach_inst)
Definition faults.hh:382
SecureMonitorTrap(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:424
Software Breakpoint (AArch64 only)
Definition faults.hh:667
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1564
SoftwareBreakpoint(ExtMachInst mach_inst, uint32_t _iss)
Definition faults.cc:1559
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1698
bool il(ThreadContext *tc) const override
Definition faults.hh:723
uint32_t iss() const override
Definition faults.cc:1718
SoftwareStepFault(ExtMachInst mach_inst, bool is_ldx, bool stepped)
Definition faults.cc:1689
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:829
uint32_t vectorCatchFlag() const override
Definition faults.hh:372
ExceptionClass overrideEc
Definition faults.hh:359
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:361
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:998
SupervisorTrap(ExtMachInst mach_inst, uint32_t _iss, ExceptionClass _overrideEc=ExceptionClass::INVALID)
Definition faults.hh:404
ExceptionClass overrideEc
Definition faults.hh:401
uint32_t iss() const override
Definition faults.cc:1005
System error (AArch64 only)
Definition faults.hh:653
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1532
bool il(ThreadContext *tc) const override
Syndrome methods.
Definition faults.hh:662
bool routeToMonitor(ThreadContext *tc) const override
Definition faults.cc:1539
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1548
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:339
UndefinedInstruction(ExtMachInst mach_inst, bool _unknown, const char *_mnemonic=NULL, bool _disabled=false)
Definition faults.hh:331
uint32_t vectorCatchFlag() const override
Definition faults.hh:349
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:792
uint32_t iss() const override
Definition faults.cc:800
VirtualDataAbort(Addr _addr, TlbEntry::DomainType _domain, bool _write, uint8_t _source)
Definition faults.hh:584
static const MiscRegIndex FsrIndex
Definition faults.hh:580
void invoke(ThreadContext *tc, const StaticInstPtr &inst) override
Definition faults.cc:1423
static const MiscRegIndex FarIndex
Definition faults.hh:581
static const MiscRegIndex HFarIndex
Definition faults.hh:582
Watchpoint(ExtMachInst mach_inst, Addr vaddr, bool _write, bool _cm)
Definition faults.cc:1629
bool il(ThreadContext *tc) const override
Definition faults.hh:707
bool routeToHyp(ThreadContext *tc) const override
Definition faults.cc:1655
void annotate(AnnotationIDs id, uint64_t val) override
Definition faults.cc:1665
uint32_t iss() const override
Definition faults.cc:1636
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
Definition faults.cc:1647
ThreadContext is the external interface to all thread state for anything outside of the CPU.
@ MODE_UNDEFINED
Definition types.hh:303
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:1782
Bitfield< 20 > il
Definition misc_types.hh:61
Bitfield< 23, 0 > offset
Definition types.hh:144
@ MISCREG_HDFAR
Definition misc.hh:295
@ MISCREG_IFAR
Definition misc.hh:292
@ MISCREG_DFAR
Definition misc.hh:289
@ MISCREG_IFSR
Definition misc.hh:277
@ MISCREG_DFSR
Definition misc.hh:274
@ MISCREG_HIFAR
Definition misc.hh:296
Addr FaultOffset
Definition faults.hh:60
Bitfield< 8 > va
Bitfield< 63 > val
Definition misc.hh:804
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
uint64_t 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:178
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:196
const ExceptionClass ec
Definition faults.hh:194

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