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 1DDC0940FE8 for ; Wed, 6 Sep 2023 03:11:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HK5EIlW49bHezpEGje09qZYOm2Fkx3NEDHUCqkenevI=; 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=1693969884; v=1; b=nv8Wjaa3KGEe8LEfRKDjdMVwdY6BofI9lTVm8LbV/tGfw1kNcf5OH0V4AuquSNnpDCrmxlnC wWweRMMmrNiSU2nUIq42COQ71Hc1+kXwKkrH0ygSU9JKLnsZFfaQok34LrhWW0DPyJxAjU2hpu4 BTsF9OWDo6WfFhTJSxltPCx0= X-Received: by 127.0.0.2 with SMTP id BMVnYY7687511x2bKgNeTjjB; Tue, 05 Sep 2023 20:11:24 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.713.1693969883885735854 for ; Tue, 05 Sep 2023 20:11:24 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10824"; a="463338767" X-IronPort-AV: E=Sophos;i="6.02,230,1688454000"; d="scan'208,217";a="463338767" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2023 20:11:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10824"; a="806846349" X-IronPort-AV: E=Sophos;i="6.02,230,1688454000"; d="scan'208,217";a="806846349" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Sep 2023 20:11:23 -0700 X-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.2507.27; Tue, 5 Sep 2023 20:11:22 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2507.27; Tue, 5 Sep 2023 20:11:22 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Tue, 5 Sep 2023 20:11:22 -0700 X-Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.42) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 5 Sep 2023 20:11:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KWZFosM3R4BYeFswPyotXraHCDWuSmRGD/3M0yqBPlv5J0PzJz3ogd/Km8Htr6sGwT631OICl0susfeDBUkwTwVj+FqrFllyT9TSHuz3ZdNnUhtcQ0N17H7Xok8PidQ4OdysvVdPynraTZcHX354uSjzRE3QEsHS5R+BNpdmLu8wuodDQxQIz8gNaG3Ac+pbzFuGbHBO/q6VIVZuRgy1SdByxGRK5IcgpdGnggJYZ7Xy2smHosW4pmzEcsVep8UjTXSNcR0pSmg8X2K/+RC3fnkwGSlcZH2HJjZkOFpnAbKLdz0Atrxxww4ziHbitlntyHKblbuwhKL02RLtcEnhLw== 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=ZFgn1vLuLPaOX4NIe5P93m3GE411xCVLiAXI2CqYOHY=; b=CSwETiMWkyu3QpFJM2PiJGnL8r3ZtOnWJuBeSHG3DEJc4fzdsn5Sx24z4wIJOgbuhXcZYGAcsXgcU3u8WRUGVLFcYocvbXGEw3QzEOpWdSvdXcsiyVkss9BTmZnD9r2HqjGDitwZwP0RdrxrHKx1iiCLUf/Ao9bJpv3aMjFZ5nbXNvXeJ+mTbrXQL+fqNapWnFHja/7Ra4Lgg8C8Hud0B/VSvPhL0cxuE2RLWTHwcG5ROrRISvU7Mexw6IOJQctdtZCoz1tvkM7rsjyhADj49JyX3SQj940efuOOEnRADHmzWdEaxkXvVVtc9z0EbJML2xxk7p+FKP+tY3TkZVdkYA== 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 MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by SN7PR11MB6923.namprd11.prod.outlook.com (2603:10b6:806:2aa::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33; Wed, 6 Sep 2023 03:11:19 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::bf9a:54ca:d270:59b]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::bf9a:54ca:d270:59b%5]) with mapi id 15.20.6745.030; Wed, 6 Sep 2023 03:11:19 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" Subject: Re: [edk2-devel] [Patch V2 2/5] UefiCpuPkg/S3Resume2Pei: prepare MpService2Ppi in S3Resume Thread-Topic: [Patch V2 2/5] UefiCpuPkg/S3Resume2Pei: prepare MpService2Ppi in S3Resume Thread-Index: AQHZ09SjZQBiI7xHe0uRJ6ND+eEu8LANN9RA Date: Wed, 6 Sep 2023 03:11:19 +0000 Message-ID: References: <20230821020947.346-1-dun.tan@intel.com> <20230821020947.346-3-dun.tan@intel.com> In-Reply-To: <20230821020947.346-3-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|SN7PR11MB6923:EE_ x-ms-office365-filtering-correlation-id: a97ad981-2451-49d2-1bce-08dbae86f0fe x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 2A5ZiB/N0Dy/TSVzXEh0NTRxuxj+N2bmpRAmlH+biUx1hHnXl+OeIs0Kvt6ob3GzGQc8GUWUed8CoBgpJvyN5PzlKCly9v+cwC6l34XXCvwbNLl2aVpjkAsC/Fx2sHHg0IEzXHv6B5YIIprNy/j2kDy6yHmYZvwmtJ0wc0TSGsTnGfQBm65kbRdRMYvob2q0LVB4TLnHVjIId5FOEt48YBVNSgClqbUa9XIG2RogzBGrG2b9PLNQzylGsi7Gs1bzBp3kCmmmYbgKHyiajLq5mrhJT3sjzI/TCn5Tu/7QKlPS4tmDKsz+0yMHwo1igY20/fHOs8z5E/RsAVyjDZKl62NHYo482j+Z+qW+YAtL09Tr3r/se31UuYgh0R2WEj91IswPUkz/eVjLn6hxZnWL5xsEP8H36oMyVxN1qyVEg7Zgk8Xom/fMoq69kuxJ804msFuTLQtuUAV4jnKgSglYa9LqqIAHMU8Rb439JaQkhalfGVxESfI5Ab9/DauXalRMHgy8Mb0pVcqGobv/ArAWdFDeocpgm3R8xMmybxP+A36irUF1hO8i8fR4BBjRalEuLTO0nwqB/CYbMvmM0a9h6ldDJTANvGhpfrFcAKCHqzjwiDsPS6eTxCRIRo3n0AwESePNwuYXEp0NaLBfZxzgrg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?reYpT9oxaTDI45s3WmVWtfWD0TF6vnYBHlCFZIce5z15wgBYYmEKQMu8gs1u?= =?us-ascii?Q?6bjvPvjvTioyvFP+9/N7J/7T+ELp7UCnBKPdUjuKxZyeZxAb+WcxjklECjmS?= =?us-ascii?Q?8TG1uxHDxiLU6Ssfsi9CMpsp4uQ83dQdvV6p1Y5tpFNqSt2v8rOxdz7VuyXJ?= =?us-ascii?Q?MpH22oBBitvOP6UOOoo0yfBezHgJykFDbRAd+S9Zo1gYEqQPNwnRJB1WKD7g?= =?us-ascii?Q?yAgD4AOb8XfQpOuT/KFvBq+9ZjCTsMYkbSorlfehidEeQ5Qt5TZ5klASTbZk?= =?us-ascii?Q?Rq/xXK0OhxWQR43zcx9hkVpB7ANmpjKSSwwjvYfKNN7QAKLoe27rVWoGDhyq?= =?us-ascii?Q?DSvesbaMevQgFrbKreRZ46vOGh/fsl8EyTZ5ejUSGNBP5+HibZqk+ntPeEre?= =?us-ascii?Q?lp5HUszBFmkMN1R8I3Xn/+6IcVCWO/dAjC0TTOZzV2JxOHj/2eD0C/L/gUQ9?= =?us-ascii?Q?3Jzb1tzp6fhy76BFehed+yhGaqZTQbGOdL+tyFdonVAc7u0fiBxjmvsR4gqD?= =?us-ascii?Q?cBW0zHR9VgDbWmWu+Olp7rxs5yMtueu+5RONbZ1bfa49Yqg1ssj5MSBFFhKS?= =?us-ascii?Q?obglybo0IiVniBEPJbVEdNMptiMcbOH9jfVlvzernVseHZlIUu3Alo7cjZUr?= =?us-ascii?Q?d3ExWCzAaW5gB+DyNLEp/QbutmEvT7MC1RqI4CL6nmPSslfNSTptk4UCyTCB?= =?us-ascii?Q?lZKkXAcldbe4iYLp/tvhAPJmqyX3P1yFD0iy4FjaOgxP1/eyEtgq7AXtWhmT?= =?us-ascii?Q?/Yn5ZuZTrxltibh3NwI315Qwm/STqFui3FVMXQ1BvCH52Rm/iRYRNdKhMAcH?= =?us-ascii?Q?0gQYRRb454Coa7PAdl9SxF6vD/ZisEDRMNiitvxMLZNcgoSgKacsf7D1Sx1A?= =?us-ascii?Q?Z91DHykyExwsHHEVgjoM6y1GKtc6VfBAYanG86H9q43zW2PTZSWClJOV4QlC?= =?us-ascii?Q?3NhrCgJxxAXg/E/g9sqdsK5ShVkpgRnexKToYQ06zCsjcpmYK9xqB0CHoU4y?= =?us-ascii?Q?cqNXhBjAlgMQQdhBal/7C/52UZImMLwLPTgfPSP6gxt0VGUH4C1CRBQ/jhw3?= =?us-ascii?Q?c7kLToE+ORt7ZkaCR3jz2xaiYEpn62Efg2xsapnGSzoFTVapPiPScNi+l1bg?= =?us-ascii?Q?/AeS4C9w4MiZYV/Fh+HnwD+qrhTUci8tgoLvSSWHJR8WIUmK9xg801WKMTAM?= =?us-ascii?Q?x9xpItWcwz7N5IMg2/+M+Xhdk6iKUWBiUvbOSeWpDuXttenby99262dk7bB4?= =?us-ascii?Q?WFwnXn2QAsNufxoS2sYyM6XcOSYaTGorTTtw7qnAZg2DTSPpHJPoy550xGaC?= =?us-ascii?Q?XYtzBRb+dad54nG3YT2y74Zy5htAV29UXLeQ269eexOVNRKzJTs65jbnduV1?= =?us-ascii?Q?LAtR1pI16O+x5RKbn0iGn/1zV2DGtUy4XBZqp9a6YhcuxMx2SOpe2Q87plZN?= =?us-ascii?Q?mLRWNA5s8ucXcqsnz9BOgXv4vV6sDblIIrox1ijo8jFoMJu85ASLbMyE/VYh?= =?us-ascii?Q?8CKDWPmRacVrV0x57x5f+1H+N2oqbceFrvUGOn+9VWKUEdgcmBELoSZWshMg?= =?us-ascii?Q?Yg+mYzp9FbNXFYHxG5I=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a97ad981-2451-49d2-1bce-08dbae86f0fe X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2023 03:11:19.4686 (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: w/bt+78Irxz6L96N5IdxPvf59pGmHomY4c5wz1D743JsgkvmRYCaGqUB2bdDg8bVH9uELHBjxidrKa756Meq+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6923 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,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: qgvA4TX3km01MvJaEymmViWKx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244BAE070EBBE1350750C288CEFAMN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=nv8Wjaa3; 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 --_000_MN6PR11MB8244BAE070EBBE1350750C288CEFAMN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni Thanks, Ray ________________________________ From: Tan, Dun Sent: Monday, August 21, 2023 10:09 AM To: devel@edk2.groups.io Cc: Dong, Eric ; Ni, Ray ; Kumar, Ra= hul R Subject: [Patch V2 2/5] UefiCpuPkg/S3Resume2Pei: prepare MpService2Ppi in S= 3Resume Prepare MpService2Ppi in S3Resume when PEI and SMM env run in the same execution mode. Then smm s3 code can use Mp Service to wakeup AP instead of only sending InitSipiSipi. Signed-off-by: Dun Tan Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: Dun Tan --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 18 +++++++++++++= ++++- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg= /Universal/Acpi/S3Resume2Pei/S3Resume.c index 9ea5f6f4e5..1fd5670c7f 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -4,7 +4,7 @@ This module will execute the boot script saved during last boot and afte= r that, control is passed to OS waking up handler. - Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2023, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -988,6 +989,7 @@ S3RestoreConfig2 ( BOOLEAN Build4GPageTableOnly; BOOLEAN InterruptStatus; IA32_CR0 Cr0; + EDKII_PEI_MP_SERVICES2_PPI *MpService2Ppi; TempAcpiS3Context =3D 0; TempEfiBootScriptExecutorVariable =3D 0; @@ -1088,6 +1090,7 @@ S3RestoreConfig2 ( SmmS3ResumeState->ReturnContext1 =3D (EFI_PHYSICAL_ADDRESS)(UINTN)= AcpiS3Context; SmmS3ResumeState->ReturnContext2 =3D (EFI_PHYSICAL_ADDRESS)(UINTN)= EfiBootScriptExecutorVariable; SmmS3ResumeState->ReturnStackPointer =3D (EFI_PHYSICAL_ADDRESS)STACK_A= LIGN_DOWN (&Status); + SmmS3ResumeState->MpService2Ppi =3D 0; DEBUG ((DEBUG_INFO, "SMM S3 Signature =3D %x\n", SmmS3R= esumeState->Signature)); DEBUG ((DEBUG_INFO, "SMM S3 Stack Base =3D %x\n", SmmS3R= esumeState->SmmS3StackBase)); @@ -1109,6 +1112,19 @@ S3RestoreConfig2 ( if (((SmmS3ResumeState->Signature =3D=3D SMM_S3_RESUME_SMM_32) && (siz= eof (UINTN) =3D=3D sizeof (UINT32))) || ((SmmS3ResumeState->Signature =3D=3D SMM_S3_RESUME_SMM_64) && (siz= eof (UINTN) =3D=3D sizeof (UINT64)))) { + // + // Get MP Services2 Ppi to pass it to Smm S3. + // + Status =3D PeiServicesLocatePpi ( + &gEdkiiPeiMpServices2PpiGuid, + 0, + NULL, + (VOID **)&MpService2Ppi + ); + ASSERT_EFI_ERROR (Status); + SmmS3ResumeState->MpService2Ppi =3D (EFI_PHYSICAL_ADDRESS)(UINTN)MpS= ervice2Ppi; + DEBUG ((DEBUG_INFO, "SMM S3 MpService2Ppi Point =3D %lx\n", SmmS3Res= umeState->MpService2Ppi)); + SwitchStack ( (SWITCH_STACK_ENTRY_POINT)(UINTN)SmmS3ResumeState->SmmS3ResumeEntr= yPoint, (VOID *)AcpiS3Context, diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/Uefi= CpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf index aae984d138..9c9b6f3db3 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf @@ -5,7 +5,7 @@ # This module will excute the boot script saved during last boot and after= that, # control is passed to OS waking up handler. # -# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2023, Intel Corporation. All rights reserved.
# Copyright (c) 2017, AMD Incorporated. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -86,6 +86,7 @@ gPeiPostScriptTablePpiGuid ## SOMETIMES_PRODUCES gEfiEndOfPeiSignalPpiGuid ## SOMETIMES_PRODUCES gEfiPeiSmmCommunicationPpiGuid ## SOMETIMES_CONSUMES + gEdkiiPeiMpServices2PpiGuid ## SOMETIMES_CONSUMES [FeaturePcd] gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONS= UMES -- 2.31.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 (#108300): https://edk2.groups.io/g/devel/message/108300 Mute This Topic: https://groups.io/mt/100866130/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN6PR11MB8244BAE070EBBE1350750C288CEFAMN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray

From: Tan, Dun <dun.tan@= intel.com>
Sent: Monday, August 21, 2023 10:09 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel= .com>; Kumar, Rahul R <rahul.r.kumar@intel.com>
Subject: [Patch V2 2/5] UefiCpuPkg/S3Resume2Pei: prepare MpService2P= pi in S3Resume
 
Prepare MpService2Ppi in S3Resume when PEI and SMM= env run
in the same execution mode. Then smm s3 code can use Mp
Service to wakeup AP instead of only sending InitSipiSipi.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Dun Tan <dun.tan@intel.com>
---
 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c   &n= bsp;   | 18 +++++++++++++++++-
 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf |  3 ++-=
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg= /Universal/Acpi/S3Resume2Pei/S3Resume.c
index 9ea5f6f4e5..1fd5670c7f 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -4,7 +4,7 @@
   This module will execute the boot script saved during last boo= t and after that,
   control is passed to OS waking up handler.
 
-  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.&= lt;BR>
+  Copyright (c) 2006 - 2023, Intel Corporation. All rights reserved.&= lt;BR>
   Copyright (c) 2017, AMD Incorporated. All rights reserved.<= BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -23,6 +23,7 @@
 #include <Ppi/PostBootScriptTable.h>
 #include <Ppi/EndOfPeiPhase.h>
 #include <Ppi/SmmCommunication.h>
+#include <Ppi/MpServices2.h>
 
 #include <Library/DebugLib.h>
 #include <Library/BaseLib.h>
@@ -988,6 +989,7 @@ S3RestoreConfig2 (
   BOOLEAN         &= nbsp;           &nbs= p;  Build4GPageTableOnly;
   BOOLEAN         &= nbsp;           &nbs= p;  InterruptStatus;
   IA32_CR0         =             &nb= sp; Cr0;
+  EDKII_PEI_MP_SERVICES2_PPI     *MpService2Ppi;<= br>  
   TempAcpiS3Context       &nb= sp;         =3D 0;
   TempEfiBootScriptExecutorVariable =3D 0;
@@ -1088,6 +1090,7 @@ S3RestoreConfig2 (
     SmmS3ResumeState->ReturnContext1  &nb= sp;  =3D (EFI_PHYSICAL_ADDRESS)(UINTN)AcpiS3Context;
     SmmS3ResumeState->ReturnContext2  &nb= sp;  =3D (EFI_PHYSICAL_ADDRESS)(UINTN)EfiBootScriptExecutorVariable;      SmmS3ResumeState->ReturnStackPointer =3D (EFI_P= HYSICAL_ADDRESS)STACK_ALIGN_DOWN (&Status);
+    SmmS3ResumeState->MpService2Ppi   &nb= sp;  =3D 0;
 
     DEBUG ((DEBUG_INFO, "SMM S3 Signature &n= bsp;            = ;  =3D %x\n", SmmS3ResumeState->Signature));
     DEBUG ((DEBUG_INFO, "SMM S3 Stack Base &= nbsp;           &nbs= p; =3D %x\n", SmmS3ResumeState->SmmS3StackBase));
@@ -1109,6 +1112,19 @@ S3RestoreConfig2 (
     if (((SmmS3ResumeState->Signature =3D=3D SMM_S3= _RESUME_SMM_32) && (sizeof (UINTN) =3D=3D sizeof (UINT32))) ||
         ((SmmS3ResumeState->Sig= nature =3D=3D SMM_S3_RESUME_SMM_64) && (sizeof (UINTN) =3D=3D sizeo= f (UINT64))))
     {
+      //
+      // Get MP Services2 Ppi to pass it to Smm S= 3.
+      //
+      Status =3D PeiServicesLocatePpi (
+            &n= bsp;    &gEdkiiPeiMpServices2PpiGuid,
+            &n= bsp;    0,
+            &n= bsp;    NULL,
+            &n= bsp;    (VOID **)&MpService2Ppi
+            &n= bsp;    );
+      ASSERT_EFI_ERROR (Status);
+      SmmS3ResumeState->MpService2Ppi =3D (EFI= _PHYSICAL_ADDRESS)(UINTN)MpService2Ppi;
+      DEBUG ((DEBUG_INFO, "SMM S3 MpService2= Ppi Point =3D %lx\n", SmmS3ResumeState->MpService2Ppi));
+
       SwitchStack (
         (SWITCH_STACK_ENTRY_POINT)= (UINTN)SmmS3ResumeState->SmmS3ResumeEntryPoint,
         (VOID *)AcpiS3Context,
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/Uefi= CpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
index aae984d138..9c9b6f3db3 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
@@ -5,7 +5,7 @@
 # This module will excute the boot script saved during last boot and = after that,
 # control is passed to OS waking up handler.
 #
-# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR= >
+# Copyright (c) 2010 - 2023, Intel Corporation. All rights reserved.<BR= >
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>= ;
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -86,6 +86,7 @@
   gPeiPostScriptTablePpiGuid      =             &nb= sp; ## SOMETIMES_PRODUCES
   gEfiEndOfPeiSignalPpiGuid      &= nbsp;           &nbs= p;  ## SOMETIMES_PRODUCES
   gEfiPeiSmmCommunicationPpiGuid     &n= bsp;          ## SOMETIMES_CON= SUMES
+  gEdkiiPeiMpServices2PpiGuid      &nbs= p;            ## SOM= ETIMES_CONSUMES
 
 [FeaturePcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode =         ## CONSUMES
--
2.31.1.windows.1

_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--_000_MN6PR11MB8244BAE070EBBE1350750C288CEFAMN6PR11MB8244namp_--