diff mbox series

[edk2,5/8] StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute

Message ID 20190104110315.18339-6-ard.biesheuvel@linaro.org
State Superseded
Headers show
Series StandaloneMmPkg: assorted fixes and improvements | expand

Commit Message

Ard Biesheuvel Jan. 4, 2019, 11:03 a.m. UTC
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>

---
 StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

-- 
2.17.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/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
index 1c9fec201916..f6bfcc875751 100644
--- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
+++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
@@ -145,8 +145,7 @@  UpdatePeCoffPermissions (
 
     if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_EXECUTE) == 0) {
 
-      if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_WRITE) == 0 &&
-          TmpContext.ImageType != EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {
+      if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_WRITE) == 0) {
 
         DEBUG ((DEBUG_INFO,
           "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n",
@@ -158,14 +157,10 @@  UpdatePeCoffPermissions (
           __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize));
       }
     } else {
-        DEBUG ((DEBUG_INFO,
-          "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n",
-           __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize));
-        ReadOnlyUpdater (Base, SectionHeader.Misc.VirtualSize);
-
         DEBUG ((DEBUG_INFO,
           "%a: Mapping section %d of image at 0x%lx with RO-X permissions and size 0x%x\n",
           __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize));
+        ReadOnlyUpdater (Base, SectionHeader.Misc.VirtualSize);
         NoExecUpdater (Base, SectionHeader.Misc.VirtualSize);
     }