From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.2519.1617654371219990104 for ; Mon, 05 Apr 2021 13:26:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=e/32Xjz8; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: W76NN6u2ILnef2yq/7en5ugi0Jiw7q96zMg3JQAQA6wc0VVDyWLG+sPkH/EjbJzCacG8/b839Q thqhbA3dn1IA== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="193031117" X-IronPort-AV: E=Sophos;i="5.81,307,1610438400"; d="scan'208,217";a="193031117" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 13:26:00 -0700 IronPort-SDR: oLhdoOQa8I6e11scAMZqWeRk337iRfhNOJUuUpEw1C5SZzJlpICqocGIKSwv4+D2pZpUU0OuB8 MG9vHgk1VRTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,307,1610438400"; d="scan'208,217";a="447558896" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by FMSMGA003.fm.intel.com with ESMTP; 05 Apr 2021 13:26:00 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 5 Apr 2021 13:26:00 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Mon, 5 Apr 2021 13:26:00 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.52) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Mon, 5 Apr 2021 13:26:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScuCR5kethyFqms69d0QReXbW5K5o3TzlOnvPPuAnBr8/o/Sd/AcIbdx5xXt+XVNCc9uCzbH2vKenkYHZDbZqs/jYivKkaYE7PyplaBggF+1zyeBmiI6HHPwD4EXRvD2liakXXz1amOxPoykHdF0DoWcqteQEtuov3unotFgBMMW/xr0LjaaZBXct84JWnpP4AKNpw6E38iORO2Szq5Qf0oD5bmhMVoHu6d1w7nadxJtwdee6qGY1HfNyw6Vsv+wH2u90S6QQTW3g+OVL1E+XKzK49C8q58JBGDCjrJVFeoverjb1L99Uyd9MTfZ1pwGiUbY63xE8ywsaKMdP+kw9Q== 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-SenderADCheck; bh=Bi67DX8iltfD/p5+XPHkZHwZR4XTyK6DrqEeTpCWU+g=; b=e+XYuSQ143Qvh2T7BPe4b+sxNFyTrRzIvBxTKB2+E6ZHSikBI+NfHEHKcOjpA+OXboNp8rRs0LFARo88MIy2yYqh5qJj6KZax1Wmst4V1fFvC/rfN6LS08Z4FkgSqFPqtXMc9+izT87exNQdrtnD5LFeEiuZMLGxQNc4XbX0oADZBeYV6qF3sqdbGbJq2/8FHSETIXgy7JTffIbJGYwn0XwwlfySGG5QNKv9e2EILgYjqyrobx+R+bqeUJqMblHLk6tNiTQLWjWYfrO9S0v6l+yz4m+dV5R9g19McC5UH3TAKqxdTJgpaO4r07Mquzd4eg/CgybrcOsqCbGAphYy+g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bi67DX8iltfD/p5+XPHkZHwZR4XTyK6DrqEeTpCWU+g=; b=e/32Xjz8VIin/MMrFE4qec9u6FexQtSsVqnpwVsG7I8CVeAC/1HZEVVXqRz3dte9mCiEha4WNeHhRh7ohuH7XAO34qWl3JKXMymxqiAHybXMRDHUrq6+0q45p98YbSvJfidvbvS5gg7ZwyC4ZoQ8cA/ZuAEkYec38TayY1YbZdo= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by CO1PR11MB5124.namprd11.prod.outlook.com (2603:10b6:303:94::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Mon, 5 Apr 2021 20:25:58 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::6540:bca7:645a:6788]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::6540:bca7:645a:6788%5]) with mapi id 15.20.3999.032; Mon, 5 Apr 2021 20:25:58 +0000 From: "Nate DeSimone" To: Bret Barkelew , "devel@edk2.groups.io" , "Oram, Isaac W" CC: "Chiu, Chasel" , Liming Gao , "Dong, Eric" , "Michael Kubacki" Subject: Re: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries Thread-Topic: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries Thread-Index: AQHXKTa2Cp2Y/bI0Xk6tBVdt0ZdD5aqmT8PggAACJwCAAAhCQA== Date: Mon, 5 Apr 2021 20:25:58 +0000 Message-ID: References: <20210404094039.2701-1-nathaniel.l.desimone@intel.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-04-05T19:30:04.9212353Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: microsoft.com; dkim=none (message not signed) header.d=none;microsoft.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5f28c31b-3ced-4023-b2f1-08d8f87105cc x-ms-traffictypediagnostic: CO1PR11MB5124: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k3+T9F69I1B6I3NwABECGomFGqKIdoBiSefd2/h640m4h/1J7QbE0FPxSATvmGKPjcCamOM2nVr0VvE+bFV+WcbN52tswGMlLDCQfDy/V3CVF2F858n/omz4VwLRYRWjKgCad/+YNtCkHsZXw2m5oPBbNaa1AiTm35QvUNy2q1snYz35RNA08yNN51bE4o/NLNDm7+qCQIta19ek72nI3+lZCWb3/8E06Z98XvNHnwgOeBhVo22+aHD0KpjS0BNk4qdV6dT1HcInlC0KW/q2IPTBCVvNxuzg9VFs+i9uZF3SI8+tiRn+6EshloOharlxhQAYiAbVVbE2bgr+Danih53D3ZYVlYG6w8zSQmyKDxolOkLOkKE+jwya+B1XnXG8LWL2kIzhW7MM7URgFr71s+FcZUOYpeHrd9yoG/fihHPycuB6KAW+2KBOjcTWG0/oHFd68J8qEWRO7McjtcsY/OIJMumS5vw7HWUxsE6sNmy07e10Kx35iktzhuKUJJwKL+I8ksVfvVpNsbCF1DZrIFeqv1d/GKAupiKZ1shIPRnUQqbjbrRW+utA5HJiTdxXqaJ8bbNY9kBREo/BuhCrI8L9jhMtpBZdlZfflNOt1+h9IIxY1U4R879rgBqB97CnIEYDf9CigSoUiXORk/WhmKuw1zct23wzTapvy2UXIvzojEmdc2PCjEEATqPaFcetHAC4Fj+GjRo/XD7/3eSSPGBk4aWGdA1stcsCjXwPif4AqrTP6PvQbyLZadyYenqt x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2160.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(346002)(396003)(136003)(376002)(366004)(478600001)(66574015)(8676002)(66476007)(64756008)(45080400002)(76116006)(66446008)(5660300002)(110136005)(186003)(66946007)(66556008)(38100700001)(316002)(71200400001)(4326008)(166002)(6506007)(6636002)(9686003)(966005)(55016002)(7696005)(2906002)(83380400001)(26005)(33656002)(86362001)(52536014)(54906003)(8936002)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?iso-8859-1?Q?Mwk+xMhEdMRVgPrLaW1EkvShD/R/B2dNdDA1wEEESaXYJ1DN3k1xRwj+pq?= =?iso-8859-1?Q?Hi5lb+i/wstDaSf8UgoEgNdoPWGZLoiSUTx1t/r5xvKSttH9Ptis7JaXQR?= =?iso-8859-1?Q?fr+8KWyBz0S+kOUOgtXeLBrowy6t/Bl4d8OJ4Ex/Ud+kFRmzItCoUYge/8?= =?iso-8859-1?Q?50eSSSIyktXcRJje0mOdDwwbdelfe+vZQoonOZXphVX2RrRp3qISIG3lFi?= =?iso-8859-1?Q?p90sUTUgDDpzYECpQlVGHWKUNsxgSFBph6LkgFRWJM/PS40WDAuxGpTP+U?= =?iso-8859-1?Q?WLaWDrgchtGIBdeNuwqzTXvYSb63nsPQ6HK9fxplpStbj+YC6cPdfpI0xc?= =?iso-8859-1?Q?W72Hw57s6sAgly8wBMz7Z5AmH+8nGyebdhUFfrHeillgQUSL4nxOe4Q828?= =?iso-8859-1?Q?UUpo+OuPJrQqn0F8UsPcAuKb5z2lSdleVWkANGWk4+TQl86x0+5FV789Uy?= =?iso-8859-1?Q?OQgdbLTn3HFhcO00dQGu2ZAMo02tuGzsHGXuJ/fGDAOiLee+OvInWoD4H0?= =?iso-8859-1?Q?SgOjYn4u5as4P5xSv+i3IxOOmU5062AVOVejlA6+mMy/iCXjX4GgEJOaKg?= =?iso-8859-1?Q?ZYZ4jmlk+wK6cF85n+5Q1jpcHYb/PtcbWvhDN3n0ezZDmRaqosve9Rx2wp?= =?iso-8859-1?Q?poYE0L0Hz+dPPnAoXo1UkzJfWZJm+IKwZ0EBmzq0bTqsImdsOrfPtlwhLS?= =?iso-8859-1?Q?BpEZWJkSVty9JPEswyeHCThzaZtrhKx7PMw5Fa0VKUzF2Qwbu2ppPrp2PL?= =?iso-8859-1?Q?RQoE+9whVJ9HeEpwIZi1QFf7FXiqehLr335fPGHT9LLK6e1eqFMi32tmKt?= =?iso-8859-1?Q?YcnCRY0xr+XLGCK9/A2igFWHuTRVcs8/bSdJwQdCsj/7W75zpg3IWlDuNe?= =?iso-8859-1?Q?tiEl6Is/Z4aOn6hJfwZ8HloXEh1+Hycp/j2JCuGbsqY7CDZ1kQCGKMflxT?= =?iso-8859-1?Q?xxYc+zX88/zeh77CU+tdz+Ch0hyzhTw0dF6rMJESyrgOpWz2nQGgsDBJi1?= =?iso-8859-1?Q?lFiXTwtOxxR6DNnzk6Zsua3zu2We2NFSWZgfGfXNaWrdUp3MT5iUdnaG9S?= =?iso-8859-1?Q?2O9NyjxHDW+IdQ+GiW2myx5q6l/PP2y1xr2X2j1UJ/OctxWRHQk8nk7mLz?= =?iso-8859-1?Q?sP9M4wRezdVdXPpvvPcZ5nOVU6gGNQzXiv7qOX0FDmXBN28ns1VuuCOhPH?= =?iso-8859-1?Q?LVrZ/k0wPYPAqJ2kEKsEjhEBJhLjPRmeBl5TM+E72Y50VbRoK6JZbrePcf?= =?iso-8859-1?Q?Q1SNOBvjzWhLQhbaK3S6HOf3uu7iEXusfyk64vqTn5L0UDW75M9su49ege?= =?iso-8859-1?Q?03MJwuOLaaFHlfG3EfTDZQM3yI0nx+83W1CBWw0RoJgVucAJ16l66bP2qF?= =?iso-8859-1?Q?qj1LQjTxZO?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2160.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f28c31b-3ced-4023-b2f1-08d8f87105cc X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2021 20:25:58.4169 (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: sadquqhnlPPd/rsY1dCegk0FgB1877KWH1EMFMX7uvRt5E35KgzKNLQ+byqUbzkmyiBwovh7kx7aWKLVIOPoZrbKvwWL/OpacVk5Dpfoh9E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5124 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MWHPR1101MB2160FF0CB14DECCC05EDAB7FCD779MWHPR1101MB2160_" --_000_MWHPR1101MB2160FF0CB14DECCC05EDAB7FCD779MWHPR1101MB2160_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The max variable size is a build time configurable option. For those that p= roduce binary compatible drivers/OpROMs which need to work both with TianoC= ore and other vendor provided UEFI PI implementations, the luxury of recomp= iling the entire BIOS image or dictating the platform's choice for PcdMaxVa= riableSize image may not exist. From: Bret Barkelew Sent: Monday, April 5, 2021 12:31 PM To: devel@edk2.groups.io; Oram, Isaac W ; Desimone= , Nathaniel L Cc: Chiu, Chasel ; Liming Gao ; Dong, Eric ; Michael Kubacki Subject: RE: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries Na=EFve question: if max variable size is not already configurable, why no= t just do that? - Bret From: Oram, Isaac W via groups.io Sent: Monday, April 5, 2021 12:27 PM To: Desimone, Nathaniel L; devel@ed= k2.groups.io Cc: Chiu, Chasel; Liming Gao; Dong, Eric; Michael Kubacki<= mailto:Michael.Kubacki@microsoft.com> Subject: [EXTERNAL] Re: [edk2-devel] [edk2-platforms] [PATCH v2 0/4] Add L= arge Variable Libraries Series Reviewed-by: Isaac Oram > -----Original Message----- From: Desimone, Nathaniel L > Sent: Sunday, April 4, 2021 2:41 AM To: devel@edk2.groups.io Cc: Chiu, Chasel >; Li= ming Gao >; Dong,= Eric >; Michael Kubacki >; Oram, = Isaac W > Subject: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries Changes from V1: - Changed prefix from "Min" to "VarLib" - Better comments - Added more whitespace for readability - Removed unused INF sections - Better debug messages This patch series introduces libaries that enable large data sets to be st= ored using the UEFI Variable Services. At present, most UEFI Variable Servi= ces implementations have a maximum variable size of <=3D64KB. The exact val= ue varies depending on platform. These libaries enable a data set to use as much space as needed, up to the= remaining space in the UEFI Variable non-volatile storage. To implement this, I have broken the problem down into two parts: 1. Phase angostic UEFI Variable access. 2. Storage of data across multiple UEFI Variables. For the first part, I have created two new LibraryClasses: VariableReadLib and VariableWriteLib. I have provided implementation insta= nces of VariableReadLib for PEI, DXE, and SMM. For VariableWriteLib, I have provided implementation instances for DXE and= SMM. This enables code that accesses UEFI variables to be written in a mat= ter than is phase agnostic, so the same code can be used in PEI, DXE, or SM= M without modification. The second part involves another two new LibaryClasses: LargeVariableReadLib and LargeVariableWriteLib. Only one BASE implementati= on is needed for both of these as the phase dependent code was seperated ou= t in the first piece. These libraries provide logic to calculate the maximu= m size of an individual UEFI variable and split the data into as many small= er pieces as needed to store the entire data set in the UEFI Variable stora= ge. They also provide the ability to stitch the data back together when it = is read. Deleting the data will delete all variables used to store it. Cc: Chasel Chiu > Cc: Liming Gao > Cc: Eric Dong > Cc: Michael Kubacki > Cc: Isaac Oram > Signed-off-by: Nate DeSimone > Nate DeSimone (4): MinPlatformPkg: Add VariableReadLib MinPlatformPkg: Add VariableWriteLib MinPlatformPkg: Add LargeVariableReadLib MinPlatformPkg: Add LargeVariableWriteLib .../Include/Dsc/CoreCommonLib.dsc | 6 +- .../MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc | 12 +- .../MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 9 +- .../Include/Library/LargeVariableReadLib.h | 50 ++ .../Include/Library/LargeVariableWriteLib.h | 58 +++ .../Include/Library/VariableReadLib.h | 87 ++++ .../Include/Library/VariableWriteLib.h | 129 +++++ .../BaseLargeVariableReadLib.inf | 44 ++ .../LargeVariableReadLib.c | 199 ++++++++ .../BaseLargeVariableWriteLib.inf | 44 ++ .../LargeVariableWriteLib.c | 479 ++++++++++++++++++ .../DxeRuntimeVariableReadLib.c | 115 +++++ .../DxeRuntimeVariableReadLib.inf | 41 ++ .../DxeRuntimeVariableWriteLib.c | 256 ++++++++++ .../DxeRuntimeVariableWriteLib.inf | 49 ++ .../PeiVariableReadLib/PeiVariableReadLib.c | 153 ++++++ .../PeiVariableReadLib/PeiVariableReadLib.inf | 42 ++ .../SmmVariableReadCommon.c | 114 +++++ .../StandaloneMmVariableReadLib.inf | 50 ++ .../StandaloneMmVariableReadLibConstructor.c | 48 ++ .../TraditionalMmVariableReadLib.inf | 49 ++ .../TraditionalMmVariableReadLibConstructor.c | 48 ++ .../SmmVariableWriteCommon.c | 167 ++++++ .../StandaloneMmVariableWriteLib.inf | 45 ++ .../StandaloneMmVariableWriteLibConstructor.c | 48 ++ .../TraditionalMmVariableWriteLib.inf | 44 ++ ...TraditionalMmVariableWriteLibConstructor.c | 48 ++ .../Intel/MinPlatformPkg/MinPlatformPkg.dsc | 4 +- 28 files changed, 2428 insertions(+), 10 deletions(-) create mode 100644= Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableReadLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/LargeVar= iableWriteLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/Variable= ReadLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/Variable= WriteLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariabl= eReadLib/BaseLargeVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariabl= eReadLib/LargeVariableReadLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariabl= eWriteLib/BaseLargeVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariabl= eWriteLib/LargeVariableWriteLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariab= leReadLib/DxeRuntimeVariableReadLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariab= leReadLib/DxeRuntimeVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariab= leWriteLib/DxeRuntimeVariableWriteLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariab= leWriteLib/DxeRuntimeVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariableReadL= ib/PeiVariableReadLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariableReadL= ib/PeiVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadL= ib/SmmVariableReadCommon.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadL= ib/StandaloneMmVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadL= ib/StandaloneMmVariableReadLibConstructor.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadL= ib/TraditionalMmVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadL= ib/TraditionalMmVariableReadLibConstructor.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWrite= Lib/SmmVariableWriteCommon.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWrite= Lib/StandaloneMmVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWrite= Lib/StandaloneMmVariableWriteLibConstructor.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWrite= Lib/TraditionalMmVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWrite= Lib/TraditionalMmVariableWriteLibConstructor.c -- 2.27.0.windows.1 --_000_MWHPR1101MB2160FF0CB14DECCC05EDAB7FCD779MWHPR1101MB2160_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

The max variable size is a build time configurable = option. For those that produce binary compatible drivers/OpROMs which need = to work both with TianoCore and other vendor provided UEFI PI implementatio= ns, the luxury of recompiling the entire BIOS image or dictating the platform’s choice for PcdMaxVariableSiz= e image may not exist.

 

From: Bret Barkelew <Bret.Barkelew@micros= oft.com>
Sent: Monday, April 5, 2021 12:31 PM
To: devel@edk2.groups.io; Oram, Isaac W <isaac.w.oram@intel.com&= gt;; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Liming Gao <gaol= iming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>; Michael K= ubacki <Michael.Kubacki@microsoft.com>
Subject: RE: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Lib= raries

 

Na=EFve question: if max variable size is not alrea= dy configurable, why not just do that?

 

- Bret

 

From: Oram, Isaac W via groups.io
Sent: Monday, April 5, 2021 12:27 PM
To: Desimone, Nat= haniel L; devel@edk2.groups.io
Cc: Chiu, Chasel; Liming Gao; Dong, Eric; Michael Kubacki
Subject: [EXTERNAL] Re: [edk2-devel] [edk2-platforms] [PATCH v2 0/4= ] Add Large Variable Libraries

 

Series Reviewed-by: = Isaac Oram <isaac.w.oram@intel= .com>

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Sent: Sunday, April 4, 2021 2:41 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@= intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>; Michael Kubacki <michael.kubacki@micr= osoft.com>; Oram, Isaac W <isaac.w.oram@intel.com>
Subject: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries

Changes from V1:
 - Changed prefix from "Min" to "VarLib"
 - Better comments
 - Added more whitespace for readability
 - Removed unused INF sections
 - Better debug messages

This patch series introduces libaries that enable large data sets to be st= ored using the UEFI Variable Services. At present, most UEFI Variable Servi= ces implementations have a maximum variable size of <=3D64KB. The exact = value varies depending on platform.

These libaries enable a data set to use as much space as needed, up to the= remaining space in the UEFI Variable non-volatile storage.

To implement this, I have broken the problem down into two parts:

 1. Phase angostic UEFI Variable access.
 2. Storage of data across multiple UEFI Variables.

For the first part, I have created two new LibraryClasses:
VariableReadLib and VariableWriteLib. I have provided implementation insta= nces of VariableReadLib for PEI, DXE, and SMM.
For VariableWriteLib, I have provided implementation instances for DXE and= SMM. This enables code that accesses UEFI variables to be written in a mat= ter than is phase agnostic, so the same code can be used in PEI, DXE, or SM= M without modification.

The second part involves another two new LibaryClasses:
LargeVariableReadLib and LargeVariableWriteLib. Only one BASE implementati= on is needed for both of these as the phase dependent code was seperated ou= t in the first piece. These libraries provide logic to calculate the maximu= m size of an individual UEFI variable and split the data into as many smaller pieces as needed to store the ent= ire data set in the UEFI Variable storage. They also provide the ability to= stitch the data back together when it is read.
Deleting the data will delete all variables used to store it.

Cc: Chasel Chiu <chasel.chiu@i= ntel.com>
Cc: Liming Gao <gaoliming@b= yosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.c= om>
Cc: Michael Kubacki <m= ichael.kubacki@microsoft.com>
Cc: Isaac Oram <isaac.w.oram@= intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

Nate DeSimone (4):
  MinPlatformPkg: Add VariableReadLib
  MinPlatformPkg: Add VariableWriteLib
  MinPlatformPkg: Add LargeVariableReadLib
  MinPlatformPkg: Add LargeVariableWriteLib

 .../Include/Dsc/CoreCommonLib.dsc      = ;       |   6 +-
 .../MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc |  12 +-
 .../MinPlatformPkg/Include/Dsc/CorePeiLib.dsc |   9 +-
 .../Include/Library/LargeVariableReadLib.h    | = 50 ++
 .../Include/Library/LargeVariableWriteLib.h   |  58 += ++
 .../Include/Library/VariableReadLib.h     &= nbsp;   |  87 ++++
 .../Include/Library/VariableWriteLib.h     =    | 129 +++++
 .../BaseLargeVariableReadLib.inf      =         |  44 ++
 .../LargeVariableReadLib.c       =              | = 199 ++++++++
 .../BaseLargeVariableWriteLib.inf      = ;       |  44 ++
 .../LargeVariableWriteLib.c       = ;            | 479 += +++++++++++++++++
 .../DxeRuntimeVariableReadLib.c      &= nbsp;        | 115 +++++
 .../DxeRuntimeVariableReadLib.inf      = ;       |  41 ++
 .../DxeRuntimeVariableWriteLib.c      =         | 256 ++++++++++
 .../DxeRuntimeVariableWriteLib.inf     &nbs= p;      |  49 ++
 .../PeiVariableReadLib/PeiVariableReadLib.c   | 153 ++++++=
 .../PeiVariableReadLib/PeiVariableReadLib.inf |  42 ++
 .../SmmVariableReadCommon.c       = ;            | 114 += ++++
 .../StandaloneMmVariableReadLib.inf     &nb= sp;     |  50 ++
 .../StandaloneMmVariableReadLibConstructor.c  |  48 ++
 .../TraditionalMmVariableReadLib.inf     &n= bsp;    |  49 ++
 .../TraditionalMmVariableReadLibConstructor.c |  48 ++
 .../SmmVariableWriteCommon.c      &nbs= p;           | 167 ++++++=
 .../StandaloneMmVariableWriteLib.inf     &n= bsp;    |  45 ++
 .../StandaloneMmVariableWriteLibConstructor.c |  48 ++
 .../TraditionalMmVariableWriteLib.inf     &= nbsp;   |  44 ++
 ...TraditionalMmVariableWriteLibConstructor.c |  48 ++
 .../Intel/MinPlatformPkg/MinPlatformPkg.dsc   |  = ; 4 +-
 28 files changed, 2428 insertions(+), 10 deletions(-)  create m= ode 100644 Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableReadL= ib.h
 create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/Lar= geVariableWriteLib.h
 create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/Var= iableReadLib.h
 create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/Var= iableWriteLib.h
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVa= riableReadLib/BaseLargeVariableReadLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVa= riableReadLib/LargeVariableReadLib.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVa= riableWriteLib/BaseLargeVariableWriteLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVa= riableWriteLib/LargeVariableWriteLib.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeV= ariableReadLib/DxeRuntimeVariableReadLib.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeV= ariableReadLib/DxeRuntimeVariableReadLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeV= ariableWriteLib/DxeRuntimeVariableWriteLib.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeV= ariableWriteLib/DxeRuntimeVariableWriteLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariable= ReadLib/PeiVariableReadLib.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariable= ReadLib/PeiVariableReadLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= ReadLib/SmmVariableReadCommon.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= ReadLib/StandaloneMmVariableReadLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= ReadLib/StandaloneMmVariableReadLibConstructor.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= ReadLib/TraditionalMmVariableReadLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= ReadLib/TraditionalMmVariableReadLibConstructor.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= WriteLib/SmmVariableWriteCommon.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= WriteLib/StandaloneMmVariableWriteLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= WriteLib/StandaloneMmVariableWriteLibConstructor.c
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= WriteLib/TraditionalMmVariableWriteLib.inf
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariable= WriteLib/TraditionalMmVariableWriteLibConstructor.c

--
2.27.0.windows.1



 

--_000_MWHPR1101MB2160FF0CB14DECCC05EDAB7FCD779MWHPR1101MB2160_--