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::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-Google-Smtp-Source: ALg8bN5KQRNmU48HFMwTSGECQZqkI9752ppzClbI8dyPE9kkIX2e4pv68KvgHycR1ylTYV2eh3Jy6A== 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 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:25 +0100 Message-Id: <20190116202236.6977-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [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: , X-List-Received-Date: Wed, 16 Jan 2019 20:22:46 -0000 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