From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::344; helo=mail-wm1-x344.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D24AA211B81AE for ; Wed, 16 Jan 2019 12:22:55 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id t200so3471285wmt.0 for ; Wed, 16 Jan 2019 12:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tRa+/INl89H+E9gOy7jcMxo+5Ay5bnSLAEu/QHG3RP4=; b=dZfRJ8W4jz8HYRY58Kpu6R9d7+LSkn1Cxe79WbJ4llKGlg+93kwV0FJOsCPK3Asq+S b3ih4kPJibCZLtuAo0Y1fktseTRdKc9wPsZyzNzRDw+EVURHGOe+PyG+JrAwDQs2Lv6Y mySqXc6SmH5u+qjdE39pLdvWSzMZ2jJFSt1Bc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tRa+/INl89H+E9gOy7jcMxo+5Ay5bnSLAEu/QHG3RP4=; b=LeFoYG4KM7qWv14ZRxAQmQxALg/2s61c5J1Kc5N4D4D6pgMcgXJLgsrhdaG04gOycv 51EuQHjBY6yXu6IxKQzpiGPsPuFnt2znpadCFo5tJis4txBPrqhd7I3KoG0WQDJVwKeq lXmqm/RowjO+y3Aygsrb+/4xcmztpFPP6k0T+veyGczlzwoSoZu706wWyHi2qSny5hQu qJvlrVcuuIazm2ePYyU388PANu8o0LF3X63WxKK7M6Q1FENE3VztNi0PYsr2k5Ag9bMP nXdz5FdmOloRubbMa/n8TrKonpfYvBLRzebnls493XoCNorTHeWqsBi838lU+8+P5xmN pEFQ== X-Gm-Message-State: AJcUukeLjJhoyOMA+nnWAMLXjS8bTAxv5Df+Pt0+h9c4peJSt03NvriS j0IUeM8NRE1TfAlnq1CSvfTDY1U+SCIsSw== X-Google-Smtp-Source: ALg8bN4gaZAwF2uILhUrW9CDTT8piqCWzDik691JRl/5tX4/4bjHA0AbE286cw6O+1avgYJBdwr0zA== X-Received: by 2002:a1c:ac85:: with SMTP id v127mr8061761wme.62.1547670174196; Wed, 16 Jan 2019 12:22:54 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:28df:207d:542c:1451]) by smtp.gmail.com with ESMTPSA id p139sm70901316wmd.31.2019.01.16.12.22.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 12:22:53 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: Ard Biesheuvel , Achin Gupta , Jiewen Yao , Supreeth Venkatesh , Leif Lindholm , Jagadeesh Ujja , Thomas Panakamattam Abraham , Sami Mujawar Date: Wed, 16 Jan 2019 21:22:33 +0100 Message-Id: <20190116202236.6977-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190116202236.6977-1-ard.biesheuvel@linaro.org> References: <20190116202236.6977-1-ard.biesheuvel@linaro.org> Subject: [PATCH v2 08/11] StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2019 20:22:56 -0000 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 --- StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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); } -- 2.17.1