From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.7832.1667537427446508002 for ; Thu, 03 Nov 2022 21:50:28 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aMT/PgSF; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667537427; x=1699073427; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=cFk+Gv16gLWhadhTk9kybWjtle4J66Cgq8S/6w6m4Jo=; b=aMT/PgSFTiW7QUQAYcXAdLR55+bQAF1j4a68bc/g+NVP5uH2VyFtEpyd uVqh7dG+/P1mX5NANEEwkquR5dv9mbY8lvvHvRHNApDAUNqQzaYKuORIk Zl1vsB6jnglvWQU+2Qwi7nKypph5X8B70z9CBY/MuD2CJuMPWxKgfGOxm 4CuE/m1oHGz15r+/eyrB/nRRWpL4mmr3oou1bFYKw8ts84a8XTbmNorbH 9oAlD47UMoC5j3IdAlTcX9qmLlPktFHLxhWSggtxMwKZQIHVfaybaIPa9 6LIUctLHr0xH3Nj6FPC3t6y+sF3iXwDagwUnVrBd4MXsCdBVzcd/nqPfV w==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="374117614" X-IronPort-AV: E=Sophos;i="5.96,136,1665471600"; d="scan'208";a="374117614" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 21:50:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="612923949" X-IronPort-AV: E=Sophos;i="5.96,136,1665471600"; d="scan'208";a="612923949" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 03 Nov 2022 21:50:25 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 3 Nov 2022 21:50:24 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 3 Nov 2022 21:50:24 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 3 Nov 2022 21:50:24 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.47) 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.2375.31; Thu, 3 Nov 2022 21:50:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoqgOWRUqSCffeHt0owPg1ySbVWUnUfh2Egrvg42XqPiPKsZtRXS2UG6c/JYW5tXWRPdMMhf8bDELQcpqJvK+yil8WwElFjFJoynqfGzDl+F6z2WM6WAq5Fbae6R9vjx944NS4N8sizBOH2gNYNMk1PL0Y0CMw91hdS78mEkP4OE996IWs3jjCgILInCdQy6puGa9tR6wzGNuh8puLjrrhV8cHCUdnLLl99n7Szkbx3mLmxKeg59UFHA7deWHm12sV+uqx38Psc1T9docr7LsCiiD8MQpfnNguPl6WUWn4O4j3EPwOkw5frlh+xSKaA3z0yPuYLQVDTxZGjcj7XDWg== 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=hT2E1c7tHAfVVLPK6MlRoaTtrINUT19Jz3Izrgz7s2I=; b=RikLpqFbbNeR5fLQ0TJHf7fwYw+l+A/i46a/8X26y2L4fECDOa1hWnUZvm6DouATWS6e1FBlixLD6pBz4/bthEmZ/Mulenkye+9IixWXehS62KbYFF+zLrWzDDc52EIs0HWvEEcJmJKZ39S2pmg/UWYM1JeS4LYXsz9WNnX9YJgj0bsTtI6dgoaCsZhzBaMdvqezbfZSP808jIXStmFJGTGBXDBoN4a+04prVUle7C0jwsdWMI7oGq/ViTXiZy7/RaC1yLDmh8i/+xkByY6GNg5/Y5F64Evi4AjWuwrx+M+rbP+psTrrxFGhllz6CzHe7Kp91xDk3zglW/HMokFqhA== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Fri, 4 Nov 2022 04:50:17 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::3f62:3295:adf5:aaae]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::3f62:3295:adf5:aaae%4]) with mapi id 15.20.5791.022; Fri, 4 Nov 2022 04:50:16 +0000 From: "Chiu, Chasel" To: "devel@edk2.groups.io" , "Chiu, Chasel" CC: "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [edk2-devel] [PATCH v2] IntelFsp2Pkg: FSP should support input UPD as NULL. Thread-Topic: [edk2-devel] [PATCH v2] IntelFsp2Pkg: FSP should support input UPD as NULL. Thread-Index: AQHY7n6dh1DqZar7I0udLL5KUwe6Mq4uNM7A Date: Fri, 4 Nov 2022 04:50:16 +0000 Message-ID: References: <1723AE652BEE57BF.15522@groups.io> In-Reply-To: <1723AE652BEE57BF.15522@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5483:EE_|MN0PR11MB6231:EE_ x-ms-office365-filtering-correlation-id: aa9c4a57-f864-4cc9-bc23-08dabe201139 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dLnUhwknz7gY7N85icBYX8E9PoeDPCWkmn4WjVc2dxh0RNnrWRNvkaxdGtjix3xlU4vE3KXLwEAcs0dGdXqjA4WsyWXuMLolGXPON3apswkmoOXxRkJVL+NVitNLd/nmlvo+A8AcYJx5m1sZaa4B/04fDT0GSoTWwdH34BH5mYQr2C5l0+4rLjE1q2nJFr98MnJ8izYBOcW670osdR0tdnED1BvIfiquvLZW91Gdrj7KROpUjb3Fy1IH2Qr5zLreMsoFX8i6DrBesALX5VkbzOY6tqMJGWbNzjoFbO34RrJZ8O2FqpQEHmkSvR3GNeq5hJ8GHJ95qnIzOWhRfJd7213UBTRIhQSmVe5RNp9iO3GEAS/BemM83llU2rSzgz3WXscXpbOGSY5O8+QGX1ZYMuSWAIafaQczMCWyo21jBUk7t0bBgzif89JSI/8OUIqJgtm4HTY1Jv0go/4tk1a5T8wPtw6A6OTryRbfmMeBOn6gnvP46rC0naujY+vtxvdUCH5j/G+o2WJSaB7DRdc5eF2kPr/9ajL4VgSl4rFsQ7c4nHvk6NFP2Zw4scYTCQS8+V+F5idkwypo5+DcMHqpRnh1V/RB6s0w979Hoh9fEXNdmfvDLOkQNCpkm7U2xMILBFqKeiSfExjYUA1pIn+VTxC1+gUSrlY+A4mco01XUKPM3LNFc4QM3EBJcGmvX9dTYAQFG43A2gcK4lqFJExIJejfPavpmy6FVmeSR0DKYjZPXsL/pu/StVimiUUPz0Zx4n+u4ELv64g6W7GH2qYDa39n4HXAnpWXoG8Mmm0MvahXBBmGa4aW0tRslOQmp5TP20xoyOxJMhqXI4E+5gVmSQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(366004)(396003)(376002)(136003)(39860400002)(451199015)(71200400001)(110136005)(33656002)(52536014)(66556008)(316002)(54906003)(66476007)(66446008)(64756008)(66946007)(76116006)(4326008)(8676002)(5660300002)(41300700001)(8936002)(19627235002)(38070700005)(55016003)(38100700002)(82960400001)(7696005)(6506007)(53546011)(9686003)(26005)(478600001)(107886003)(186003)(83380400001)(966005)(86362001)(122000001)(2906002)(66899015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LOkvo1auSbFC8vlq0ONNbSjjGGp6lFnUb/lCTc5MRLfvDrYlIVTjoPE4dD4S?= =?us-ascii?Q?aPgJzyOtjHQooaf3d4O+yhctHDEGcMBajleGjvoE+HwZo9/eR2lIed/Uq1Mr?= =?us-ascii?Q?D6fqarVqxOabPnqAKvDzQIRWDUC91KMbhI7ijIKF5O/koraL5sA10Ih3EN93?= =?us-ascii?Q?h6d00NRrBItYod60ZwKF4PYb6b4DbYt1sv69X9iwUxTEZ+ZRkDmWf6usqBQX?= =?us-ascii?Q?bgxvPhZKqj5KEoAMHVNN/XLuLYguU+UwRh5jWNRdRsZ8usLWwb9GjliWW+Hb?= =?us-ascii?Q?AICFB7d71bh/RTUeYsPpiKjKKMp+2DbFMX7xbiI5JF4vFPRnfi6im3MeW4m5?= =?us-ascii?Q?4uaMzv5/pe1Q8/2k+exrF1xHJOc1XemzGFnbAZONWMZwvDr6ZmgyV3NsCFHG?= =?us-ascii?Q?GGL0KWm7IPWTq45YyXh+F9/AmTcSNzBk5cKVu0pkB7uOhpaRNqTfPtdouc2O?= =?us-ascii?Q?ku0sv7FBvkE0zhDGnCpLfa2yR/Ohmgej+vgFUXxM0dJ60RAtBYHo117Sxj7H?= =?us-ascii?Q?ebYPaGbyjuB78CA46z/Q+aKdOP9khutd5KOW+BH4DDDz4ZpY7sYaSofdRpQL?= =?us-ascii?Q?4Yw4SHbV4WT9UuBHZJuh002lE56doys1J08+YCk3pvzj1Xfn/dzMVk1CLEyD?= =?us-ascii?Q?qaEv9fW3I9qgF/OIuGeTIdczYzWLceSZE45LL7rR8Yl0uyjpvzcFpMCtWXk/?= =?us-ascii?Q?RcFv83OkW6n9qv41/qr9+91Zj7agjJfFwcea4B+TZVZoWQYwpggi2KbaxYep?= =?us-ascii?Q?ThF6jQ3VwhZWVu6E+IS9Qq6YRg4jnLyITuEbZYeHrdFxJI6VrhVAr89hldNQ?= =?us-ascii?Q?UdVQzo5AIGvYYmSYS6XjemewrR9Ytwg5v8+NY4O6xOmzMda3J11xmvyMkpDC?= =?us-ascii?Q?1eBEk0qLXv0ZdyAfGXyqNoFiIU9nP6HyzuPEZx4MMl88tISSgXxdWdh9nlMj?= =?us-ascii?Q?cLx3//ZyROlAH6DQyjOl+jLxHnPeMHDbdDlVPG1UoQkVsoYGq5mZiVmY9cca?= =?us-ascii?Q?rme5tpKAmP+kOfhYtUnUvWG4hzZPRX7XtkqeYKH7Q1iOV80haBlvUZorzo2o?= =?us-ascii?Q?NGZJ6JkcGgoZ+fsIP0uT7h+KebA1YD+jplQpTkWpQtBKy0/z60YRAsYRZZUX?= =?us-ascii?Q?0kt4J/YcLuKNeXfbBrjblEViPprj4icgiVOiIBtW0Qm4tXzqTrM4gpTm2LFd?= =?us-ascii?Q?gtT2sJjT/pH5fvh6gA0L795d8GZzIaUwa+p4F+V4NTFIL0tCADpOSkKT5Moj?= =?us-ascii?Q?B6ufHmZeoHMnRv9HoUj3XGX/QxPH9cltk1TouqMd5LWD8UsNo0Wba1cCSBoG?= =?us-ascii?Q?re85roA9WsY0GkEFChguRRi89fp9FW+5N3YXLALZ6MlF5ryViD4CX/yWjrTC?= =?us-ascii?Q?02pDJYkvdPrK/Ae2p9RtZYryQK+Dg1lq41qeuGGQgskM8LZuCgOaEycBR26J?= =?us-ascii?Q?sovHWQbD4ZHsT9abwQ42NOvSQZriE7tCQSv7CDMyyOri/CIKFpfpTJyFRI5o?= =?us-ascii?Q?crSNA3N3rTC9WLY8TcFOKsph8hH9AZ6V5vM2nU48nkvl311s42YCJIs0ovxL?= =?us-ascii?Q?boNRu3iZjuJ7KyhYk6KinhQiDjFAUGa76OiFmEbe?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa9c4a57-f864-4cc9-bc23-08dabe201139 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2022 04:50:16.3104 (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: ySno8oU+B1kWhQ421E6h8m199frDaBPb66441vpVZqkURkIwwuD5XAECWv0NPiivTFK91VSKJBJ0yx8oqbpUfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6231 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 Patch merged: https://github.com/tianocore/edk2/commit/b84f32ae5b475ce657ea= 1c9db29d4e4ec7711948 Thanks, Chasel > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chiu, > Chasel > Sent: Tuesday, November 1, 2022 10:46 PM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star > Subject: [edk2-devel] [PATCH v2] IntelFsp2Pkg: FSP should support input > UPD as NULL. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4114 >=20 > FSP specification supports input UPD as NULL cases which FSP will use bui= lt- > in UPD region instead. > FSP should not return INVALID_PARAMETER in such cases. >=20 > In FSP-T entry point case, the valid FSP-T UPD region pointer will be pas= sed > to platform FSP code to consume. > In FSP-M and FSP-S cases, valid UPD pointer will be decided when updating > corresponding pointer field in FspGlobalData. >=20 > Cc: Nate DeSimone > Cc: Star Zeng > Signed-off-by: Chasel Chiu > --- > IntelFsp2Pkg/FspSecCore/SecFspApiChk.c | 12 ++++++++++-- > IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm | 73 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++------ > ------------ > IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 40 > ++++++++++++++++++++++++++-------------- > 3 files changed, 91 insertions(+), 34 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > index a44fbf2a50..5f59938518 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > @@ -44,6 +44,8 @@ FspApiCallingCheck ( > // if (((UINTN)FspData !=3D MAX_ADDRESS) && ((UINTN)FspData !=3D > MAX_UINT32)) { Status =3D EFI_UNSUPPORTED;+ } else if (ApiParam = =3D=3D > NULL) {+ Status =3D EFI_SUCCESS; } else if (EFI_ERROR > (FspUpdSignatureCheck (ApiIdx, ApiParam))) { Status =3D > EFI_INVALID_PARAMETER; }@@ -67,9 +69,13 @@ FspApiCallingCheck ( > } else { if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE= ) > { Status =3D EFI_UNSUPPORTED;- } else if (EFI_ERROR > (FspUpdSignatureCheck (FspSiliconInitApiIndex, ApiParam))) {- Stat= us =3D > EFI_INVALID_PARAMETER; } else if (ApiIdx =3D=3D FspSiliconInitApiIn= dex) {+ > if (ApiParam =3D=3D NULL) {+ Status =3D EFI_SUCCESS;+ } e= lse if > (EFI_ERROR (FspUpdSignatureCheck (FspSiliconInitApiIndex, ApiParam))) {+ > Status =3D EFI_INVALID_PARAMETER;+ }+ // // Reset = MultiPhase > NumberOfPhases to zero //@@ -89,6 +95,8 @@ FspApiCallingCheck ( > } else { if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE= ) > { Status =3D EFI_UNSUPPORTED;+ } else if (ApiParam =3D=3D NU= LL) {+ > Status =3D EFI_SUCCESS; } else if (EFI_ERROR (FspUpdSignatureCheck > (FspSmmInitApiIndex, ApiParam))) { Status =3D > EFI_INVALID_PARAMETER; }diff --git > a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm > b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm > index 61030a843b..73821ad22a 100644 > --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm > @@ -21,7 +21,7 @@ extern ASM_PFX(PcdGet32 > (PcdFspReservedBufferSize)) > ; Following functions will be provided in PlatformSecLib ; extern > ASM_PFX(AsmGetFspBaseAddress)-extern > ASM_PFX(AsmGetFspInfoHeader)+extern > ASM_PFX(AsmGetFspInfoHeaderNoStack) ;extern > ASM_PFX(LoadMicrocode) ; @todo: needs a weak implementation extern > ASM_PFX(SecPlatformInit) ; @todo: needs a weak implementation extern > ASM_PFX(SecCarInit)@@ -160,6 +160,47 @@ endstruc > RET_ESI_EXT mm7 %endmacro +%macro CALL_EDI 1++ mov edi, > %%ReturnAddress+ jmp %1+%%ReturnAddress:++%endmacro++%macro > CALL_EBP 1+ mov ebp, %%ReturnAddress+ jmp > %1+%%ReturnAddress:+%endmacro++%macro RET_EBP 0+ jmp > ebp ; restore EIP from EBP+%endmacro++;+; Load = UPD > region pointer in ECX+;+global > ASM_PFX(LoadUpdPointerToECX)+ASM_PFX(LoadUpdPointerToECX):+ ;+ ; > esp + 4 is input UPD parameter+ ; If esp + 4 is NULL the default UPD sho= uld > be used+ ; ecx will be the UPD region that should be used+ ;+ mov = ecx, > dword [esp + 4]+ cmp ecx, 0+ jnz ParamValid++ ;+ ; Fall b= ack to > default UPD region+ ;+ CALL_EDI > ASM_PFX(AsmGetFspInfoHeaderNoStack)+ mov ecx, DWORD [eax + > 01Ch] ; Read FsptImageBaseAddress+ add ecx, DWORD [eax + > 024h] ; Get Cfg Region base address =3D FsptImageBaseAddress + > CfgRegionOffset+ParamValid:+ RET_EBP+ ; ; @todo: The strong/weak > implementation does not work. ; This needs to be reviewed later.@@= - > 187,10 +228,9 @@ endstruc > global ASM_PFX(LoadMicrocodeDefault) > ASM_PFX(LoadMicrocodeDefault): ; Inputs:- ; esp -> > LoadMicrocodeParams pointer+ ; ecx -> UPD region contains > LoadMicrocodeParams pointer ; Register Usage:- ; esp Preserved- = ; > All others destroyed+ ; All are destroyed ; Assumptions: ; No > memory available, stack is hard-coded and used for return address ; > Executed by SBSP and NBSP@@ -201,12 +241,9 @@ > ASM_PFX(LoadMicrocodeDefault): > ; movd ebp, mm7 + mov esp, ecx ; ECX has been assigned to = UPD > region cmp esp, 0 jz ParamError- mov eax, dword [esp + = 4] ; > Parameter pointer- cmp eax, 0- jz ParamError- mov esp, ea= x ; > skip loading Microcode if the MicrocodeCodeSize is zero ; and report e= rror > if size is less than 2k@@ -444,13 +481,15 @@ Done: > Exit2: jmp ebp -+;+; EstablishStackFsp: EDI should be preserved cro= ss > this function+; global ASM_PFX(EstablishStackFsp) > ASM_PFX(EstablishStackFsp): ; ; Save parameter pointer in edx ;- m= ov > edx, dword [esp + 4]+ mov edx, ecx ; ECX has been assigned to UP= D > region ; ; Enable FSP STACK@@ -555,39 +594,37 @@ > ASM_PFX(TempRamInitApi): > SAVE_EAX SAVE_EDX - ;- ; Check Parameter- ;- mov eax, dwor= d [esp > + 4]- cmp eax, 0- mov eax, 80000002h- jz TempRamIni= tExit- > ; ; Sec Platform Init ;+ CALL_EBP ASM_PFX(LoadUpdPointerToECX) ; > ECX for UPD param CALL_MMX ASM_PFX(SecPlatformInit) cmp eax, 0 > jnz TempRamInitExit ; Load microcode LOAD_ESP+ CALL_EBP > ASM_PFX(LoadUpdPointerToECX) ; ECX for UPD param CALL_MMX > ASM_PFX(LoadMicrocodeDefault) SXMMN xmm6, 3, eax ;Save > microcode return status in ECX-SLOT 3 in xmm6. ;@note If return value e= ax > is not 0, microcode did not load, but continue and attempt to boot. ; = Call > Sec CAR Init LOAD_ESP+ CALL_EBP ASM_PFX(LoadUpdPointerToECX) ; > ECX for UPD param CALL_MMX ASM_PFX(SecCarInit) cmp eax, 0 jn= z > TempRamInitExit LOAD_ESP+ CALL_EBP > ASM_PFX(LoadUpdPointerToECX) ; ECX for UPD param+ mov edi, > ecx ; Save UPD param to EDI for later code use CALL= _MMX > ASM_PFX(EstablishStackFsp) cmp eax, 0 jnz TempRamInitExit > LXMMN xmm6, eax, 3 ;Restore microcode status if no CAR init error > from ECX-SLOT 3 in xmm6.+ SXMMN xmm6, 3, edi ;Save FSP-T UPD > parameter pointer in ECX-SLOT 3 in xmm6. TempRamInitExit: mov bl= , > al ; save al data in bldiff --git > a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > index 7dd89c531a..cdebe90fab 100644 > --- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > +++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > @@ -21,7 +21,7 @@ extern ASM_PFX(PcdGet32 > (PcdFspReservedBufferSize)) > ; Following functions will be provided in PlatformSecLib ; extern > ASM_PFX(AsmGetFspBaseAddress)-extern > ASM_PFX(AsmGetFspInfoHeader)+extern > ASM_PFX(AsmGetFspInfoHeaderNoStack) ;extern > ASM_PFX(LoadMicrocode) ; @todo: needs a weak implementation extern > ASM_PFX(SecPlatformInit) ; @todo: needs a weak implementation extern > ASM_PFX(SecCarInit)@@ -87,6 +87,14 @@ struc > LoadMicrocodeParamsFsp24 > .size: endstruc +%macro CALL_RDI 1++ mov rdi, %%ReturnAddress= + > jmp %1+%%ReturnAddress:++%endmacro+ ; ; @todo: The strong/weak > implementation does not work. ; This needs to be reviewed later.@@= - > 116,8 +124,7 @@ ASM_PFX(LoadMicrocodeDefault): > ; Inputs: ; rcx -> LoadMicrocodeParams pointer ; Register Usa= ge:- ; > rsp Preserved- ; All others destroyed+ ; All are destroyed ; > Assumptions: ; No memory available, stack is hard-coded and used for > return address ; Executed by SBSP and NBSP@@ -420,10 +427,6 @@ > ASM_PFX(TempRamInitApi): > ENABLE_SSE ENABLE_AVX ;- ; Save Input Parameter in YMM10- ;- > SAVE_RCX- ; ; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and > YMM6 ; SAVE_REGS@@ -433,6 +436,22 @@ > ASM_PFX(TempRamInitApi): > ; SAVE_BFV rbp + ;+ ; Save Input Parameter in YMM10+ ;+ cmp = rcx, > 0+ jnz ParamValid++ ;+ ; Fall back to default UPD+ ;+ CALL_RDI > ASM_PFX(AsmGetFspInfoHeaderNoStack)+ xor rcx, rcx+ mov ecx, > DWORD [rax + 01Ch] ; Read FsptImageBaseAddress+ add ecx, > DWORD [rax + 024h] ; Get Cfg Region base address =3D > FsptImageBaseAddress + CfgRegionOffset+ParamValid:+ SAVE_RCX+ ; ; > Save timestamp into YMM6 ;@@ -441,13 +460,6 @@ > ASM_PFX(TempRamInitApi): > or rax, rdx SAVE_TS rax - ;- ; Check Parameter- ;- cmp = rcx, 0- > mov rcx, 08000000000000002h- jz TempRamInitExit- ; ; Se= c > Platform Init ;-- > 2.35.0.windows.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#95854): > https://edk2.groups.io/g/devel/message/95854 > Mute This Topic: https://groups.io/mt/94728678/1777047 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [chasel.chiu@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20