summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-07-02 07:32:56 +0000
committerabiesheuvel <abiesheuvel@Edk2>2015-07-02 07:32:56 +0000
commit0255cfb89c1d61f7182cf1689e64ba40f2ad6764 (patch)
treefef10824f5a21916c9c6ce526208a691b417137f /MdeModulePkg/Core
parentd2f87ac0576af7f8b67e2f0179c0c5786c6271b7 (diff)
downloadedk2-platforms-0255cfb89c1d61f7182cf1689e64ba40f2ad6764.tar.xz
MdeModulePkg: enforce arch-specific alignment for split regions
The splitting of memory regions into code and data regions violates architecture specific alignment rules by using a fixed alignment of 4 KB. Replace it with EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT, which is defined appropriately on each architecture. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: "Jaben Carsey" <jaben.carsey@intel.com> Reviewed-by: "Yao, Jiewen" <Jiewen.Yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17812 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
index 0232a3ce7d..01ecca64ab 100644
--- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
+++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
@@ -785,7 +785,7 @@ SetPropertiesTableSectionAlignment (
IN UINT32 SectionAlignment
)
{
- if (((SectionAlignment & (SIZE_4KB - 1)) != 0) &&
+ if (((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) &&
((mPropertiesTable.MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) != 0)) {
DEBUG ((EFI_D_VERBOSE, "SetPropertiesTableSectionAlignment - Clear\n"));
mPropertiesTable.MemoryProtectionAttribute &= ~EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA;
@@ -1119,8 +1119,9 @@ InsertImageRecord (
}
SetPropertiesTableSectionAlignment (SectionAlignment);
- if ((SectionAlignment & (SIZE_4KB - 1)) != 0) {
- DEBUG ((EFI_D_ERROR, "!!!!!!!! InsertImageRecord - Section Alignment(0x%x) is not 4K !!!!!!!!\n", SectionAlignment));
+ if ((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {
+ DEBUG ((EFI_D_ERROR, "!!!!!!!! InsertImageRecord - Section Alignment(0x%x) is not %dK !!!!!!!!\n",
+ SectionAlignment, EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT >> 10));
PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageAddress);
if (PdbPointer != NULL) {
DEBUG ((EFI_D_ERROR, "!!!!!!!! Image - %a !!!!!!!!\n", PdbPointer));