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::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-Google-Smtp-Source: ALg8bN6NnSIZBLgpkVkPXKgKZ+h5gS2hftLPB1euRagFTnSxhxddfHWpvspNDV09S5y6lMfG6orJSA== 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 Cc: Ard Biesheuvel , Achin Gupta , Jiewen Yao , Supreeth Venkatesh , Leif Lindholm , Jagadeesh Ujja , Thomas Panakamattam Abraham , Sami Mujawar 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: [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: , X-List-Received-Date: Fri, 04 Jan 2019 11:03:32 -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