summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d32702d)
As reported by Eugene, the practice of sizing the address space in the
virtual memory system based on the maximum address in the table passed
to ArmConfigureMmu() is problematic, since it fails to take into account
the fact that the GCD memory space may be extended at a later time, both
for memory and for MMIO. So instead, choose the VA size identical to the
GCD memory map size, which is based on PcdPrePiCpuMemorySize on ARM
systems.
Reported-by: Eugene Cohen <eugene@hp.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
VOID* TranslationTable;\r
VOID* TranslationTableBuffer;\r
UINT32 TranslationTableAttribute;\r
VOID* TranslationTable;\r
VOID* TranslationTableBuffer;\r
UINT32 TranslationTableAttribute;\r
- ARM_MEMORY_REGION_DESCRIPTOR *MemoryTableEntry;\r
UINTN T0SZ;\r
UINTN RootTableEntryCount;\r
UINTN RootTableEntrySize;\r
UINTN T0SZ;\r
UINTN RootTableEntryCount;\r
UINTN RootTableEntrySize;\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
- // Identify the highest address of the memory table\r
- MaxAddress = MemoryTable->PhysicalBase + MemoryTable->Length - 1;\r
- MemoryTableEntry = MemoryTable;\r
- while (MemoryTableEntry->Length != 0) {\r
- TopAddress = MemoryTableEntry->PhysicalBase + MemoryTableEntry->Length - 1;\r
- if (TopAddress > MaxAddress) {\r
- MaxAddress = TopAddress;\r
- }\r
- MemoryTableEntry++;\r
- }\r
+ // Cover the entire GCD memory space\r
+ MaxAddress = (1UL << PcdGet8 (PcdPrePiCpuMemorySize)) - 1;\r
\r
// Lookup the Table Level to get the information\r
LookupAddresstoRootTable (MaxAddress, &T0SZ, &RootTableEntryCount);\r
\r
// Lookup the Table Level to get the information\r
LookupAddresstoRootTable (MaxAddress, &T0SZ, &RootTableEntryCount);\r
\r
[Packages]\r
ArmPkg/ArmPkg.dec\r
\r
[Packages]\r
ArmPkg/ArmPkg.dec\r
+ EmbeddedPkg/EmbeddedPkg.dec\r
MdePkg/MdePkg.dec\r
\r
[LibraryClasses]\r
MdePkg/MdePkg.dec\r
\r
[LibraryClasses]\r
CacheMaintenanceLib\r
MemoryAllocationLib\r
\r
CacheMaintenanceLib\r
MemoryAllocationLib\r
\r
+[Pcd.AARCH64]\r
+ gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
+\r
[Pcd.ARM]\r
gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride\r
[Pcd.ARM]\r
gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride\r
\r
[Packages]\r
ArmPkg/ArmPkg.dec\r
\r
[Packages]\r
ArmPkg/ArmPkg.dec\r
+ EmbeddedPkg/EmbeddedPkg.dec\r
MdePkg/MdePkg.dec\r
\r
[LibraryClasses]\r
ArmLib\r
CacheMaintenanceLib\r
MemoryAllocationLib\r
MdePkg/MdePkg.dec\r
\r
[LibraryClasses]\r
ArmLib\r
CacheMaintenanceLib\r
MemoryAllocationLib\r
+\r
+[Pcd.AARCH64]\r
+ gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r