changeset 43caa4ca5979 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=43caa4ca5979
description:
        arch: Add support for invalidating TLBs when draining

        This patch adds support for the memInvalidate() drain method.  TLB
        flushing is requested by calling the virtual flushAll() method on the
        TLB.

        Note: This patch renames invalidateAll() to flushAll() on x86 and
        SPARC to make the interface consistent across all supported
        architectures.

diffstat:

 src/arch/sparc/tlb.cc   |   2 +-
 src/arch/sparc/tlb.hh   |   2 +-
 src/arch/x86/isa.cc     |  12 ++++++------
 src/arch/x86/tlb.cc     |   4 ++--
 src/arch/x86/tlb.hh     |   6 ++----
 src/arch/x86/utility.cc |   4 ++--
 src/sim/tlb.hh          |   7 +++++++
 7 files changed, 21 insertions(+), 16 deletions(-)

diffs (141 lines):

diff -r 34d2e8082912 -r 43caa4ca5979 src/arch/sparc/tlb.cc
--- a/src/arch/sparc/tlb.cc     Mon Jan 07 13:05:39 2013 -0500
+++ b/src/arch/sparc/tlb.cc     Mon Jan 07 13:05:40 2013 -0500
@@ -323,7 +323,7 @@
 }
 
 void
-TLB::invalidateAll()
+TLB::flushAll()
 {
     cacheValid = false;
     lookupTable.clear();
diff -r 34d2e8082912 -r 43caa4ca5979 src/arch/sparc/tlb.hh
--- a/src/arch/sparc/tlb.hh     Mon Jan 07 13:05:39 2013 -0500
+++ b/src/arch/sparc/tlb.hh     Mon Jan 07 13:05:40 2013 -0500
@@ -123,7 +123,7 @@
     uint64_t TagRead(int entry);
 
     /** Remove all entries from the TLB */
-    void invalidateAll();
+    void flushAll();
 
     /** Remove all non-locked entries from the tlb that match partition id. */
     void demapAll(int partition_id);
diff -r 34d2e8082912 -r 43caa4ca5979 src/arch/x86/isa.cc
--- a/src/arch/x86/isa.cc       Mon Jan 07 13:05:39 2013 -0500
+++ b/src/arch/x86/isa.cc       Mon Jan 07 13:05:40 2013 -0500
@@ -191,8 +191,8 @@
                 }
             }
             if (toggled.pg) {
-                tc->getITBPtr()->invalidateAll();
-                tc->getDTBPtr()->invalidateAll();
+                tc->getITBPtr()->flushAll();
+                tc->getDTBPtr()->flushAll();
             }
             //This must always be 1.
             newCR0.et = 1;
@@ -208,15 +208,15 @@
       case MISCREG_CR2:
         break;
       case MISCREG_CR3:
-        tc->getITBPtr()->invalidateNonGlobal();
-        tc->getDTBPtr()->invalidateNonGlobal();
+        tc->getITBPtr()->flushNonGlobal();
+        tc->getDTBPtr()->flushNonGlobal();
         break;
       case MISCREG_CR4:
         {
             CR4 toggled = regVal[miscReg] ^ val;
             if (toggled.pae || toggled.pse || toggled.pge) {
-                tc->getITBPtr()->invalidateAll();
-                tc->getDTBPtr()->invalidateAll();
+                tc->getITBPtr()->flushAll();
+                tc->getDTBPtr()->flushAll();
             }
         }
         break;
diff -r 34d2e8082912 -r 43caa4ca5979 src/arch/x86/tlb.cc
--- a/src/arch/x86/tlb.cc       Mon Jan 07 13:05:39 2013 -0500
+++ b/src/arch/x86/tlb.cc       Mon Jan 07 13:05:40 2013 -0500
@@ -129,7 +129,7 @@
 }
 
 void
-TLB::invalidateAll()
+TLB::flushAll()
 {
     DPRINTF(TLB, "Invalidating all entries.\n");
     for (unsigned i = 0; i < size; i++) {
@@ -148,7 +148,7 @@
 }
 
 void
-TLB::invalidateNonGlobal()
+TLB::flushNonGlobal()
 {
     DPRINTF(TLB, "Invalidating all non global entries.\n");
     for (unsigned i = 0; i < size; i++) {
diff -r 34d2e8082912 -r 43caa4ca5979 src/arch/x86/tlb.hh
--- a/src/arch/x86/tlb.hh       Mon Jan 07 13:05:39 2013 -0500
+++ b/src/arch/x86/tlb.hh       Mon Jan 07 13:05:40 2013 -0500
@@ -75,8 +75,6 @@
         typedef X86TLBParams Params;
         TLB(const Params *p);
 
-        void dumpAll();
-
         TlbEntry *lookup(Addr va, bool update_lru = true);
 
         void setConfigAddress(uint32_t addr);
@@ -90,9 +88,9 @@
       public:
         Walker *getWalker();
 
-        void invalidateAll();
+        void flushAll();
 
-        void invalidateNonGlobal();
+        void flushNonGlobal();
 
         void demapPage(Addr va, uint64_t asn);
 
diff -r 34d2e8082912 -r 43caa4ca5979 src/arch/x86/utility.cc
--- a/src/arch/x86/utility.cc   Mon Jan 07 13:05:39 2013 -0500
+++ b/src/arch/x86/utility.cc   Mon Jan 07 13:05:40 2013 -0500
@@ -213,8 +213,8 @@
         dest->setMiscRegNoEffect(i, src->readMiscRegNoEffect(i));
     }
 
-    dest->getITBPtr()->invalidateAll();
-    dest->getDTBPtr()->invalidateAll();
+    dest->getITBPtr()->flushAll();
+    dest->getDTBPtr()->flushAll();
 }
 
 void
diff -r 34d2e8082912 -r 43caa4ca5979 src/sim/tlb.hh
--- a/src/sim/tlb.hh    Mon Jan 07 13:05:39 2013 -0500
+++ b/src/sim/tlb.hh    Mon Jan 07 13:05:40 2013 -0500
@@ -65,6 +65,11 @@
     virtual void demapPage(Addr vaddr, uint64_t asn) = 0;
 
     /**
+     * Remove all entries from the TLB
+     */
+    virtual void flushAll() = 0;
+
+    /**
      * Get the table walker master port if present. This is used for
      * migrating port connections during a CPU takeOverFrom()
      * call. For architectures that do not have a table walker, NULL
@@ -75,6 +80,8 @@
      */
     virtual BaseMasterPort* getMasterPort() { return NULL; }
 
+    void memInvalidate() { flushAll(); }
+
     class Translation
     {
       public:
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to