changeset 9818190de72e in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=9818190de72e
description:
        sim: Don't quiesce UDelayEvents with 0 latency

        ARM uses UDelayEvents to emulate kernel __*udelay functions and speed up
        simulation. UDelayEvents call Pseudoinst::quiesceNs to quiesce the 
system for
        a specified delay. Changeset 10341:0b4d10f53c2d introduced the 
requirement
        that any quiesce process that is started must also be completed by 
scheduling
        an EndQuiesceEvent. This change causes the CPU to hang if an IsQuiesce
        instruction is executed, but the corresponding EndQuiesceEvent is not
        scheduled.

        Changeset 11058:d0934b57735a introduces a fix for uses of 
PseudoInst::quiesce*
        that would conditionally execute the EndQuiesceEvent. ARM UDelayEvents 
specify
        quiesce period of 0 ns (src/arch/arm/linux/system.cc), so changeset 
11058
        causes these events to now execute full quiesce processes, greatly 
increasing
        the total instructions executed in kernel delay loops and slowing 
simulation.

        This patch updates the UDelayEvent to conditionally execute
        PseudoInst::quiesceNs (**a quiesce operation**) only if the specified
        delay is >0 ns. The result is ARM delay loops no longer execute 
instructions
        for quiesce handling, and regression time returns to normal.

diffstat:

 src/kern/freebsd/events.cc |  8 +++++++-
 src/kern/linux/events.cc   |  8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r d90aec9435bd -r 9818190de72e src/kern/freebsd/events.cc
--- a/src/kern/freebsd/events.cc        Fri Oct 09 14:50:54 2015 -0500
+++ b/src/kern/freebsd/events.cc        Sat Oct 10 16:45:38 2015 -0500
@@ -65,7 +65,13 @@
 
     SkipFuncEvent::process(tc);
 
-    PseudoInst::quiesceNs(tc, time);
+    // Currently, only ARM full-system simulation uses UDelayEvents to skip
+    // __delay and __loop_delay functions. One form involves setting quiesce
+    // time to 0 with the assumption that quiesce will not happen. To avoid
+    // the quiesce handling in this case, only execute the quiesce if time > 0.
+    if (time > 0) {
+        PseudoInst::quiesceNs(tc, time);
+    }
 }
 
 } // namespace FreeBSD
diff -r d90aec9435bd -r 9818190de72e src/kern/linux/events.cc
--- a/src/kern/linux/events.cc  Fri Oct 09 14:50:54 2015 -0500
+++ b/src/kern/linux/events.cc  Sat Oct 10 16:45:38 2015 -0500
@@ -85,7 +85,13 @@
 
     SkipFuncEvent::process(tc);
 
-    PseudoInst::quiesceNs(tc, time);
+    // Currently, only ARM full-system simulation uses UDelayEvents to skip
+    // __delay and __loop_delay functions. One form involves setting quiesce
+    // time to 0 with the assumption that quiesce will not happen. To avoid
+    // the quiesce handling in this case, only execute the quiesce if time > 0.
+    if (time > 0) {
+        PseudoInst::quiesceNs(tc, time);
+    }
 }
 
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to