Go to the documentation of this file.
48 using namespace ArmISA;
63 }
else if (!req->isCacheMaintenance() ||
64 (req->isCacheInvalidate() && !req->isCacheClean())) {
69 req->isCacheMaintenance());
94 if (pcst.itstate() != 0x0)
96 if (
p.enable &&
p.isActive(
pc) &&(!
to32 || !
p.onUse)) {
97 const DBGBCR ctr =
p.getControlReg(tc);
98 if (
p.isEnabled(tc,
el, ctr.hmc, ctr.ssc, ctr.pmc)) {
99 if (
p.test(tc,
pc,
el, ctr,
false)) {
115 return std::make_shared<PrefetchAbort>(
vaddr,
120 return std::make_shared<HardwareBreakpoint>(
vaddr, 0x22);
126 bool atomic,
unsigned size,
bool cm)
155 return std::make_shared<DataAbort>(
vaddr,
160 return std::make_shared<Watchpoint>(0,
vaddr, write,
cm);
166 bool secure,
bool mask)
169 (!secure ||
HaveExt(tc, ArmExtension::FEAT_SEL2)) &&
177 if (
el == target_el) {
180 return target_el >
el;
186 bool secure,
bool mask)
297 if (
HaveExt(tc, ArmExtension::FEAT_VHE) &&
303 if (
HaveExt(tc, ArmExtension::FEAT_VHE) && from_link &&
342 for (
int i = 0;
i <= dfr.brps;
i++) {
343 const bool isctxaw =
i >= (dfr.brps - dfr.ctx_cmps);
347 this, isctxaw, (
bool)mm_fr2.varange,
355 for (
int i = 0;
i <= dfr.wrps;
i++) {
358 this, (
bool)mm_fr2.varange,
aarch32);
397 prs =
bits(in_pc, 1, 0) == 0x2;
399 prs =
bits(in_pc, 1, 0) == 0x0;
401 return (
pc == pc_tocmp) && prs;
417 prs =
bits(in_pc, 1, 0) == 0x2;
419 prs =
bits(in_pc, 1, 0) == 0x0;
421 return (
pc != pc_tocmp) && !prs;
445 if (
el ==
EL2 && a32)
459 uint32_t vmid_index = 55;
482 if (no_el3 && !no_el2 && (
ssc == 0x1 ||
ssc == 0x2) &&
485 }
else if (no_el3 && no_el2 && (
hmc != 0x0 ||
ssc != 0x0) &&
486 !(!aarch32 && ((
hmc &&
ssc == 0x1 &&
pmc == 0x0) ||
ssc == 0x3))) {
488 }
else if (no_el2 &&
hmc &&
ssc == 0x3 &&
pmc == 0x0) {
490 }
else if (
ssc == 0x11 &&
pmc == 0x1 &&
491 !(!aarch32 &&
hmc &&
ssc == 0x3 &&
pmc == 0x0)) {
494 }
else if (
hmc &&
ssc == 0x1 &&
pmc == 0x0) {
500 v = (
pmc == 0x3) || (
pmc == 0x2 &&
hmc == 0x0);
504 panic(
"Unexpected EL in SelfDebug::isDebugEnabled.\n");
507 v = (
pmc == 0x3) || (
pmc == 0x1);
513 ((
hmc == 0x1) && !((
ssc == 0x2) && (
pmc == 0x0)));
515 panic(
"Unexpected EL in SelfDebug::isDebugEnabled.\n");
519 panic(
"Unexpected EL in SelfDebug::isDebugEnabled.\n");
520 v = (
hmc == 0x1) & (
ssc != 0x3);
523 panic(
"Unexpected EL %d in BrkPoint::isEnabled.\n",
el);
531 uint32_t vmid_index = 39;
554 if (
ssc == 0x01 ||
ssc == 0x02 ){
561 if (no_el2 &&
hmc &&
ssc == 0x03 &&
pac == 0)
569 v = (
pac == 0x1 ||
pac == 0x3);
576 (
ssc == 0x1 && (
pac == 0x1 ||
pac == 0x3))));
579 panic(
"Unexpected EL in WatchPoint::isEnabled.\n");
586 bool atomic,
unsigned size)
591 if (
isEnabled(tc,
el, ctr.hmc, ctr.ssc, ctr.pac) &&
592 ((wrt && (ctr.lsv & 0x2)) || (!wrt && (ctr.lsv & 0x1)) ||
atomic)) {
598 if (
atomic && (ctr.lsv & 0x1)) {
606 uint8_t
mask,
unsigned size)
617 for (
int i = 0;
i < maxbits;
i++) {
618 uint8_t bas_m = 0x1 <<
i;
619 uint8_t masked_bas =
bas & bas_m;
620 if (masked_bas == bas_m) {
621 uint8_t off = log2(masked_bas);
622 Addr cmpaddr = addr_tocmp | off;
623 for (
int j = 0;
j < size;
j++) {
624 if ((
addr +
j) == cmpaddr) {
633 for (
int j = 0;
j < size;
j++) {
642 v =
v || (
addr == compaddr);
653 bool enabled_src =
false;
657 bool enabled_dst =
false;
668 if (!
ELIs32(tc, ELd) && !enabled_src && enabled_dst) {
731 if (fault ==
nullptr)
737 return std::make_shared<HypervisorTrap>(0, 0x22,
740 return std::make_shared<PrefetchAbort>(
addr,
759 DBGVCR match_word = 0x0;
764 if (vaddress == vbase) {
766 uint32_t bmask = 1UL << (low_addr + 24);
767 match_word = match_word | (DBGVCR) bmask;
770 uint32_t bmask = 1UL << (low_addr);
771 match_word = match_word | (DBGVCR) bmask;
777 isSecure(tc) && (vaddress == mvbase)) {
778 uint32_t bmask = 1UL << (low_addr + 8);
779 match_word = match_word | (DBGVCR) bmask;
787 mask = (DBGVCR) 0xDE;
789 mask = (DBGVCR) 0xDE0000DE;
791 mask = (DBGVCR) 0xDE00DEDE;
794 match_word = match_word & dbgvcr &
mask;
799 if (((match_word & 0x18001818) != 0x0) && ELd ==
el) {
819 mask = (DBGVCR) 0xDE;
821 mask = (DBGVCR) 0x0000DE00;
824 mask = (DBGVCR) 0x000000DE;
826 mask = (DBGVCR) 0xDE000000;
828 match_type = match_type &
mask & dbgvcr;
830 if (match_type != 0x0) {
Fault testWatchPoints(ThreadContext *tc, Addr vaddr, bool write, bool atomic, unsigned size, bool cm)
void updateControl(DBGWCR val)
void setenableTDETGE(HCR hcr, HDCR mdcr)
void init(ThreadContext *tc)
@ EC_PREFETCH_ABORT_TO_HYP
virtual RegVal readMiscReg(RegIndex misc_reg)=0
constexpr decltype(nullptr) NoFault
bool isDoubleAligned(Addr addr)
bool test(ThreadContext *tc, Addr pc, ExceptionLevel el, DBGBCR ctr, bool from_link)
static const uint8_t ACTIVE_PENDING_STATE
RegVal getContextfromReg(ThreadContext *tc, bool ctxid1) const
bool testVMIDMatch(ThreadContext *tc)
MiscRegIndex ctrlRegIndex
std::vector< BrkPoint > arBrkPoints
virtual const PCStateBase & pcState() const =0
bool testAddrMissMatch(ThreadContext *tc, Addr pc, uint8_t bas)
bool isDebugEnabledForEL64(ThreadContext *tc, ExceptionLevel el, bool secure, bool mask)
bool isSecureBelowEL3(ThreadContext *tc)
void updateOSLock(RegVal val)
bool targetAArch32(ThreadContext *tc)
bool debugExceptionReturnSS(ThreadContext *tc, CPSR spsr, ExceptionLevel dest)
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 ...
bool advanceSS(ThreadContext *tc)
OperatingMode getToMode() const
Fault testBreakPoints(ThreadContext *tc, Addr vaddr)
bool isDebugEnabledForEL32(ThreadContext *tc, ExceptionLevel el, bool secure, bool mask)
bool testAddrMatch(ThreadContext *tc, Addr pc, uint8_t bas)
Fault testDebug(ThreadContext *tc, const RequestPtr &req, BaseMMU::Mode mode)
Bitfield< 23, 20 > atomic
bool testContextMatch(ThreadContext *tc, bool ctx1, bool low_ctx)
Addr getAddrfromReg(ThreadContext *tc) const
Fault triggerException(ThreadContext *tc, Addr vaddr)
void setMDSCRvals(RegVal val)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Addr getAddrfromReg(ThreadContext *tc)
@ MISCREG_ID_AA64MMFR2_EL1
std::shared_ptr< FaultBase > Fault
static const uint8_t INACTIVE_STATE
const DBGBCR getControlReg(ThreadContext *tc)
bool testLinkedBk(ThreadContext *tc, Addr vaddr, ExceptionLevel el)
bool test(ThreadContext *tc, Addr addr, ExceptionLevel el, bool &wrt, bool atomic, unsigned size)
bool exceptionTrapping(ThreadContext *tc, ExceptionLevel el, ArmFault *fault)
virtual uint32_t vectorCatchFlag() const
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
std::shared_ptr< Request > RequestPtr
static const uint8_t ACTIVE_NOT_PENDING_STATE
static bool securityStateMatch(ThreadContext *tc, uint8_t ssc, bool hmc)
bool EL2Enabled(ThreadContext *tc)
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
@ MISCREG_ID_AA64DFR0_EL1
bool isEnabled(ThreadContext *tc, ExceptionLevel el, bool hmc, uint8_t ssc, uint8_t pac)
@ MISCREG_ID_AA64MMFR1_EL1
ExceptionLevel debugTargetFrom(ThreadContext *tc, bool secure)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool isSecure(ThreadContext *tc)
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
vmid_t getVMIDfromReg(ThreadContext *tc, bool vs)
bool isDebugEnabled(ThreadContext *tc)
Fault testVectorCatch(ThreadContext *tc, Addr addr, ArmFault *flt)
BrkPoint * getBrkPoint(uint8_t index)
std::vector< WatchPoint > arWatchPoints
bool ELStateUsingAArch32(ThreadContext *tc, ExceptionLevel el, bool secure)
void updateControl(DBGBCR val)
bool isEnabled(ThreadContext *tc, ExceptionLevel el, uint8_t hmc, uint8_t ssc, uint8_t pmc)
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Fault triggerWatchpointException(ThreadContext *tc, Addr vaddr, bool write, bool cm)
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
bool addressMatching(ThreadContext *tc, Addr addr, ExceptionLevel el)
bool compareAddress(ThreadContext *tc, Addr in_addr, uint8_t bas, uint8_t mask, unsigned size)
void setAArch32(ThreadContext *tc)
Addr getVectorBase(ThreadContext *tc, bool monitor)
#define panic(...)
This implements a cprintf based panic() function.
Generated on Thu Jun 16 2022 10:41:41 for gem5 by doxygen 1.8.17