From nobody Mon Dec 23 14:25:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 151816356417436.6878728884642; Fri, 9 Feb 2018 00:06:04 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D70E421E0BA01; Fri, 9 Feb 2018 00:00:16 -0800 (PST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 33615223DB780 for ; Fri, 9 Feb 2018 00:00:15 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 00:06:00 -0800 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga005.fm.intel.com with ESMTP; 09 Feb 2018 00:06:00 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,482,1511856000"; d="scan'208";a="202604587" From: Dandan Bi To: edk2-devel@lists.01.org Date: Fri, 9 Feb 2018 16:05:17 +0800 Message-Id: <1518163522-23144-3-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1518163522-23144-1-git-send-email-dandan.bi@intel.com> References: <1518163522-23144-1-git-send-email-dandan.bi@intel.com> Subject: [edk2] [PATCH v2 2/7] UefiCpuPkg/S3Resume: Remove useless pref code X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Eric Dong , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" V2: Just update the commit message to reference the hash value of new new performance infrastructure. Our new performance infrastructure (edk2 trunk commit hash value: SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~ SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4)can support to dump performance date form ACPI table in OS. So we can remove the old pref code to write performance data to OS. Cc: Eric Dong Cc: Laszlo Ersek Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Laszlo Ersek --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 131 -----------------= ---- .../Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf | 3 +- 2 files changed, 1 insertion(+), 133 deletions(-) diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg= /Universal/Acpi/S3Resume2Pei/S3Resume.c index d7d2a4d..4d77689 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -20,11 +20,10 @@ =20 #include =20 #include #include -#include #include #include #include #include #include @@ -284,136 +283,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT mGdtEntries[]= =3D { GLOBAL_REMOVE_IF_UNREFERENCED CONST IA32_DESCRIPTOR mGdt =3D { sizeof (mGdtEntries) - 1, (UINTN) mGdtEntries }; =20 -/** - Performance measure function to get S3 detailed performance data. - - This function will getS3 detailed performance data and saved in pre-rese= rved ACPI memory. -**/ -VOID -WriteToOsS3PerformanceData ( - VOID - ) -{ - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS mAcpiLowMemoryBase; - PERF_HEADER *PerfHeader; - PERF_DATA *PerfData; - UINT64 Ticker; - UINTN Index; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - UINTN VarSize; - UINTN LogEntryKey; - CONST VOID *Handle; - CONST CHAR8 *Token; - CONST CHAR8 *Module; - UINT64 StartTicker; - UINT64 EndTicker; - UINT64 StartValue; - UINT64 EndValue; - BOOLEAN CountUp; - UINT64 Freq; - - // - // Retrieve time stamp count as early as possible - // - Ticker =3D GetPerformanceCounter (); - - Freq =3D GetPerformanceCounterProperties (&StartValue, &EndValue); - - Freq =3D DivU64x32 (Freq, 1000); - - Status =3D PeiServicesLocatePpi ( - &gEfiPeiReadOnlyVariable2PpiGuid, - 0, - NULL, - (VOID **) &VariableServices - ); - if (EFI_ERROR (Status)) { - return; - } - - VarSize =3D sizeof (EFI_PHYSICAL_ADDRESS); - Status =3D VariableServices->GetVariable ( - VariableServices, - L"PerfDataMemAddr", - &gPerformanceProtocolGuid, - NULL, - &VarSize, - &mAcpiLowMemoryBase - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Fail to retrieve variable to log S3 performance = data \n")); - return; - } - - PerfHeader =3D (PERF_HEADER *) (UINTN) mAcpiLowMemoryBase; - - if (PerfHeader->Signiture !=3D PERFORMANCE_SIGNATURE) { - DEBUG ((EFI_D_ERROR, "Performance data in ACPI memory get corrupted! \= n")); - return; - } - - // - // Record total S3 resume time. - // - if (EndValue >=3D StartValue) { - PerfHeader->S3Resume =3D Ticker - StartValue; - CountUp =3D TRUE; - } else { - PerfHeader->S3Resume =3D StartValue - Ticker; - CountUp =3D FALSE; - } - - // - // Get S3 detailed performance data - // - Index =3D 0; - LogEntryKey =3D 0; - while ((LogEntryKey =3D GetPerformanceMeasurement ( - LogEntryKey, - &Handle, - &Token, - &Module, - &StartTicker, - &EndTicker)) !=3D 0) { - if (EndTicker !=3D 0) { - PerfData =3D &PerfHeader->S3Entry[Index]; - - // - // Use File Handle to specify the different performance log for PEIM. - // File Handle is the base address of PEIM FFS file. - // - if ((AsciiStrnCmp (Token, "PEIM", PEI_PERFORMANCE_STRING_SIZE) =3D= =3D 0) && (Handle !=3D NULL)) { - AsciiSPrint (PerfData->Token, PERF_TOKEN_LENGTH, "0x%11p", Handle); - } else { - AsciiStrnCpyS (PerfData->Token, PERF_TOKEN_SIZE, Token, PERF_TOKEN= _LENGTH); - } - if (StartTicker =3D=3D 1) { - StartTicker =3D StartValue; - } - if (EndTicker =3D=3D 1) { - EndTicker =3D StartValue; - } - Ticker =3D CountUp? (EndTicker - StartTicker) : (StartTicker - EndTi= cker); - PerfData->Duration =3D (UINT32) DivU64x32 (Ticker, (UINT32) Freq); - - // - // Only Record > 1ms performance data so that more big performance c= an be recorded. - // - if ((Ticker > Freq) && (++Index >=3D PERF_PEI_ENTRY_MAX_NUM)) { - // - // Reach the maximum number of PEI performance log entries. - // - break; - } - } - } - PerfHeader->S3EntryNum =3D (UINT32) Index; -} =20 /** The function will check if current waking vector is long mode. =20 @param AcpiS3Context a pointer to a structure of ACPI_S= 3_CONTEXT @@ -602,14 +475,10 @@ S3ResumeBootOs ( // // report status code on S3 resume // REPORT_STATUS_CODE (EFI_PROGRESS_CODE, EFI_SOFTWARE_PEI_MODULE | EFI_SW_= PEI_PC_OS_WAKE); =20 - PERF_CODE ( - WriteToOsS3PerformanceData (); - ); - AsmTransferControl =3D (ASM_TRANSFER_CONTROL)(UINTN)PeiS3ResumeState->As= mTransferControl; if (Facs->XFirmwareWakingVector !=3D 0) { // // Switch to native waking vector // diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/Uefi= CpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf index 15fa2d1..9522ede 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf @@ -3,11 +3,11 @@ # # This module works with StandAloneBootScriptExecutor to S3 resume to OS. # 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 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# Copyright (c) 2017, AMD Incorporated. All rights reserved.
# # This program and the accompanying materials are # licensed and made available under the terms and conditions of the BSD Li= cense # which accompanies this distribution. The full text of the license may b= e found at @@ -71,11 +71,10 @@ PrintLib =20 [Guids] gEfiBootScriptExecutorVariableGuid ## SOMETIMES_CONSUMES ## U= NDEFINED # LockBox gEfiBootScriptExecutorContextGuid ## SOMETIMES_CONSUMES ## U= NDEFINED # LockBox - gPerformanceProtocolGuid ## SOMETIMES_CONSUMES ## V= ariable:L"PerfDataMemAddr" ## SOMETIMES_CONSUMES ## HOB ## SOMETIMES_CONSUMES ## UNDEFINED # LockBox gEfiAcpiVariableGuid gEfiAcpiS3ContextGuid ## SOMETIMES_CONSUMES ## U= NDEFINED # LockBox gEdkiiEndOfS3ResumeGuid ## SOMETIMES_CONSUMES ## U= NDEFINED # Used to do smm communication --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel