From patchwork Wed Jan 16 20:22:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155756 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1097024jaa; Wed, 16 Jan 2019 12:23:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN6BtdLkjbAcZJSIJxIgpChHeHSEuypgxILxtSs7EH5OnRv5gwnWlLtk0n2YTlTIoGXma2zx X-Received: by 2002:a81:ad26:: with SMTP id l38mr9266222ywh.439.1547670194725; Wed, 16 Jan 2019 12:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547670194; cv=none; d=google.com; s=arc-20160816; b=H3GyCUaVh6cW4sD16OzZQp8HT6ii/TLl+Ynj0qcoH3O/RX+3bNp7jW9aEAvcSpLsft SvzMGYYBZ1rbGurewWgDzschs7U8GiwAP17qtSbY4Z9I+4SV1yWeRAErmwqxgurgFn5H HQJdj3wXiPWZ19zOWlxK8Wp+2aHYgBnOsDiwd/D3YfjLsgBLNXAa7z1rrhA4ZoVB4nox KbhXxwG/RnzhbHfbtTIZzD8ZKZqkaI226QTKrjlFmpCaSoXv9iFlPsAcH2MgiEaUc3BM vCG+uK9D5UCvkBbXh9uTx9QGlQtuPHF8n8s0OME1WgM6oxtkwOf2qyuJWDSEnmZGIkc5 1+mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=D479i1fKXoxmMu7EIVj3i4NBXRk4+jmTiJghqIEEWt8=; b=mR7nKkX62X8WWZj4tc7wIrC1/ysDB5xUffBQdGSIK7RmGbArd50Q/ywD18W3ExOL++ OI+HU/Yc8PFmzq+FQ48SCKDAHqeygChL9vmgHIGUa4TZzM6sYuOA+OY1Fe8i+rNd9/hu omufMrldUySsdjg0AhJq6AC/BhhO6H/+88E53UWKUduNdnpxBUY4sxk9RQcV7GOT3WCK cq7ds5Jo4iTvPM2xuUkzSAYUg1fg/TNikm/8V4d9PRpwp+PTynsybBCY7jWbq0nc8Gj7 DfKCn8m63rPlSLSBki2z35i2ZTfiVHRrMu3G8H3Jn6IdLPSfJEwRTIQUiHYAW0cYhYaz YlkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dZfRJ8W4; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id y6si4888828ywd.262.2019.01.16.12.23.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 12:23:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dZfRJ8W4; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EBAA4211B81AE; Wed, 16 Jan 2019 12:22:56 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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); }