From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.4978.1591701862111845088 for ; Tue, 09 Jun 2020 04:24:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: ming.tan@intel.com) IronPort-SDR: pzD3NrcbUXZh7qOjtmQSNllSsAug6Gk73ZP5Zaf6sncBI11T74AvXwbtRMqG8DKQC5vnx3BqCz B6n+QSqOmgWg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 04:24:20 -0700 IronPort-SDR: RwrIKOY7L6nGL/pBRNBxisbkm508O22H+yyLZf9i9l3g7hZEri/wKtXeKhVTMeOKE2UehEkfs8 MXf1hUZSv/eQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,491,1583222400"; d="scan'208";a="314177547" Received: from shwdejointlab96.ccr.corp.intel.com ([10.239.134.144]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jun 2020 04:24:19 -0700 From: "Tan, Ming" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [PATCH v3 1/4] MdeModulePkg.dec: Change PCDs for status code. Date: Tue, 9 Jun 2020 19:23:45 +0800 Message-Id: <20200609112353.20824-1-ming.tan@intel.com> X-Mailer: git-send-email 2.24.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2786 In order to support enable/disable report status code through memory or serial dynamic, change the following PCDs from [PcdsFeatureFlag] to [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]: PcdStatusCodeUseSerial PcdStatusCodeUseMemory The original plaforms can use PcdsFixedAtBuild in .dsc files to save size. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Ming Tan --- V3: Split one patch to several patchs, each Pkg has one patch. V2: Change the new type from [PcdsDynamic] to [PcdsFixedAtBuild, PcdsPatcha= bleInModule, PcdsDynamic, PcdsDynamicEx] And set to PcdsFixedAtBuild in the original platform .dsc files. MdeModulePkg/MdeModulePkg.dec | 26 +++++++++---------- .../Pei/StatusCodeHandlerPei.c | 6 ++--- .../Pei/StatusCodeHandlerPei.inf | 6 ++--- .../RuntimeDxe/StatusCodeHandlerRuntimeDxe.c | 16 ++++++------ .../StatusCodeHandlerRuntimeDxe.inf | 6 ++--- .../Smm/StatusCodeHandlerSmm.c | 10 +++---- .../Smm/StatusCodeHandlerSmm.inf | 6 ++--- 7 files changed, 35 insertions(+), 41 deletions(-) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 4f44af6948..843e963ad3 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -760,19 +760,6 @@ # @Prompt Enable PCI bridge IO alignment probe.=0D gEfiMdeModulePkgTokenSpaceGuid.PcdPciBridgeIoAlignmentProbe|FALSE|BOOLEA= N|0x0001004e=0D =0D - ## Indicates if StatusCode is reported via Serial port.

=0D - # TRUE - Reports StatusCode via Serial port.
=0D - # FALSE - Does not report StatusCode via Serial port.
=0D - # @Prompt Enable StatusCode via Serial port.=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE|BOOLEAN|0x000= 10022=0D -=0D - ## Indicates if StatusCode is stored in memory.=0D - # The memory is boot time memory in PEI Phase and is runtime memory in = DXE Phase.

=0D - # TRUE - Stores StatusCode in memory.
=0D - # FALSE - Does not store StatusCode in memory.
=0D - # @Prompt Enable StatusCode via memory.=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE|BOOLEAN|0x00= 010023=0D -=0D ## Indicates if PEI phase StatusCode will be replayed in DXE phase.
<= BR>=0D # TRUE - Replays PEI phase StatusCode in DXE phased.
=0D # FALSE - Does not replay PEI phase StatusCode in DXE phase.
=0D @@ -2001,6 +1988,19 @@ # @Prompt TCG Platform Firmware Profile revision.=0D gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision|0|UINT32|0x0= 0010077=0D =0D + ## Indicates if StatusCode is reported via Serial port.

=0D + # TRUE - Reports StatusCode via Serial port.
=0D + # FALSE - Does not report StatusCode via Serial port.
=0D + # @Prompt Enable StatusCode via Serial port.=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE|BOOLEAN|0x000= 10022=0D +=0D + ## Indicates if StatusCode is stored in memory.=0D + # The memory is boot time memory in PEI Phase and is runtime memory in = DXE Phase.

=0D + # TRUE - Stores StatusCode in memory.
=0D + # FALSE - Does not store StatusCode in memory.
=0D + # @Prompt Enable StatusCode via memory.=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE|BOOLEAN|0x00= 010023=0D +=0D [PcdsPatchableInModule]=0D ## Specify memory size with page number for PEI code when=0D # Loading Module at Fixed Address feature is enabled.=0D diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandler= Pei.c b/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c index 1b07f92f3c..9b2ea4ee84 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.c @@ -2,7 +2,7 @@ Report Status Code Handler PEIM which produces general handlers and hook= them=0D onto the PEI status code router.=0D =0D - Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -45,13 +45,13 @@ StatusCodeHandlerPeiEntry ( // If enable UseSerial, then initialize serial port.=0D // if enable UseMemory, then initialize memory status code worker.=0D //=0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D Status =3D SerialPortInitialize();=0D ASSERT_EFI_ERROR (Status);=0D Status =3D RscHandlerPpi->Register (SerialStatusCodeReportWorker);=0D ASSERT_EFI_ERROR (Status);=0D }=0D - if (FeaturePcdGet (PcdStatusCodeUseMemory)) {=0D + if (PcdGetBool (PcdStatusCodeUseMemory)) {=0D Status =3D MemoryStatusCodeInitializeWorker ();=0D ASSERT_EFI_ERROR (Status);=0D Status =3D RscHandlerPpi->Register (MemoryStatusCodeReportWorker);=0D diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandler= Pei.inf b/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei= .inf index 8aef9af34a..64380ddfac 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf +++ b/MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf @@ -53,11 +53,9 @@ [Ppis]=0D gEfiPeiRscHandlerPpiGuid ## CONSUMES=0D =0D -[FeaturePcd]=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES=0D -=0D [Pcd]=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES=0D gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1|gEfiMdeModulePk= gTokenSpaceGuid.PcdStatusCodeUseMemory ## SOMETIMES_CONSUMES=0D =0D [Depex]=0D diff --git a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCode= HandlerRuntimeDxe.c b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/S= tatusCodeHandlerRuntimeDxe.c index 79cc48fa55..a8c0fe5b71 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandler= RuntimeDxe.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandler= RuntimeDxe.c @@ -2,7 +2,7 @@ Status Code Handler Driver which produces general handlers and hook them= =0D onto the DXE status code router.=0D =0D - Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -29,7 +29,7 @@ UnregisterBootTimeHandlers ( IN VOID *Context=0D )=0D {=0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D mRscHandlerProtocol->Unregister (SerialStatusCodeReportWorker);=0D }=0D }=0D @@ -80,14 +80,14 @@ InitializationDispatcherWorker ( // If enable UseSerial, then initialize serial port.=0D // if enable UseRuntimeMemory, then initialize runtime memory status cod= e worker.=0D //=0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D //=0D // Call Serial Port Lib API to initialize serial port.=0D //=0D Status =3D SerialPortInitialize ();=0D ASSERT_EFI_ERROR (Status);=0D }=0D - if (FeaturePcdGet (PcdStatusCodeUseMemory)) {=0D + if (PcdGetBool (PcdStatusCodeUseMemory)) {=0D Status =3D RtMemoryStatusCodeInitializeWorker ();=0D ASSERT_EFI_ERROR (Status);=0D }=0D @@ -115,7 +115,7 @@ InitializationDispatcherWorker ( //=0D // Dispatch records to devices based on feature flag.=0D //=0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D SerialStatusCodeReportWorker (=0D Record[Index].CodeType,=0D Record[Index].Value,=0D @@ -124,7 +124,7 @@ InitializationDispatcherWorker ( NULL=0D );=0D }=0D - if (FeaturePcdGet (PcdStatusCodeUseMemory)) {=0D + if (PcdGetBool (PcdStatusCodeUseMemory)) {=0D RtMemoryStatusCodeReportWorker (=0D Record[Index].CodeType,=0D Record[Index].Value,=0D @@ -171,10 +171,10 @@ StatusCodeHandlerRuntimeDxeEntry ( //=0D InitializationDispatcherWorker ();=0D =0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D mRscHandlerProtocol->Register (SerialStatusCodeReportWorker, TPL_HIGH_= LEVEL);=0D }=0D - if (FeaturePcdGet (PcdStatusCodeUseMemory)) {=0D + if (PcdGetBool (PcdStatusCodeUseMemory)) {=0D mRscHandlerProtocol->Register (RtMemoryStatusCodeReportWorker, TPL_HIG= H_LEVEL);=0D }=0D =0D diff --git a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCode= HandlerRuntimeDxe.inf b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe= /StatusCodeHandlerRuntimeDxe.inf index d74c2a55dc..faadfd9578 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandler= RuntimeDxe.inf +++ b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandler= RuntimeDxe.inf @@ -58,12 +58,10 @@ [Protocols]=0D gEfiRscHandlerProtocolGuid ## CONSUMES=0D =0D -[FeaturePcd]=0D +[Pcd]=0D gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeReplayIn ## CONSUMES=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES=0D gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES=0D -=0D -[Pcd]=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES=0D gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| gEfiMdeModu= lePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## SOMETIMES_CONSUMES=0D =0D [Depex]=0D diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandler= Smm.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c index f54991ed3f..20271571de 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c @@ -2,7 +2,7 @@ Status Code Handler Driver which produces general handlers and hook them= =0D onto the SMM status code router.=0D =0D - Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -28,14 +28,14 @@ InitializationDispatcherWorker ( // If enable UseSerial, then initialize serial port.=0D // if enable UseRuntimeMemory, then initialize runtime memory status cod= e worker.=0D //=0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D //=0D // Call Serial Port Lib API to initialize serial port.=0D //=0D Status =3D SerialPortInitialize ();=0D ASSERT_EFI_ERROR (Status);=0D }=0D - if (FeaturePcdGet (PcdStatusCodeUseMemory)) {=0D + if (PcdGetBool (PcdStatusCodeUseMemory)) {=0D Status =3D MemoryStatusCodeInitializeWorker ();=0D ASSERT_EFI_ERROR (Status);=0D }=0D @@ -73,10 +73,10 @@ StatusCodeHandlerSmmEntry ( //=0D InitializationDispatcherWorker ();=0D =0D - if (FeaturePcdGet (PcdStatusCodeUseSerial)) {=0D + if (PcdGetBool (PcdStatusCodeUseSerial)) {=0D mRscHandlerProtocol->Register (SerialStatusCodeReportWorker);=0D }=0D - if (FeaturePcdGet (PcdStatusCodeUseMemory)) {=0D + if (PcdGetBool (PcdStatusCodeUseMemory)) {=0D mRscHandlerProtocol->Register (MemoryStatusCodeReportWorker);=0D }=0D =0D diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandler= Smm.inf b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm= .inf index 47d0545f95..4e24d87e55 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf @@ -53,11 +53,9 @@ [Protocols]=0D gEfiSmmRscHandlerProtocolGuid ## CONSUMES=0D =0D -[FeaturePcd]=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES=0D -=0D [Pcd]=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES=0D gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| gEfiMdeModu= lePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## SOMETIMES_CONSUMES=0D =0D [Depex]=0D --=20 2.24.0.windows.2