From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.1644.1617650809626840678 for ; Mon, 05 Apr 2021 12:26:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Dcdjpyxl; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: isaac.w.oram@intel.com) IronPort-SDR: 50VTagebMXwFAR/rkNGKJa0rsXI14RidTxJv9kXkw77bHmyBmRkyt4uCSOtmogWH+3wMJAqxZl LSVvyZSOXv0g== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="180041211" X-IronPort-AV: E=Sophos;i="5.81,307,1610438400"; d="scan'208";a="180041211" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 12:26:48 -0700 IronPort-SDR: 59sPsOJJNLf7CbxDgAtGR6sqyy1JUwJHtTwCjnemuH00zF0dKyHo3Dszm61cXvDDgATQ2Zd3DP /0S2GOog4W9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,307,1610438400"; d="scan'208";a="597665867" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga005.jf.intel.com with ESMTP; 05 Apr 2021 12:26:48 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX604.amr.corp.intel.com (10.22.229.17) 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 12:26:47 -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.2106.2; Mon, 5 Apr 2021 12:26:47 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.2106.2 via Frontend Transport; Mon, 5 Apr 2021 12:26:47 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (134.134.137.103) 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 12:26:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zb+wTnQMINL+ZGurOxq05H8a6FpKBTuaXm7jH7xXMhbzYo2AlA8a7MXhOnJC6H25DjsHuhf1pQYWAj11dUTpmV7TMaL3FMBevXi+jO3ZfYJ4krNKcrcLoD1tAHXLpbazrKmI8zKdtl5CSLYcYRKBGoyCI88IeCSMiBAudW44SB9TMEEpWkni0OjZHfWc+/7RLFU6trX7QjCJ3tdZwYE6EFGlwk1JAO7nRhstTudc5Vqg9yYPMSO0LYgq+dExGQbecjAOPNoGSoIFb/FRYziVoKXC3ABbPAlWNvfpZj/pKuxYccdRrsYCLo/QnIu6MPsUt+9UUPrgPp3ZpYXQUzrZHg== 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=BiwENmg3DsZ1Atj4R0j63YLMvqS3ZAx7bWZXNOvghEE=; b=IJoUNAwlgolrfOkDT8TDF68M6u+he0ttrcoxQK0yIuB2acOaf4pJLobht1RIBv6qzUnezuvDpdT7xTSIv7FpwaPNd3Gecz8db8jRQQfSjcO7IN/8C3+uxZCKSqu71Vg6fMeyWdfrw2nFaC/ubz864U85SYVz235rxqnwYGqXt1ERKlmlI5WhqKNPGV3fdkyBoDgQbvFDLjZ46AjZwDgav8l/ffFbUxyoc7ZFSWfUTn3m5aCU6AYbmugHovkF7Zf7ZBX7BsxQi/2m3hvmjA8f3tzVYmgI8flhQiEVAHt59MDNjvoOMJ9kFwG/9rmzB8DfMGhCjC3drgaMeuJ9/BiPqg== 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=BiwENmg3DsZ1Atj4R0j63YLMvqS3ZAx7bWZXNOvghEE=; b=DcdjpyxlUfTk5/jlYWUkvWHN8uAy8Qf2Dhhe1wKvPERx9VB9nN+gnRsUd63fsX+aMVXVOBbjavfRDZDGKhhQ0TpHWqq/MJvKppw1Lx7jTAM6dnkq5l0gC+4TZorGWl6yXDH0f7/XXEwF2wW9YiknHEBuhe0He7JrhOY2F4Bmmqo= Received: from MW3PR11MB4747.namprd11.prod.outlook.com (2603:10b6:303:2f::11) by CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Mon, 5 Apr 2021 19:26:45 +0000 Received: from MW3PR11MB4747.namprd11.prod.outlook.com ([fe80::9479:8edc:7d14:fdee]) by MW3PR11MB4747.namprd11.prod.outlook.com ([fe80::9479:8edc:7d14:fdee%3]) with mapi id 15.20.3999.032; Mon, 5 Apr 2021 19:26:45 +0000 From: "Oram, Isaac W" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" 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/bI0Xk6tBVdt0ZdD5aqmT8Pg Date: Mon, 5 Apr 2021 19:26:45 +0000 Message-ID: References: <20210404094039.2701-1-nathaniel.l.desimone@intel.com> In-Reply-To: <20210404094039.2701-1-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [73.67.210.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a1c244b7-7411-44a5-4509-08d8f868c025 x-ms-traffictypediagnostic: CO1PR11MB5041: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8ysoNeWkRUGS9+qPZ+WgYOI+ij/IwzS7+5WPJ4sn3oEC1J93IdIRHnhLtO5q2Uq06ApQlDOXY2keDo0hRuMcxHtIqqQhC3zw0bguaxjCBBhT+rGzx5lCKKXeYquDBXwF/qfLn26M8kXgfbY1aZ3/+U3IiGDW2h2EvMDbcR03VgZ+77FjNiMKJATIRoCjWM1HZ4O28ljhik3rZidZCdNllHy+WrRzApdXeAPBg12CSlF0y/tH9CQW8jY0czYwEl0GwPa54AYbjxSwXx2doWm2Ed43gaQ10bO3vcsgm/hj0caWB3+sk+DNnBEi+XCmILvWbQF41ufVBko95315jFwVTHiSlLLrtQMFX8kS63QWGLM4Md4puw3yVzcR5i5HH4Jffy3Johii5ahGWkTaEjRZsaSejI+IAeIs8zRD7XR9pVqsxufbua/z9rJaSi/d8FYB8BsJ0i5dx5jBI1WW4jYxeCFqZmwUzHWERa0b4FHjvHcSc/Ej4A9vlOVgsHpB4PMKdTtcdc+v2y6d1qY7HqsqTI4PFj3emQEeR3lpJSvTkeXfTufJkJo2WjIC/AtFzLdO3oskYsGWTo5QP2IVtzaYolniUXSC8RD4nhz/90vzo6GIq/d9+/ZcsPyaOnuW6pZqgdQ0FDw3Db27dB6ttOqSdn6/nyiFnHu3gG5hDxopie4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4747.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(346002)(366004)(136003)(376002)(396003)(2906002)(8936002)(38100700001)(66556008)(186003)(4326008)(8676002)(83380400001)(66476007)(110136005)(54906003)(6506007)(71200400001)(7696005)(478600001)(52536014)(33656002)(26005)(5660300002)(55016002)(76116006)(66946007)(66446008)(9686003)(53546011)(316002)(64756008)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?yWH6p0yAauJX8HedWeImVmRhHQU5fzBgW0p+idAnIWy8rcZ9uIg1wlIpnXS3?= =?us-ascii?Q?7WpkIxb1Qg2pDTSi8aHY1mupeL00fD0u5gVP5UfWw2Lri3feuFBMiNCqNbfq?= =?us-ascii?Q?UmRJ4Wm1ZomTOcaVDXNPUBliEfIBFyDyW4qd6c/OpSy4ANejLpsX6v+UWhMV?= =?us-ascii?Q?2je0AdhMH+KXm4jGkRZd/XVq99a8rItTcbkIGqdtU0Ylb05b7IW/hWHGF2/9?= =?us-ascii?Q?1+dOsRT0so+TvEwA5/A/+jZsaVsabGdsARdwMVO/Vxs0uCz8Gmd6fvevQLUj?= =?us-ascii?Q?3qGLjkmKBwEoN5X+rxmjc+cOFOeUm/DCbOBkg0XTr8MCaROgw2MAYtH7YZ9B?= =?us-ascii?Q?RvkUJbRHL8XVZEtgYLP+xPF58Kg4k1m1CbReq3YPGvE70yb0aNl+SvaROvSG?= =?us-ascii?Q?L+Jsj5Oy3thEL+L9Cav9H4Ef/1a5SFGMGYqnVMRxk5dZtiJMVlyzXRmUt+mh?= =?us-ascii?Q?qUxIV0GVHUho0xl0WEgKe642g1Iu5oLUregJBWfdMZzb8llFbOo7fcdrrm7P?= =?us-ascii?Q?6pxdz1q5k3uRjYolFYWKt6mOut+xkWDSmASoEeSDAaHoakOMhRdqbF1rhLay?= =?us-ascii?Q?geD5XSwC/bBla512A1sBK9gmg10kKrPOcn9ObR6Wyq9wmaN89blvzjOW4uIH?= =?us-ascii?Q?Ja7+aBQIRabadH0VnUtrayomkcvS9+opXXsmz+vACnMl52o4UKkuCfmrpMtR?= =?us-ascii?Q?UVxxvYsEtBYItYunog+/Podg+BqEgPLCRcgkAn5irSuV6lsK+AIEsGI5OzvX?= =?us-ascii?Q?THkutCRse1jPhkGeTf/F+NULfEVUUqZ1QWzcv3BJHBj8uMgn4v5Am+K7E21z?= =?us-ascii?Q?4SpLDUhimXs/hO/u46QT7TH8pQqKo1U3RMAY1CRarisFlnUmTdzt1QNHxJR8?= =?us-ascii?Q?ciAd9Caco0wx/p7LskaQeqD/MY5YbHcDjOHhgMpy3LMm2bQdQGyfd0AMoOdn?= =?us-ascii?Q?1/JwLA9GHewY7GcAxzdsUCf+gF1HKg4iySQ6Rezl1vmpwHap8O68zN9qsBcl?= =?us-ascii?Q?ZHfSpHtoay42/Is9LgSUXEruKTBTG/lo5aXeTn7+C6Vo9SZy50PT7whe/zit?= =?us-ascii?Q?EggGFZ14N4P1DiT7SArTC4RI+RjIcG1INgDhmpnwgOydvA3MADEK+e4gKXKH?= =?us-ascii?Q?JT3eyo9F8jJ8y5E3ReWFckerBniY9Qojj/35ctKb4tMw3bxfPW0a35zzSzo1?= =?us-ascii?Q?AW5VI3XZqB2rNx9HWTEPBHM0UYgdEI1fPkGPcZCRjjNyfd2Qid2p1hPmYDyf?= =?us-ascii?Q?oIyp0cX9uYJtcVUC3eHAjKuU0tfl9Ct0FvY7WPfjsNw9lqVIFMQOKXEx3pcV?= =?us-ascii?Q?KX7SPI2MzfiU9QEEwmPsIu8q?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4747.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1c244b7-7411-44a5-4509-08d8f868c025 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2021 19:26:45.6382 (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: hkT1eiqdfjKUYog1+RF2DrVNod6glWFxP660HtYf/nsuxYrtaoTUUKakvr0e2lgTB2dwmUwXAyrvmTuC+pqd0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Series Reviewed-by: Isaac Oram -----Original Message----- From: Desimone, Nathaniel L =20 Sent: Sunday, April 4, 2021 2:41 AM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Liming 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 sto= red using the UEFI Variable Services. At present, most UEFI Variable Servic= es implementations have a maximum variable size of <=3D64KB. The exact valu= e 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 instan= ces 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 matt= er than is phase agnostic, so the same code can be used in PEI, DXE, or SMM= without modification. The second part involves another two new LibaryClasses: LargeVariableReadLib and LargeVariableWriteLib. Only one BASE implementatio= n is needed for both of these as the phase dependent code was seperated out= in the first piece. These libraries provide logic to calculate the maximum= size of an individual UEFI variable and split the data into as many smalle= r pieces as needed to store the entire data set in the UEFI Variable storag= e. They also provide the ability to stitch the data back together when it i= s 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/LargeVari= ableWriteLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/VariableR= eadLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/VariableW= riteLib.h create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariable= ReadLib/BaseLargeVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariable= ReadLib/LargeVariableReadLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariable= WriteLib/BaseLargeVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariable= WriteLib/LargeVariableWriteLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariabl= eReadLib/DxeRuntimeVariableReadLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariabl= eReadLib/DxeRuntimeVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariabl= eWriteLib/DxeRuntimeVariableWriteLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariabl= eWriteLib/DxeRuntimeVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLi= b/PeiVariableReadLib.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLi= b/PeiVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLi= b/SmmVariableReadCommon.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLi= b/StandaloneMmVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLi= b/StandaloneMmVariableReadLibConstructor.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLi= b/TraditionalMmVariableReadLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLi= b/TraditionalMmVariableReadLibConstructor.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteL= ib/SmmVariableWriteCommon.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteL= ib/StandaloneMmVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteL= ib/StandaloneMmVariableWriteLibConstructor.c create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteL= ib/TraditionalMmVariableWriteLib.inf create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteL= ib/TraditionalMmVariableWriteLibConstructor.c -- 2.27.0.windows.1