From patchwork Wed Jan 16 20:22:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155748 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1096480jaa; Wed, 16 Jan 2019 12:22:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN5EYQGq28QS/dCRis436LtRr6VQ1FhNymZreQgGKzbbMPqT8LSkc233XUetPa4b9HarCBf2 X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr11676799plp.213.1547670167783; Wed, 16 Jan 2019 12:22:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547670167; cv=none; d=google.com; s=arc-20160816; b=k4hIe++rP2BdfqS6EkH+n7bh3nX+2kJvtAqYakhkMWqaDKbFFs6vi3ohnY2zs8mVEh c3pSDKXS7LJhyW7fr4a1yYSve6Jjp921F46wR0eGNKtYM8FoDEubBnaq/kOZrKbXsn6I CeNM77lbdwuUgYP1bqV11e70I/V+sxNl8hDtA1dXWai8tNa8UaSAKlcb1bjt3S0gPYVd 5aloCSNk7m81/USYT545/PFDj1/mCRgyWdM4u3QOD61b8ab33FGuEwhDdd0WJlweIbB7 TOLatGjFl1kezrLJN6jfR6e1Sypxjm+oCKFdnreqW2k+p8nf22oPX+puLKKAou0z+iDW Fy1Q== 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:message-id:date:to:from:dkim-signature :delivered-to; bh=l+oEk/xkKFS4eDnsXFR+RYLjEl7mSesqtyvOdaMaDcU=; b=SObSOL8mh/Fj53V3Ovw1QMr7/yVvyGEQckK6HLAesi/B5iaTZyWa28n7g6i4ACHhxJ a68FOvLAO/JaDi134HdFZKKdZiXNqkWVysJoBLmlMw7buDnzv0NRQP6VlnDInMNoFLJs EZ2DCP9MEzXhxwtJxTZwI25xpJTjhLAS0bC1vEh61d/Cg5lntA563TZv09fh3vIlFR7a TheWGXEsAinxHy0Tp+n6KjzKxOCmas240K7SYwQd+WnFyeNW9W3r07xDE17TKtdMWKxL XvgfShAgx8bMaczn9GbVY9mrNt8xbt14NZCJio6WV5fYlIDNugJUA1IyEVwURpMtmTMj 4m5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Wrx9HMQG; 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 t74si6843580pgc.150.2019.01.16.12.22.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 12:22:47 -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=Wrx9HMQG; 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 55C21211B113E; Wed, 16 Jan 2019 12:22:47 -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::436; helo=mail-wr1-x436.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 8E6B3211A759E for ; Wed, 16 Jan 2019 12:22:45 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id x10so8445387wrs.8 for ; Wed, 16 Jan 2019 12:22:45 -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; bh=FBu4G7OhUuoZCzo1mUex9L++Y+M3/R+NhA6ZQ/ubkjY=; b=Wrx9HMQGZC1F07nL2biaAiT9YCZhrrjn0dH6EliCa1xYVquy6wK6M5/N7BUqV3zBEA 5mzGFPHAch8xhYfKcKKsEo2c5KdYLOVjTT7D4mhvc6MoQREgEwOB071LEQhWh5Y/StsT 1MqUQO/U6cnH1Gvhej7LV5i01YDzs5c0UoQCE= 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; bh=FBu4G7OhUuoZCzo1mUex9L++Y+M3/R+NhA6ZQ/ubkjY=; b=M2BKNvz5f4FLYo47m/ruKRkyDPS5aPp/HRgm4nOMzIohw7kvq0fISyH2li+H+TZWmT i/qMBi/qW6gJa6x9WRtmR2M2CzFonjhyKrK9YWyxrPzuZ05vpwkChpFBX/GdOwRoDr61 UsistYvesgNu/CU5hOr99Co8+e071wcN51+k3ptO9kKbpUyp3fqHccPShg3+DuMq+nrX xVdm4xVjHFuwQ7e9SHS54tr0qQm5KIZn2QrJPpDb7V1V8Hf6EhIzsbi8E8Nq6AqW+Ufs YUDD16gC7/TEo8XwB5oy613QtQaVd3QwXENIkcnt8jvk6sXG8eecc7q1oBOQoprWhTQS jHQw== X-Gm-Message-State: AJcUukeUwHftnyV4T46ytQsQwIzMpYGHYl0/8H6Wx8EdVlID9IC4WQee 4F6GLIwwC/Zx3E23NNhtkFkYtcepzsp9oA== X-Received: by 2002:a5d:50c5:: with SMTP id f5mr8675556wrt.37.1547670162298; Wed, 16 Jan 2019 12:22:42 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 12:22:40 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 16 Jan 2019 21:22:25 +0100 Message-Id: <20190116202236.6977-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [edk2] [PATCH v2 00/11] StandaloneMmPkg: assorted fixes and improvements 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" This series addresses a number of issues I ran into while bringing up the standalone MM based authenticated variable store on the SynQuacer (AArch64) platform. Patches #1 - #3 are based on Jagadeesh's patch that imports some staging code into StandaloneMmPkg, with the following changes: - drop unused source files, GUID references are other unused bit, - clean up comments referring to the MM core implementation. Patches #4 - #9 are obvious fixes/improvements. Patch #10 adds support for TE formatted MM_CORE_STANDALONE binaries. This is useful given that the 4 KB section alignment we require in AArch64 implementations of standalone MM (due to the strict separation between code and date) results in 8 KB of wasted space at the start of the firmware volume. This can be reduced to 4 KB when using a TE image and the FIXED attribute in the associated [Rule] section, by leveraging an existing optimization in the FFS generation code that aligns TE images by reducing FFS padding rather than adding more. Patch #11 is another space optimization: it reuses the existing support for encapsulated compressed firmware volumes in FFS files to shrink the size of the primary standalone MM FV considerably. Again, due to alignment requirements, there is significant bloat in the uncompressed images (4 KB for the PE/COFF header, and up to 4 KB per section for the .text, .data and .reloc sections), making the absolute minimum size of any trivial MM_STANDALONE module 16 KB. Changes since v1: - add patches #1 - #3 - add Supreeth's ack to patches #4 - #7 Cc: Achin Gupta Cc: Jiewen Yao Cc: Supreeth Venkatesh Cc: Leif Lindholm Cc: Jagadeesh Ujja Cc: Thomas Panakamattam Abraham Cc: Sami Mujawar Ard Biesheuvel (11): StandaloneMmPkg: add HobLib implementation for MM_STANDALONE modules StandaloneMmPkg: add MM_STANDALONE MemoryAllocationLib implementation StandaloneMmPkg/StandaloneMmCoreHobLib: restrict to MM_CORE_STANDALONE StandaloneMmPkg/StandaloneMmCpu: fix typo Standlone -> Standalone StandaloneMmPkg/StandaloneMmCoreEntryPoint: add missing SerialPortLib ref StandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII strings StandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()s StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute StandaloneMmPkg/Core/Dispatcher: don't copy dispatched image twice StandaloneMmPkg/StandaloneMmCoreEntryPoint: permit the use of TE images StandaloneMmPkg/Core: permit encapsulated firmware volumes StandaloneMmPkg/Core/Dispatcher.c | 30 +- StandaloneMmPkg/Core/FwVol.c | 99 ++- StandaloneMmPkg/Core/StandaloneMmCore.inf | 1 + .../StandaloneMmCpu/AArch64/EventHandle.c | 2 +- .../StandaloneMmCpu/AArch64/StandaloneMmCpu.c | 6 +- .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h | 8 +- .../AArch64/StandaloneMmCpu.inf | 4 +- .../AArch64/SetPermissions.c | 109 +-- .../AArch64/StandaloneMmCoreEntryPoint.c | 7 +- .../StandaloneMmCoreEntryPoint.inf | 4 + .../StandaloneMmCoreHobLib.inf | 2 +- .../StandaloneMmHobLib/StandaloneMmHobLib.c | 649 ++++++++++++++ .../StandaloneMmHobLib/StandaloneMmHobLib.inf | 45 + .../StandaloneMmMemoryAllocationLib.c | 822 ++++++++++++++++++ .../StandaloneMmMemoryAllocationLib.inf | 42 + .../StandaloneMmPeCoffExtraActionLib.c | 9 +- 16 files changed, 1716 insertions(+), 123 deletions(-) create mode 100644 StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c create mode 100644 StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf create mode 100644 StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.c create mode 100644 StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Achin Gupta