summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel van Tol <Michiel.VanTol@arm.com>2019-11-13 17:01:14 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2020-01-06 15:45:04 +0000
commitca7d52ebc081300885953199a5a64a5b926422c7 (patch)
treed772c4a044f49fc55c825d3a49500f08aa863e23
parent6f6bf2f90e71295e8c025e0d627e6cbd28d8b429 (diff)
downloadgem5-ca7d52ebc081300885953199a5a64a5b926422c7.tar.xz
dev-arm: Fix SMMUv3 walkMasks in page table ops
The masks did not include the high bits above the active addressing bits. This could cause overlapping issues when using high addresses. (Translated with TTBR1) Change-Id: Ib705558aac456c1b3f069e1bd3ccdd9229a1c1d2 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23764 Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r--src/dev/arm/smmu_v3_ptops.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/dev/arm/smmu_v3_ptops.cc b/src/dev/arm/smmu_v3_ptops.cc
index 05c8bc022..569b59e8a 100644
--- a/src/dev/arm/smmu_v3_ptops.cc
+++ b/src/dev/arm/smmu_v3_ptops.cc
@@ -114,9 +114,9 @@ Addr
V7LPageTableOps::walkMask(unsigned level) const
{
switch (level) {
- case 1: return mask(39, 30);
- case 2: return mask(39, 21);
- case 3: return mask(39, 12);
+ case 1: return ~mask(30);
+ case 2: return ~mask(21);
+ case 3: return ~mask(12);
default: panic("bad level %d", level);
}
}
@@ -207,10 +207,10 @@ Addr
V8PageTableOps4k::walkMask(unsigned level) const
{
switch (level) {
- case 0: return mask(47, 39);
- case 1: return mask(47, 30);
- case 2: return mask(47, 21);
- case 3: return mask(47, 12);
+ case 0: return ~mask(39);
+ case 1: return ~mask(30);
+ case 2: return ~mask(21);
+ case 3: return ~mask(12);
default: panic("bad level %d", level);
}
}
@@ -401,9 +401,9 @@ Addr
V8PageTableOps64k::walkMask(unsigned level) const
{
switch (level) {
- case 1: return mask(47, 42);
- case 2: return mask(47, 29);
- case 3: return mask(47, 16);
+ case 1: return ~mask(42);
+ case 2: return ~mask(29);
+ case 3: return ~mask(16);
default: panic("bad level %d", level);
}
}