Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/34979 )

Change subject: arch-x86: Replace any getDTBPtr/getITBPtr usage
......................................................................

arch-x86: Replace any getDTBPtr/getITBPtr usage

The getMMUPtr should be used instead

Change-Id: I363c2b50abdd5d2d8442ebf5892eaf17c99c129a
Signed-off-by: Giacomo Travaglini <[email protected]>
---
M src/arch/x86/faults.cc
M src/arch/x86/isa.cc
M src/arch/x86/remote_gdb.cc
M src/arch/x86/tlb.hh
M src/arch/x86/utility.cc
5 files changed, 20 insertions(+), 12 deletions(-)



diff --git a/src/arch/x86/faults.cc b/src/arch/x86/faults.cc
index 36cc47e..b786af6 100644
--- a/src/arch/x86/faults.cc
+++ b/src/arch/x86/faults.cc
@@ -137,8 +137,7 @@
 {
     if (FullSystem) {
// Invalidate any matching TLB entries before handling the page fault.
-        tc->getITBPtr()->demapPage(addr, 0);
-        tc->getDTBPtr()->demapPage(addr, 0);
+        tc->getMMUPtr()->demapPage(addr, 0);
         HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
         X86FaultBase::invoke(tc);
         // If something bad happens while trying to enter the page fault
diff --git a/src/arch/x86/isa.cc b/src/arch/x86/isa.cc
index a142bcf..5c557ae 100644
--- a/src/arch/x86/isa.cc
+++ b/src/arch/x86/isa.cc
@@ -239,8 +239,7 @@
                 }
             }
             if (toggled.pg) {
-                dynamic_cast<TLB *>(tc->getITBPtr())->flushAll();
-                dynamic_cast<TLB *>(tc->getDTBPtr())->flushAll();
+                dynamic_cast<MMU *>(tc->getMMUPtr())->flushAll();
             }
             //This must always be 1.
             newCR0.et = 1;
@@ -255,15 +254,13 @@
       case MISCREG_CR2:
         break;
       case MISCREG_CR3:
-        dynamic_cast<TLB *>(tc->getITBPtr())->flushNonGlobal();
-        dynamic_cast<TLB *>(tc->getDTBPtr())->flushNonGlobal();
+        dynamic_cast<MMU *>(tc->getMMUPtr())->flushNonGlobal();
         break;
       case MISCREG_CR4:
         {
             CR4 toggled = regVal[miscReg] ^ val;
             if (toggled.pae || toggled.pse || toggled.pge) {
-                dynamic_cast<TLB *>(tc->getITBPtr())->flushAll();
-                dynamic_cast<TLB *>(tc->getDTBPtr())->flushAll();
+                tc->getMMUPtr()->flushAll();
             }
         }
         break;
diff --git a/src/arch/x86/remote_gdb.cc b/src/arch/x86/remote_gdb.cc
index 9603b90..892ef41 100644
--- a/src/arch/x86/remote_gdb.cc
+++ b/src/arch/x86/remote_gdb.cc
@@ -68,8 +68,8 @@
 RemoteGDB::acc(Addr va, size_t len)
 {
     if (FullSystem) {
-        Walker *walker = dynamic_cast<TLB *>(
-            context()->getDTBPtr())->getWalker();
+        Walker *walker = dynamic_cast<MMU *>(
+            context()->getMMUPtr())->getDataWalker();
         unsigned logBytes;
         Fault fault = walker->startFunctional(context(), va, logBytes,
                                               BaseTLB::Read);
diff --git a/src/arch/x86/tlb.hh b/src/arch/x86/tlb.hh
index 4cf2eb4..8af09d3 100644
--- a/src/arch/x86/tlb.hh
+++ b/src/arch/x86/tlb.hh
@@ -174,6 +174,19 @@
     {
       public:
         MMU(const X86MMUParams *p);
+
+        void
+        flushNonGlobal()
+        {
+            static_cast<TLB*>(itb)->flushNonGlobal();
+            static_cast<TLB*>(dtb)->flushNonGlobal();
+        }
+
+        Walker*
+        getDataWalker()
+        {
+            return static_cast<TLB*>(dtb)->getWalker();
+        }
     };
 }

diff --git a/src/arch/x86/utility.cc b/src/arch/x86/utility.cc
index 33b9371..70e8901 100644
--- a/src/arch/x86/utility.cc
+++ b/src/arch/x86/utility.cc
@@ -86,8 +86,7 @@
     // CPU switch have different frequencies.
     dest->setMiscReg(MISCREG_TSC, src->readMiscReg(MISCREG_TSC));

-    dest->getITBPtr()->flushAll();
-    dest->getDTBPtr()->flushAll();
+    dest->getMMUPtr()->flushAll();
 }

 void

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34979
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I363c2b50abdd5d2d8442ebf5892eaf17c99c129a
Gerrit-Change-Number: 34979
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to