From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 437EF21D19921 for ; Sun, 30 Jul 2017 21:54:18 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2017 21:56:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,440,1496127600"; d="scan'208";a="133896450" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 30 Jul 2017 21:56:25 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 30 Jul 2017 21:56:25 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 30 Jul 2017 21:56:24 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Mon, 31 Jul 2017 12:56:23 +0800 From: "Fan, Jeff" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [PATCH 2/3] UefiCpuPkg SecCore: Add SecPerformancePpiCallBack Thread-Index: AQHTCa2ZC/yZJApmIEikZmgjrlkdSaJtXxnw Date: Mon, 31 Jul 2017 04:56:22 +0000 Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C631869@shsmsx102.ccr.corp.intel.com> References: <1501471917-11272-1-git-send-email-star.zeng@intel.com> <1501471917-11272-3-git-send-email-star.zeng@intel.com> In-Reply-To: <1501471917-11272-3-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDk1ODA3NjgtZjY4Ni00ZTM3LWI4ZTYtMDFmZjNiNGVmZTE1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IllORllDQ2dHc2xhVHZyd2gyS1ZYcEVvQVNwVFRHZGlnaUh4YlRRUjZMSGs9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/3] UefiCpuPkg SecCore: Add SecPerformancePpiCallBack X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 04:54:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jeff Fan -----Original Message----- From: Zeng, Star=20 Sent: Monday, July 31, 2017 11:32 AM To: edk2-devel@lists.01.org Cc: Zeng, Star; Gao, Liming; Fan, Jeff Subject: [PATCH 2/3] UefiCpuPkg SecCore: Add SecPerformancePpiCallBack Add SecPerformancePpiCallBack to get SEC performance data and build HOB to = convey the SEC performance data to DXE phase. Cc: Liming Gao Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng --- UefiCpuPkg/SecCore/SecCore.inf | 7 +++++++ UefiCpuPkg/SecCore/SecMain.c | 46 ++++++++++++++++++++++++++++++++++++++= ++++ UefiCpuPkg/SecCore/SecMain.h | 25 ++++++++++++++++++++++- 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/SecCore/SecCore.inf b/UefiCpuPkg/SecCore/SecCore.in= f index 0d135e62ec33..a8f8a6da2728 100644 --- a/UefiCpuPkg/SecCore/SecCore.inf +++ b/UefiCpuPkg/SecCore/SecCore.inf @@ -71,6 +71,13 @@ [Ppis] ## SOMETIMES_PRODUCES gEfiSecPlatformInformation2PpiGuid gEfiTemporaryRamDonePpiGuid ## PRODUCES + ## NOTIFY + ## SOMETIMES_CONSUMES + gPeiSecPerformancePpiGuid + +[Guids] + ## SOMETIMES_PRODUCES ## HOB + gEfiFirmwarePerformanceGuid =20 [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdPeiTemporaryRamStackSize ## CONSUMES diff = --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c index a= 53fa04cc303..3d4e6ac92a5e 100644 --- a/UefiCpuPkg/SecCore/SecMain.c +++ b/UefiCpuPkg/SecCore/SecMain.c @@ -22,6 +22,14 @@ EFI_SEC_PLATFORM_INFORMATION_PPI mSecPlatformInformatio= nPpi =3D { SecPlatformInfo =20 EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformInformationPpi[] =3D { { + // + // SecPerformance PPI notify descriptor. + // + EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK, + &gPeiSecPerformancePpiGuid, + (VOID *) (UINTN) SecPerformancePpiCallBack }, { EFI_PEI_PPI_DESCRIPTOR_PPI, &gEfiTemporaryRamDonePpiGuid, &gSecTemporaryRamDonePpi @@ -56,6 +64,44 @@ SecStartupPhase2( ); =20 /** + Entry point of the notification callback function itself within the PEIM= . + It is to get SEC performance data and build HOB to convey the SEC=20 + performance data to DXE phase. + + @param PeiServices Indirect reference to the PEI Services Table. + @param NotifyDescriptor Address of the notification descriptor data str= ucture. + @param Ppi Address of the PPI that was installed. + + @return Status of the notification. + The status code returned from this function is ignored. +**/ +EFI_STATUS +EFIAPI +SecPerformancePpiCallBack ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, + IN VOID *Ppi + ) +{ + EFI_STATUS Status; + PEI_SEC_PERFORMANCE_PPI *SecPerf; + FIRMWARE_SEC_PERFORMANCE Performance; + + SecPerf =3D (PEI_SEC_PERFORMANCE_PPI *) Ppi; Status =3D=20 + SecPerf->GetPerformance (PeiServices, SecPerf, &Performance); if=20 + (!EFI_ERROR (Status)) { + BuildGuidDataHob ( + &gEfiFirmwarePerformanceGuid, + &Performance, + sizeof (FIRMWARE_SEC_PERFORMANCE) + ); + DEBUG ((DEBUG_INFO, "FPDT: SEC Performance Hob ResetEnd =3D %ld\n",=20 + Performance.ResetEnd)); } + + return Status; +} + +/** =20 Entry point to the C language phase of SEC. After the SEC assembly code has initialized some temporary memory and set up the stack, diff --= git a/UefiCpuPkg/SecCore/SecMain.h b/UefiCpuPkg/SecCore/SecMain.h index 6e3= 1a953f757..46c7d41c6e3e 100644 --- a/UefiCpuPkg/SecCore/SecMain.h +++ b/UefiCpuPkg/SecCore/SecMain.h @@ -1,7 +1,7 @@ /** @file Master header file for SecCore. =20 - Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2017, Intel Corporation. All rights=20 + reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -20,6 +20,9 @@ #include #inc= lude #include +#include + +#include =20 #include #include @@ -157,4 +160,24 @@ RepublishSecPlatformInformationPpi ( VOID ); =20 +/** + Entry point of the notification callback function itself within the PEIM= . + It is to get SEC performance data and build HOB to convey the SEC=20 +performance + data to DXE phase. + + @param PeiServices Indirect reference to the PEI Services Table. + @param NotifyDescriptor Address of the notification descriptor data str= ucture. + @param Ppi Address of the PPI that was installed. + + @return Status of the notification. + The status code returned from this function is ignored. +**/ +EFI_STATUS +EFIAPI +SecPerformancePpiCallBack ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, + IN VOID *Ppi + ); + #endif -- 2.7.0.windows.1