Giacomo Travaglini has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/32775 )
Change subject: arch-arm: Rename SelfDebug member variables
......................................................................
arch-arm: Rename SelfDebug member variables
* enableFlag -> mde
The "enableFlag" variable, enabling the Breakpoint, Watchpoint, Vector
Catch exceptions is actually the cached version of MDSCR_EL1.MDE. The
"enableFlag" name looks too general as it's not covering the Software
Step exception case.
* bKDE -> kde
* bSDD -> sdd
The b prefix was likely referring to "breakpoint". However these bitfields
are actually used by watchpoints as well.
Change-Id: I48b762b32b2d763f4c4ceb7dcc28968cfb470fc1
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikole...@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32775
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Richard Cooper <richard.coo...@arm.com>
---
M src/arch/arm/self_debug.cc
M src/arch/arm/self_debug.hh
2 files changed, 16 insertions(+), 17 deletions(-)
Approvals:
Richard Cooper: Looks good to me, approved
Giacomo Travaglini: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/arm/self_debug.cc b/src/arch/arm/self_debug.cc
index 21ad84c..e55df64 100644
--- a/src/arch/arm/self_debug.cc
+++ b/src/arch/arm/self_debug.cc
@@ -72,7 +72,7 @@
Fault
SelfDebug::testBreakPoints(ThreadContext *tc, Addr vaddr)
{
- if (!enableFlag)
+ if (!mde)
return NoFault;
setAArch32(tc);
@@ -127,7 +127,7 @@
to32 = targetAArch32(tc);
if (!initialized)
init(tc);
- if (!isDebugEnabled(tc) || !enableFlag)
+ if (!isDebugEnabled(tc) || !mde)
return NoFault;
ExceptionLevel el = (ExceptionLevel) currEL(tc);
@@ -168,12 +168,12 @@
(!secure || HaveSecureEL2Ext(tc)) && enableTdeTge;
ExceptionLevel target_el = route_to_el2 ? EL2 : EL1;
- if (oslk || (bSDD && secure && ArmSystem::haveEL(tc, EL3))) {
+ if (oslk || (sdd && secure && ArmSystem::haveEL(tc, EL3))) {
return false;
}
if (el == target_el) {
- return bKDE && !mask;
+ return kde && !mask;
} else {
return target_el > el;
}
@@ -720,7 +720,7 @@
to32 = targetAArch32(tc);
if (!initialized)
init(tc);
- if (!isDebugEnabled(tc) || !enableFlag || !aarch32)
+ if (!isDebugEnabled(tc) || !mde || !aarch32)
return NoFault;
ExceptionLevel el = (ExceptionLevel) currEL(tc);
diff --git a/src/arch/arm/self_debug.hh b/src/arch/arm/self_debug.hh
index c9afa60..2ae2f8e 100644
--- a/src/arch/arm/self_debug.hh
+++ b/src/arch/arm/self_debug.hh
@@ -167,8 +167,7 @@
inline Addr
getAddrfromReg(ThreadContext *tc)
{
- return bits(tc->readMiscReg(valRegIndex), maxAddrSize, 0);
-
+ return bits(tc->readMiscReg(valRegIndex), maxAddrSize, 0);
}
inline bool
@@ -282,11 +281,9 @@
bool initialized;
bool enableTdeTge; // MDCR_EL2.TDE || HCR_EL2.TGE
- // THIS is MDSCR_EL1.MDE in aarch64 and DBGDSCRext.MDBGen in aarch32
- bool enableFlag;
-
- bool bSDD; // MDCR_EL3.SDD
- bool bKDE; // MDSCR_EL1.KDE
+ bool mde; // MDSCR_EL1.MDE, DBGDSCRext.MDBGen
+ bool sdd; // MDCR_EL3.SDD
+ bool kde; // MDSCR_EL1.KDE
bool oslk; // OS lock flag
bool aarch32; // updates with stage1 aarch64/32
@@ -295,7 +292,7 @@
public:
SelfDebug()
: initialized(false), enableTdeTge(false),
- enableFlag(false), bSDD(false), bKDE(false), oslk(false)
+ mde(false), sdd(false), kde(false), oslk(false)
{
softStep = new SoftwareStep(this);
}
@@ -320,6 +317,8 @@
public:
Fault testVectorCatch(ThreadContext *tc, Addr addr, ArmFault* flt);
+ bool enabled() const { return mde || softStep->bSS; };
+
inline BrkPoint*
getBrkPoint(uint8_t index)
{
@@ -373,21 +372,21 @@
inline void
setbSDD(RegVal val)
{
- bSDD = bits(val, 16);
+ sdd = bits(val, 16);
}
inline void
setMDSCRvals(RegVal val)
{
- enableFlag = bits(val, 15);
- bKDE = bits(val, 13);
+ mde = bits(val, 15);
+ kde = bits(val, 13);
softStep->bSS = bits(val, 0);
}
inline void
setMDBGen(RegVal val)
{
- enableFlag = bits(val, 15);
+ mde = bits(val, 15);
}
inline void
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32775
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I48b762b32b2d763f4c4ceb7dcc28968cfb470fc1
Gerrit-Change-Number: 32775
Gerrit-PatchSet: 3
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-Reviewer: Richard Cooper <richard.coo...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s