From patchwork Fri Jan 4 11:03:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154755 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495398ljp; Fri, 4 Jan 2019 03:03:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN5RDzburCNbd80fBXW4XV0yXqyj3KPk/f/09dt9gwvM8BgG8BzcXWEzgV3XMHu8YqAXtTsQ X-Received: by 2002:a62:3adc:: with SMTP id v89mr7249124pfj.109.1546599809430; Fri, 04 Jan 2019 03:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599809; cv=none; d=google.com; s=arc-20160816; b=CUDR/Gmp6mTwkSMWMrXqq96rT9Uc3WASaKwS+2kip7m4UbL7VgvWVIXe9PM9TsAD9f 9jeDxQcMx9gBelbKHwVdfh3go98u4yNyIPCapxd1Pi9k+C35T5NCsk6ZEFNu9O5knUYl /RFPm8nFEsnn0PNrxeMWbqAsCovMMsnhxU9L6fDuCHV61Y3mG3qL1ZMzAdHef25ro9vA H6qDoCJiXjXYey6aZ4CFnfgxkZOlfiHTSuxQbBcVI0YnpLmqkOn0xXzk/8FqglzPTwZN CElgIYT6HSeRGell5ShAsikLf0yxDToqKGb5xarvBbgtAmxM3YiaosHCz/g8AhRaYmpc Og3w== 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=cB/wD6MDiEI9qj9f7KoZLtb6hzzRK+bB03b/qoXHKr4=; b=nOUyHcXppRAsez4heWCrTZFO4lS3kfQRd0CjD818nPKftuIlUKIM6fE+YYUu0jx/1f 2+PlFYgLq8Avgcclq9bIHIss3NsrNpMm73QQCDdwjkwP6XcaX61YbAhvihV3VpnCXUSo o8uYNUvNs0Ah7ApR26uO+YpwzxNdBtKSXySTROxNAyHlXdDmXczIAG/fr73AUAOZjNtT QHmzCjaVPhoS6DL1u6cn6kJWUNCdLMlsW9Mbx7pKEI8xqW0HIVrIFHqh4jSHgtdteCb9 epzX0YkcSis8Ll1ZqMqt93RU41IoLbQpMsstUORNwq3+GZAUPkv6pZZir4F64v2RueV/ DyuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WL7qOS09; 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 92si18912221plw.158.2019.01.04.03.03.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:29 -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=WL7qOS09; 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 07616211A7575; Fri, 4 Jan 2019 03:03:27 -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 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-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 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: [edk2] [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: , 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. 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel