summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Drivers/CpuDxe/AArch64
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2014-05-14 05:32:07 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-05-14 05:32:07 +0000
commit48ef4e4276fcd748f10f9a12f8dad6cc3c62ee01 (patch)
tree03f4e225817d3e3779f064932eb6e53d53664ce0 /ArmPkg/Drivers/CpuDxe/AArch64
parent7da62bc02d70f11d6294efc71ccebb65199655d0 (diff)
downloadedk2-48ef4e4276fcd748f10f9a12f8dad6cc3c62ee01.tar.gz
edk2-48ef4e4276fcd748f10f9a12f8dad6cc3c62ee01.tar.bz2
edk2-48ef4e4276fcd748f10f9a12f8dad6cc3c62ee01.zip
ArmPkg/CpuDxe/AArch64: Fixed SyncCacheConfig() when first entry is in 3-level
If the first entry of the memory map is in the third level (case when the region at 0x0 is smaller than 4KB) then its descriptor type would be TT_TYPE_BLOCK_ENTRY_LEVEL3 (=0x3) which has the same value as TT_TYPE_TABLE_ENTRY (=0x3). The first condition in GetFirstPageAttribute() needed the table level to not mix these two descriptor types. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15526 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Drivers/CpuDxe/AArch64')
-rw-r--r--ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
index 95bf10bcb2..6cba1218c6 100644
--- a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
+++ b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
@@ -32,9 +32,8 @@ GetFirstPageAttribute (
// Get the first entry of the table
FirstEntry = *FirstLevelTableAddress;
- if ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_TABLE_ENTRY) {
+ if ((TableLevel != 3) && (FirstEntry & TT_TYPE_MASK) == TT_TYPE_TABLE_ENTRY) {
// Only valid for Levels 0, 1 and 2
- ASSERT (TableLevel < 3);
// Get the attribute of the subsequent table
return GetFirstPageAttribute ((UINT64*)(FirstEntry & TT_ADDRESS_MASK_DESCRIPTION_TABLE), TableLevel + 1);