From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.2885.1617771635759358969 for ; Tue, 06 Apr 2021 22:00:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=uolK/TFl; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: chasel.chiu@intel.com) IronPort-SDR: vu29Nhnmjs+LbBBzXCrXA0Uu/L5fvasiscW4G+NezOmk0UmAA7eX1tJqtkzI5CQqAjqmrEMYu3 bGAX+Y2Zqfdg== X-IronPort-AV: E=McAfee;i="6000,8403,9946"; a="190017766" X-IronPort-AV: E=Sophos;i="5.82,201,1613462400"; d="scan'208";a="190017766" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2021 22:00:34 -0700 IronPort-SDR: vc8yIsdgVyBrxmZhvWgOe8ymiF3zFXlL7GTlOqvb2Y0WplA+znVw/8NVOltJrZTJloJyGz9gjI 0mhuBVgD9Zsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,201,1613462400"; d="scan'208";a="396517484" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 06 Apr 2021 22:00:34 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 6 Apr 2021 22:00:33 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) 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; Tue, 6 Apr 2021 22:00:33 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Tue, 6 Apr 2021 22:00:33 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 6 Apr 2021 22:00:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jv90p2dZuVMbHQ3ZpZbdDEaMUnIHTlVjcXOzqC6o8svHhNLZj1iRg2lSM0LNvpM3egEhRKoX1r+FWi6iy4d1qn8UvJIBHI/+s9usGdV//+84B74CUF2wSYz3D/gvgUoL57f1T6b9FevrbdJsEl7yoHicbdwW9ZSJaWwYRTbfmEPNIdYqEahiDA3ve1HjM8otlYpaT2SYryBbJgA2N+fd4F4UItIR8l5i0cuNENTTtGVHXrJr+8YMDEjPknx1Ysye7PN5QDzBm7I05fmC1dAHKnl/2ahus5jjKUFem9Sis6NQyPNzsvnHKcZFhaOcSe0kFdtfWiE9zY4CxZo1IpC/OQ== 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=STC3eKtOg4XjkfC/oZ2xx+8+YaJkykBv2POiPNVr9bw=; b=n2OOGv2eoq4rRL3Rk/QBQ8samApH3pt74ARbKWYcHFaww2IXiZqCGhq/Ud9WkbwTHNOGG6Ot5hbUcqjI9a3IWRyxgoiVNJUJe3d0D7I7AJNqc6YYqKhJR6ucHA4vTNCIELru6S8QhiIxey7c2s/gKyqu8T5GEX9Plq+WM7yUEb2dWw2b9eqNu5J1MzvgaI+Mh3vpZFZYDJfL7wDc6tjotptiHOT/SV+ahRthh4eovcC8FK93V/Mfhz0P6Ph5sNA/f9DeT06Z91rt8104RbAA5UkyE+w1GQmlsVAhkdewcHd3+rOh4xjcpAfKW1bJXgKXea588tOawpXTYQOb7YG4Xw== 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=STC3eKtOg4XjkfC/oZ2xx+8+YaJkykBv2POiPNVr9bw=; b=uolK/TFlgwO9dSOP1cx1PvbalZel1MxwnIM4sOhRPw6rIgdd591fZgba1IctGspja44ifTmM2QRF6RyjLZKM0iXwNzsRYoxI4wysmJutOCm1qWpaeqp0XnIgU1rLyRCbpzUHP+id8RzQett87FTDTTiTMTHiGNeHWjZ5xTIpCak= Received: from SN6PR11MB2814.namprd11.prod.outlook.com (2603:10b6:805:55::15) by SN6PR11MB2864.namprd11.prod.outlook.com (2603:10b6:805:63::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 05:00:31 +0000 Received: from SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::3101:f483:8348:816]) by SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::3101:f483:8348:816%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 05:00:31 +0000 From: "Chiu, Chasel" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: Liming Gao , "Dong, Eric" , Michael Kubacki , "Oram, Isaac W" Subject: Re: [edk2-platforms] [PATCH v4 0/4] Add Large Variable Libraries Thread-Topic: [edk2-platforms] [PATCH v4 0/4] Add Large Variable Libraries Thread-Index: AQHXK1sMKnQ8bjy28E6d5GH1muj8kaqofJbg Date: Wed, 7 Apr 2021 05:00:31 +0000 Message-ID: References: <20210407030426.8075-1-nathaniel.l.desimone@intel.com> In-Reply-To: <20210407030426.8075-1-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 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: [192.55.52.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5031fb42-ca8f-426e-2ea1-08d8f982122c x-ms-traffictypediagnostic: SN6PR11MB2864: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wk3dFpB2zfDlmJior6IlegNAEHA92eqtUxo9VFyX8QQ8WxtK1rDVFviPoKaEs0zjN9K4jA55JR77zKjylpDsCn6qGY6EngNZW2RXT2USmLrauHd8r2mAKTfGOIAfJeOtacBHunGiPHghQAqWLb+kK7ZGM944ItUSSF6rClBNiHa54HtWl9J3+GDZDQYZHrJs7AElf8gMPWZwBNatNxAeEtDDDPE+h0k4/84pakUfvvJlsQPK4xxAazT0LuGff6I73QS21bV1m2l31U7cNbesCJLNzpoogOGAuzMQ+GKBHLRai77SKcac5D0h32lV8JO2yLkE7xysXFAVMXljWnpqT0ywneFVrznXdRcYd8CRArdl/wpJUUTfgproYzG8If+Mx8cvHjkOqJ8vCMliWhWkAQXqAmteAndnf/9I9pKdXqGE8DKpYpj+WQCSivqlb5Em04As3RAFDRseKAO9aubEq8c6uS/C1f4dzzdiRmu48DK364tWB/XuezswEJXpg9VUQXYraTKrPEmV3jiIEGQlX5gqx6ITdMazFGApL3Hbwh+51oi5jCr3TfVz5bnIbPireY8LJFgOOkMTWvOt4P1xBHcmXvY9nUYaqDiaxY+NJ0xMntygdYlkIoTqK5Wzwh2vrwIPRG65ODkjF0ebFrq7mQcqwfhOSF2RBwQ1odt6RAA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2814.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(346002)(39850400004)(366004)(136003)(53546011)(6506007)(66556008)(55016002)(66946007)(4326008)(107886003)(316002)(33656002)(52536014)(9686003)(110136005)(8936002)(38100700001)(54906003)(478600001)(71200400001)(7696005)(2906002)(66476007)(64756008)(76116006)(66446008)(5660300002)(86362001)(26005)(83380400001)(8676002)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Zjo9yu2iQ0X5VNzlYAimVybczmMofNVwNGSW4JuiDbLoe39r5l7MiaU4OSyC?= =?us-ascii?Q?wyQkRmi+a7R7JCXCEBml/S5JFuPYB+lyFVEPrCgu3qUkpaVkSdEFkQNB5exB?= =?us-ascii?Q?j1qB4yjn9djsLsXYKAs1xMJ3HHkcbQYNoPPlhgOdUuNAmraKFVYhsMHvvj8g?= =?us-ascii?Q?ADEGRk5NMMgZu/987VHeAgJzn1dHVS0TxjeBtq2vdP5kQptlHwueRrarmZ31?= =?us-ascii?Q?BQL68viz+wxhFQkGXmEvfKzTs7jGhUv4jcFQuBB5uPayvdfsvzsZH+RpC9Rw?= =?us-ascii?Q?qly7IMdNsLVlZmQJqUCdSDzaS1WtFXiLbz0x8Iger4gdMWXfl4VNNyCcW+9r?= =?us-ascii?Q?7Dj78oGbJjKHNH43zdXyYkvqumQiNDulCdzokZYizDVdq2gjCTDnx/5hHhLe?= =?us-ascii?Q?FjY70odEzOBYw+e9hpihKJkc8iqAnGq2CSMzBQZTHedsJkb2Tn6CpR5SvtuR?= =?us-ascii?Q?RS8EOq7UavGaV/EngGAcPCl8Jz9roL32zFeXiuK6zxcK32CKpJhuMobVP5r0?= =?us-ascii?Q?vNYwBDf/hanAtGjWsIBZoDLkr/aB3HM0HMYjWBpX7l23lA9SRKtuce8sTOQD?= =?us-ascii?Q?Vz3A8oM+Ab90UCj2pr1DIHkvn4WOSpZ+eA8rJiYTXXRB0heDSJnByTjP6+fb?= =?us-ascii?Q?vxGGuW2Dk7SFVagehNrPFHIrQaYFbmM6ASvQDs/z7AaSZwsEY57of6XovEN7?= =?us-ascii?Q?F585s67vP2GJod1yvEI3V+HVOi92JPmgWCfe1g0gOPM8Ppw3t/VkKIT53qoN?= =?us-ascii?Q?jDEUMyfDhPE2CjfBJ69NEwI2J60Bu2z+F6Jg7BvKQ9ybYXl3V0F5L51t/b0Q?= =?us-ascii?Q?vcMbmPDoZWMs2Sgf1/UNFer/1BVfomqnP54miZ5SrJe2X7Q6AxkUE27cgRfl?= =?us-ascii?Q?w5mA4nJzYoYfcbvgv1+obmcqSPLqFcVAM3+8DLCvzEl+etw2xifwAEK7Lu8g?= =?us-ascii?Q?KaHd2+DdkzyuTPagF/m89gMkB7t2WMlSRCf0fNHMQUgUXpJaB+JkvRl0gC28?= =?us-ascii?Q?8q6EafXdVz929NdMXOC/YoBxNXneq3vhjFnniJ+qgIBnbo67t6b5Oy8toNfl?= =?us-ascii?Q?xynEjtrzTlb7g9aIloF1UJGhm1gvTPDk/hPQ73mRwh43Vm7Yud6tIsoCE6gr?= =?us-ascii?Q?t3h8AxileGc7qg4R1GjBbHmrX1BmAKbkUHx1kVSyxj2UgHF3/kcHDycsOeMX?= =?us-ascii?Q?JAzQhTeIwSEOiWGbyFORYEoM9kD3fOK229drMP8mVGRTbhw2QqjcngTPm1bb?= =?us-ascii?Q?L6nyFi0ruPY+z1fAQT9U3be91s3ffARYm+z78FdARQdcOZsygAsWCy0CLp+h?= =?us-ascii?Q?CRxEjxb/nri3meOZpZhlDOyd?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2814.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5031fb42-ca8f-426e-2ea1-08d8f982122c X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2021 05:00:31.8115 (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: Tater+OTHRzEeSqVegWSDWEVmBDB/NvuvcOvaDT5V6z8jPAU+XesN3UvY9N7MChXpooR07y0k4mC5vo/Fp72HA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2864 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Change looks good to me, just one comment, would you also add new library c= lass into MinPlatformPkg.dec file for reference? Thanks, Chasel > -----Original Message----- > From: Desimone, Nathaniel L > Sent: Wednesday, April 7, 2021 11:04 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Liming Gao > ; Dong, Eric ; Michael > Kubacki ; Oram, Isaac W > > Subject: [edk2-platforms] [PATCH v4 0/4] Add Large Variable Libraries >=20 > Changes from V3: > - Added header guards > - Documented the possibility of returning EFI_UNSUPPORTED > - Added MM_CORE_STANDALONE to the StandaloneMm library > implementations > - Documented library constructor return status > - Moved LargeVariableReadLib and LargeVariableWriteLib into > a single BaseLargeVariableLib folder > - Added LargeVariableCommon.h for shared macro definitions > - Converted some debug macros from DEBUG_INFO to DEBUG_VERBOSE >=20 > Changes from V2: > - Added comment to LargeVariableLib INF and header files > describing the usage for drivers that cannot assume that > PcdMaxVariableSize has been set to a certain minimum value. >=20 > Changes from V1: > - Changed prefix from "Min" to "VarLib" > - Better comments > - Added more whitespace for readability > - Removed unused INF sections > - Better debug messages >=20 > This patch series introduces libaries that enable large data sets to be s= tored > using the UEFI Variable Services. At present, most UEFI Variable Services > implementations have a maximum variable size of <=3D64KB. The exact value > varies depending on platform. >=20 > These libaries enable a data set to use as much space as needed, up to th= e > remaining space in the UEFI Variable non-volatile storage. >=20 > To implement this, I have broken the problem down into two parts: >=20 > 1. Phase angostic UEFI Variable access. > 2. Storage of data across multiple UEFI Variables. >=20 > For the first part, I have created two new LibraryClasses: > VariableReadLib and VariableWriteLib. I have provided implementation inst= ances > of VariableReadLib for PEI, DXE, and SMM. > For VariableWriteLib, I have provided implementation instances for DXE an= d > SMM. This enables code that accesses UEFI variables to be written in a ma= tter > than is phase agnostic, so the same code can be used in PEI, DXE, or SMM > without modification. >=20 > The second part involves another two new LibaryClasses: > LargeVariableReadLib and LargeVariableWriteLib. Only one BASE > implementation is needed for both of these as the phase dependent code wa= s > seperated out in the first piece. These libraries provide logic to calcul= ate the > maximum size of an individual UEFI variable and split the data into as ma= ny > smaller pieces as needed to store the entire data set in the UEFI Variabl= e 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. >=20 > Cc: Chasel Chiu > Cc: Liming Gao > Cc: Eric Dong > Cc: Michael Kubacki > Cc: Isaac Oram > Signed-off-by: Nate DeSimone >=20 > Nate DeSimone (4): > MinPlatformPkg: Add VariableReadLib > MinPlatformPkg: Add VariableWriteLib > MinPlatformPkg: Add LargeVariableReadLib > MinPlatformPkg: Add LargeVariableWriteLib >=20 > .../Include/Dsc/CoreCommonLib.dsc | 6 +- > .../MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc | 12 +- > .../MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 9 +- > .../Include/Library/LargeVariableReadLib.h | 61 +++ > .../Include/Library/LargeVariableWriteLib.h | 69 +++ > .../Include/Library/VariableReadLib.h | 94 ++++ > .../Include/Library/VariableWriteLib.h | 138 ++++++ > .../BaseLargeVariableReadLib.inf | 51 ++ > .../BaseLargeVariableWriteLib.inf | 51 ++ > .../LargeVariableCommon.h | 47 ++ > .../LargeVariableReadLib.c | 176 +++++++ > .../LargeVariableWriteLib.c | 450 ++++++++++++++++++ > .../DxeRuntimeVariableReadLib.c | 117 +++++ > .../DxeRuntimeVariableReadLib.inf | 41 ++ > .../DxeRuntimeVariableWriteLib.c | 265 +++++++++++ > .../DxeRuntimeVariableWriteLib.inf | 49 ++ > .../PeiVariableReadLib/PeiVariableReadLib.c | 155 ++++++ > .../PeiVariableReadLib/PeiVariableReadLib.inf | 42 ++ > .../SmmVariableReadCommon.c | 116 +++++ > .../StandaloneMmVariableReadLib.inf | 50 ++ > .../StandaloneMmVariableReadLibConstructor.c | 51 ++ > .../TraditionalMmVariableReadLib.inf | 49 ++ > .../TraditionalMmVariableReadLibConstructor.c | 51 ++ > .../SmmVariableWriteCommon.c | 171 +++++++ > .../StandaloneMmVariableWriteLib.inf | 45 ++ > .../StandaloneMmVariableWriteLibConstructor.c | 51 ++ > .../TraditionalMmVariableWriteLib.inf | 44 ++ > ...TraditionalMmVariableWriteLibConstructor.c | 51 ++ > .../Intel/MinPlatformPkg/MinPlatformPkg.dsc | 4 +- > 29 files changed, 2506 insertions(+), 10 deletions(-) create mode 10064= 4 > Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableReadLib.h > create mode 100644 > Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableWriteLib.h > create mode 100644 > Platform/Intel/MinPlatformPkg/Include/Library/VariableReadLib.h > create mode 100644 > Platform/Intel/MinPlatformPkg/Include/Library/VariableWriteLib.h > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableLib/BaseLargeVaria= bl > eReadLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableLib/BaseLargeVaria= bl > eWriteLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableLib/LargeVariableC= o > mmon.h > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableLib/LargeVariableR= ea > dLib.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableLib/LargeVariableW= ri > teLib.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableReadLib/DxeRuntim > eVariableReadLib.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableReadLib/DxeRuntim > eVariableReadLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableWriteLib/DxeRunti > meVariableWriteLib.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableWriteLib/DxeRunti > meVariableWriteLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadL= ib. > c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadL= ib. > inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/SmmVariableRead > Common.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/StandaloneMmVa > riableReadLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/StandaloneMmVa > riableReadLibConstructor.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/TraditionalMmVar > iableReadLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/TraditionalMmVar > iableReadLibConstructor.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/SmmVariableWrit > eCommon.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVa > riableWriteLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVa > riableWriteLibConstructor.c > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVa > riableWriteLib.inf > create mode 100644 > Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVa > riableWriteLibConstructor.c >=20 > -- > 2.27.0.windows.1