changeset e622a3e2ed14 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=e622a3e2ed14
description:
        arm: Fix TLB ignoring faults when table walking

        This patch fixes a case where the Minor CPU can deadlock due to the lack
        of a response to TLB request because of a bug in fault handling in the 
ARM
        table walker.

        TableWalker::processWalkWrapper is the scheduler-called wrapper which
        handles deferred walks which calls to TableWalker::wait cannot 
immediately
        process.  The handling of faults generated by processWalk{AArch64,LPAE,}
        calls in those two functions is is different.  processWalkWrapper 
ignores
        fault returns from processWalk... which can lead to ::finish not being
        called on a translation.

        This fix provides fault handling in processWalkWrapper similar to that
        found in the leaf functions which BaseTLB::Translation::finish.

diffstat:

 src/arch/arm/table_walker.cc |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 997be6ba467e -r e622a3e2ed14 src/arch/arm/table_walker.cc
--- a/src/arch/arm/table_walker.cc      Tue Dec 02 06:08:09 2014 -0500
+++ b/src/arch/arm/table_walker.cc      Tue Dec 02 06:08:11 2014 -0500
@@ -344,12 +344,22 @@
         // We've got a valid request, lets process it
         pending = true;
         pendingQueue.pop_front();
+        // Keep currState in case one of the processWalk... calls NULLs it
+        WalkerState *curr_state_copy = currState;
+        Fault f;
         if (currState->aarch64)
-            processWalkAArch64();
+            f = processWalkAArch64();
         else if ((_haveLPAE && currState->ttbcr.eae) || currState->isHyp || 
isStage2)
-            processWalkLPAE();
+            f = processWalkLPAE();
         else
-            processWalk();
+            f = processWalk();
+
+        if (f != NoFault) {
+            curr_state_copy->transState->finish(f, curr_state_copy->req,
+                    curr_state_copy->tc, curr_state_copy->mode);
+
+            delete curr_state_copy;
+        }
         return;
     }
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to