From patchwork Fri Jan 4 11:03:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154760 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495626ljp; Fri, 4 Jan 2019 03:03:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/UDKLba3FwmltB59DgqVitiOerbkFeoqw2flRsPGw68yLEimR7ml+9sYeCgnQ9wab1NOK9f X-Received: by 2002:aa7:80d7:: with SMTP id a23mr50925574pfn.86.1546599822466; Fri, 04 Jan 2019 03:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599822; cv=none; d=google.com; s=arc-20160816; b=S5zn0kmWo6egVZnpLx6mNWiXTgzz7wmWCf6MbXbtQePNTOjaZCZ1mdvR+bSFFnTJgK RX7W6FvMMpLxjTEmTwLgaIcj568cijwkNA0yZG0aDs6OLqetguNtRPDi4L4zvt2Vb7NX vLtKPA87/a03FFnPCHdi9iAV79Rq5UigQbSgN2sa+9dPGieD1E8Ec/gjxTMcee7Ap9Im e61sPiaUxdfQsvK3HhxcjIeF7XgX2f9q8UcI9gnMAL+cye6/nv31lmFb645lbDSYxaap 7MZsf17CR/Sb2JRx+BZscPskLokNbxtvwDwC8eEAzU9wmBFuzJ6nFc9z6E++Uc/ro3c+ HsxQ== 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=cBLi/nkyMYXH1yEaCiNvMAXbnujLixEpHmSrzV6MNyV66CvX/a6V8QubYEHzpGTDZt mEvPGnXlaMo6VhF6Z2k+Ag0G5VN4qCv1hkBE+KZPU34f+loJZmymXYFWTVDYe3GUxWE5 6UFZkMEyW4BAy704XUbc2DBkLS25sy6qUiygRT0KliXsAu4sPEiBczZaA/WgeDocIEwm tFbXCwm0BsDP2X3U2AFrVZ7qoUqev/G4J5YIOzXFlrqm3ts+dwEvJ2FzvtFu8H2qTx6c PRviai9IPK8hzqZ0r+jvCsZI89gAy6MmMDOx49E8h8+HH+AAxRTtGlYHhVg4sk3BbTLn ej4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CdjgJY7C; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id s36si20600569pld.46.2019.01.04.03.03.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CdjgJY7C; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 10EE3211AE8C4; Fri, 4 Jan 2019 03:03:34 -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::542; helo=mail-ed1-x542.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (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 5C0D6211AE8B2 for ; Fri, 4 Jan 2019 03:03:32 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id f9so31427368eds.10 for ; Fri, 04 Jan 2019 03:03:32 -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=CdjgJY7C4g4U+22S3nxPqi1vMDvLzut61HLxz7hsU6TcthABKETmfa+ZRXUKUwLRke 0b7OrcoY5ST2r/JmYRrMkOCN3ZYQIU/UPJXRtecsp9OADNSMzp3PntJMNdy/qn+XCRdm jJuuH2qYkbi6mmgBDgNZa42TUd0K3IpdUdgmg= 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=ergDx4xwLcpZDyUjC84Cj3UXWTOdiT3ZDwXDeRvtnyasIA3S+OCRh2zfJaAc0DHXhT I/Fvg0jTKc/NlgT0tRusAEAYOdAvO/4eJbKDpt1dTlZkmicdATvtOIefazHegAlx4UPe WuGl0REbYYbuR01oGJ7w18KnqgbqQ5/oeJfKchsDWY0Ah1+rkDVj2eKzeKQckAMmIwcl Ug7uR0uqFjw1FahSJfr6IH1Y1I23UtMEh0V8rUhGuVYWspa4SLQV1k6XE1lYt925KLFi LXikqV9plDMz1Ob/Wnby24HNJqrVRaGbspRcV6EBagbcdYWSHuWgymFYj+E5nLnKpaqH lPoQ== X-Gm-Message-State: AJcUukeiAphdBv9I67tmtvu/eZKjTRiG9yRv2iKF4mAbuCKTzhuRVqpj zGLRSU5DiGONLEIFi3RAgkp9Hfs08UBoVA== X-Received: by 2002:a17:906:a384:: with SMTP id k4-v6mr2370267ejz.243.1546599810700; Fri, 04 Jan 2019 03:03:30 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:29 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:12 +0100 Message-Id: <20190104110315.18339-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 5/8] 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); }