From: Andreas Sandberg Date: Tue, 5 Jun 2018 16:55:53 +0000 (+0100) Subject: arch-arm: Remove dead doingStage2 variable in PT walker X-Git-Tag: v19.0.0.0~2081 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60600f09c25255b3c8f72da7fb49100e2682093a;p=gem5.git arch-arm: Remove dead doingStage2 variable in PT walker Change-Id: Iab5ecec56120c725847b2e462fd4793cfac87d3c Signed-off-by: Andreas Sandberg Reviewed-by: Nikos Nikoleris Reviewed-on: https://gem5-review.googlesource.com/10815 --- diff --git a/src/arch/arm/table_walker.cc b/src/arch/arm/table_walker.cc index 325a5128d..ba445878b 100644 --- a/src/arch/arm/table_walker.cc +++ b/src/arch/arm/table_walker.cc @@ -132,7 +132,7 @@ TableWalker::WalkerState::WalkerState() : asid(0), vmid(0), isHyp(false), transState(nullptr), vaddr(0), vaddr_tainted(0), isWrite(false), isFetch(false), isSecure(false), secureLookup(false), rwTable(false), userTable(false), xnTable(false), - pxnTable(false), stage2Req(false), doingStage2(false), + pxnTable(false), stage2Req(false), stage2Tran(nullptr), timing(false), functional(false), mode(BaseTLB::Read), tranType(TLB::NormalTran), l2Desc(l1Desc), delayed(false), tableWalker(nullptr) @@ -302,11 +302,6 @@ TableWalker::walk(RequestPtr _req, ThreadContext *_tc, uint16_t _asid, statRequestOrigin[REQUESTED][currState->isFetch]++; - // We only do a second stage of translation if we're not secure, or in - // hyp mode, the second stage MMU is enabled, and this table walker - // instance is the first stage. - // TODO: fix setting of doingStage2 for timing mode - currState->doingStage2 = false; currState->stage2Req = _stage2Req && !isStage2; bool long_desc_format = currState->aarch64 || _isHyp || isStage2 || @@ -1817,13 +1812,11 @@ TableWalker::doL1DescriptorWrapper() else if (!currState->delayed) { // delay is not set so there is no L2 to do // Don't finish the translation if a stage 2 look up is underway - if (!currState->doingStage2) { - statWalkServiceTime.sample(curTick() - currState->startTime); - DPRINTF(TLBVerbose, "calling translateTiming again\n"); - tlb->translateTiming(currState->req, currState->tc, - currState->transState, currState->mode); - statWalksShortTerminatedAtLevel[0]++; - } + statWalkServiceTime.sample(curTick() - currState->startTime); + DPRINTF(TLBVerbose, "calling translateTiming again\n"); + tlb->translateTiming(currState->req, currState->tc, + currState->transState, currState->mode); + statWalksShortTerminatedAtLevel[0]++; pending = false; nextWalk(currState->tc); @@ -1859,16 +1852,12 @@ TableWalker::doL2DescriptorWrapper() currState->transState->finish(currState->fault, currState->req, currState->tc, currState->mode); statWalksShortTerminatedAtLevel[1]++; - } - else { - // Don't finish the translation if a stage 2 look up is underway - if (!currState->doingStage2) { - statWalkServiceTime.sample(curTick() - currState->startTime); - DPRINTF(TLBVerbose, "calling translateTiming again\n"); - tlb->translateTiming(currState->req, currState->tc, - currState->transState, currState->mode); - statWalksShortTerminatedAtLevel[1]++; - } + } else { + statWalkServiceTime.sample(curTick() - currState->startTime); + DPRINTF(TLBVerbose, "calling translateTiming again\n"); + tlb->translateTiming(currState->req, currState->tc, + currState->transState, currState->mode); + statWalksShortTerminatedAtLevel[1]++; } @@ -1941,14 +1930,11 @@ TableWalker::doLongDescriptorWrapper(LookupLevel curr_lookup_level) delete currState; } else if (!currState->delayed) { // No additional lookups required - // Don't finish the translation if a stage 2 look up is underway - if (!currState->doingStage2) { - DPRINTF(TLBVerbose, "calling translateTiming again\n"); - statWalkServiceTime.sample(curTick() - currState->startTime); - tlb->translateTiming(currState->req, currState->tc, - currState->transState, currState->mode); - statWalksLongTerminatedAtLevel[(unsigned) curr_lookup_level]++; - } + DPRINTF(TLBVerbose, "calling translateTiming again\n"); + statWalkServiceTime.sample(curTick() - currState->startTime); + tlb->translateTiming(currState->req, currState->tc, + currState->transState, currState->mode); + statWalksLongTerminatedAtLevel[(unsigned) curr_lookup_level]++; pending = false; nextWalk(currState->tc); diff --git a/src/arch/arm/table_walker.hh b/src/arch/arm/table_walker.hh index b322c50d7..1957bef0d 100644 --- a/src/arch/arm/table_walker.hh +++ b/src/arch/arm/table_walker.hh @@ -761,11 +761,6 @@ class TableWalker : public MemObject /** Flag indicating if a second stage of lookup is required */ bool stage2Req; - /** Indicates whether the translation has been passed onto the second - * stage mmu, and no more work is required from the first stage. - */ - bool doingStage2; - /** A pointer to the stage 2 translation that's in progress */ TLB::Translation *stage2Tran;