summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa.cc
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2018-01-24 17:39:48 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2018-03-12 10:23:50 +0000
commitf1b7d0afe93497ef55e857cdd7ae9e168970bd65 (patch)
tree113712737092cff6e6227e2eef9c9d32cd1fd628 /src/arch/arm/isa.cc
parenta2df8b2f631b82b2830a64206fe50acbf12e7940 (diff)
downloadgem5-f1b7d0afe93497ef55e857cdd7ae9e168970bd65.tar.xz
arch-arm: Adding IPA-Based Invalidating instructions
This patch introduces the TLB IPA-Based invalidating instructions in aarch32. In the entry selection policy the level of translation is not taken into account. This means that no difference stands between (e.g.) TLBIIPAS2 and TLBIPAS2L. Change-Id: Ieeb54665480874d2041056f356d86448c45043cb Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/8822 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/isa.cc')
-rw-r--r--src/arch/arm/isa.cc54
1 files changed, 37 insertions, 17 deletions
diff --git a/src/arch/arm/isa.cc b/src/arch/arm/isa.cc
index 4d27c9a22..1f3f53657 100644
--- a/src/arch/arm/isa.cc
+++ b/src/arch/arm/isa.cc
@@ -1145,6 +1145,19 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc)
hyp = 1;
tlbiMVA(tc, newVal, secure_lookup, hyp, target_el);
return;
+ case MISCREG_TLBIIPAS2L:
+ case MISCREG_TLBIIPAS2LIS:
+ // mcr tlbiipas2l(is) is invalidating all matching entries
+ // regardless of the level of lookup, since in gem5 we cache
+ // in the tlb the last level of lookup only.
+ case MISCREG_TLBIIPAS2:
+ case MISCREG_TLBIIPAS2IS:
+ assert32(tc);
+ target_el = 1; // EL 0 and 1 are handled together
+ scr = readMiscReg(MISCREG_SCR, tc);
+ secure_lookup = haveSecurity && !scr.ns;
+ tlbiIPA(tc, newVal, secure_lookup, target_el);
+ return;
// TLBI by address and asid, EL0&1, instruction side only
case MISCREG_ITLBIMVA:
assert32(tc);
@@ -1330,23 +1343,7 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc)
target_el = 1; // EL 0 and 1 are handled together
scr = readMiscReg(MISCREG_SCR, tc);
secure_lookup = haveSecurity && !scr.ns;
- sys = tc->getSystemPtr();
- for (x = 0; x < sys->numContexts(); x++) {
- oc = sys->getThreadContext(x);
- Addr ipa = ((Addr) bits(newVal, 35, 0)) << 12;
- getITBPtr(oc)->flushIpaVmid(ipa,
- secure_lookup, false, target_el);
- getDTBPtr(oc)->flushIpaVmid(ipa,
- secure_lookup, false, target_el);
-
- CheckerCPU *checker = oc->getCheckerCpuPtr();
- if (checker) {
- getITBPtr(checker)->flushIpaVmid(ipa,
- secure_lookup, false, target_el);
- getDTBPtr(checker)->flushIpaVmid(ipa,
- secure_lookup, false, target_el);
- }
- }
+ tlbiIPA(tc, newVal, secure_lookup, target_el);
return;
case MISCREG_ACTLR:
warn("Not doing anything for write of miscreg ACTLR\n");
@@ -1877,6 +1874,29 @@ ISA::tlbiMVA(ThreadContext *tc, MiscReg newVal, bool secure_lookup, bool hyp,
}
}
+void
+ISA::tlbiIPA(ThreadContext *tc, MiscReg newVal, bool secure_lookup,
+ uint8_t target_el)
+{
+ System *sys = tc->getSystemPtr();
+ for (auto x = 0; x < sys->numContexts(); x++) {
+ tc = sys->getThreadContext(x);
+ Addr ipa = ((Addr) bits(newVal, 35, 0)) << 12;
+ getITBPtr(tc)->flushIpaVmid(ipa,
+ secure_lookup, false, target_el);
+ getDTBPtr(tc)->flushIpaVmid(ipa,
+ secure_lookup, false, target_el);
+
+ CheckerCPU *checker = tc->getCheckerCpuPtr();
+ if (checker) {
+ getITBPtr(checker)->flushIpaVmid(ipa,
+ secure_lookup, false, target_el);
+ getDTBPtr(checker)->flushIpaVmid(ipa,
+ secure_lookup, false, target_el);
+ }
+ }
+}
+
BaseISADevice &
ISA::getGenericTimer(ThreadContext *tc)
{