arch-arm: Remove unnecessary self hosted debug initialization

The init method is already called by in the ISA::init, before
simulation starts, so there is no need to check for it
when a watchpoint/breakpoint is set by guest software

Change-Id: I776a1824799a7f4a351eb7d3c7002a11726f9d6a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60730
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Giacomo Travaglini
2022-06-23 13:06:44 +01:00
parent 424643e91e
commit 58f448743b
2 changed files with 1 additions and 14 deletions

View File

@@ -82,8 +82,6 @@ SelfDebug::testBreakPoints(ThreadContext *tc, Addr vaddr)
to32 = targetAArch32(tc);
init(tc);
if (!isDebugEnabled(tc))
return NoFault;
@@ -127,8 +125,6 @@ SelfDebug::testWatchPoints(ThreadContext *tc, Addr vaddr, bool write,
{
setAArch32(tc);
to32 = targetAArch32(tc);
if (!initialized)
init(tc);
if (!isDebugEnabled(tc) || !mde)
return NoFault;
@@ -330,8 +326,6 @@ BrkPoint::test(ThreadContext *tc, Addr pc, ExceptionLevel el, DBGBCR ctr,
void
SelfDebug::init(ThreadContext *tc)
{
if (initialized)
return;
CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
aarch32 = cpsr.width == 1;
@@ -362,8 +356,6 @@ SelfDebug::init(ThreadContext *tc)
arWatchPoints.push_back(wtp);
}
initialized = true;
RegVal oslar_el1 = tc->readMiscReg(MISCREG_OSLAR_EL1);
updateOSLock(oslar_el1);
// Initialize preloaded control booleans
@@ -721,8 +713,6 @@ SelfDebug::testVectorCatch(ThreadContext *tc, Addr addr,
setAArch32(tc);
to32 = targetAArch32(tc);
if (!initialized)
init(tc);
if (!isDebugEnabled(tc) || !mde || !aarch32)
return NoFault;

View File

@@ -282,7 +282,6 @@ class SelfDebug
SoftwareStep * softStep;
VectorCatch * vcExcpt;
bool initialized;
bool enableTdeTge; // MDCR_EL2.TDE || HCR_EL2.TGE
bool mde; // MDSCR_EL1.MDE, DBGDSCRext.MDBGen
@@ -295,7 +294,7 @@ class SelfDebug
public:
SelfDebug()
: initialized(false), enableTdeTge(false),
: enableTdeTge(false),
mde(false), sdd(false), kde(false), oslk(false)
{
softStep = new SoftwareStep(this);
@@ -449,8 +448,6 @@ class SelfDebug
VectorCatch*
getVectorCatch(ThreadContext *tc)
{
if (!initialized)
init(tc);
return vcExcpt;
}