diff mbox series

[edk2,platforms:,05/13] Marvell/Armada: Use 4k/64k aligned sections for DXE/DXE-rt modules

Message ID 1507568462-28775-6-git-send-email-mw@semihalf.com
State Superseded
Headers show
Series None | expand

Commit Message

Marcin Wojtas Oct. 9, 2017, 5 p.m. UTC
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Enable strict memory protection at boot time and under the OS, by using
4 KB section alignment for DXE_DRIVER, UEFI_DRIVER and UEFI_APPLICATION
modules, and 64 KB alignment for DXE_RUNTIME_DRIVER modules. Note that
the latter is mandated by the UEFI spec.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Signed-off-by: Marcin Wojtas <mw@semihalf.com>

---
 Platform/Marvell/Armada/Armada.dsc.inc | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
1.8.3.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Leif Lindholm Oct. 10, 2017, 2:44 p.m. UTC | #1
On Mon, Oct 09, 2017 at 07:00:54PM +0200, Marcin Wojtas wrote:
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> 

> Enable strict memory protection at boot time and under the OS, by using

> 4 KB section alignment for DXE_DRIVER, UEFI_DRIVER and UEFI_APPLICATION

> modules, and 64 KB alignment for DXE_RUNTIME_DRIVER modules. Note that

> the latter is mandated by the UEFI spec.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> Signed-off-by: Marcin Wojtas <mw@semihalf.com>


Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> ---

>  Platform/Marvell/Armada/Armada.dsc.inc | 6 ++++++

>  1 file changed, 6 insertions(+)

> 

> diff --git a/Platform/Marvell/Armada/Armada.dsc.inc b/Platform/Marvell/Armada/Armada.dsc.inc

> index 433892e..1b4e713 100644

> --- a/Platform/Marvell/Armada/Armada.dsc.inc

> +++ b/Platform/Marvell/Armada/Armada.dsc.inc

> @@ -486,6 +486,12 @@

>        gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000

>    }

>  

> +[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]

> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000

> +

> +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]

> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x10000

> +

>  ################################################################################

>  #

>  # Defines - platform description macros

> -- 

> 1.8.3.1

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/Platform/Marvell/Armada/Armada.dsc.inc b/Platform/Marvell/Armada/Armada.dsc.inc
index 433892e..1b4e713 100644
--- a/Platform/Marvell/Armada/Armada.dsc.inc
+++ b/Platform/Marvell/Armada/Armada.dsc.inc
@@ -486,6 +486,12 @@ 
       gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
 
+[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
+[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x10000
+
 ################################################################################
 #
 # Defines - platform description macros