From: Kurt Kennett Date: Mon, 26 Sep 2016 22:45:02 +0000 (+0000) Subject: ArmPkg/CpuDxe: Fix MMU initialization problem X-Git-Tag: edk2-stable201903~5723 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=f6be48e9907d8bb8f8534df50049ce428c38f719 ArmPkg/CpuDxe: Fix MMU initialization problem 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 Reviewed-by: Ard Biesheuvel --- diff --git a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c index 63da8ba8cb..14fc22d7a5 100644 --- a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c +++ b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c @@ -297,6 +297,11 @@ SyncCacheConfig ( } NextRegionLength += TT_DESCRIPTOR_SECTION_SIZE; } else if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(FirstLevelTable[i])) { + // In this case 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 + // section attributes into page attributes + NextSectionAttributes = 0; Status = SyncCacheConfigPage ( i,FirstLevelTable[i], NumberOfDescriptors, MemorySpaceMap,