Sean Wilson has uploaded this change for review. ( https://gem5-review.googlesource.com/4002

Change subject: cpu: Use the same TLB pointer for all switching CPUs.
......................................................................

cpu: Use the same TLB pointer for all switching CPUs.

Previously, before a CPU was switched out, the TLB was always flushed.
With this changeset, when you switch from atomic to timing mode the
TLB is warm.

Change-Id: I8413e059d4b75d68f3577512fd7231cfccf461f4
Signed-off-by: Sean Wilson <[email protected]>
---
M src/cpu/base.cc
1 file changed, 0 insertions(+), 67 deletions(-)



diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index 6f460d3..eb0c0ed 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -510,10 +510,6 @@
     _switchedOut = true;
     if (profileEvent && profileEvent->scheduled())
         deschedule(profileEvent);
-
-    // Flush all TLBs in the CPU to avoid having stale translations if
-    // it gets switched in later.
-    flushTLBs();
 }

 void
@@ -546,69 +542,6 @@
            if (DTRACE(Context))
             ThreadContext::compare(oldTC, newTC);
         */
-
-        BaseMasterPort *old_itb_port = oldTC->getITBPtr()->getMasterPort();
-        BaseMasterPort *old_dtb_port = oldTC->getDTBPtr()->getMasterPort();
-        BaseMasterPort *new_itb_port = newTC->getITBPtr()->getMasterPort();
-        BaseMasterPort *new_dtb_port = newTC->getDTBPtr()->getMasterPort();
-
-        // Move over any table walker ports if they exist
-        if (new_itb_port) {
-            assert(!new_itb_port->isConnected());
-            assert(old_itb_port);
-            assert(old_itb_port->isConnected());
-            BaseSlavePort &slavePort = old_itb_port->getSlavePort();
-            old_itb_port->unbind();
-            new_itb_port->bind(slavePort);
-        }
-        if (new_dtb_port) {
-            assert(!new_dtb_port->isConnected());
-            assert(old_dtb_port);
-            assert(old_dtb_port->isConnected());
-            BaseSlavePort &slavePort = old_dtb_port->getSlavePort();
-            old_dtb_port->unbind();
-            new_dtb_port->bind(slavePort);
-        }
-        newTC->getITBPtr()->takeOverFrom(oldTC->getITBPtr());
-        newTC->getDTBPtr()->takeOverFrom(oldTC->getDTBPtr());
-
-        // Checker whether or not we have to transfer CheckerCPU
-        // objects over in the switch
-        CheckerCPU *oldChecker = oldTC->getCheckerCpuPtr();
-        CheckerCPU *newChecker = newTC->getCheckerCpuPtr();
-        if (oldChecker && newChecker) {
-            BaseMasterPort *old_checker_itb_port =
-                oldChecker->getITBPtr()->getMasterPort();
-            BaseMasterPort *old_checker_dtb_port =
-                oldChecker->getDTBPtr()->getMasterPort();
-            BaseMasterPort *new_checker_itb_port =
-                newChecker->getITBPtr()->getMasterPort();
-            BaseMasterPort *new_checker_dtb_port =
-                newChecker->getDTBPtr()->getMasterPort();
-
-            newChecker->getITBPtr()->takeOverFrom(oldChecker->getITBPtr());
-            newChecker->getDTBPtr()->takeOverFrom(oldChecker->getDTBPtr());
-
-            // Move over any table walker ports if they exist for checker
-            if (new_checker_itb_port) {
-                assert(!new_checker_itb_port->isConnected());
-                assert(old_checker_itb_port);
-                assert(old_checker_itb_port->isConnected());
-                BaseSlavePort &slavePort =
-                    old_checker_itb_port->getSlavePort();
-                old_checker_itb_port->unbind();
-                new_checker_itb_port->bind(slavePort);
-            }
-            if (new_checker_dtb_port) {
-                assert(!new_checker_dtb_port->isConnected());
-                assert(old_checker_dtb_port);
-                assert(old_checker_dtb_port->isConnected());
-                BaseSlavePort &slavePort =
-                    old_checker_dtb_port->getSlavePort();
-                old_checker_dtb_port->unbind();
-                new_checker_dtb_port->bind(slavePort);
-            }
-        }
     }

     interrupts = oldCPU->interrupts;

--
To view, visit https://gem5-review.googlesource.com/4002
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8413e059d4b75d68f3577512fd7231cfccf461f4
Gerrit-Change-Number: 4002
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Wilson <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to