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 2A6A3211A3227 for ; Fri, 4 Jan 2019 03:03:24 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id y20so31422565edw.9 for ; Fri, 04 Jan 2019 03:03:24 -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=/h6FafE7m0ZBlCa6jwNjJjz2thzYXwdu5bYpPYhHbq0=; b=WL7qOS09vYI19luYvKQs60hGysVxy6Fs+XL3SS+EVvIhewK1a9TksnZAWVOVTijtOS BEBdXpsTGSsRnN1QNXmbaQNwc6haqJlxR6rW1F6HbQU9RA4VZEo/ipVfoM8EO+LfF+m1 z4/xrHZQd3MtSSq+o/1FHEwvcP7b5e684W7Kw= 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=/h6FafE7m0ZBlCa6jwNjJjz2thzYXwdu5bYpPYhHbq0=; b=G30UEb51gkj11LJuTOG1frNVqvolKw6zlT/xDqLC2jSreSvVquZlvQno6CL0Ozw66G ZYXrDSWQBh2QUyEmuCORiZbBIA/edN3K0OFCljA8yVeOe53wlPO3FSxdj4b+ys1V6Wox qvwOPn6Qpfu5V86t0wdbKi3MbPaILjje/NKhJ80odTE+EU/CKLvr/pas0QoZhA+PK5i6 s8LPDvH67XJ3nEQDf+HIUa9NiFq9xln6mIuineD+E3XRn+yRxAPEy+SLcZo6jb9JbnW1 bBozo9Bn12vpd7nxd7KeebzsADNugXw6MfRjHyGtg9kmqfn9OO2Z8TzMwrM3VJFnLIwI zd9g== X-Gm-Message-State: AA+aEWZ2mCnkTuxhVgyPImXL3Ymh0jXnGCmnEr5Wz6K7953NZRUZOtf6 47zFTqBzuVxcSPhLBowTNtxcuFIcxu4h9Q== X-Google-Smtp-Source: AFSGD/WGKvzR1+j5u6PIFz/8L2eBjEISN8Ek3nfuhpHEURrbuZ+d8YxnXhDpbthjUQ1ouxH3D0Jq6A== X-Received: by 2002:a50:de88:: with SMTP id c8mr45438332edl.129.1546599803119; Fri, 04 Jan 2019 03:03:23 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:22 -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:07 +0100 Message-Id: <20190104110315.18339-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [PATCH 0/8] 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: Fri, 04 Jan 2019 11:03:25 -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. The first six patches are obvious fixes/improvements. Patch #7 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 #8 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. Cc: Achin Gupta Cc: Jiewen Yao Cc: Supreeth Venkatesh Cc: Leif Lindholm Cc: Jagadeesh Ujja Cc: Thomas Panakamattam Abraham Cc: Sami Mujawar Ard Biesheuvel (8): 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 + .../StandaloneMmPeCoffExtraActionLib.c | 9 +- 11 files changed, 157 insertions(+), 122 deletions(-) -- 2.17.1