From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.13.72; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=achin.gupta@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130072.outbound.protection.outlook.com [40.107.13.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4C15C211B63EF for ; Fri, 18 Jan 2019 01:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pYgGwP/IF8K0Lw5/Hoxytmhrj7X+/DowFvEX/5o7UHQ=; b=pOGYvFYyxNSyzWLr4jtGVJKhAYpS+69cLmJBLAmHZ2dV0GbsmBeTs0DDljmYbjhfxUmtGBSi8Vrgqnh5TiXjs4gziwzanVd4B4ijEEwCnp65tHiXmGDBy3BbKAQfxG1rWtaLli+pCQ8MMT7isOf8v4mmVkhpABJn0n0AIS16V0g= Received: from AM0PR08MB2980.eurprd08.prod.outlook.com (52.134.92.153) by AM0PR08MB3106.eurprd08.prod.outlook.com (52.134.93.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.26; Fri, 18 Jan 2019 09:26:48 +0000 Received: from AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::e1e6:4e33:e916:e4f4]) by AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::e1e6:4e33:e916:e4f4%5]) with mapi id 15.20.1537.018; Fri, 18 Jan 2019 09:26:48 +0000 From: Achin Gupta To: Ard Biesheuvel , "edk2-devel@lists.01.org" , Jiewen Yao CC: Supreeth Venkatesh , Leif Lindholm , Jagadeesh Ujja , Thomas Abraham , Sami Mujawar , nd Thread-Topic: [PATCH v2 00/11] StandaloneMmPkg: assorted fixes and improvements Thread-Index: AQHUrdk8nm2iOeV3TUubUrJe9V09QaW0wgTN Date: Fri, 18 Jan 2019 09:26:48 +0000 Message-ID: References: <20190116202236.6977-1-ard.biesheuvel@linaro.org> In-Reply-To: <20190116202236.6977-1-ard.biesheuvel@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; x-originating-ip: [82.132.233.213] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR08MB3106; 6:YBEIYLQD4F5X5/sRYUGK3A/onAHuDxncv2aUPJJ9kSTONAnIZG/1+7pxjegaeDlaQ9QAIG7KX32Ibu97oOjHmveV76BTuT7RJgptyBD7SZiM3afB98SOXwOgm0+J0K8a2DTjMy3N9syp+9ehlUYB66a/jgh3V0kvl4RSriIf2yQ7tXkAU1V/IErRoJlRB6GakkDgXuDcGjq31R5ghQy/52lKCzWteZA7XsGx1O37rhQWBG2MGECkuKlhws4RUUD+50eM24StWY8YfKZG5EFs4YPpmvRj0MK8R/qTQQhDkjYaQ2rS0cqsepQ47FBju9xPGyV+R4uIEPd+XIgzdZc6io4oExlsguvTNIw86Hwb5/siOlOa/i0F+U9xf4WtuxSKsjkPtj8h6oGoUiTCtAIJ6PJ07DtuYoudfF6ppiJNjpHc9gYDH4C7VsIkj05x4BTc0fFI1AqJnUnd5/k4yyqLvw==; 5:BI8ydeE81AjJvjFKMBO6yrP5uFNs1Qij0JTrjYcZKK1fxqNJBO4nWvidCtfly+ikEH4U51bJp3zR+4yzPME+9ITT9N2a0daSLCXhGQhILbvDU0Dl7ASsNkhB/CVZcWgXyouCWmDEXobMqbO0bItXndMRzJUaEmbrchs7pgHoPZcvwY0ibkuENdd/6QgfyE/vFKlshfmq8WgLTbQS870Qaw==; 7:bFDzVrkcT8XnlDvSnAIet760J3whjv8PUG7K5BH9Wzkqt8Ysi6XJd90xob3oJ+X8S4k93AIcy06EeX5YhqnBGfQBx38SL9aNspt6L+SsXGFwDmJKt4TH7CN0kFs4aVVq7GDHHg+fWYTMylSonAUOJQ== x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: bf22677c-2cd7-4125-232f-08d67d271278 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3106; x-ms-traffictypediagnostic: AM0PR08MB3106: nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0921D55E4F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(376002)(366004)(136003)(39860400002)(346002)(396003)(199004)(189003)(54906003)(2501003)(71190400001)(2906002)(476003)(71200400001)(316002)(11346002)(110136005)(6246003)(99286004)(256004)(86362001)(19627235002)(4326008)(105586002)(72206003)(106356001)(53936002)(6116002)(5660300001)(486006)(7696005)(55016002)(7736002)(76176011)(9686003)(8936002)(229853002)(97736004)(14454004)(81156014)(53546011)(186003)(74316002)(66066001)(81166006)(68736007)(6436002)(3846002)(478600001)(33656002)(25786009)(8676002)(6506007)(102836004)(305945005)(26005)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3106; H:AM0PR08MB2980.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ztkp4py0bf81fs9A8/dSiHoGE9d28PbLU3EW5CT5VG9nbQWteFGH77oVOLeKzIA4/9rMWkiShGi655/gHXyQMA7DgCcuELNI6LAyq9pB7SVNq5PXha5XJkLaPNwdT4hXMjAxwMoa+5OGb+VFPOt03ZMtUdporbMHAVJF0kkidUGv1rZPhKUnOWeeSByC+84uaOLVQS5qBwKymVZ5ChlnPogY3jLS6ByvK0YEEtUZuDQm5L+qkwZXDUS4ZU7nEMm0xZY03zX9lTFLDWTLURTuDR26jQ7jgrU3KCDMinJNKuuPGsDsDbke99Mq44T1wklg0tiblKXNu7kEMlvh463AweaIf3bUg+WG7bZOA1o6X3T1XbSqLjrKxgZGgcDLJ2+ehjJHGiItVrvAATLmDCUdzDvmcPzJpuTDnPH3Ue6sPlY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf22677c-2cd7-4125-232f-08d67d271278 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2019 09:26:48.5152 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3106 Subject: Re: [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: Fri, 18 Jan 2019 09:26:54 -0000 Content-Language: en-GB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Ard, For all the patches... Reviewed-by: Achin Gupta Jiewen. There are changes to the generic Standalone MM code in this series.= Do you want to have a look as well? cheers, Achin=20 ________________________________________ From: Ard Biesheuvel Sent: 16 January 2019 20:22 To: edk2-devel@lists.01.org Cc: Ard Biesheuvel; Achin Gupta; Jiewen Yao; Supreeth Venkatesh; Leif Lindh= olm; Jagadeesh Ujja; Thomas Abraham; Sami Mujawar Subject: [PATCH v2 00/11] StandaloneMmPkg: assorted fixes and improvements 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/StandaloneMm= HobLib.c create mode 100644 StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMm= HobLib.inf create mode 100644 StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib= /StandaloneMmMemoryAllocationLib.c create mode 100644 StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib= /StandaloneMmMemoryAllocationLib.inf -- 2.17.1