From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.5182.1633988820397676826 for ; Mon, 11 Oct 2021 14:47:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=J54Ad1fh; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="207781023" X-IronPort-AV: E=Sophos;i="5.85,365,1624345200"; d="scan'208";a="207781023" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 14:47:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,365,1624345200"; d="scan'208";a="562369604" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by FMSMGA003.fm.intel.com with ESMTP; 11 Oct 2021 14:47:00 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.2242.12; Mon, 11 Oct 2021 14:46:59 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 11 Oct 2021 14:46:59 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 11 Oct 2021 14:46:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uo3cDInp/ANJh7jZeGdJivpP937AG40IRit1a6uSnCBS52yELixNgiSRx/JogbA4TfqygU7GuaRYOyM5k2tFkYixWsOkGLJvAThd43ANWFILREamT2smSGgPxTS/ixs4woHwOFrje8zKdkVbTkQ+6pUoo3763XXqaKtcsSS+jwWG9+Bb6QtoPDBuEjAw15ldJLnpKTHXm3DAbLZlXrXgTI8mgyEf1VviG6FAd2hFH14iojzKka42yofb/t+owsuo3Sy7CEJ1zRt8ggAt5kLh9Y3erL3KRKORpiwWf53g/Al2345AQEdQg/f3nGb7UPbO7UXi3WoH4DGA7jYL1tZQjw== 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=is3R67NKcfEddiJuIEB/YzHMj5c1CNAqvAidwDSTl6Q=; b=Nj0ynACi3WxDSXXKz1rcBQPlE/foDvdH0PuXV2yKvOY9tuy84fHvo89d6z78J+4eokLpbIbVp1uEIJ/mLmylSAQLFFvo7BCy2ab9i3X98ovlJJehv0zvIbiCPXQH449nNzrQFU4xtV1jysJdbTtqMqBUIOUyvTHW8HytWgfB10ZNPfNDVw0XrROO5PNy61FlBcCbeqT+kNHYKweqbqF39DiwFa3fG37Groz1XqU7vH3ymN5pvboBaW8CR3oZpeEr03sEn/Wa3PbO3wtPfde8uxLA49lKC/8F+zRNWlo862LWm4nN+/j3nKVoOOBHK3pV2qXsTcvxwlO59PPdaBQksw== 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=is3R67NKcfEddiJuIEB/YzHMj5c1CNAqvAidwDSTl6Q=; b=J54Ad1fhvs4xkRev93lS2N3AJlgZDAqJqiOVwziP1NAukVaZ7XOBZ+KW6kisf6nhsXqjdp9+z5lm7CE8CpoCaJBP+SnVqzNU/8r/5E/raaf1gxUClZzcAOqpnod/BCjDixuA02KH+FhHJTYqf2H6v9XdwapZi4/CGilKv0rChKY= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by CO1PR11MB5057.namprd11.prod.outlook.com (2603:10b6:303:6c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 21:46:59 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::f07d:7a97:3b68:92ed]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::f07d:7a97:3b68:92ed%11]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 21:46:58 +0000 From: "Nate DeSimone" To: "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Oram, Isaac W" Subject: Re: [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Thread-Topic: [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Thread-Index: AQHXvA/dAP1Mp+cQlE2qg+BhfEN2TavOWrEQ Date: Mon, 11 Oct 2021 21:46:58 +0000 Message-ID: References: <20211008064317.1371-1-chasel.chiu@intel.com> <20211008064317.1371-9-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-9-chasel.chiu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ea3b4166-a0b2-4c88-5b92-08d98d00a6ea x-ms-traffictypediagnostic: CO1PR11MB5057: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xVlsj99I7yKB524Bx3rUGJjjNLPctYeiUN1TGtAYGgHXWTLksXYOKqPRUE6A7P6hY4Lo6d2OA7K+0BXT9R0VCUKLKSP6DU2rqLgpvm0iDt0c577hztU94jFIDuzXYUPAZC2PkwQgOFNrDba3nm4mGsGkEB9X9FmSQu/qRCkym/aNIY9T2ijexZLHeBorbW5mtAvb6UVCrO0JufaNBLyf9Rhq94BVZjeR6Tnh/IixXLufiST0+9ouMHrLYhHA41wSQrXSp4v/n1BKNFpLdgKTEI9fsD6PRm5QaelZghdptMobxGjoFOEzFPDBbAPZeo4N5qdJw028BEYuy4yDJTLwJoDz7UZxkSKSUK+PqgC+Jdv+QynQBRGGwRjC+tPwLlUiGG5coJ1fTCUh2pMhkr1vsT0KZ7nBcX4a3eGfEoRah8ai8QcJ6F+Bi08JrQTO4juVrdohD9kh02L/uL7Vav2/+G6wyBQ42c3R1qZO9LmsUWUiiJakYVnmoIRk45+6Ea2059jjgb3/qUF/2q6tRouk8/LV3T0M7Z+71RCKwHH1MYYNbS+auy75oDrAGo7DP/h3CUFq572zJ9Zh5ddora0ejy4Hcqvbf55psYd5VDWsw/0IfTNdJYYum1q5bk5tAOI8P8OWB7Og6fiYRQHUgqM+T6n2DfSrm3vFoODSjJurY4B+WPr8+6oX7rrI4eLVGqme3n8EGue7fsBG7eNB9kgXPI68gL1NSC2xNO/YEw9nuiRAhpyOtvaLMdbz67jNdX44pHM6BO111Z3B/77Vt0jOn/khZbej4xpcJVdBWbWKrwQ= 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:(4636009)(366004)(86362001)(64756008)(38070700005)(33656002)(83380400001)(186003)(8936002)(66556008)(4326008)(2906002)(66476007)(107886003)(122000001)(26005)(66946007)(52536014)(7696005)(5660300002)(316002)(8676002)(9686003)(76116006)(71200400001)(6506007)(55016002)(966005)(38100700002)(508600001)(53546011)(66446008)(19627235002)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dBe1C6UsWSem7poaIZCedxZqaPuRVXVKOCvMj+vy6D5r4wFQ+UktQPP2L3YF?= =?us-ascii?Q?1li2yEEhrv7wS3Z6E/kP1ZDiZiL1HgXgNBQ1H+hjRHRdgUejy5Q4fGP8wvcy?= =?us-ascii?Q?f3XyF4z00Yin+z6yLnxLQY6RhCsVulmGXRWqgYE9ZQaFUm6f0mQsS5vAKDFq?= =?us-ascii?Q?K+UcVN6CSxM1KmY0kH1P5TmnLDXNMkfJCbcZ4y6nLA+E1pnVLi2OPrUuq2FH?= =?us-ascii?Q?j33DRH4mI3UfOAeFOOyQvsZVNF2WFkeNET1+o9uiFjkoZjXXbI9Kriqj+0LE?= =?us-ascii?Q?bskEXwSUrBqi0PpYL2mhy8ahScSk7vuMtWt8k4jsQfh9YwY7HqfYcA2+adSd?= =?us-ascii?Q?BAcPTNv9P8JLmkf+qILIhFa96U+9rlREp5W0X4JvyHBkOn6iQPbgWjGkywX7?= =?us-ascii?Q?A5At3NFwS9YVUnJuu16QwP8eEId43HGhRUnvkzu4bemxO7ARWlY+4vPPgzQ5?= =?us-ascii?Q?pTGMxh4YlO2ZnXMnyX/P+/N1m90z9iZOcWf1Bqc+K1eSL4WTfb4S0fVh5SmA?= =?us-ascii?Q?te52Cs1wiUfuuUa3OMhffMNNUXx5NLWVg5mEOzDA1ZdlirJ8hcAaTrg3DRN6?= =?us-ascii?Q?h4xh4C45rIICHL9XoKm3ruqntvKuwBCJUOGO+OtxBPJBjPYjFCbK4mk0j3AJ?= =?us-ascii?Q?96l7P23B238U7h87rreNTEe2C/JeXlQBJp8c3du2kRWhtBbEE6Z/ZIgGTpG8?= =?us-ascii?Q?aoNUGAq0+tnVy/CggWnusHfUevekGTbazEH1QX5DrmontpFeaYMZO12dmt9c?= =?us-ascii?Q?WaFhFdo9uMG3Vc3RhjyfVR3Mi0HaXz5Dx3wmmPDCmOrKyesp9/xjuKQYl9fF?= =?us-ascii?Q?cHY4+E97Ow5+gcQpZjKPAFxWaeMlACcGX5QYQkwx3jS0vn9IQDGDNC45ze8b?= =?us-ascii?Q?7bZXHdXo+ftnf6X7Q7IQjeut7ms8P1MLTNyFKfMhf3VRPsjjd5rY3WmtDicr?= =?us-ascii?Q?/c5jort4F1ae0/fmk6wfHvQBRD4i0ZP4e/wqn203FG/vQklbJjV7H5BmkrnY?= =?us-ascii?Q?8nXzgiL8GTAuroCeE8dCP0tZVra+8BY7xbfhbIq4qJAzaO3QAoCJrIiR92Z6?= =?us-ascii?Q?tXqiAUUofSKDP/1hZNbJZt/mn33ftJmbHfIXFG0azQmdSYF5qUT8HOp+iJun?= =?us-ascii?Q?RGUytCf0NQm4kACON3lrcTKCRAduVLzxgv4J/S0sGLlRD6jfB/yCCNpwuIt8?= =?us-ascii?Q?pARKXwHUdNHZjpotrMR9aM1kWcWhBkRLULNaBhfo/HU8d5uSNs3iYE4Ri4HY?= =?us-ascii?Q?z5dhDODBiXgMcG1LfX2ScjoBuAkrTI367Db2NKnOvpF+N2FFJowZYB41dy1h?= =?us-ascii?Q?iRviks15/fdhlc8PMSWmlkj2?= 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: ea3b4166-a0b2-4c88-5b92-08d98d00a6ea X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2021 21:46:58.7689 (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: iQ1RWQX4UgYxV+9yGeFMPeNao5dC8Hz4EC811Zk+mk4ribVyroEwhVffgEawCnmdYTLkqm6X/4Tu6OWgW5ZiYMqiCuj2QoyGBRYeDMYFpuk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5057 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 Reviewed-by: Nate DeSimone > -----Original Message----- > From: Chiu, Chasel > Sent: Thursday, October 7, 2021 11:43 PM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Oram, Isaac W > ; Desimone, Nathaniel L > > Subject: [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP > 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 >=20 > Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly > and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is > not found. >=20 > Also added PeiGetLargeVariable () to support the scenarios where the > variable data size is bigger than a single variable size limit. >=20 > Cc: Isaac Oram > Cc: Nate DeSimone > Signed-off-by: Chasel Chiu > --- >=20 > Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra > mSave.c | 29 +++++++++++++++++++++++------ >=20 > Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra > mSave.inf | 4 +++- > Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc = | 1 + > 3 files changed, 27 insertions(+), 7 deletions(-) >=20 > diff --git > a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > amSave.c > b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > amSave.c > index 709c7ad479..01e36cda27 100644 > --- > a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > amSave.c > +++ > b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > a > +++ mSave.c > @@ -7,6 +7,7 @@ > **/ #include "S3NvramSave.h"+#include > #include > #include > #include @@ -80,21 +81,37 @@ > SaveFspNonVolatileStorageHob ( > Status =3D EFI_SUCCESS; DEBUG ((DEBUG_INFO, "Saving FSP = / MRC > Training Data\n"));- GuidHob =3D GetFirstGuidHob > (&gFspNonVolatileStorageHobGuid);+ //+ // Firstly check version2 > FspNvsHob.+ //+ GuidHob =3D GetFirstGuidHob > (&gFspNonVolatileStorageHob2Guid); if (GuidHob !=3D NULL) {- HobData= =3D > GET_GUID_HOB_DATA (GuidHob);- DataSize =3D > GET_GUID_HOB_DATA_SIZE (GuidHob);+ HobData =3D (VOID *) (UINTN) > ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataPtr;+ > DataSize =3D (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) > GuidHob)->NvsDataLength;+ } else {+ //+ // Fall back to version1 > FspNvsHob+ //+ GuidHob =3D GetFirstGuidHob > (&gFspNonVolatileStorageHobGuid);+ if (GuidHob !=3D NULL) {+ HobD= ata > =3D GET_GUID_HOB_DATA (GuidHob);+ DataSize =3D > GET_GUID_HOB_DATA_SIZE (GuidHob);+ }+ }+ if (HobData !=3D NULL) {+ > DEBUG ((DEBUG_INFO, "FspNvsHob.Size: %d\n", DataSize));+ DEBUG > ((DEBUG_INFO, "FspNvsHob.NvsDataPtr: 0x%x\n", HobData)); if (DataSize > > 0) { // // Check if the presently saved data is identical = to the data > given by MRC/FSP //- Status =3D GetLargeVariable (L"FspNvsBuff= er", > &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, NULL);+ Status = =3D > GetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, > &FspNvsBufferSize, NULL); if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {= if > (FspNvsBufferSize =3D=3D DataSize) { VariableData =3D AllocateP= ool > (FspNvsBufferSize); if (VariableData !=3D NULL) {- S= tatus =3D > GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, > &FspNvsBufferSize, VariableData);+ Status =3D GetLargeVariable > (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferSize, > VariableData); if (!EFI_ERROR (Status) && (FspNvsBufferSize = =3D=3D > DataSize) && (0 =3D=3D CompareMem (HobData, VariableData, DataSize))) { > DataIsIdentical =3D TRUE; }@@ -105,7 +122,7 @@ > SaveFspNonVolatileStorageHob ( > Status =3D EFI_SUCCESS; if (!DataIsIdentical) {- Sta= tus =3D > SetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, > TRUE, DataSize, HobData);+ Status =3D SetLargeVariable (L"FspNvsBu= ffer", > &gFspNvsBufferVariableGuid, TRUE, DataSize, HobData); > ASSERT_EFI_ERROR (Status); DEBUG ((DEBUG_INFO, "Saved size of FSP= / > MRC Training Data: 0x%x\n", DataSize)); } else {diff --git > a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > amSave.inf > b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > amSave.inf > index e62baa24c4..a77125cf44 100644 > --- > a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > amSave.inf > +++ > b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr > a > +++ mSave.inf > @@ -43,7 +43,9 @@ > LargeVariableWriteLib [Guids]- gFspNonVolatileStorageHobGuid # > CONSUMES+ gFspNonVolatileStorageHobGuid # CONSUMES+ > gFspNonVolatileStorageHob2Guid # CONSUMES+ > gFspNvsBufferVariableGuid # PRODUCES [Pcd] > gEfiCpRcPkgTokenSpaceGuid.PcdPeiSyshostMemorySizediff --git > a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > index dc3dd0e026..87165103bf 100644 > --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > @@ -637,6 +637,7 @@ > [LibraryClasses.Common] > DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort. > inf+ PeiLib|MinPlatformPkg/Library/PeiLib/PeiLib.inf [Components.IA32] > UefiCpuPkg/SecCore/SecCore.inf-- > 2.28.0.windows.1