]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuDxe: Fix MMU initialization problem
authorKurt Kennett <Kurt.Kennett@microsoft.com>
Mon, 26 Sep 2016 22:45:02 +0000 (22:45 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 26 Sep 2016 22:50:28 +0000 (15:50 -0700)
During Mmu initialization in the CpuDxe, for a page table any bits set
in the 'NextSectionAttributes' are garbage and were set from bits that
are actually part of the pagetable address.  We clear it out to zero
so that the SyncCacheConfigPage will use the page attributes instead
of trying to convert the (bogus) section attributes into page
attributes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Kurt Kennett <kurt.kennett@microsoft.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Drivers/CpuDxe/Arm/Mmu.c

index 63da8ba8cb88567b6ed8943ffcb22903ede1e56f..14fc22d7a59fb1637aeca74305a9a28aa518a803 100644 (file)
@@ -297,6 +297,11 @@ SyncCacheConfig (
       }\r
       NextRegionLength += TT_DESCRIPTOR_SECTION_SIZE;\r
     } else if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(FirstLevelTable[i])) {\r
       }\r
       NextRegionLength += TT_DESCRIPTOR_SECTION_SIZE;\r
     } else if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(FirstLevelTable[i])) {\r
+      // In this case any bits set in the 'NextSectionAttributes' are garbage and were set from\r
+      // bits that are actually part of the pagetable address.  We clear it out to zero so that\r
+      // the SyncCacheConfigPage will use the page attributes instead of trying to convert the\r
+      // section attributes into page attributes\r
+      NextSectionAttributes = 0;\r
       Status = SyncCacheConfigPage (\r
           i,FirstLevelTable[i],\r
           NumberOfDescriptors, MemorySpaceMap,\r
       Status = SyncCacheConfigPage (\r
           i,FirstLevelTable[i],\r
           NumberOfDescriptors, MemorySpaceMap,\r