diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-07-25 14:58:54 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-08-07 12:41:34 +0000 |
commit | 676d5fe4e882c9d073964a72c619024306fd279a (patch) | |
tree | ec35840d82a6ccda5e602c261a1da8718418ee26 /src/dev/arm/smmu_v3.cc | |
parent | e33b3aa6692b172f6db5957774a9e0289e81fa5b (diff) | |
download | gem5-676d5fe4e882c9d073964a72c619024306fd279a.tar.xz |
dev-arm: Perform SMMUv3 CFG Invalidation at device interface
In the current SMMUv3 model, multiple micro/mainTLB are present at the
device interface (SMMUv3SlaveInterface), caching translations specific
to a device.
Those distributed TLBs are checked for a translation before checking for
centralized TLBs (shared by devices), like the configuration cache, walk
cache etc. This means that if a hit in these TLBs occurs, there won't
be a need to enter configuration stage (which is where the STE and CD
are retrieved). So if we invalidate a cached configuration (in
ConfigCache), we need to invalidate those interface TLB entries as well,
otherwise in theory we will keep the same translation even after a
change in configuration tables.
Change-Id: I4aa36ba8392a530267517bef7562318b282bee25
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Michiel van Tol <michiel.vantol@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19813
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/dev/arm/smmu_v3.cc')
-rw-r--r-- | src/dev/arm/smmu_v3.cc | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/dev/arm/smmu_v3.cc b/src/dev/arm/smmu_v3.cc index 28539297c..f17ef9578 100644 --- a/src/dev/arm/smmu_v3.cc +++ b/src/dev/arm/smmu_v3.cc @@ -395,6 +395,11 @@ SMMUv3::processCommand(const SMMUCommand &cmd) case CMD_CFGI_STE: { DPRINTF(SMMUv3, "CMD_CFGI_STE sid=%#x\n", cmd.dw0.sid); configCache.invalidateSID(cmd.dw0.sid); + + for (auto slave_interface : slaveInterfaces) { + slave_interface->microTLB->invalidateSID(cmd.dw0.sid); + slave_interface->mainTLB->invalidateSID(cmd.dw0.sid); + } break; } @@ -405,12 +410,23 @@ SMMUv3::processCommand(const SMMUCommand &cmd) // range = 31 DPRINTF(SMMUv3, "CMD_CFGI_ALL\n"); configCache.invalidateAll(); + + for (auto slave_interface : slaveInterfaces) { + slave_interface->microTLB->invalidateAll(); + slave_interface->mainTLB->invalidateAll(); + } } else { DPRINTF(SMMUv3, "CMD_CFGI_STE_RANGE\n"); const auto start_sid = cmd.dw0.sid & ~((1 << (range + 1)) - 1); const auto end_sid = start_sid + (1 << (range + 1)) - 1; - for (auto sid = start_sid; sid <= end_sid; sid++) + for (auto sid = start_sid; sid <= end_sid; sid++) { configCache.invalidateSID(sid); + + for (auto slave_interface : slaveInterfaces) { + slave_interface->microTLB->invalidateSID(sid); + slave_interface->mainTLB->invalidateSID(sid); + } + } } break; } @@ -419,12 +435,24 @@ SMMUv3::processCommand(const SMMUCommand &cmd) DPRINTF(SMMUv3, "CMD_CFGI_CD sid=%#x ssid=%#x\n", cmd.dw0.sid, cmd.dw0.ssid); configCache.invalidateSSID(cmd.dw0.sid, cmd.dw0.ssid); + + for (auto slave_interface : slaveInterfaces) { + slave_interface->microTLB->invalidateSSID( + cmd.dw0.sid, cmd.dw0.ssid); + slave_interface->mainTLB->invalidateSSID( + cmd.dw0.sid, cmd.dw0.ssid); + } break; } case CMD_CFGI_CD_ALL: { DPRINTF(SMMUv3, "CMD_CFGI_CD_ALL sid=%#x\n", cmd.dw0.sid); configCache.invalidateSID(cmd.dw0.sid); + + for (auto slave_interface : slaveInterfaces) { + slave_interface->microTLB->invalidateSID(cmd.dw0.sid); + slave_interface->mainTLB->invalidateSID(cmd.dw0.sid); + } break; } |