From: Michiel van Tol Date: Wed, 13 Nov 2019 17:01:14 +0000 (+0000) Subject: dev-arm: Fix SMMUv3 walkMasks in page table ops X-Git-Tag: v19.0.0.0~145 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca7d52ebc081300885953199a5a64a5b926422c7;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23764 Maintainer: Giacomo Travaglini Tested-by: kokoro --- 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); } }