Bobby R. Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/25466 )

Change subject: arch-arm: ArmISA::clear, inval TLB cached miscregs
......................................................................

arch-arm: ArmISA::clear, inval TLB cached miscregs

ArmISA::clear resets the value of the architecture registers. Some of
these are cached in ArmTLB, including SCTLR. This patch invalidates the
cached copies on clear; this fixes a bug when resetting CPU cores by which
the cached SCTLR was used and SCTLR.M was set, resulting in non-arch
compliant reset behaviour and a PA being treated as a VA on translation.

Change-Id: I8d4eeeaf807325bd7b300a7a317abfa40ad23c87
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25466
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Maintainer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/arm/isa.cc
M src/arch/arm/isa.hh
2 files changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Giacomo Travaglini: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/arm/isa.cc b/src/arch/arm/isa.cc
index f6faf5b..205f82f 100644
--- a/src/arch/arm/isa.cc
+++ b/src/arch/arm/isa.cc
@@ -120,6 +120,15 @@
 }

 void
+ISA::clear(ThreadContext *tc)
+{
+    clear();
+    // Invalidate cached copies of miscregs in the TLBs
+    getITBPtr(tc)->invalidateMiscReg();
+    getDTBPtr(tc)->invalidateMiscReg();
+}
+
+void
 ISA::clear()
 {
     const Params *p(params());
diff --git a/src/arch/arm/isa.hh b/src/arch/arm/isa.hh
index 89be015..736c395 100644
--- a/src/arch/arm/isa.hh
+++ b/src/arch/arm/isa.hh
@@ -463,7 +463,7 @@
         }

       public:
-        void clear(ThreadContext *tc) { clear(); }
+        void clear(ThreadContext *tc);

       protected:
         void clear();

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/25466
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: I8d4eeeaf807325bd7b300a7a317abfa40ad23c87
Gerrit-Change-Number: 25466
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to