From nobody Sun Feb 8 01:33:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44020+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44020+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563521300; cv=none; d=zoho.com; s=zohoarc; b=QGtTjuFwTKBLzgd+aO0gdIMvkYrfqr4kWPaoQWDJ6M/ZuCejvw7WDAWXklb0R4Gw0dNqb3hEvl8zPk5R2OViwcQeev+COZNmkMqmvqBsEx9T5tj6JTMIzP8/bcC+pl+vnev+s15rQSw5uM7igD/o2+bUtusGftgQs8y0lv1Fe3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563521300; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=DiYnGVPf3/uOl4b4ONs5B4rcqO2wDriXFDNDA47VNJI=; b=J5rhNvyCQ4U3BVTLlH29dgM6YadRkP3lkEpRV+5mf3xsK3DxszlvmDnHzW2c2IuY95Eq1q3/w7hNk9Gmp+8YmN0HQSzIaYLz9Fih2rD7tLsT7dz/+FeBDB7Bbb4lHVOfve4TLT/wIFUO/T2nFt2SLji/37SKXm2HWrmjz8CCTq0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44020+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563521300847558.7471895171699; Fri, 19 Jul 2019 00:28:20 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Fri, 19 Jul 2019 00:28:20 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 00:28:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,281,1559545200"; d="scan'208";a="170828884" X-Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.133]) by orsmga003.jf.intel.com with ESMTP; 19 Jul 2019 00:28:18 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Ray Ni , Laszlo Ersek , Chandana Kumar , Star Zeng Subject: [edk2-devel] [Patch 4/5] UefiCpuPkg/CpuMpPei: Produce EDKII_PEI_MP_SERVICES2_PPI. Date: Fri, 19 Jul 2019 15:28:09 +0800 Message-Id: <20190719072811.6352-5-eric.dong@intel.com> In-Reply-To: <20190719072811.6352-1-eric.dong@intel.com> References: <20190719072811.6352-1-eric.dong@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,eric.dong@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563521300; bh=lVF6xWKiB95xnx5wfrsWN4pEJyk6Df6Uk/Oo9jEe8ic=; h=Cc:Date:From:Reply-To:Subject:To; b=L1uqcyxfF6A3sdMyLxQm4hV9yRTempgD9c7qchuGlNF82sVdkPscFF1IojKvq7ILAhT 0j0kGHTx/h2uY+W17+NCOzHYFxFLvdxMEtOxVNzeFYW4eRezhoHV0r379GKLm1NTyJgSS ee1HnriE0AqftA3EVWzhoT40EPiVpAVRrhU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1973 Produce new EDKII_PEI_MP_SERVICES2_PPI service. It includes all APIs existed in EFI_PEI_MP_SERVICES_PPI and add new API EDKII_PEI_MP_SERVICES_STARTUP_ALL_CPUS. Cc: Ray Ni Cc: Laszlo Ersek Cc: Chandana Kumar Cc: Star Zeng Signed-off-by: Eric Dong --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 73 +++++++++++++++++++++++++++++--- UefiCpuPkg/CpuMpPei/CpuMpPei.h | 35 ++++++++++++++- UefiCpuPkg/CpuMpPei/CpuMpPei.inf | 1 + 3 files changed, 102 insertions(+), 7 deletions(-) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index 926541c937..5ed2297770 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -1,7 +1,7 @@ /** @file CPU PEI Module installs CPU Multiple Processor PPI. =20 - Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -21,10 +21,31 @@ EFI_PEI_MP_SERVICES_PPI mMpServicesPpi = =3D { PeiWhoAmI, }; =20 -EFI_PEI_PPI_DESCRIPTOR mPeiCpuMpPpiDesc =3D { - (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), - &gEfiPeiMpServicesPpiGuid, - &mMpServicesPpi +// +// CPU MP2 PPI to be installed +// +EDKII_PEI_MP_SERVICES2_PPI mMpServices2Ppi =3D { + PeiGetNumberOfProcessors, + PeiGetProcessorInfo, + PeiStartupAllAPs, + PeiStartupThisAP, + PeiSwitchBSP, + PeiEnableDisableAP, + PeiWhoAmI, + PeiStartupAllCPUs +}; + +EFI_PEI_PPI_DESCRIPTOR mPeiCpuMpPpiList[] =3D { + { + EFI_PEI_PPI_DESCRIPTOR_PPI, + &gEdkiiPeiMpServices2PpiGuid, + &mMpServices2Ppi + }, + { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiMpServicesPpiGuid, + &mMpServicesPpi + } }; =20 /** @@ -402,6 +423,46 @@ PeiWhoAmI ( return MpInitLibWhoAmI (ProcessorNumber); } =20 +/** + This service executes a caller provided function on all enabled CPUs. CP= Us can + run either simultaneously or one at a time in sequence. This service may= only + be called from the BSP. + + @param[in] This A pointer to the EDKII_PEI_MP_SERVICES2_= PPI instance. + @param[in] Procedure A pointer to the function to be run on e= nabled APs of + the system. + @param[in] TimeoutInMicroSeconds + Indicates the time limit in microseconds= for APs to + return from Procedure, for blocking mode= only. Zero + means infinity. If the timeout expires = in blocking + mode, BSP returns EFI_TIMEOUT. + @param[in] ProcedureArgument The parameter passed into Procedure for = all CPUs. + + @retval EFI_SUCCESS In blocking mode, all APs have finished = before the + timeout expired. + @retval EFI_DEVICE_ERROR Caller processor is AP. + @retval EFI_NOT_READY Any enabled APs are busy. + @retval EFI_TIMEOUT In blocking mode, the timeout expired be= fore all + enabled APs have finished. + @retval EFI_INVALID_PARAMETER Procedure is NULL. +**/ +EFI_STATUS +EFIAPI +PeiStartupAllCPUs ( + IN EDKII_PEI_MP_SERVICES2_PPI *This, + IN EFI_AP_PROCEDURE Procedure, + IN UINTN TimeoutInMicroSeconds, + IN VOID *ProcedureArgument OPTIONAL + ) +{ + return MpInitLibStartupAllCPUs ( + Procedure, + TimeoutInMicroSeconds, + ProcedureArgument, + NULL + ); +} + /** Get GDT register value. =20 @@ -667,7 +728,7 @@ InitializeCpuMpWorker ( // // Install CPU MP PPI // - Status =3D PeiServicesInstallPpi(&mPeiCpuMpPpiDesc); + Status =3D PeiServicesInstallPpi(mPeiCpuMpPpiList); ASSERT_EFI_ERROR (Status); =20 return Status; diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index a5d8a755b2..b385c5088b 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -1,7 +1,7 @@ /** @file Definitions to install Multiple Processor PPI. =20 - Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -15,6 +15,7 @@ #include #include #include +#include =20 #include #include @@ -431,6 +432,38 @@ MemoryDiscoveredPpiNotifyCallback ( IN VOID *Ppi ); =20 +/** + This service executes a caller provided function on all enabled CPUs. CP= Us can + run either simultaneously or one at a time in sequence. This service may= only + be called from the BSP. + + @param[in] This A pointer to the EDKII_PEI_MP_SERVICES2_= PPI instance. + @param[in] Procedure A pointer to the function to be run on e= nabled APs of + the system. + @param[in] TimeoutInMicroSeconds + Indicates the time limit in microseconds= for APs to + return from Procedure, for blocking mode= only. Zero + means infinity. If the timeout expires = in blocking + mode, BSP returns EFI_TIMEOUT. + @param[in] ProcedureArgument The parameter passed into Procedure for = all CPUs. + + @retval EFI_SUCCESS In blocking mode, all APs have finished = before the + timeout expired. + @retval EFI_DEVICE_ERROR Caller processor is AP. + @retval EFI_NOT_READY Any enabled APs are busy. + @retval EFI_TIMEOUT In blocking mode, the timeout expired be= fore all + enabled APs have finished. + @retval EFI_INVALID_PARAMETER Procedure is NULL. +**/ +EFI_STATUS +EFIAPI +PeiStartupAllCPUs ( + IN EDKII_PEI_MP_SERVICES2_PPI *This, + IN EFI_AP_PROCEDURE Procedure, + IN UINTN TimeoutInMicroSeconds, + IN VOID *ProcedureArgument OPTIONAL + ); + extern EFI_PEI_NOTIFY_DESCRIPTOR mPostMemNotifyList[]; =20 #endif diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf b/UefiCpuPkg/CpuMpPei/CpuMpPe= i.inf index 4fc4ea77ba..e42ba824e4 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf @@ -54,6 +54,7 @@ gEfiSecPlatformInformation2PpiGuid gEfiVectorHandoffInfoPpiGuid ## SOMETIMES_CONSUMES gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES + gEdkiiPeiMpServices2PpiGuid ## PRODUCES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask ##= CONSUMES --=20 2.21.0.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 (#44020): https://edk2.groups.io/g/devel/message/44020 Mute This Topic: https://groups.io/mt/32524460/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-