From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web08.9773.1649256846882324995 for ; Wed, 06 Apr 2022 07:54:07 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=HKK8X0po; spf=pass (domain: intel.com, ip: 134.134.136.65, 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=1649256847; x=1680792847; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=mH2bAY+g1bBumMCnI/SleWhmKb7Bxq1LhYfi1fiGXZQ=; b=HKK8X0pokNcXdANSHQJcp8JIrQaK+e5fzreKEmwaK3k2FtP97eZyMqkD Ly9ayZ2VTMdjgEsIAIXBd3KbQdZQmB81MY8ggY/ZRulCkuI4bVnKk/A78 GnMFQUKWYctM3HI1/quZu3pGX/jtBdVle65GQz1KThx6bnEHrRC3fyXtY rx19fNzZi/K5wTrUbqqh7WLdR6Vq40jskIxK0Y/TtzWFOaXS0uDoxhL9z FsWuTYGIQEIZCkt0dSoChWEE4gWtKYMbsjtQg5eINFvRCDKvAYHYYBlgk jCVSlP8QLCVL7VXm76uA2HSChN0qy/lKJm8iiDolx+uNzZkhxH6Dqcvx1 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="261063930" X-IronPort-AV: E=Sophos;i="5.90,240,1643702400"; d="scan'208";a="261063930" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 07:54:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,240,1643702400"; d="scan'208";a="790828957" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 06 Apr 2022 07:54:05 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2308.27; Wed, 6 Apr 2022 07:54:05 -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.2308.27 via Frontend Transport; Wed, 6 Apr 2022 07:54:05 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) 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.2308.27; Wed, 6 Apr 2022 07:54:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZBWtdIB7brjSiKxdRFzhD4qoTOWdcidwpitjgsmPartJ5TyqDc6zOpabthW3fk1IOJEJZM8WDooORPLB6EvBX4QiGJ36EtIalU79BnmhsryyE8GXkp+SmP+WTJ4L625P9GzBi9mfO6s8Wh3FuM4jqNHAZm0uDV5TcJ2Lz7p9CT+yDzcistOa4n4XBbuDZWP6FoBEGnCjDk+8Joye2M205fY4n7r5onpKLogq1hWomipktfwu/EvFPGxAQBDN8bjSaOk9+EuVrDXBPBDqFBqhWn1ye7FJjOBsm/SlsaxrwqS8l+nxSXjvFJDY6SVi9xPufjXHSvRdMgLVzhE9yUCC6Q== 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=aJ5Xzr6mFtmt0usmjCh2ojdO2Q05GzUJ1bmo9AkAnoo=; b=MCY9m9lAEUTt5A/YjUZe+ywscNGZP+bH1CL74P9eVrkYonuX1e3KOEbhGaVK5VnS/8f3EBu1Ihx+L2GSbx51atyfKqApqNorEgjiV1BQUa7WSHNk0oNKwwDNKTOBIOYCqcAsPeuM0PPhvndf9iNoH18WBwAEAFHAh9+6odgm+wBwI9YPILuW+azyRq1AWlrKdQAje7KHvi2WKyrYwwKe8RU4sgRI9bwPrbpl2G8bMoehKORSUm+iyC10DsWa0r4PiXu6v1arm0AuL5o7SOAngP/PRwUSriPOw/WrWgb5qVfL06w85VG41npN02k0PIY1jmx+yC285jcTAZSpY2bpsg== 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 SN6PR11MB2670.namprd11.prod.outlook.com (2603:10b6:805:61::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.21; Wed, 6 Apr 2022 14:54:02 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::c076:6436:db8e:ee22]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::c076:6436:db8e:ee22%7]) with mapi id 15.20.5144.019; Wed, 6 Apr 2022 14:54:02 +0000 From: "Chiu, Chasel" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "S, Ashraf Ali" Subject: Re: [edk2-devel][PATCH v2 1/8] IntelFsp2Pkg: X64 compatible changes to support PEI in 64bit Thread-Topic: [edk2-devel][PATCH v2 1/8] IntelFsp2Pkg: X64 compatible changes to support PEI in 64bit Thread-Index: AQHYR+yA2Ii34PDSyEKbBJQSqFvPLqzi+8fQ Date: Wed, 6 Apr 2022 14:54:02 +0000 Message-ID: References: <0d8259c44249ad6f4279965cfdfa90108c6ce7c8.1649053236.git.ted.kuo@intel.com> In-Reply-To: <0d8259c44249ad6f4279965cfdfa90108c6ce7c8.1649053236.git.ted.kuo@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.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1828a31e-813e-4a8a-5875-08da17dd4a4b x-ms-traffictypediagnostic: SN6PR11MB2670:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uOJasu06ILn8FrsAf4zWWyLx7eqYvKyqwHGpDx2+KVPb3WSn/CkGjnRJdBD0BZeUvFrSkgc8u997hvye4ageFd04QCJMwnv33a0mzroAwsbKIxTTE3u1JK/iMmY38Us6I+JJ8s52wvriMIvpdE0+UgfQ1dYZh4PYYiWy7+t+l6vTKAnyBvqIdlIXbeMjBafcSvi4C4uhmvnxiQLcGx3H+i5ORhGATJ2L2WADRW+4mLy/8fLTqbqbOm8uUzXf9mqgfILWySCOdxeD1sMrYkHL2Jl8PEJU/RcMScdi3TFOiz622s6UPbr1wFIQF/o/zxmGPK0EMLTtkKUaZrD6sEQi4nguuIQtd/0sT95C+xirOMYzkPOj1ryzNmPWO+Wc2k2MAvzzpXDKJJ3iUfgFkn4i21yD/MEkgtmr7bDnrqFW0N/n05fRGKdKQE3Z9q8Y4pofM5ULJMFyMWfXe2rH58w5z+EYT5t+KDzjKLlrKrgTNl9scAJXZ/kKP+03s4SdB1pGxFyXRZKl4x5zlUT/0ZPQlJi+LWNDt2+3LbrNerY62c0+E9Ku9UuzLZlsO0uClRtJh+gaWvLjd+nsWZWbZ1jwrlc6Exp4O8QEcg6yY5rr5AVtLkFcu/TP0ePSt/CM2ow7LMn9yT3B1JGdogkHF5EQzBroOVIZsrjaX3PtOruB9KxKvgoIdD0PeG1AzlOw1V8eu3ogUAdfPoALXjPZePVYYzUZw1Kv6gBsA+m1thUh/RSGZvfMwqeGu+0+57wXUHJdhOXN9xFX/V4JPHPWmjFTw0keCWvpME7n+EYf1bFbmhHkKeHDeVgJgs87Az8wahlJ 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:(13230001)(366004)(9686003)(508600001)(53546011)(7696005)(6506007)(83380400001)(186003)(26005)(107886003)(2906002)(5660300002)(55016003)(8936002)(19627235002)(54906003)(71200400001)(316002)(110136005)(52536014)(66476007)(4326008)(8676002)(64756008)(76116006)(66556008)(66446008)(66946007)(122000001)(82960400001)(86362001)(38100700002)(33656002)(38070700005)(11716005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oq1AWK2b3pcStiK+bLizR5/inFe/DUpB9VElAzGHgCLo3FkZudn78vYr0gQ0?= =?us-ascii?Q?KYQMvrwf41zFxbGcBvzSJDJTpjGo3HKFaIEVqLrQ9aPKOP4c5Z/wUOES4ojy?= =?us-ascii?Q?hmwz1vP4rr2AotaxCLFsfXY5MRFIPp42nPxEX9QYgC6ZGNDwG456SCHSlKId?= =?us-ascii?Q?adgal0Ixt6CQy1wK3mAL7sjdJMhLVhVX0nUwfMACvig54p7tCJfHF7zUGSfm?= =?us-ascii?Q?Wq2ayrxi8prIF/+GJi6wBC18A/VqtlCnHky7oDLyZEv5AVZYezIvkHvCKBCw?= =?us-ascii?Q?Ny6RGsw+3bRvXwvi3Rjc12kzxx1Apt1XgJmWiAX4JFNBqylLOl45f9cV2W80?= =?us-ascii?Q?2a+FjuQM4nuGMm+QJT4uQG20fXN8tjtWBgVmFsABRK2Ms2zJZfDhlSPgoc3X?= =?us-ascii?Q?bfmvoY+B7tiL9bToIpmm6KGAidQq9qs7ntQMqpB+15/SjCFR+r/Q8A4vlXTz?= =?us-ascii?Q?S5+E0T8fapM01q2q4kOHLTbFDs7x2Ruj9dlGAMIt4moV2bS7uSQdEub/jCgA?= =?us-ascii?Q?v6Oq10c6UikdqLCb+7CQ+0mM4++97bMLyONqi804ykjxFp6/Gv0DIgMiMRO3?= =?us-ascii?Q?2rMKIgkSJ4vqorpoREqBA7/UgNtb8AW8SpwbV6EJ/iPUtsEka+OMwyqBoRq0?= =?us-ascii?Q?m2yQHkuzMwlz7JOH1ffa2Gh9h21Bl/Vas9CsaDN3fyPTjVfE8R+HgfKvLbk1?= =?us-ascii?Q?JBkH+BSUKUBpJyezFSDhZ9lthGR2ChGNwtAKwcCbzgHz3syVwcgrJmXYTzoD?= =?us-ascii?Q?L36ntgC0IHdBgOmiR2ZchRC+u3mduHcdCebQ3+eX3V7FG0JFDzvaN1Rbx60T?= =?us-ascii?Q?B7QjIvpBtDdQldrTQajF60fQK2gKT0T6/9UzYJ8oqCv5sbyrI/h5MGCVOW+j?= =?us-ascii?Q?fLf6zP5P9JMWIveP7FJZZh+THjACFmqlLQaVWMtPuFZ9XCQby0NIV3FAlgaa?= =?us-ascii?Q?VCpRPLXqXYTtH1LKCZkpLXRnvi1uC9q2ZFFZoImvj6FaqC3/wZ0peAihA2Ym?= =?us-ascii?Q?LDFB5PUgm1tjzGXmud3Rck01ygiia5gtSwHiSs9rB2LJWllzziwGh2jsE1w6?= =?us-ascii?Q?fF8iETo5XCyqJQBgnLPXbbkDFGTYHXUpXiJoSUxNwQWz0Zb5BLZDDfqoc4EP?= =?us-ascii?Q?ZZXHOipN7joR14jqLFTQbL2fmpgkWpDMoY8B6ClHliyokbloBSKOhhjF/Rcb?= =?us-ascii?Q?eLaY+/3DGS5tTlHPHcWGjj9cZTm1lRm9hxpPIjvY1xsHvLJb4qwP3Yj4g+mu?= =?us-ascii?Q?r15r+bFhzNXBfJ9mbGrhpoJN+5msOeniKhsUdmJgQrspfg8nDe+9EXGKr4sr?= =?us-ascii?Q?Twvz8rR/5QVaxaNEyNfi8zC3tQ5bl15rgoPdWY7r4Lu4XUFqPLx3AUytIvNM?= =?us-ascii?Q?SKN6Vz5qAtpa0c3XWX6xeiymtaEZeRLQR+xi11VOkOqsGFX7QNhqmjiEMTjZ?= =?us-ascii?Q?Pp2wShY2FHGRkNvcLdE4yAMX/fADaOZOq5DGTVUzFh4oAd5Ioo0NRjAJn7Z/?= =?us-ascii?Q?qXr0RY6S26OOLQWtqQzChftqLniQ/IJwgj0YJyQoI2eCELcAwTYtOww1q7/H?= =?us-ascii?Q?PSoO+/+nTL9wIhSA2AFDZXmeBqy/CGTRaC3YPeQsbCT3WjF4/bG7LWlcC7lz?= =?us-ascii?Q?ULGKkJJVzipBQc02MEue+7JW5aNT1Xn8w77luD3b1fXtSm1Yz+CWhAvDXGsM?= =?us-ascii?Q?aeAuUAOpnPk2zejyH6NCJFX3wNnzj5OJ2U0musJ2oM4gwAa3DaC+7UDGbE85?= =?us-ascii?Q?7kfH+puRDg=3D=3D?= 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: 1828a31e-813e-4a8a-5875-08da17dd4a4b X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2022 14:54:02.6291 (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: aL2s4Py2VU90bQvncXuaPCgsBf/N09IuZsaij7WjeOyA2rVZ5QvupckJUdVN0TcP0k5uTnEORB1O8uuQy5CC8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2670 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 Hi Ted, Please see my comments inline below. Thanks, Chasel > -----Original Message----- > From: Kuo, Ted > Sent: Monday, April 4, 2022 2:23 PM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star ; S, > Ashraf Ali > Subject: [edk2-devel][PATCH v2 1/8] IntelFsp2Pkg: X64 compatible changes > to support PEI in 64bit >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3893 > 1.Added EFIAPI to FspNotifyPhasePeimEntryPoint. > 2.Changed AsmReadEsp to AsmReadStackPointer. > 3.Changed the type of the return value of AsmReadStackPointer > from UINT32 to UINTN. > 4.Changed the type of TemporaryMemoryBase, PermenentMemoryBase > and BootLoaderStack from UINT32 to UINTN. > 5.Some type casting to pointers are UINT32. Changed them to > UINTN to accommodate both IA32 and X64. > 6.Corrected some typos. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ashraf Ali S > Signed-off-by: Ted Kuo > --- > IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.c | 1 + > IntelFsp2Pkg/FspSecCore/Ia32/ReadEsp.nasm | 8 ++++= ---- > IntelFsp2Pkg/FspSecCore/Ia32/Stack.nasm | 10 ++++= +----- > IntelFsp2Pkg/FspSecCore/SecFsp.c | 8 ++++= ---- > IntelFsp2Pkg/FspSecCore/SecFsp.h | 2 +- > IntelFsp2Pkg/FspSecCore/SecFspApiChk.c | 8 ++++= ---- > IntelFsp2Pkg/FspSecCore/SecMain.c | 8 ++++= ---- > IntelFsp2Pkg/FspSecCore/SecMain.h | 10 ++++= +----- > IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm | 2 +- > 9 files changed, 29 insertions(+), 28 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.c > b/IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.c > index 88f5540fef..66d39cc70c 100644 > --- a/IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.c > +++ b/IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.c > @@ -112,6 +112,7 @@ WaitForNotify ( > @retval EFI_OUT_OF_RESOURCES Insufficient resources to create > database > **/ > EFI_STATUS > +EFIAPI > FspNotifyPhasePeimEntryPoint ( > IN EFI_PEI_FILE_HANDLE FileHandle, > IN CONST EFI_PEI_SERVICES **PeiServices > diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/ReadEsp.nasm > b/IntelFsp2Pkg/FspSecCore/Ia32/ReadEsp.nasm > index 8046b43745..d40dad5a52 100644 > --- a/IntelFsp2Pkg/FspSecCore/Ia32/ReadEsp.nasm > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/ReadEsp.nasm > @@ -9,14 +9,14 @@ > SECTION .text >=20 > ;-----------------------------------------------------------------------= ------- > -; UINT32 > +; UINTN > ; EFIAPI > -; AsmReadEsp ( > +; AsmReadStackPointer ( > ; VOID > ; ); > ;-----------------------------------------------------------------------= ------- > -global ASM_PFX(AsmReadEsp) > -ASM_PFX(AsmReadEsp): > +global ASM_PFX(AsmReadStackPointer) > +ASM_PFX(AsmReadStackPointer): > mov eax, esp > ret >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/Stack.nasm > b/IntelFsp2Pkg/FspSecCore/Ia32/Stack.nasm > index 5a7e27c240..ce20639890 100644 > --- a/IntelFsp2Pkg/FspSecCore/Ia32/Stack.nasm > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/Stack.nasm > @@ -9,20 +9,20 @@ > ; > ;-----------------------------------------------------------------------= ------- >=20 > -SECTION .text > + SECTION .text >=20 > ;-----------------------------------------------------------------------= ------- > ; VOID > ; EFIAPI > ; SecSwitchStack ( > ; UINT32 TemporaryMemoryBase, > -; UINT32 PermenentMemoryBase > +; UINT32 PermanentMemoryBase > ; ); > ;-----------------------------------------------------------------------= ------- > global ASM_PFX(SecSwitchStack) > ASM_PFX(SecSwitchStack): > ; > - ; Save three register: eax, ebx, ecx > + ; Save four register: eax, ebx, ecx, edx > ; > push eax > push ebx > @@ -55,7 +55,7 @@ ASM_PFX(SecSwitchStack): > mov dword [eax + 12], edx > mov edx, dword [esp + 16] ; Update this function's return addre= ss > into permanent memory > mov dword [eax + 16], edx > - mov esp, eax ; From now, esp is pointed to per= manent > memory > + mov esp, eax ; From now, esp is pointed to permane= nt > memory >=20 > ; > ; Fixup the ebp point to permanent memory @@ -63,7 +63,7 @@ > ASM_PFX(SecSwitchStack): > mov eax, ebp > sub eax, ebx > add eax, ecx > - mov ebp, eax ; From now, ebp is pointed to permanen= t > memory > + mov ebp, eax ; From now, ebp is pointed to permane= nt > memory >=20 > pop edx > pop ecx > diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.c > b/IntelFsp2Pkg/FspSecCore/SecFsp.c > index 68e588dd41..85fbc7664c 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFsp.c > +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.c > @@ -26,7 +26,7 @@ FspGetExceptionHandler ( > IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor; > FSP_INFO_HEADER *FspInfoHeader; >=20 > - FspInfoHeader =3D (FSP_INFO_HEADER *)AsmGetFspInf= oHeader > (); > + FspInfoHeader =3D (FSP_INFO_HEADER > *)(UINTN)AsmGetFspInfoHeader (); > ExceptionHandler =3D IdtEntryTemplate; > IdtGateDescriptor =3D (IA32_IDT_GATE_DESCRIPTOR > *)&ExceptionHandler; > Entry =3D (IdtGateDescriptor->Bits.Offset= High << 16) | > IdtGateDescriptor->Bits.OffsetLow; > @@ -115,7 +115,7 @@ SecGetPlatformData ( VOID FspGlobalDataInit ( > IN OUT FSP_GLOBAL_DATA *PeiFspData, > - IN UINT32 BootLoaderStack, > + IN UINTN BootLoaderStack, > IN UINT8 ApiIdx > ) > { > @@ -141,7 +141,7 @@ FspGlobalDataInit ( > // Get FSP Header offset > // It may have multiple FVs, so look into the last one for FSP header > // > - PeiFspData->FspInfoHeader =3D (FSP_INFO_HEADER > *)AsmGetFspInfoHeader (); > + PeiFspData->FspInfoHeader =3D (FSP_INFO_HEADER > + *)(UINTN)AsmGetFspInfoHeader (); > SecGetPlatformData (PeiFspData); >=20 > // > @@ -154,7 +154,7 @@ FspGlobalDataInit ( > // > FspmUpdDataPtr =3D (VOID *)GetFspApiParameter (); > if (FspmUpdDataPtr =3D=3D NULL) { > - FspmUpdDataPtr =3D (VOID *)(PeiFspData->FspInfoHeader->ImageBase + > PeiFspData->FspInfoHeader->CfgRegionOffset); > + FspmUpdDataPtr =3D (VOID > + *)(UINTN)(PeiFspData->FspInfoHeader->ImageBase + > + PeiFspData->FspInfoHeader->CfgRegionOffset); > } >=20 > SetFspUpdDataPointer (FspmUpdDataPtr); diff --git > a/IntelFsp2Pkg/FspSecCore/SecFsp.h b/IntelFsp2Pkg/FspSecCore/SecFsp.h > index 7c9be85fe0..7fb31c3f87 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFsp.h > +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h > @@ -48,7 +48,7 @@ FspGetExceptionHandler ( VOID FspGlobalDataInit ( > IN OUT FSP_GLOBAL_DATA *PeiFspData, > - IN UINT32 BootLoaderStack, > + IN UINTN BootLoaderStack, > IN UINT8 ApiIdx > ); >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > index 7d6ef11fe7..c57247bfaf 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c > @@ -31,7 +31,7 @@ FspApiCallingCheck ( > // > // NotifyPhase check > // > - if ((FspData =3D=3D NULL) || ((UINT32)FspData =3D=3D 0xFFFFFFFF)) { > + if ((FspData =3D=3D NULL) || ((UINTN)FspData =3D=3D MAX_ADDRESS)) { > Status =3D EFI_UNSUPPORTED; > } else { > if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) { @@ -42,7 > +42,7 @@ FspApiCallingCheck ( > // > // FspMemoryInit check > // > - if ((UINT32)FspData !=3D 0xFFFFFFFF) { > + if ((UINTN)FspData !=3D 0xFFFFFFFF) { Compare with MAX_ADDRESS instead of 0xFFFFFFFF > Status =3D EFI_UNSUPPORTED; > } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx, ApiParam))) { > Status =3D EFI_INVALID_PARAMETER; > @@ -51,7 +51,7 @@ FspApiCallingCheck ( > // > // TempRamExit check > // > - if ((FspData =3D=3D NULL) || ((UINT32)FspData =3D=3D 0xFFFFFFFF)) { > + if ((FspData =3D=3D NULL) || ((UINTN)FspData =3D=3D MAX_ADDRESS)) { > Status =3D EFI_UNSUPPORTED; > } else { > if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) { @@ -62,7 > +62,7 @@ FspApiCallingCheck ( > // > // FspSiliconInit check > // > - if ((FspData =3D=3D NULL) || ((UINT32)FspData =3D=3D 0xFFFFFFFF)) { > + if ((FspData =3D=3D NULL) || ((UINTN)FspData =3D=3D MAX_ADDRESS)) { > Status =3D EFI_UNSUPPORTED; > } else { > if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) { diff --gi= t > a/IntelFsp2Pkg/FspSecCore/SecMain.c > b/IntelFsp2Pkg/FspSecCore/SecMain.c > index d376fb8361..9e9332ffcd 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecMain.c > +++ b/IntelFsp2Pkg/FspSecCore/SecMain.c > @@ -54,7 +54,7 @@ SecStartup ( > IN UINT32 TempRamBase, > IN VOID *BootFirmwareVolume, > IN PEI_CORE_ENTRY PeiCore, > - IN UINT32 BootLoaderStack, > + IN UINTN BootLoaderStack, > IN UINT32 ApiIdx > ) > { > @@ -233,7 +233,7 @@ SecTemporaryRamSupport ( > GetFspGlobalDataPointer ()->OnSeparateStack =3D 1; >=20 > if (PcdGet8 (PcdFspHeapSizePercentage) =3D=3D 0) { > - CurrentStack =3D AsmReadEsp (); > + CurrentStack =3D AsmReadStackPointer (); > FspStackBase =3D (UINTN)GetFspEntryStack (); >=20 > StackSize =3D FspStackBase - CurrentStack; @@ -292,8 +292,8 @@ > SecTemporaryRamSupport ( > // permanent memory. > // > SecSwitchStack ( > - (UINT32)(UINTN)OldStack, > - (UINT32)(UINTN)NewStack > + (UINTN)OldStack, > + (UINTN)NewStack > ); >=20 > return EFI_SUCCESS; > diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.h > b/IntelFsp2Pkg/FspSecCore/SecMain.h > index 7794255af1..3c60b15f01 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecMain.h > +++ b/IntelFsp2Pkg/FspSecCore/SecMain.h > @@ -51,8 +51,8 @@ typedef struct _SEC_IDT_TABLE { VOID EFIAPI > SecSwitchStack ( > - IN UINT32 TemporaryMemoryBase, > - IN UINT32 PermenentMemoryBase > + IN UINTN TemporaryMemoryBase, > + IN UINTN PermenentMemoryBase > ); >=20 > /** > @@ -104,7 +104,7 @@ SecStartup ( > IN UINT32 TempRamBase, > IN VOID *BootFirmwareVolume, > IN PEI_CORE_ENTRY PeiCore, > - IN UINT32 BootLoaderStack, > + IN UINTN BootLoaderStack, > IN UINT32 ApiIdx > ); >=20 > @@ -127,9 +127,9 @@ ProcessLibraryConstructorList ( > @return value of esp. >=20 > **/ > -UINT32 > +UINTN > EFIAPI > -AsmReadEsp ( > +AsmReadStackPointer ( > VOID > ); >=20 > diff --git > a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm > b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm > index aef7f96d1d..7be570c4e5 100644 > --- a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm > +++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm > @@ -16,7 +16,7 @@ SECTION .text >=20 > %macro RET_ESI 0 >=20 > - movd esi, mm7 ; restore ESP from MM7 > + movd esi, mm7 ; restore EIP from MM7 > jmp esi >=20 > %endmacro > -- > 2.16.2.windows.1