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 7EE0AD80A20 for ; Tue, 31 Oct 2023 08:35:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=IXbLiwZDJv3aEWQVKm2F8PfHTBsLYPvhNdTM+5M/yvE=; 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:msip_labels: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; s=20140610; t=1698741355; v=1; b=t/UpXArCf/ju33KlV36Qu9foOUFZvCjz8pet5tCxSOmMpUCvKCR2tlZEN4BK+KNSTl3Of+Pv Dl9Gd1GxtO+6U7J2jg0dyBgu3vdqRpVN4nD3atjHJKRQTmAD5cgzwG+Hsab5zBCuecrmWRVpveW wvuAjZbOSZi6p3unHkjmikvQ= X-Received: by 127.0.0.2 with SMTP id 1gqkYY7687511xjqObzRVWwD; Tue, 31 Oct 2023 01:35:55 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.181893.1698741354433339215 for ; Tue, 31 Oct 2023 01:35:54 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="474479589" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208,217";a="474479589" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 01:35:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="795488546" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208,217";a="795488546" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Oct 2023 01:35:53 -0700 X-Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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.2507.34; Tue, 31 Oct 2023 01:35:53 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Tue, 31 Oct 2023 01:35:53 -0700 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 31 Oct 2023 01:35:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DG57PHJjlmAQv42zuNozcOfniHMzYOaMFEovgmjOGx/G2QT19Thb6WF7HGTttzyovJ6LFrQIifhWitv4vR2/WQYr/MMeIFqLqe/s5FLZsoq5MLYCtFdbclM2FH5ETVjwzVKYPs59/Hq+9mrW96jsve3a2tlwt7ri61nJcmq0PRbO8ikToGNhovkjJCwSlwt2X6utv1a7sJhx60yIVjcOBe939UGy2ODJ3pHqF98ZaZioexcnEIBFbCpRdhqYjsi9RFO0TPiSQEEnTqcso1LAiDVFH26c3rjZUmGie70CNPaM2B3E6htvls1rTr3CYf4pS2tCAZ8zPjJZ/Q9vC9bzKQ== 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=u+yXEKktV7cr51oGtcgdSJ1QqxQv/ZYFjKkUEyycd8Y=; b=RMGzs7nGGyxL9E79XaMtkg8Lo5UNBkn5Fw6xvBSMjw3D2IFhewrJFA6ts9eiGa73SbRdL+ES0rv1wHygoG7hzW7UvxJ1sKxNRs8iU4ClGqwNdsV2lHrX3O5YfGjcUR61QagmEY05gp7uP13AsAXs7tPKjdhlvFb730ZA77HlEo5aGRjlbQWt1N0Q2ROTpN+nuDcbfGOrxXCxKtNp7TEahLosGefTU/qYuyX3rO2+hB0FIt/fLB48PKeWcy4nIB7nf4R1DAJOZUUtF+5SckCQ+7zp3l9BZt/298ZiCkuRXrqpKt3KdEneliJXdfIMicGwhT0CfCTRiyAJvqaLNGn2Qg== 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 SA1PR11MB8352.namprd11.prod.outlook.com (2603:10b6:806:377::13) by MN6PR11MB8103.namprd11.prod.outlook.com (2603:10b6:208:473::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Tue, 31 Oct 2023 08:35:49 +0000 X-Received: from SA1PR11MB8352.namprd11.prod.outlook.com ([fe80::764a:325f:c24c:bac8]) by SA1PR11MB8352.namprd11.prod.outlook.com ([fe80::764a:325f:c24c:bac8%5]) with mapi id 15.20.6954.019; Tue, 31 Oct 2023 08:35:49 +0000 From: "Kuo, Ted" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Duggapu, Chinni B" , "Ng, Ray Han Lim" , "Zeng, Star" , "S, Ashraf Ali" , "Mohapatra, Susovan" Subject: Re: [edk2-devel] [PATCH] IntelFsp2Pkg/SwitchStack: Reserve 32B when calling C function in 64bit Thread-Topic: [edk2-devel] [PATCH] IntelFsp2Pkg/SwitchStack: Reserve 32B when calling C function in 64bit Thread-Index: AQHaC9N7djijmg8kPEKHV7LmiKoD4bBjj583gAAC7BA= Date: Tue, 31 Oct 2023 08:35:49 +0000 Message-ID: References: <1793238D7061082B.20486@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR11MB8352:EE_|MN6PR11MB8103:EE_ x-ms-office365-filtering-correlation-id: bdcfb43f-994c-4266-4272-08dbd9ec629b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 4OofgA64PRBLZGC3w7zYIvvhWd2gc7QJ//AVG96PGCawsCYQY8sLUGfunWiPle+gsPMtFqx7GsXRLugEOYSwjUHerZ+kQbHmmMqtqCPEoYZWnFVO8VZLZOGNKAgrPNxUF2kVZt4dFbWz6jVL9FJS+1qEM+D1FK7FNbvxcK8/jad2m4dOc7YF6QxS8GWfIBZGlADOdqQraNibCnuS0uzSNEV/TwPYcjRTju0hfWxWIxeQ2VfQNX5rrpQ7fEexcQkeL1/jLO05v+Dvu0YZhij4CuKkDCiIo9ElK+QNK0cR2gjYJtyg30YuqydUbtR9CSsRWth7QA6Tq7vgB/f69TkwsPTjuoekUf/Qa/+pWhj8gN4P714oZccHUZf6Um9r4qnFj2eYvH2HCYYUFScDrgh9rjpYt5LtNjuQOL4iEeewi9n94LotApSgnFlfgQcWitefgS0joo7fGnHxBvXkzQ7WbxxOFnmy3NUPEE7RIml5dHcgCu74FS0x5n/s8jI9R1JtJuqFx0RFjptNN9TdzRBwT/q7Y4gYA7WGkGjupo+0eK91ZWv48tPYwamy//hMcfJMI30fC/At/F2yYFgUBGitoamdyQa+9W7oEzMhoPP+J9jI1SbSQhV2BdDzJEaQbTcsFMN+Gq3jOc0B5uMeZSaiVA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?y+EcMmsCSbxB7hbx1r9Q4/xkpqIX/R1x4opWi+S7ERFgd4l8WUPzLbSC2/1M?= =?us-ascii?Q?H2UUu+Wm0bFqAVrAtgKAUvo17PjydVArpV3aHKbldW778hM2nFU8bcyJgkqS?= =?us-ascii?Q?fSeiFZwhgd+9UbR850nwnJ0WJn91pjN5jo2t5kMBqWuxbyAgctMqOJbMDd0h?= =?us-ascii?Q?gVlM4Ar5+XZ+/VldtmfWFz8f2ZLBe9jZACk84dsRXdC7yJ6fWnouMEB+BZAt?= =?us-ascii?Q?PHaif60qDcI0Xrd4BQB7d0+nJSEiBcqQDqoF7OAWcHkYIf+oYMSy8MEgIz1K?= =?us-ascii?Q?wKI1YJEOYzU1RGiBWBkGt/ykXMCbCebupRaJ69dx2jxAqjg9fC+0PMf8Zjgo?= =?us-ascii?Q?E12cMqx/aPF4fACJpOjmgdYQITRV9lgubyxobSz96aoD/4AOmney96FsPi/6?= =?us-ascii?Q?M7sejFEzEC26EXmFy8XyCU1uMHzx6JSO75oLRlabMG5C7AcuRZS8KavqQgci?= =?us-ascii?Q?0iL/Wx0tJktL/jEyQEGt+2BImWEy2Z4ZKQdkfeRoMymEA+6BWnXH3fDQkHNc?= =?us-ascii?Q?iJEWozRIlXppjqLha1k78YDy4IO+hGs7n8+29nGcG5xYVZ+JgU5YXyjNlXo6?= =?us-ascii?Q?HrVyRggEGBJ/sfpV5RAwqvgzrIOmzL9l8BQG0mLmRl5b99Xqog3VLkrXaR9N?= =?us-ascii?Q?7pul3QZQcduE7JGpzntcDkW9qH/bk3GtkRb08GTgrEbQmeaAi3vMWAlP/xdL?= =?us-ascii?Q?LuaNug5nhdJJ3W/st3F8EmH08JsJJwdNd/hKu4N1EgjnAa+a9wYjs/Yx2fiM?= =?us-ascii?Q?+14d16GhjT+WkxTQ71xRyG2Fx2pgmsj4QrLUD/j+sDP+gJKqzwgDFN0MvNoW?= =?us-ascii?Q?mpMtF6EmCW06XHWU2rz8+caPAAXHoP4PIsCnImOaz3j5D6Ydp5EGbf6IGkXq?= =?us-ascii?Q?MWmCp072BAAgMKrohGjzFH4YWIKT6mhD0+3GAhUtqnSSITtlJHHhoKmvdf0C?= =?us-ascii?Q?QDJ0P+lrt3uOrE+65/o6xekb1NDvz0fG6/LZC+pSO5BVw0kGupQKhUsv/B/j?= =?us-ascii?Q?C0qMPZo+UMXlbwzy+54jIt+5pPuU2bNT7oTi7jY9o31lyWsGNMMISSbjfQD9?= =?us-ascii?Q?Oqa2L0R9hAu0yViDTnZepgKo8dULUBy55PkOj8kDd4V2HFla0M37wsVQ/DrI?= =?us-ascii?Q?kTYwOGwPkUj54BI1oERZgmV9RKZAnCYN2scOcg+hDX5zUBpwYPXRRO5kOxGL?= =?us-ascii?Q?iTdj0t9bazWrWB0BQs6a1NDnmS49NYu5sbFxgc7EMiWwlaxYZYu/xS9p8YAN?= =?us-ascii?Q?tD7y9bop+Xq4RCWvlb9eBu/3afEEmmlfAkng96dR3LiGffgmJKZA57S+/iqW?= =?us-ascii?Q?SIDknjcEJHCo0/BArXtRjA24fbGwLVnGn27lokl7BYzBxBXecQb6n2Ab94wF?= =?us-ascii?Q?cLfii9buA+8lQkSWlTDSQJ90W+4LQq+HOpHZ8Pb3NrOaw3hNqCN8UBjJ+LMw?= =?us-ascii?Q?9vZOAd5pHUC6OLNhis5as5THrh5+/nTjqn7NF9H6BtuiZPnzlvU6BXW3RLHg?= =?us-ascii?Q?S8SbP78rbiTOLwHzfCs8UgsHxIADnIyCUrBcTepUuOVM1A/+nHQ0NF2dSI2H?= =?us-ascii?Q?jT4TejgKgbWP7VcHuF3YBIWpndVY1v6lSDViua2r?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB8352.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdcfb43f-994c-4266-4272-08dbd9ec629b X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Oct 2023 08:35:49.2912 (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: dlOWfNss2sgQMjlCjw00WZpai0BbJlST70WEb88THWq5PvvLkrLGuxa/sWiu7O1L2EV35Pidx2E4FkMztgVmng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR11MB8103 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,ted.kuo@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: yG8vzraccUyzNNhw3PnPc7pRx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_SA1PR11MB8352688E26B7190AB9970139E5A0ASA1PR11MB8352namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="t/UpXArC"; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") --_000_SA1PR11MB8352688E26B7190AB9970139E5A0ASA1PR11MB8352namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ted Kuo > From: Ni, Ray Sent: Tuesday, October 31, 2023 4:26 PM To: devel@edk2.groups.io; Ni, Ray Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Duggapu, Chinni B ; Ng, = Ray Han Lim ; Zeng, Star ; K= uo, Ted ; S, Ashraf Ali ; Mohapa= tra, Susovan Subject: Re: [edk2-devel] [PATCH] IntelFsp2Pkg/SwitchStack: Reserve 32B whe= n calling C function in 64bit Sorry, I copied the maintainers from Maintainers.txt but forgot to change a= ll M/R to "Cc". That caused not all the maintainers/reviewers are CCed. I will fix the commit message before merging. Thanks, Ray ________________________________ From: devel@edk2.groups.io > on behalf of Ni, Ray > Sent: Tuesday, October 31, 2023 4:22 PM To: devel@edk2.groups.io > Cc: Chiu, Chasel > Subject: [edk2-devel] [PATCH] IntelFsp2Pkg/SwitchStack: Reserve 32B when ca= lling C function in 64bit When FSP runs in API mode, it saves the IDTR in its own stack then switches to bootloader's stack before it returns from FspMemoryInit. Next time when the bootloader calls TempRamExit, FSP switches to its own stack and restores IDTR from its stack saved earlier. However, due to a bug in BaseFspSwitchStackLib, the IDTR saved on FSP's stack might be corrupted that results the following TempRamExit call fails inside FSP due to PeiServices pointer cannot be retrieved from IDT.base - 8. The bug is the assembly code doesn't reserve 32 bytes before calling the C routine in 64bit. According to the x86-64 calling convention, caller is responsible for allocating 32 bytes of "shadow space" on the stack right before calling the function (regardless of the actual number of parameters used). When FSP is built in optimization-off mode, the C routine makes use of the 32-byte "shadow space" which is not reserved by the assembly caller. That causes the IDTR saved on the stack is corrupted by the C routine. The patch fixes so by reserving the 32 bytes before calling C routine. Signed-off-by: Ray Ni > Cc: Chasel Chiu > M: Nate DeSimone > M: Duggapu Chinni B > M: Ray Han Lim Ng > R: Star Zeng > R: Ted Kuo > R: Ashraf Ali S > R: Susovan Mohapatra > --- IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm b/In= telFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm index 1ea1220608..e3a7cf002f 100644 --- a/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm +++ b/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm @@ -1,6 +1,6 @@ ;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2022, Intel Corporation. All rights reserved.
+; Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.
; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Abstract: @@ -60,7 +60,9 @@ ASM_PFX(FspSwitchStack): ; Load new stack mov rcx, rsp + sub rsp, 0x20 call ASM_PFX(SwapStack) + add rsp, 0x20 mov rsp, rax ; Restore previous contexts -- 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110384): https://edk2.groups.io/g/devel/message/110384 Mute This Topic: https://groups.io/mt/102293342/1712937 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3759105/1712937/893644498= /xyzzy [ray.ni@intel.com] -=3D-=3D-=3D-=3D-=3D-=3D -=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 (#110387): https://edk2.groups.io/g/devel/message/110387 Mute This Topic: https://groups.io/mt/102293342/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- --_000_SA1PR11MB8352688E26B7190AB9970139E5A0ASA1PR11MB8352namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Ted Kuo <ted.kuo@intel.com>

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Tuesday, October 31, 2023 4:26 PM
To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel = L <nathaniel.l.desimone@intel.com>; Duggapu, Chinni B <chinni.b.du= ggapu@intel.com>; Ng, Ray Han Lim <ray.han.lim.ng@intel.com>; Zeng= , Star <star.zeng@intel.com>; Kuo, Ted <ted.kuo@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>; Mohapatra, Susovan <susov= an.mohapatra@intel.com>
Subject: Re: [edk2-devel] [PATCH] IntelFsp2Pkg/SwitchStack: Reserve = 32B when calling C function in 64bit

 

Sorry, I copied the maintainers from Maintainers.txt but f= orgot to change all M/R to "Cc". That caused not all the maintain= ers/reviewers are CCed.

I will fix the commit message before merging.

 

Thanks,

Ray


From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of= Ni, Ray <ray.ni@intel.com> Sent: Tuesday, October 31, 2023 4:22 PM
To: devel@edk2.groups.io= <devel@edk2.groups.io> Cc: Chiu, Chasel <chasel= .chiu@intel.com>
Subject: [edk2-devel] [PATCH] IntelFsp2Pkg/SwitchStack: Reserve 32B = when calling C function in 64bit

 

When FSP runs in API = mode, it saves the IDTR in its own stack then
switches to bootloader's stack before it returns from FspMemoryInit.
Next time when the bootloader calls TempRamExit, FSP switches to
its own stack and restores IDTR from its stack saved earlier.

However, due to a bug in BaseFspSwitchStackLib, the IDTR saved on
FSP's stack might be corrupted that results the following TempRamExit
call fails inside FSP due to PeiServices pointer cannot be retrieved
from IDT.base - 8.

The bug is the assembly code doesn't reserve 32 bytes before calling
the C routine in 64bit. According to the x86-64 calling convention,
caller is responsible for allocating 32 bytes of "shadow space" o= n the
stack right before calling the function (regardless of the actual
number of parameters used).

When FSP is built in optimization-off mode, the C routine makes use
of the 32-byte "shadow space" which is not reserved by the assemb= ly
caller. That causes the IDTR saved on the stack is corrupted by the
C routine.
The patch fixes so by reserving the 32 bytes before calling C routine.

Signed-off-by: Ray Ni <ray.ni@intel.= com>
Cc: Chasel Chiu <chasel.chiu@in= tel.com>
M: Nate DeSimone <nath= aniel.l.desimone@intel.com>
M: Duggapu Chinni B <chinn= i.b.duggapu@intel.com>
M: Ray Han Lim Ng <ray.han.l= im.ng@intel.com>
R: Star Zeng <star.zeng@intel.com= >
R: Ted Kuo <ted.kuo@intel.com&g= t;
R: Ashraf Ali S <ashraf.ali.s@= intel.com>
R: Susovan Mohapatra <sus= ovan.mohapatra@intel.com>
---
 IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm | 4 +++-  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm b/In= telFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm
index 1ea1220608..e3a7cf002f 100644
--- a/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm
+++ b/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm
@@ -1,6 +1,6 @@
 ;--------------------------------------------------------------------= ----------

 ;

-; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.<BR= >

 ; SPDX-License-Identifier: BSD-2-Clause-Patent

 ;

 ; Abstract:

@@ -60,7 +60,9 @@ ASM_PFX(FspSwitchStack):
 

     ; Load new stack

     mov     rcx, rsp

+    sub     rsp, 0x20

     call    ASM_PFX(SwapStack)

+    add     rsp, 0x20

     mov     rsp, rax

 

     ; Restore previous contexts

--
2.39.1.windows.1



-=3D-=3D-=3D-=3D-=3D-=3D
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110384): https://edk2.groups.io/g/devel/message/110384
Mute This Topic: https:/= /groups.io/mt/102293342/1712937
Group Owner: devel+owner@edk2= .groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3759105/1712937/893644498/xyzzy [r= ay.ni@intel.com]
-=3D-=3D-=3D-=3D-=3D-=3D

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#110387) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_SA1PR11MB8352688E26B7190AB9970139E5A0ASA1PR11MB8352namp_--