From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 38591AC019F for ; Fri, 26 Jan 2024 00:19:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HirAlk7HJ6RdYWqmfpT97l6dH4mULHvU5eFmqTBl7Gk=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706228376; v=1; b=TGJFPxycVX4S9yp/j49anFVBi0ReBAxx3JzPA5THPRm7ItRH2u18bz/cX/W4hU7+90nPI4cp w7c3bK6Xo8LDIb8Ont0M599K8tJrWFe3RPDr8o1wHxA4LnsECLVJYrzd7WgGv9p9exM7I5zu+a9 INhp23I/bTW6LvPqusAz8zbo= X-Received: by 127.0.0.2 with SMTP id QNDDYY7687511xMbrjL5WgJh; Thu, 25 Jan 2024 16:19:36 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by mx.groups.io with SMTP id smtpd.web10.3022.1706228375911029584 for ; Thu, 25 Jan 2024 16:19:36 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="1270598" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="1270598" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 16:19:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="1118107027" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="1118107027" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Jan 2024 16:19:35 -0800 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2507.35; Thu, 25 Jan 2024 16:19:34 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 25 Jan 2024 16:19:34 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 25 Jan 2024 16:19:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ldEjlXRSHQYXUIDksrXZEpa8PQn5fXpSUel8vQxjT8wL/E0hbr5Jj+JYqSzPeeg30exCw7DaQ64Rg+iIqCsHuM4psoaTAbjkq7yrUMMZjzXVZdTt2/JsYceezqQIlvEhXFa8hDuNU1DMNcH8pCa+ZbOh5502gTHsszdepgz0HYGqzamC/cn4xFTZv60JWZYiaS9NSAp1PvYqHeTQKn8N+spMc4JZAOVHcbdSj2QnfJn0HH0Qz21Zc6NlbUdJzutjQfQ3r3OKpNY/poYlo4La65AAGnAkwpcLD3aIlJwwtBvPgToacLh8csbdIkCFSq0SaXZcERFWTOUueY7Hzsg0JQ== 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=4VyFYw0uSmVxNheJfbC8Sju9+RHAfnWOT+NfAxHuCoU=; b=gc3Qb56egjWUp7KG1LpHT5FhtDqEz3tw9eFuJPl+SpZL/Qd3ORtiAKhcwmJC0EhUNWo5qEGr2UEWIKxtWh3W3dHU/LQBgIpCsIMq4xyrmGmROSK3dQP2AblQmALTQuQYGSG8Ctxg66jXcU9oLGbt5qOjgW99WVwABNX1skH/gmoUfIZA9B3Ow88+UkzYJUwbsImHsMjl72Qqni7Ylks2yVETsxWf2YxyEUOWwNApvTh6+NpBzVZSNT9ehlZYDEBxRj3yhGpUHSzlBhSY2FkrFEW1V8g5x5Fv5Mt8B5sWA57a2S3RRBh0jXFrMU6lG21JfcTqbgjpJ//1Z3W/iws2Xg== 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 X-Received: from MW4PR11MB5776.namprd11.prod.outlook.com (2603:10b6:303:183::9) by DS0PR11MB6326.namprd11.prod.outlook.com (2603:10b6:8:ce::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Fri, 26 Jan 2024 00:19:29 +0000 X-Received: from MW4PR11MB5776.namprd11.prod.outlook.com ([fe80::7733:f6b8:e322:f670]) by MW4PR11MB5776.namprd11.prod.outlook.com ([fe80::7733:f6b8:e322:f670%4]) with mapi id 15.20.7228.023; Fri, 26 Jan 2024 00:19:29 +0000 From: "Chaganty, Rangasai V" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Dong, Eric" , "S, Ashraf Ali" , "Duggapu, Chinni B" , "Gao, Liming" Subject: Re: [edk2-devel][edk2-platforms][PATCH v4] MinPlatformPkg: Support SecFspWrapperPlatformSecLib in X64 Thread-Topic: [edk2-devel][edk2-platforms][PATCH v4] MinPlatformPkg: Support SecFspWrapperPlatformSecLib in X64 Thread-Index: AQHaPV/OmyoGtnkEl0mMAPgbaIZq+rDrXJlQ Date: Fri, 26 Jan 2024 00:19:29 +0000 Message-ID: References: <588d6f17d0a4ac8ea2353d027829c1993da3dd0a.1704183832.git.ted.kuo@intel.com> In-Reply-To: <588d6f17d0a4ac8ea2353d027829c1993da3dd0a.1704183832.git.ted.kuo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5776:EE_|DS0PR11MB6326:EE_ x-ms-office365-filtering-correlation-id: 5e82849c-9964-4dae-b26d-08dc1e047650 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 9kQeJMCOy/hvcdOVrE0kZSk6C4LsjPP1unQR162xjjTvmpwvJ+y/kW22wRdJLErcBuiOXNf/0k6qA2HV1SZ1Bks81zoyXbmLs1N6q0whWLigGxlClc7Vyc/Fd1nykJGiHLef62oe+uSZc1mqSaMNeQ8FlAyp7ixvBAstFYnthL6hWN36AcEfR+mPxz848xO0xWb+BkaIHdehp1yZ3c4V/Y3bRqpsnlgGZwYXAm9e9cJWW+uH5QB3nq+5Og0tRvp1WoE0uhazJJtOXH4HTgWLuj5ekBbkH8Cz5FUnK7DKB9p5oFUzW3ecZiPsTL4pqtgzh5cJaQUYnR8u7C+u07ThKjBJpsTJeBkA1fQQRQbon0IqcBJ9C4uW1U+f8LXc2NFnAl6W3VSxKJVGeyd8ySFDc+BCOSTY4k5aQC4jRpE8G8CImYcS2uL2zRIl1ycgU3riQw8zKQrPrNOTZEhWcewZBGIQDtxmGkbgwB1G1ZdccFuS6nJ0l60B4KAWf8Y9ZZ6b3f5Yua17C051jbIjeRp+FRUUudbZpqzXPFItVRfkQ/wJEj9qg82B+sPanYWxmvE7l7Tq8o52cXCLAlb4+QkP9rTxqBUWZ7GObyL/O6zsLpKm56P4UUY6JDkINiXfmxTireADlya42sffDRuJwaFXqxO+iMTj2njN21ctlZtpEgHJ219s0FHMnGEN70cvKCm8gmNysyXAr4I/7MB9094XWQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ef3CzfMKAI4w+EEjt9WVccCtc5UdSZVLCheKxyPTQlbw6mehDP3YOH6TdW+l?= =?us-ascii?Q?gXPa+2fQtsXOfMQ+SMQ0Fp/dsqpGPBvu2b4E0x3OUe47wR7+vMvTgU+SYbQP?= =?us-ascii?Q?yKh29hGuGNGYNvBkVcLzyhec3cTiX2Lre1pN+df5KsHX0yUnApUqeheUzY+y?= =?us-ascii?Q?qblRSRSdQwD7OfiZrpxjAlEebenEfwjyw75UT0flNlJU3B8UlY/zPemUoNIW?= =?us-ascii?Q?cu3KEdH5xUb45QfHVwfCxCjxddsHLk9u4L4u482stdADAFfcASAldMQUysFu?= =?us-ascii?Q?cPmB3FZfj4LaVithR/9D08jibw6jSIWdpTLVBGz87AB63tsmxBgXZqd63mWe?= =?us-ascii?Q?9/oe3sySafiD77jy5zl3GXeL8RooFuvPobI8D4dNtC/RYtx/NzFuSq+Jp0a6?= =?us-ascii?Q?XsDwA67dMGEXz4YesRr0MPxf7BZh8CXsaVM0OjoNDW2vOseaESx3Ql5DgxhE?= =?us-ascii?Q?E4ZzcXnCN6dMqYWHHOysCivUEGMIZ8nFuxoKc/EGynulEhSLsc6k8Bg5yFe3?= =?us-ascii?Q?bTv0636yDLK+wMasS0otbSWLqnaL2T44C8FH+MIzGP/Ol2d+nCqQT2Co9XV+?= =?us-ascii?Q?cT/2O/sZLYQVUfgNT59TLOVBM8PM05lCpl5r5D6AA+SJAmmtnLFEU9kUGrrI?= =?us-ascii?Q?nLOI7IR3iJdfVaLUuDkuNEvd4VGPd2zc66tXYnY1XNTR2Ik1yhE1beu1M23V?= =?us-ascii?Q?v1KqJY5ib7U4+4leKYjQINVgRapINaQxDJgjA82zW6eqFE5dWwes/IyZdRUE?= =?us-ascii?Q?PNJS1dd53WgqTglE4oO4DS0UuHMSxMpJ3LFBThGisx6t6ZmqmxgjO/OJKhEd?= =?us-ascii?Q?apH4HNXL6gax/zafGH8G1uwQGj69aA+cLvdvAwdous+OZ57gye/81/ITN7p2?= =?us-ascii?Q?Sk583JSRzXGEtjaRUdkwJkoYw6rfaynXR+ZCaJQTLAjBeB73CBZXMtAk5Nn7?= =?us-ascii?Q?SMg2Yn/S40hHNV5dUQX8PklCHGXX/gXc50OC93hVfNPzQeeda1lHkWP+QGkV?= =?us-ascii?Q?ZxckRtWc7xDeViSeQTmXdc/XYCTxg5tEd2Qw/pnxJfVj9C/gmHaU4l+A9GUo?= =?us-ascii?Q?Oouv3jyL1GhqU659XMhLqD14ZYbCur8fTSTy4f/maF81IAaQ0GMf31bG3rQ4?= =?us-ascii?Q?JeSDTIKxWTOguXSlX7xjJjtF+wSHa2HtTrFTpyZA/ecNa+XfiFAnk2c93O0y?= =?us-ascii?Q?zN1k5n+FWuH63uINRJDoNJuon9eEGhk3qZzAaOlTbNl0rdvcwTK3P1iaiHhE?= =?us-ascii?Q?ud8+i8AK5Tljs384DFsmDydSUuCV6TXF6R3SJkW6+5B2eKqb/mTy3Ixa1R6+?= =?us-ascii?Q?gdDLFRJLfVetuX8+j+qtHEUsarZf3nz4HC7B7W8eWxNsWR9Z5X5MYaEdBNCN?= =?us-ascii?Q?4A1wdRMFx6xkLC6oQ88EwrjIxJEEuQcWBZy0yErv7D5+NfiTkL2P1CIwiUG0?= =?us-ascii?Q?T/V6FK22VjS2F7rco85/4MMlvBbvsyXfxTgd6Urxt1MiPAxwjpvTFgCKSNtm?= =?us-ascii?Q?iPcbe4OAKJWjRLiJmz4ajcgdKG4qYATKuGsIzTDfgCgplL6Kl6Xnl4EbXRba?= =?us-ascii?Q?KXUPD+zXcwlo/t+0Tk8d6ypcgDXrXA5PTc78du85PS/gac0ewUe1B/+tkQw7?= =?us-ascii?Q?tQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5776.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e82849c-9964-4dae-b26d-08dc1e047650 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2024 00:19:29.3123 (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: 4gTGGlUBbLVh/N2iUeqKh/RWh7bPHyQVko3O2M7OL8NN+vEuUGK/pxLfvxDz2xsw6vofmkAbe/h0qLDwiEuxTTHg/AbQ8DujB0YWneiz4u0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB6326 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rangasai.v.chaganty@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: zSdea9I3k6wDjIQlLCFWFpixx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=TGJFPxyc; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Looks good to me. Please get RB by atleast one of the Pkg maintainers.=20 With that: Reviewed-by: Sai Chaganty -----Original Message----- From: Kuo, Ted =20 Sent: Tuesday, January 2, 2024 1:41 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Chiu, Chasel ; Desimone, Nathaniel L = ; Dong, Eric ; S, Ashraf Ali ;= Duggapu, Chinni B ; Gao, Liming Subject: [edk2-devel][edk2-platforms][PATCH v4] MinPlatformPkg: Support Sec= FspWrapperPlatformSecLib in X64 https://bugzilla.tianocore.org/show_bug.cgi?id=3D4623 1.Added PeiCoreEntry.nasm, SecEntry.nasm and Stack.nasm for X64. 2.Made changes in common files to support both IA32 and X64. 3.Added the PCDs below for FSP-T UPD revisions and reset vector in FSP. - PcdFspWrapperBfvforResetVectorInFsp - PcdFsptUpdHeaderRevision - PcdFsptArchUpdRevision Cc: Sai Chaganty Cc: Chasel Chiu Cc: Nate DeSimone Cc: Eric Dong Cc: Ashraf Ali S Cc: Chinni B Duggapu Cc: Liming Gao Signed-off-by: Ted Kuo --- .../SecFspWrapperPlatformSecLib/FsptCoreUpd.h | 25 ++- .../Ia32/SecEntry.nasm | 4 +- .../SecFspWrapperPlatformSecLib.inf | 9 +- ...pWrapperPlatformSecLibResetVectorInFsp.inf | 101 +++++++++ .../SecGetPerformance.c | 11 +- .../SecPlatformInformation.c | 8 +- .../SecRamInitData.c | 73 +++++-- .../X64/PeiCoreEntry.nasm | 202 ++++++++++++++++++ .../X64/SecEntry.nasm | 71 ++++++ .../X64/Stack.nasm | 72 +++++++ .../Ia32 =3D> Include}/Fsp.h | 6 +- .../Intel/MinPlatformPkg/MinPlatformPkg.dec | 17 +- 12 files changed, 565 insertions(+), 34 deletions(-) create mode 100644 P= latform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib= /SecFspWrapperPlatformSecLibResetVectorInFsp.inf create mode 100644 Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFsp= WrapperPlatformSecLib/X64/PeiCoreEntry.nasm create mode 100644 Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFsp= WrapperPlatformSecLib/X64/SecEntry.nasm create mode 100644 Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFsp= WrapperPlatformSecLib/X64/Stack.nasm rename Platform/Intel/MinPlatformPkg/{FspWrapper/Library/SecFspWrapperPlat= formSecLib/Ia32 =3D> Include}/Fsp.h (79%) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapper= PlatformSecLib/FsptCoreUpd.h b/Platform/Intel/MinPlatformPkg/FspWrapper/Lib= rary/SecFspWrapperPlatformSecLib/FsptCoreUpd.h index 7c0f605b92..24c18f25b8 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/FsptCoreUpd.h +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/FsptCoreUpd.h @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved.
= +Copyright (c) 2017 - 2024, Intel Corporation. All rights reserved.
SPD= X-License-Identifier: BSD-2-Clause-Patent **/@@ -10,6 +10,7 @@ SPDX-Licens= e-Identifier: BSD-2-Clause-Patent #pragma pack(1) +#if FixedPcdGet8 (PcdFsptArchUpdRevision) <=3D 1 /** Fsp= T Core UPD **/ typedef struct {@@ -34,6 +35,28 @@ typedef struct { **/ UINT8 Reserved[16]; } FSPT_CORE_UPD;+#else+/**= Fsp T Core UPD+**/+typedef struct {++/** Offset 0x0040+**/+ EFI_PHYSICAL_= ADDRESS MicrocodeRegionBase;++/** Offset 0x0048+**/+ UINT64 = MicrocodeRegionSize;++/** Offset 0x0050+**/+ EFI_PHYSICAL_AD= DRESS CodeRegionBase;++/** Offset 0x0058+**/+ UINT64 = CodeRegionSize;+} FSPT_CORE_UPD;+#endif #pragma pack() diff --git a= /Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecL= ib/Ia32/SecEntry.nasm b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/Se= cFspWrapperPlatformSecLib/Ia32/SecEntry.nasm index 7f6d771e41..0b3f343991 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/Ia32/SecEntry.nasm +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/Ia32/SecEntry.nasm @@ -1,6 +1,6 @@ ;-------------------------------------------------------------------------= ----- ;-; Copyright (c) 2019, Intel Corporation. All rights reserved.
+;= Copyright (c) 2019 - 2024, Intel Corporation. All rights reserved.
; S= PDX-License-Identifier: BSD-2-Clause-Patent ; Module Name: ;@@ -13,7 +13,7 = @@ ; ;--------------------------------------------------------------------= ---------- -#include "Fsp.h"+#include SECTION .text diff --git a/P= latform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib= /SecFspWrapperPlatformSecLib.inf b/Platform/Intel/MinPlatformPkg/FspWrapper= /Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf index 2e0d67eae4..6806e000ce 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecFspWrapperPlatformSecLib.inf +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/SecFspWrapperPlatformSecLib.inf @@ -1,7 +1,7 @@ ## @file-# Provide FSP wrapper platform sec related function.+# Provide = FSP wrapper platform sec related function for IA32. #-# Copyright (c) 2017= - 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 = - 2024, Intel Corporation. All rights reserved.
# # SPDX-License-Identi= fier: BSD-2-Clause-Patent #@@ -25,7 +25,7 @@ # # The following information is for reference only and not required by th= e build tools. #-# VALID_ARCHITECTURES =3D IA32 X64+# VALID_ARC= HITECTURES =3D IA32 # ##########################################= ######################################@@ -47,7 +47,6 @@ Ia32/SecEntry.nasm Ia32/PeiCoreEntry.nasm Ia32/Stack.nasm- Ia32/Fsp= .h #######################################################################= ######### #@@ -96,3 +95,5 @@ gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## C= ONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection = ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFspDispatchModeUseFspPeiM= ain ## CONSUMES+ gMinPlatformPkgTokenSpaceGuid.PcdFsptUpdHeaderRevis= ion ## CONSUMES+ gMinPlatformPkgTokenSpaceGuid.PcdFsptArchUpd= Revision ## CONSUMESdiff --git a/Platform/Intel/MinPlatformP= kg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecL= ibResetVectorInFsp.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/S= ecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLibResetVectorInFsp.inf new file mode 100644 index 0000000000..ea062cfad1 --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/SecFspWrapperPlatformSecLibResetVectorInFsp.inf @@ -0,0 +1,101 @@ +## @file+# Provide FSP wrapper platform sec related function for X64.+#+#= Copyright (c) 2024, Intel Corporation. All rights reserved.
+#+# SPDX-= License-Identifier: BSD-2-Clause-Patent+#+#+##++###########################= #####################################################+#+# Defines Section -= statements that will be processed to create a Makefile.+#+################= ################################################################+[Defines]+= INF_VERSION =3D 0x00010005+ BASE_NAME = =3D SecFspWrapperPlatformSecLib+ FILE_GUID =3D = 94D8AA5C-5BAE-421F-B2C7-DD1A93BB4D3D+ MODULE_TYPE =3D S= EC+ VERSION_STRING =3D 1.0+ LIBRARY_CLASS = =3D PlatformSecLib+++#+# The following information is for reference only = and not required by the build tools.+# This library is only supported in X6= 4 when reset vector is in FSP.+#+# VALID_ARCHITECTURES =3D X64+#= ++#########################################################################= #######+#+# Sources Section - list of files that are required for the build= to succeed.+#+############################################################= ####################++[Sources]+ FspWrapperPlatformSecLib.c+ SecRamInitDa= ta.c+ SecPlatformInformation.c+ SecGetPerformance.c+ SecTempRamDone.c+ = PlatformInit.c+ FsptCoreUpd.h++[Sources.X64]+ X64/SecEntry.nasm+ X64/Pei= CoreEntry.nasm+ X64/Stack.nasm++##########################################= ######################################+#+# Package Dependency Section - lis= t of Package files that are required for+# thi= s module.+#+###############################################################= #################++[Packages]+ MdePkg/MdePkg.dec+ MdeModulePkg/MdeModuleP= kg.dec+ UefiCpuPkg/UefiCpuPkg.dec+ IntelFsp2Pkg/IntelFsp2Pkg.dec+ IntelF= sp2WrapperPkg/IntelFsp2WrapperPkg.dec+ MinPlatformPkg/MinPlatformPkg.dec++= [LibraryClasses]+ LocalApicLib+ SerialPortLib+ FspWrapperPlatformLib+ F= spWrapperApiLib+ SecBoardInitLib+ TestPointCheckLib+ PeiServicesTablePoi= nterLib++[Ppis]+ gEfiSecPlatformInformationPpiGuid ## CONSUMES+ gPe= iSecPerformancePpiGuid ## CONSUMES+ gTopOfTemporaryRamPpiGui= d ## PRODUCES+ gEfiPeiFirmwareVolumeInfoPpiGuid ## PR= ODUCES+ gFspTempRamExitPpiGuid ## CONSUMES+ gPlatformIni= tTempRamExitPpiGuid ## CONSUMES++[Pcd]+ gUefiCpuPkgTokenSpaceGuid.= PcdPeiTemporaryRamStackSize ## CONSUMES+ gIntelFsp2WrapperTo= kenSpaceGuid.PcdFsptBaseAddress ## CONSUMES+ gIntelFsp2Pk= gTokenSpaceGuid.PcdFspTemporaryRamSize ## CONSUMES+ gMinP= latformPkgTokenSpaceGuid.PcdSecSerialPortDebugEnable ## CONSUMES+= +[FixedPcd]+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase = ## CONSUMES+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize = ## CONSUMES+ gMinPlatformPkgTokenSpaceGuid.PcdMicrocodeOffse= tInFv ## CONSUMES+ gIntelFsp2WrapperTokenSpaceGuid.PcdFlash= CodeCacheAddress ## CONSUMES+ gIntelFsp2WrapperTokenSpaceGuid.P= cdFlashCodeCacheSize ## CONSUMES+ gIntelFsp2WrapperTokenSpac= eGuid.PcdFspmBaseAddress ## CONSUMES+ gIntelFsp2WrapperTo= kenSpaceGuid.PcdFspModeSelection ## CONSUMES+ gMinPlatform= PkgTokenSpaceGuid.PcdFspDispatchModeUseFspPeiMain ## CONSUMES+ gMinP= latformPkgTokenSpaceGuid.PcdFspWrapperBfvforResetVectorInFsp ## CONSUMES+= gMinPlatformPkgTokenSpaceGuid.PcdFsptUpdHeaderRevision ## CO= NSUMES+ gMinPlatformPkgTokenSpaceGuid.PcdFsptArchUpdRevision = ## CONSUMESdiff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/= SecFspWrapperPlatformSecLib/SecGetPerformance.c b/Platform/Intel/MinPlatfor= mPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c index ac2deeabec..1699bd9710 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecGetPerformance.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/SecGetPerformance.c @@ -1,7 +1,7 @@ /** @file Sample to provide SecGetPerformance function. -Copyright (c) 2= 017 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2017 = - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier= : BSD-2-Clause-Patent **/@@ -58,6 +58,7 @@ SecGetPerformance ( if (EFI_ERROR (Status)) { return EFI_NOT_FOUND; }+ // // |----= ----------| <- TopOfTemporaryRam - BL // | List Ptr |@@ -77,12 +78,12= @@ SecGetPerformance ( // | TSC[31:00] | // |--------------| //- TopOfTemporaryRam =3D (= UINTN) TopOfTemporaryRamPpi - sizeof (UINT32);- TopOfTemporaryRam -=3D siz= eof (UINT32) * 2;- Count =3D *(UINT32 *)(TopOfTemporaryRam - s= izeof (UINT32));+ TopOfTemporaryRam =3D (UINTN) TopOfTemporaryRamPpi - siz= eof (UINTN);+ TopOfTemporaryRam -=3D sizeof(UINTN) * 2;+ Count = =3D *(UINT32 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32)); Size = =3D Count * sizeof (UINT32); - Ticker =3D *(UINT64 *) (TopOfTemp= oraryRam - sizeof (UINT32) - Size - sizeof (UINT32) * 2);+ Ticker =3D *(UI= NT64 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32) - Size - sizeof (UINT6= 4)); Performance->ResetEnd =3D GetTimeInNanoSecond (Ticker); return EF= I_SUCCESS;diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/Sec= FspWrapperPlatformSecLib/SecPlatformInformation.c b/Platform/Intel/MinPlatf= ormPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformatio= n.c index 24d55ed838..4cbde95c2d 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecPlatformInformation.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/SecPlatformInformation.c @@ -1,7 +1,7 @@ /** @file Provide SecPlatformInformation function. -Copyright (c) 2017 -= 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 202= 4, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD= -2-Clause-Patent **/@@ -59,9 +59,9 @@ SecPlatformInformation ( // This routine copies the BIST information to the buffer pointed by /= / PlatformInformationRecord for output. //- TopOfTemporaryRam =3D (UINTN= ) TopOfTemporaryRamPpi - sizeof (UINT32);- TopOfTemporaryRam -=3D sizeof (= UINT32) * 2;- Count =3D *((UINT32 *)(TopOfTemporaryRam - sizeo= f (UINT32)));+ TopOfTemporaryRam =3D (UINTN) TopOfTemporaryRamPpi - sizeof= (UINTN);+ TopOfTemporaryRam -=3D sizeof (UINTN) * 2;+ Count = =3D *((UINT32 *)(UINTN) (TopOfTemporaryRam - sizeof (UINT32))); Size = =3D Count * sizeof (IA32_HANDOFF_STATUS); if ((*StructureSize) = < (UINT64) Size) {diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Lib= rary/SecFspWrapperPlatformSecLib/SecRamInitData.c b/Platform/Intel/MinPlatf= ormPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecRamInitData.c index 355d1e6509..49d5302a7b 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecRamInitData.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/SecRamInitData.c @@ -1,7 +1,7 @@ /** @file Provide TempRamInitParams data. -Copyright (c) 2017 - 2021, In= tel Corporation. All rights reserved.
+Copyright (c) 2017 - 2024, Intel = Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause= -Patent **/@@ -12,25 +12,70 @@ SPDX-License-Identifier: BSD-2-Clause-Paten= t typedef struct { FSP_UPD_HEADER FspUpdHeader;+#if FixedPcdGet8 (PcdF= sptArchUpdRevision) =3D=3D 1+ FSPT_ARCH_UPD FsptArchUpd;+#elif FixedPc= dGet8 (PcdFsptArchUpdRevision) =3D=3D 2+ FSPT_ARCH2_UPD FsptArchUpd;+#e= ndif FSPT_CORE_UPD FsptCoreUpd;-} FSPT_UPD_CORE_DATA;+ UINT16 = UpdTerminator;+} FSPT_UPD_DATA; -GLOBAL_REMOVE_IF_UNREFERENCED CONST F= SPT_UPD_CORE_DATA FsptUpdDataPtr =3D {+GLOBAL_REMOVE_IF_UNREFERENCED CONST = FSPT_UPD_DATA FsptUpdDataPtr =3D { {- 0x4450555F54505346,- 0x00,- = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,- 0x00,= 0x00, 0x00, 0x00, 0x00, 0x00, 0x00+ 0x4450555F54505346, = // FSP-T UPD Header Signature - FSPT_UPD+ Fix= edPcdGet8 (PcdFsptUpdHeaderRevision), // FSP-T UPD Hea= der Revision+ { = // Reserved[23]+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0= x00, 0x00,+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00= ,+ 0x00, 0x00, 0x00 } },+#if FixedPcdGet8 (PcdFsptArchUpdRevisio= n) =3D=3D 1 {- FixedPcdGet32 (PcdFlashFvMicrocodeBase) + FixedPcdGet32= (PcdMicrocodeOffsetInFv),- FixedPcdGet32 (PcdFlashFvMicrocodeSize) - Fi= xedPcdGet32 (PcdMicrocodeOffsetInFv),- 0, // Set CodeRegionBase= as 0, so that caching will be 4GB-(CodeRegionSize > LLCSize ? LLCSize : Co= deRegionSize) will be used.- FixedPcdGet32 (PcdFlashCodeCacheSize),- = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,+ 0x01, = // FSP-T ARCH UPD Revi= sion+ { // R= eserved[3]+ 0x00, 0x00, 0x00+ },+ 0x00000020, = // Length of FSP-T ARCH UPD+ 0, = // FspDebugHandler+ {= // Reserved1[2= 0]+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,+ = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00+ }+ },+#elif= FixedPcdGet8 (PcdFsptArchUpdRevision) =3D=3D 2+ {+ 0x02, = // FSP-T ARCH2 UPD Revision+ = { // Reserved[3= ]+ 0x00, 0x00, 0x00+ },+ 0x00000020, = // Length of FSP-T ARCH2 UPD+ 0, = // FspDebugHandler+ { = // Reserved1[16]+ = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x= 00, 0x00, 0x00, 0x00, 0x00 }- }+ },+#endif+#if FixedPcdGet8 (PcdFsptA= rchUpdRevision) <=3D 1+ {+ FixedPcdGet32 (PcdFlashFvMicrocodeBase) + Fi= xedPcdGet32 (PcdMicrocodeOffsetInFv), // MicrocodeRegionBase+ FixedPcdGe= t32 (PcdFlashFvMicrocodeSize) - FixedPcdGet32 (PcdMicrocodeOffsetInFv), // = MicrocodeRegionSize+ 0, // Set CodeRegionBase as 0, so that caching will= be 4GB-(CodeRegionSize > LLCSize ? LLCSize : CodeRegionSize) will be used.= + FixedPcdGet32 (PcdFlashCodeCacheSize), = // CodeRegionSize+ { = // Reserved[16]+ 0x00, 0x00, = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,+ 0x00, 0x00, 0x00, 0x0= 0, 0x00, 0x00+ }+ },+#else+ {+ FixedPcdGet32 (PcdFlashFvMicrocodeBa= se) + FixedPcdGet32 (PcdMicrocodeOffsetInFv), // MicrocodeRegionBase+ Fi= xedPcdGet32 (PcdFlashFvMicrocodeSize) - FixedPcdGet32 (PcdMicrocodeOffsetIn= Fv), // MicrocodeRegionSize+ 0, // Set CodeRegionBase as 0, so that cach= ing will be 4GB-(CodeRegionSize > LLCSize ? LLCSize : CodeRegionSize) will = be used.+ FixedPcdGet32 (PcdFlashCodeCacheSize) = // CodeRegionSize+ },+#endif+ 0x55AA };-diff --git a/= Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLi= b/X64/PeiCoreEntry.nasm b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/= SecFspWrapperPlatformSecLib/X64/PeiCoreEntry.nasm new file mode 100644 index 0000000000..af3affcf7f --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/X64/PeiCoreEntry.nasm @@ -0,0 +1,202 @@ +;-------------------------------------------------------------------------= -----+;+; Copyright (c) 2024, Intel Corporation. All rights reserved.
+;= SPDX-License-Identifier: BSD-2-Clause-Patent+;+; Module Name:+;+; PeiCore= Entry.nasm+;+; Abstract:+;+; Find and call SecStartup+;+;----------------= --------------------------------------------------------------++SECTION .te= xt++extern ASM_PFX(SecStartup)+extern ASM_PFX(PlatformInit)+extern ASM_PFX(= PcdGet64 (PcdFspWrapperBfvforResetVectorInFsp))++;-------------------------= ----------------------------------------------------+; Macro: PUSHA= _64+;+; Description: Saves all registers on stack+;+; Input: None= +;+; Output: None+;-------------------------------------------------= ----------------------------+%macro PUSHA_64 0+ push r8+ push r9+= push r10+ push r11+ push r12+ push r13+ push r14+ pus= h r15+ push rax+ push rcx+ push rdx+ push rbx+ push = rsp+ push rbp+ push rsi+ push rdi+%endmacro++;-----------------= ------------------------------------------------------------+; Macro: = POPA_64+;+; Description: Restores all registers from stack+;+; Input:= None+;+; Output: None+;-------------------------------------= ----------------------------------------+%macro POPA_64 0+ pop rdi+ = pop rsi+ pop rbp+ pop rsp+ pop rbx+ pop rdx+ pop rcx= + pop rax+ pop r15+ pop r14+ pop r13+ pop r12+ pop = r11+ pop r10+ pop r9+ pop r8+%endmacro++global ASM_PFX(CallPeiC= oreEntryPoint)+ASM_PFX(CallPeiCoreEntryPoint):+ ;+ ; Per X64 calling conv= ention, make sure RSP is 16-byte aligned.+ ;+ mov rax, rsp+ and = rax, 0fh+ sub rsp, rax++ ;+ ; Platform init+ ;+ PUSHA_64+ sub = rsp, 20h+ call ASM_PFX(PlatformInit)+ add rsp, 20h+ POPA_64++ ;= + ; Set stack top pointer+ ;+ mov rsp, r8++ ;+ ; Push the hob list= pointer+ ;+ push rcx++ ;+ ; RBP holds start of BFV passed from Vtf0= . Save it to r10.+ ;+ mov r10, rbp++ ;+ ; Save the value+ ; RDX:= start of range+ ; r8: end of range+ ;+ mov rbp, rsp+ push rdx= + push r8+ mov r14, rdx+ mov r15, r8++ ;+ ; Push processor = count to stack first, then BIST status (AP then BSP)+ ;+ mov eax, 1+ = cpuid+ shr ebx, 16+ and ebx, 0000000FFh+ cmp bl, 1+ jae = PushProcessorCount++ ;+ ; Some processors report 0 logical processors. = Effectively 0 =3D 1.+ ; So we fix up the processor count+ ;+ inc eb= x++PushProcessorCount:+ sub rsp, 4+ mov rdi, rsp+ mov DWORD = [rdi], ebx++ ;+ ; We need to implement a long-term solution for BIST capt= ure. For now, we just copy BSP BIST+ ; for all processor threads+ ;+ xo= r ecx, ecx+ mov cl, bl+PushBist:+ sub rsp, 4+ mov rdi, r= sp+ movd eax, mm0+ mov DWORD [rdi], eax+ loop PushBist++ ;+ = ; FSP saves the timestamp of the beginning of firmware execution in mm5.+ = ; Get the timestamp from mm5 and then push to stack.+ ;+ movq rax, mm5= + push rax++ ;+ ; Per X64 calling convention, make sure RSP is 16-byt= e aligned.+ ;+ mov rax, rsp+ and rax, 0fh+ sub rsp, rax++ = ;+ ; Pass entry point of the PEI core+ ;+ mov rdi, 0FFFFFFE0h+ mov = edi, DWORD [rdi]+ mov r9, rdi++ ;+ ; Pass BFV into the PEI Core+= ;+ ; Reset Vector and initial SEC core (to initialize Temp Ram) is part = of FSP-O.+ ; Default UefiCpuPkg Reset Vector locates FSP-O as BFV. However= the actual+ ; SEC core that launches PEI is part of another FV. We need t= o pass that FV+ ; as BFV to PEI core.+ ;+ mov r8, ASM_PFX (PcdGet64 = (PcdFspWrapperBfvforResetVectorInFsp))+ mov rcx, QWORD[r8]+ mov r= 8, rcx++ ;+ ; Pass stack size into the PEI Core+ ;+ mov rcx, r15 = ; Start of TempRam+ mov rdx, r14 ; End of TempRam++ sub rcx, rdx= ; Size of TempRam++ ;+ ; Pass Control into the PEI Core+ ;+ sub r= sp, 20h+ call ASM_PFX(SecStartup)+diff --git a/Platform/Intel/MinPlatfo= rmPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/X64/SecEntry.nasm b/Pl= atform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/= X64/SecEntry.nasm new file mode 100644 index 0000000000..de8ba83d52 --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/X64/SecEntry.nasm @@ -0,0 +1,71 @@ +;-------------------------------------------------------------------------= -----+;+; Copyright (c) 2024, Intel Corporation. All rights reserved.
+;= SPDX-License-Identifier: BSD-2-Clause-Patent+; Module Name:+;+; SecEntry.= nasm+;+; Abstract:+;+; This is the code that passes control to PEI core.+;= +;-------------------------------------------------------------------------= -----++#include ++SECTION .text++extern ASM_PFX(CallPeiCoreEntryPo= int)+extern ASM_PFX(FsptUpdDataPtr)+; Pcds+extern ASM_PFX(PcdGet32 (Pcd= FspTemporaryRamSize))++;---------------------------------------------------= -------------------------+;+; Procedure: _ModuleEntryPoint+;+; Input: = None+;+; Output: None+;+; Destroys: Assume all registers+;+;= Description:+;+; After TempRamInit done, pass control to PEI core.+;+; Re= turn: None+;+; MMX Usage:+; MM0 =3D BIST State+;+;-----= -----------------------------------------------------------------------++BI= TS 64+align 16+global ASM_PFX(_ModuleEntryPoint)+ASM_PFX(_ModuleEntryPoint)= :+ push rax+ mov rax, ASM_PFX(FsptUpdDataPtr) ; This is dummy cod= e to include TempRamInitParams in SecCore for FSP-O.+#if FixedPcdGet8(PcdFs= pModeSelection) =3D=3D 1+ mov rax, ASM_PFX(PcdGet32 (PcdFspTemporaryRa= mSize))+ sub edx, dword [rax] ; TemporaryRam for FSP+#end= if+ pop rax++ mov r8, rdx+ mov rdx, rcx+ xor ecx, ecx = ; zero - no Hob List Yet+ mov rsp, r8++ ;+ ; Pe= r X64 calling convention, make sure RSP is 16-byte aligned.+ ;+ mov r= ax, rsp+ and rax, 0fh+ sub rsp, rax++ call ASM_PFX(CallPeiCor= eEntryPoint)++ jmp $diff --git a/Platform/Intel/MinPlatformPkg/FspWrap= per/Library/SecFspWrapperPlatformSecLib/X64/Stack.nasm b/Platform/Intel/Min= PlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/X64/Stack.nasm new file mode 100644 index 0000000000..21010bf4ef --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat +++ formSecLib/X64/Stack.nasm @@ -0,0 +1,72 @@ +;-------------------------------------------------------------------------= -----+;+; Copyright (c) 2024, Intel Corporation. All rights reserved.
+;= SPDX-License-Identifier: BSD-2-Clause-Patent+; Abstract:+;+; Switch the = stack from temporary memory to permanent memory.+;+;-----------------------= -------------------------------------------------------++ SECTION .text+= +;-------------------------------------------------------------------------= -----+; VOID+; EFIAPI+; SecSwitchStack (+; UINT32 TemporaryMemoryBase,+= ; UINT32 PermanentMemoryBase+; );+;----------------------------------= --------------------------------------------+global ASM_PFX(SecSwitchStack)= +ASM_PFX(SecSwitchStack):+ ;+ ; Save four register: rax, rbx, rcx, rd= x+ ;+ push rax+ push rbx+ push rcx+ push rdx++ ;+ = ; !!CAUTION!! this function address's is pushed into stack after+ ; migr= ation of whole temporary memory, so need save it to permanent+ ; memory = at first!+ ;++ mov rbx, rcx ; Save the first parame= ter+ mov rcx, rdx ; Save the second parameter++ ;+ = ; Save this function's return address into permanent memory at first.+ = ; Then, Fixup the esp point to permanent memory+ ;+ mov rax, rsp+= sub rax, rbx+ add rax, rcx+ mov rdx, qword [rsp] ; = copy pushed register's value to permanent memory+ mov qword [rax], rdx= + mov rdx, qword [rsp + 8]+ mov qword [rax + 8], rdx+ mov rd= x, qword [rsp + 16]+ mov qword [rax + 16], rdx+ mov rdx, qword [r= sp + 24]+ mov qword [rax + 24], rdx+ mov rdx, qword [rsp + 32] = ; Update this function's return address into permanent memory+ mov qw= ord [rax + 32], rdx+ mov rsp, rax ; From now, rsp is p= ointed to permanent memory++ ;+ ; Fixup the rbp point to permanent me= mory+ ;+ mov rax, rbp+ sub rax, rbx+ add rax, rcx+ mov= rbp, rax ; From now, rbp is pointed to permanent memory+= + pop rdx+ pop rcx+ pop rbx+ pop rax+ ret+diff --git= a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSe= cLib/Ia32/Fsp.h b/Platform/Intel/MinPlatformPkg/Include/Fsp.h similarity index 79% rename from Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperP= latformSecLib/Ia32/Fsp.h rename to Platform/Intel/MinPlatformPkg/Include/Fsp.h index 9f6cdcf476..319e1e3372 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/Ia32/Fsp.h +++ b/Platform/Intel/MinPlatformPkg/Include/Fsp.h @@ -1,7 +1,7 @@ /** @file Fsp related definitions -Copyright (c) 2017, Intel Corporation= . All rights reserved.
+Copyright (c) 2017 - 2024, Intel Corporation. Al= l rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ = -36,7 +36,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // // Fsp Header //-#define FSP_HEADER_IMAGEBASE_OFFSET 0x1C-#define F= SP_HEADER_TEMPRAMINIT_OFFSET 0x30+#define FSP_HEADER_IMAGEBASE_OFFSET 0= x1C+#define FSP_HEADER_TEMPRAMINIT_OFFSET 0x30 #endifdiff --git a/Platform= /Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/Mi= nPlatformPkg.dec index a14c6b2db5..12f86585ad 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -6,7 +6,7 @@ # INF files to generate AutoGen.c and AutoGen.h files # for the build infr= astructure. #-# Copyright (c) 2017 - 2021, Intel Corporation. All rights re= served.
+# Copyright (c) 2017 - 2024, Intel Corporation. All rights rese= rved.
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights rese= rved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent@@ -393,6 +393,21= @@ # gMinPlatformPkgTokenSpaceGuid.PcdFspDispatchModeUseFspPeiMain|TRUE|B= OOLEAN|0xF00000A8 + ## BFV Location for Reset Vector in FSP+ # The defaul= t of BFV Location for Reset Vector in FSP is 0x00000000FFFF0000.+ #+ gMin= PlatformPkgTokenSpaceGuid.PcdFspWrapperBfvforResetVectorInFsp|0x00000000FFF= F0000|UINT64|0xF00000A9++ ## FSP-T UPD Header Revision+ # The default of = FSP-T UPD Header Revision is 0.+ #+ gMinPlatformPkgTokenSpaceGuid.PcdFspt= UpdHeaderRevision|0x0|UINT8|0xF00000AA++ ## FSP-T ARCH UPD Revision+ # Th= e default of FSP-T ARCH UPD Revision is 0.+ #+ gMinPlatformPkgTokenSpaceG= uid.PcdFsptArchUpdRevision|0x0|UINT8|0xF00000AC+ [PcdsFeatureFlag] gMinP= latformPkgTokenSpaceGuid.PcdStopAfterDebugInit |FALSE|BOOLEAN|0xF00000A= 1--=20 2.40.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114480): https://edk2.groups.io/g/devel/message/114480 Mute This Topic: https://groups.io/mt/103478590/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-