From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.2534.1661284284450067561 for ; Tue, 23 Aug 2022 12:51:24 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WcsJiReL; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: nathaniel.l.desimone@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661284284; x=1692820284; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jfKy1V8kP+GCDKyWwfTBlUbwg8rjkXGnLcaYI9Kd3OA=; b=WcsJiReLVpHpYXUo/s5gLRaMdUDMni1VaK90Z8bpUZsaLXCklZQpSVUo BtEmk8ms4zuM7++qs5OOKJJQMXeitGykRC7MV8oCm3wugTREwsQwItGDJ 2bHadn3LMd/W475fXrzg5YO7g/sq8LKT8D/wpLKJnUhriD1jQGB1lw+HN 6DxbscNt3gKKCd9d7HLJJz85boUiRN6RDp+mYrJwA9k657bD+epOBg5P/ DyWy2ky41fwbKluXlbN0OqgSrED0GTgGBLXCSz732AL2Llwq8wdmqYn/h dCBiQA5AsveraWIp8igGP6j2Zcb91cw4WhPDtyFhNTUBgw9+8VJwQ6FhT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10448"; a="292526544" X-IronPort-AV: E=Sophos;i="5.93,258,1654585200"; d="scan'208";a="292526544" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 12:51:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,258,1654585200"; d="scan'208";a="712735781" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga002.fm.intel.com with ESMTP; 23 Aug 2022 12:51:19 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 23 Aug 2022 12:51:16 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 23 Aug 2022 12:51:15 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 23 Aug 2022 12:51:15 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.44) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 23 Aug 2022 12:51:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K9CKUs5xO7lhckmS/jvGJBmuSwNhpTeRhrGIGD8cJxQKZsZ0YXZ34u+VqRwk/FlDAKw2Xn7RSocGoj6htmaNus9vgKkFN4LCV6MoAQx8xE0z7fcbsAaKV8d5aJnJyrKTGsDha4c7whiviYNd9RAZxYm5tr48Cl5hgICmkZkii7G1RBbjcjihsa+a0A9uKhQXoCRhNIv4X0Bl51kg5V5D/D7oJWhGMHUKrR2SEpy7PhUOoQUqXPKQKPwEr/FSo0uDq6RbJTN/rlwjqNTPfqshYf3lYKb6CJrLfOttGIuhcwD3Qt7mA0V29a0mDa+mVnZpY/qBM0xITHAA05HCMOtJeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CWcBr6QnwJNZ8RtZvGDCeEJTmZE8NBeKNnska2jZPb8=; b=CpDlVxYqVcNzlaYCZ9a3PO+xrOgU0ilb9kZgu0kUoFLdgrBasT4oMNnwrJf+5+wMoMNySbcOKSntPBQ+bZpBg+CQt2t/El2LNVYKU2jbsZBYiqPZfK/Kmy9ivyA/89ckfH4Hxrx4JntyTfOrW266G3ECvmyNfqDLsSWdsYfnK5q2Ojlw8QHDTDUUr5rf9J2CL3GmNdUxs4JZQD11eS3+QnmoCkZdOADYE86U92sVDVM7vfUZUvBKR2u8XwGKpeZj8tzUlPtoo7zblQg81+ba7jzbvWlt5Vvm0R4D2U3e/Eq3UWv1WZei8lyeCuYgPn8o1Y/KxejTb2PUPoxz6ynfZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by CY4PR1101MB2182.namprd11.prod.outlook.com (2603:10b6:910:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Tue, 23 Aug 2022 19:51:12 +0000 Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::2c94:f950:2ac4:d92f]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::2c94:f950:2ac4:d92f%9]) with mapi id 15.20.5546.021; Tue, 23 Aug 2022 19:51:09 +0000 From: "Nate DeSimone" To: "Oram, Isaac W" , "devel@edk2.groups.io" , "mikuback@linux.microsoft.com" CC: "Chiu, Chasel" , "Gao, Liming" , "Dong, Eric" Subject: Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] MinPlatformPkg: Add FspNvsBuffer compression option Thread-Topic: [edk2-devel] [edk2-platforms][PATCH v2 1/1] MinPlatformPkg: Add FspNvsBuffer compression option Thread-Index: AQHYtp+8HWDoGtiaRUeyfvhSqTurcK280I2AgAAS7LA= Date: Tue, 23 Aug 2022 19:51:08 +0000 Message-ID: References: <20220823032253.1686-1-mikuback@linux.microsoft.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 871b7b0f-fcde-4974-1ba9-08da8540d302 x-ms-traffictypediagnostic: CY4PR1101MB2182:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: q8nUzQ9Qnl1rz4fgg55ZWWjEIB3r5NuBDiRd19QfJtJ9FJH/RrA6yK3JQ55+uAxe1qaUHnQPn5MbanjKvnp7Rq8R7u2zXqUZ5UmV4LzLw+8AOmNJBivcOgSTtQX4Esrtv+ESucE8QVzvOMdoeZH0xJLCp7mRxjcBtGCT8Hwu4F5LMmg3WftRqquY4Cnal78G3o99FvWn/W2NsLj1E8jbJvgSZiQtIlRkhfSruGPc7QjTjPkHmWiHuesZsvrUyU/IjgqtFTbDoZiVBtS9gxCja78251EJFWg/yEltIloNnSobLLbIRMozHxrH0zBb9Va/fzHbJOtw8+WilLT551o70kM33MJ0UNx+42A3vBbthmx7bL76dgnxmydXlQ8nEMsnUtdXJUG4VXped/81FzTE7OT8xLRKX+W4zlK8p8Ll8l07Cx3CwzXQi3LibG3REc/UEpBWzCb2uP6zP0kY5xck3QS9awX5GP3g61zGzMbtMZU4caspcKU4WWjs5taULQAGW6Xa5Y3W+PqrFKM0oCO6DdO0RgU22vKiHAVo3yHM/QTk+h2TdxMJrlxW0VgTeBlLm+Ur2yakLEBMiwRc/c8yMDBydKSnRilPferk4g/P2ecx/vcbnEyCinKwHk69zKiROZjPc832wARuP/GvFIkMrxPJ5ZmVXaEK8m2GEPCnBOAS/12S4kikFKqVwiu8gLizulzY5bihwAKaTQbkIWfLJOz8bLxPz7nsJk1ekacQE20Y/I3pTGluQx8LCt+7ZKPZjoetS2PPDP5fUx5lmEBtiLxgDUeIjrunT0XmaVFH3dcM/wIC2gSYtftOjKHSEa99ryxWOEw4TVTzvShUbf3ddA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5821.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(136003)(376002)(346002)(39860400002)(366004)(396003)(8676002)(26005)(38070700005)(53546011)(33656002)(2906002)(86362001)(6506007)(19627235002)(7696005)(9686003)(107886003)(8936002)(5660300002)(52536014)(82960400001)(55016003)(478600001)(45080400002)(966005)(71200400001)(41300700001)(38100700002)(122000001)(186003)(83380400001)(110136005)(66556008)(66476007)(66446008)(64756008)(54906003)(316002)(66946007)(76116006)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yI1Aod+86Jb7cVsckPADON1VQXV4HnwA6YG1i+h6Q6GP2q/eUod7ZOUm20bh?= =?us-ascii?Q?GYVjkA+6/KHbBgGIpXtVHQ8HScA0Ue+FHEzqlNvnqCtzIKFX0LZVq4dVV5lm?= =?us-ascii?Q?iszA9qGdh3z1IUBlhAjhZZe+tgD7NvGvgnfwL2tserPJnjljxvuQVK4qmxfI?= =?us-ascii?Q?9UplbpqfCkrZR8NIvcC9iHjRNx8QOMrQMm6oAxhQwQHuB6SIT4UGGPO/a/v7?= =?us-ascii?Q?ZRXxGkgRtxHXXFObI3wH1uIxXmOYLjkG/hdEbtsOy9T436siq/hSnGlgQO6Z?= =?us-ascii?Q?m1DSiYY6jPB25JPE0Dmv14B9lqNRsj/7xdCvHajknYI5vsNCg6QJanzwF3U7?= =?us-ascii?Q?IXzyurjBE0boud21gWutDzismMy3uwgfUfFmtlgbPmPF7xg3wYdg2t/FAstL?= =?us-ascii?Q?/d0Zl8kr0jDmUASmeWvsyUvTPQSvmJszwk/pOK6aER3n8A4A558/I3qNmSGB?= =?us-ascii?Q?BVoA7Bivb6blLG64oNRGBOuTcml2QoGT2OZIKmIsh7yL9TRwSPqUMFbQvmLt?= =?us-ascii?Q?36b7RBkUK1o1FOZqTne+IKr5EeV3WW/V5X9xI7BiN3ql2zsOo+EKV89R1B6z?= =?us-ascii?Q?tH1hT0Lm8UBTSsNZqaYwT7wWd/ExB+xitVkuf8g0B1y/OCU7vbuR0kf5iPLy?= =?us-ascii?Q?mBrGFAP1YsoLbvxAdcXWDBO9ns7VWmzIxktaZjeqYzhBY/15YQGiqup+o/Pu?= =?us-ascii?Q?4Kna3MLos8d/tqtdUjDnoAIEwXmdWFH0aRttIm6pGRg5L+3DZjD3RlkFZH5p?= =?us-ascii?Q?FIIw8U8JClzRWPd7L69CVVigICz3ssRcr4723sSF5dgqomKvihPbQhbyxzwz?= =?us-ascii?Q?y0DxaDf0Q+iSIB1gxDF8GwHGwTVkqYPDncPVxIkdf1uwwLPO8tu9TbUOo9ao?= =?us-ascii?Q?xnmWSi2oCueWbd+iogkcXfBPcViPJnHKbPRR4G5RU+iKOneLnyrkUCefc6iD?= =?us-ascii?Q?O+tebXohJhOUVhFBRWvsOdy5gABYWE17mUooM4oGg4YTwR905UkBJ5ET1UgP?= =?us-ascii?Q?QSelHu7Ypa82exG6wcKjfe2jSyFKhrRqbj7LB8budcKswOAwqrbLDKwDBo7C?= =?us-ascii?Q?9bI4duN71ZFVZrN58oUhK2sV6oChQduBhnR4s0uh1vld5qDkcLO+MbaAw7tD?= =?us-ascii?Q?nOCDLUEB6ZQZ/EsaDbo6PlyWTU+FqM7Pe+LBGapg/8ad+9sv1rnPEraByZDt?= =?us-ascii?Q?QFO1RrVDKhjtXVQDJ5a1EluXGaX3hN5pHXbo9ZVIfIt8PqlBgdMrSqgZtH79?= =?us-ascii?Q?SNHWD9pmF3Z5JTTOwAAmZ7xASKmAacTQHK28teEeURqiNzNCb4o4ZNls3Qdl?= =?us-ascii?Q?W8Ena1j7j6TDZTVaWY+p0hxXXB5WzXxgRkA+ChFkS4Ehr+NVOoT8juguXAhP?= =?us-ascii?Q?SvOb21JArdtEJQIUwROeV8OB91a+eYf62pO2wWU2CyWIkfaQhuErH5ihEaDk?= =?us-ascii?Q?MEr4Tbo5B1y0u8+z/9UiKE7c24hcCVHO3zUamFx9h0YJVTV0jjOTwrPQyWpv?= =?us-ascii?Q?6tEc2NIuFJL4gG0TJXnUJTtRT9Pywa8xFcTUYdlxG/sT93IMQNV8SmfcABMN?= =?us-ascii?Q?3OpiH/Tj5MoCyxvokjnoCRY6iFuFr2yCvEg+w/675tAuXr8qIwao4VetGSSz?= =?us-ascii?Q?SA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 871b7b0f-fcde-4974-1ba9-08da8540d302 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Aug 2022 19:51:09.0253 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rrjx5I3j3c7+1Shs8quw3YkeJgl52jV7fda+cwWxqKm13sSQ6zpBBXU6Yr3Xsv7hpPfbxSF8b/1wy57e30KZZ5guolsJ3D/Sdkqgg1QC3sc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2182 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Agreed with Isaac that having the compression capability be more general us= e would be nice. However, I think it would better match the EDK II design s= tyle if we had a second implementation of LargeVariable*Lib that added the = compression capability on top of the original LargeVariable*Lib. I also think having a PCD to explicitly control whether to apply compressio= n to the FSP NVS buffer is important. Because there are some FSP implementa= tions like ICX and SPR that already include the CompressLib inside the FSP = binary itself. On those FSP implementations, the data in the FSP_NON_VOLATI= LE_STORAGE_HOB is already compressed. Said PCD would simply control which i= nstance of the LibraryClass gets linked with SaveMemoryConfigDxe. Also agreed with Isaac to please be careful to make sure that any new Libra= ryClasses are in the Include/*.dsc files somewhere so existing boards don't= need modifications to their BoardPkg.dsc file. Thanks, Nate -----Original Message----- From: Oram, Isaac W =20 Sent: Tuesday, August 23, 2022 11:34 AM To: devel@edk2.groups.io; mikuback@linux.microsoft.com Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Gao, Liming ; Dong, Eric <= eric.dong@intel.com> Subject: RE: [edk2-devel] [edk2-platforms][PATCH v2 1/1] MinPlatformPkg: Ad= d FspNvsBuffer compression option Implementing this way will break the build for most of the open MinPlatform= ports. At minimum, please add the CompressLib to CoreCommonLib.dsc next t= o the UefiDecompressLib instantiation so that it is included automatically = for most boards. Regarding the design, I agree this is a good capability. And it makes sens= e to me to be board controlled rather than FSP controlled. I wonder if it might be better to modify the LargeVariableRead/Write such t= hat it compresses/decompresses large variables automatically. Could be con= trolled via library class instance or maybe via PatchablePerModule PCD. Bo= ards would still have a lot of control if they wanted. Regards, Isaac -----Original Message----- From: devel@edk2.groups.io On Behalf Of Michael Kuba= cki Sent: Monday, August 22, 2022 8:23 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Oram, Isaac W ; Gao, Liming = ; Dong, Eric Subject: [edk2-devel] [edk2-platforms][PATCH v2 1/1] MinPlatformPkg: Add Fs= pNvsBuffer compression option From: Michael Kubacki Adds a PCD called "PcdEnableCompressedFspNvsBuffer" that allows the "FspNvs= Buffer" UEFI variable data to be saved as compressed data. Especially due to the nature of the data saved in this variable, it compres= ses well. For example, it has been found to reduce ~63KB of data to ~13KB. = Boot time impact has been found to be negligible. The default value is FALSE to keep default behavior consistent. Decompression can be performed on the variable data using the standard Uefi= DecompressLib. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Isaac Oram Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Notes: v2: Rebase onto 9769bf28d1fc Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig= .c | 62 ++++++++++++++++---- Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig= .inf | 4 ++ Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec = | 6 ++ Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc = | 1 + 4 files changed, 60 insertions(+), 13 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/Save= MemoryConfig.c b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/= SaveMemoryConfig.c index 0215e8eeddfb..95b8cef8b32b 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo +++ ryConfig.c @@ -3,6 +3,7 @@ exists, and saves the data to nvRAM. =20 Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -10,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include #include #include @@ -19,6 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #includ= e +#include #include #include =20 @@ -38,20 +41,26 @@ SaveMemoryConfigEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; - EFI_HOB_GUID_TYPE *GuidHob; - VOID *HobData; - VOID *VariableData; - UINTN DataSize; - UINTN BufferSize; - BOOLEAN DataIsIdentical; + EFI_STATUS Status; + EFI_HOB_GUID_TYPE *GuidHob; + VOID *HobData; + VOID *VariableData; + UINTN DataSize; + UINTN BufferSize; + BOOLEAN DataIsIdentical; + VOID *CompressedData; + UINT64 CompressedSize; + UINTN CompressedAllocationPages; =20 - DataSize =3D 0; - BufferSize =3D 0; - VariableData =3D NULL; - GuidHob =3D NULL; - HobData =3D NULL; - DataIsIdentical =3D FALSE; + DataSize =3D 0; + BufferSize =3D 0; + VariableData =3D NULL; + GuidHob =3D NULL; + HobData =3D NULL; + DataIsIdentical =3D FALSE; + CompressedData =3D NULL; + CompressedSize =3D 0; + CompressedAllocationPages =3D 0; =20 // // Search for the Memory Configuration GUID HOB. If it is not present, = then @@ -73,6 +82,29 @@ SaveMemoryConfigEntryPoint ( } } =20 + if (PcdGetBool (PcdEnableCompressedFspNvsBuffer)) { + if (DataSize > 0) { + CompressedAllocationPages =3D EFI_SIZE_TO_PAGES (DataSize); + CompressedData =3D AllocatePages (CompressedAllocationPag= es); + if (CompressedData =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "[%a] - Failed to allocate compressed data bu= ffer.\n", __FUNCTION__)); + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + CompressedSize =3D EFI_PAGES_TO_SIZE (CompressedAllocationPages); + Status =3D Compress (HobData, DataSize, CompressedData, &Com= pressedSize); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "[%a] - failed to compress data. Status =3D %= r\n", __FUNCTION__, Status)); + ASSERT_EFI_ERROR (Status); + return Status; + } + } + + HobData =3D CompressedData; + DataSize =3D (UINTN)CompressedSize; + } + if (HobData !=3D NULL) { DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataLength:%d\n", DataSize)); DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataPtr : 0x%x\n", HobData)); @@ -136,6 +168,10 @@ SaveMemoryConfigEntryPoint ( DEBUG((DEBUG_ERROR, "Memory S3 Data HOB was not found\n")); } =20 + if (CompressedData !=3D NULL) { + FreePages (CompressedData, CompressedAllocationPages); } + // // This driver does not produce any protocol services, so always unload = it. // diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/Save= MemoryConfig.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfi= g/SaveMemoryConfig.inf index 61e85a658693..0f12deb131ca 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.inf +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo +++ ryConfig.inf @@ -26,6 +26,7 @@ [LibraryClasses] LargeVariableReadLib LargeVariableWriteLib BaseLib + CompressLib =20 [Packages] MdePkg/MdePkg.dec @@ -45,6 +46,9 @@ [Guids] gFspNonVolatileStorageHob2Guid ## CONSUMES gFspNvsBufferVariableGuid ## PRODUCES =20 +[Pcd] + gMinPlatformPkgTokenSpaceGuid.PcdEnableCompressedFspNvsBuffer + [Depex] gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid \ No newline at end of file diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/In= tel/MinPlatformPkg/MinPlatformPkg.dec index 8e603b7bf94b..94353cb76824 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -306,6 +306,12 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,= PcdsDynamicEx] =20 gMinPlatformPkgTokenSpaceGuid.PcdPlatformMemoryCheckLevel|0|UINT32|0x300= 00009 =20 + ## Controls whether the FSP NVS buffer is saved as compressed data. + # Data compression can significantly reduce variable storage usage for F= SP NVS buffer data. + # Platforms that choose to compress the data will need to decompress=20 + the variable data upon # extraction. + =20 + gMinPlatformPkgTokenSpaceGuid.PcdEnableCompressedFspNvsBuffer|FALSE|BO + OLEAN|0x30000010 + ## This PCD is to control which device is the potential trusted console = input device.

# For example:
# USB Short Form: UsbHID(0xFFFF,0xFFFF,0x1,0x1)
diff --git a/Platfor= m/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/M= inPlatformPkg.dsc index 09aa6fe4d51c..ae170f87d548 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc @@ -106,6 +106,7 @@ [LibraryClasses.common.DXE_DRIVER] FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/DxeFspWrapperPla= tformLib/DxeFspWrapperPlatformLib.inf TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP= ointCheckLib.inf TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointLib.in= f + CompressLib|MinPlatformPkg/Library/CompressLib/CompressLib.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestP= ointCheckLib.inf -- 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92644): https://edk2.groups.io/g/devel/message/92644 Mute This Topic: https://groups.io/mt/93197638/1492418 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.oram@intel.com] = -=3D-=3D-=3D-=3D-=3D-=3D