]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 16 Jan 2019 20:22:33 +0000 (21:22 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 21 Jan 2019 13:42:16 +0000 (14:42 +0100)
The special handling of the EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
attribute is only necessary for images that are relocated twice, i.e.,
in the context of SetVirtualAddressMap (). This does not apply to
standalone MM modules, so drop the check.

Drop some redundant DEBUG output while at it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c

index 1c9fec2019165c6b7878d6e730986bc6f0a1d215..f6bfcc875751b1fabf16bdab336673daafb08038 100644 (file)
@@ -145,8 +145,7 @@ UpdatePeCoffPermissions (
 \r
     if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_EXECUTE) == 0) {\r
 \r
-      if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_WRITE) == 0 &&\r
-          TmpContext.ImageType != EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {\r
+      if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_WRITE) == 0) {\r
 \r
         DEBUG ((DEBUG_INFO,\r
           "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n",\r
@@ -158,14 +157,10 @@ UpdatePeCoffPermissions (
           __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize));\r
       }\r
     } else {\r
-        DEBUG ((DEBUG_INFO,\r
-          "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n",\r
-           __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize));\r
-        ReadOnlyUpdater (Base, SectionHeader.Misc.VirtualSize);\r
-\r
         DEBUG ((DEBUG_INFO,\r
           "%a: Mapping section %d of image at 0x%lx with RO-X permissions and size 0x%x\n",\r
           __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize));\r
+        ReadOnlyUpdater (Base, SectionHeader.Misc.VirtualSize);\r
         NoExecUpdater (Base, SectionHeader.Misc.VirtualSize);\r
     }\r
 \r