From e245d8557a8f44d679e4a9b69480f53b58e5cc2e Mon Sep 17 00:00:00 2001 From: Raymond Diaz Date: Fri, 2 Aug 2024 15:25:11 -0700 Subject: [PATCH 1/3] Removed all instances of PcdAdvancedLoggerPeiInRam --- AdvLoggerPkg/AdvLoggerPkg.dec | 5 ---- AdvLoggerPkg/Docs/ReadMe.md | 3 +-- .../BaseArm/AdvancedLoggerLib.c | 1 - .../MmCoreArm/AdvancedLoggerLib.c | 1 - .../PeiCore/AdvancedLoggerLib.c | 23 ++++--------------- .../PeiCore/AdvancedLoggerLib.inf | 1 - 6 files changed, 5 insertions(+), 29 deletions(-) diff --git a/AdvLoggerPkg/AdvLoggerPkg.dec b/AdvLoggerPkg/AdvLoggerPkg.dec index f4bfd2589f..3c325a170e 100644 --- a/AdvLoggerPkg/AdvLoggerPkg.dec +++ b/AdvLoggerPkg/AdvLoggerPkg.dec @@ -85,11 +85,6 @@ # gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerFixedInRAM|FALSE|BOOLEAN|0x00010189 - ## PcdAdvancedLoggerPeiInRAM - Tells the PEI Advanced Logger that this PEI can allocate memory - # and there is no need for a temporary memory buffer - # - gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPeiInRAM|FALSE|BOOLEAN|0x00010185 - ## PcdAdvancedLoggerLocator - Tells the Advanced Logger to publish a variable with the logger info block address # gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerLocator|FALSE|BOOLEAN|0x00010186 diff --git a/AdvLoggerPkg/Docs/ReadMe.md b/AdvLoggerPkg/Docs/ReadMe.md index 0d67369642..abde02af9b 100644 --- a/AdvLoggerPkg/Docs/ReadMe.md +++ b/AdvLoggerPkg/Docs/ReadMe.md @@ -14,7 +14,7 @@ The following configurations are supported: | --- | --- | | DXE Only | Uses DxeCore, DxeRuntime, and Dxe AdvancedLoggerLib libraries for logging from start of DXE CORE through Exit Boot Services. Accepts the PEI Advanced Logger Hob if one is generated. Produces the AdvancedLogger protocol. | | DXE+SMM | Requires DXE modules above, and adds the Smm AdvancedLoggerLib library. Collects SMM generated messages in the in memory log. | -| PEI | Uses PeiCore and Pei AdvancedLoggerLib libraries. Creates the Advanced Logger Hob if PcdAdvancedLoggerPeiInRAM is set. | +| PEI | Uses PeiCore and Pei AdvancedLoggerLib libraries. | | SEC | Uses the Sec Advanced Logger Library. SEC requires a fixed load address, so it piggy backs on the Temporary RAM PCD information. Produces a Fixed Address temporary RAM log. When memory is added, the Sec Advanced Logger library converts the Temporary RAM logging information to the PEI Advanced Logger Hob. | | PEI64 | Uses Pei64 Advanced Logger Library. Requires the SEC fixed address temporary log information in order to log Pei64 bit DEBUG messages. | | MM | Standalone MM - Loads during PEI phase. | @@ -25,7 +25,6 @@ PCD's used by Advanced Logger | PCD | Function of the PCD| | --- | --- | |PcdAdvancedLoggerForceEnable | The default operation is to check if a Logs directory is present in the root of the filesystem. If the UefiLogs directory is present, logging is enabled. When PcdAdvancedLoggerForceEnable is TRUE, and the device is not a USB device, a UefiLogs directory will be created and logging is enabled. When logging is enabled, the proper log files will be created if not already preset.| -|PcdAdvancedLoggerPeiInRAM | For systems that have memory at PeiCore entry. The full in memory log buffer if PcdAdvancedLoggerPages is allocated in the Pei Core constructor and PcdAdvancedLoggerPreMemPages is ignored.| |PcdAdvancedLoggerFixedInRAM | For systems that have a fixed memory buffer prior to UEFI. The full in memory log buffer is assumed.| |PcdAdvancedHdwLoggerDebugPrintErrorLevel | The standard debug flags filter which log messages are produced. This PCD allow a subset of log messages to be forwarded to the Hdw Port Lib.| |PcdAdvancedHdwLoggerDisable | Specifies when to disable writing to the Hdw Port.| diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/BaseArm/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/BaseArm/AdvancedLoggerLib.c index 48dfdc2c4e..f64affe5d7 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/BaseArm/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/BaseArm/AdvancedLoggerLib.c @@ -76,7 +76,6 @@ ValidateInfoBlock ( The following PCD settings are assumed: - PcdAdvancedLoggerPeiInRAM -- TRUE PcdAdvancedLoggerBase -- NOT NULL and pointer to memory to be used PcdAdvancedLoggerPages -- > 64KB of pages PcdAdvancedLoggerCarBase -- NOT USED, leave at default diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c index 583ed85528..0bd4f4c511 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c @@ -31,7 +31,6 @@ The following PCD settings are assumed: - PcdAdvancedLoggerPeiInRAM -- TRUE PcdAdvancedLoggerBase -- NOT NULL and pointer to memory to be used PcdAdvancedLoggerPages -- > 64KB of pages PcdAdvancedLoggerCarBase -- NOT USED, leave at default diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c index a97c0de4f4..60d57203c7 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c @@ -553,14 +553,9 @@ AdvancedLoggerGetLoggerInfo ( // Memory Discovered Ppi. At that time, the full in memory log buffer is allocated. // - if (FeaturePcdGet (PcdAdvancedLoggerPeiInRAM)) { - Pages = FixedPcdGet32 (PcdAdvancedLoggerPages); - Type = EfiRuntimeServicesData; - } else { - Pages = FixedPcdGet32 (PcdAdvancedLoggerPreMemPages); - // This is to avoid the interim buffer being allocated to consume 64KB on ARM64 platforms. - Type = EfiBootServicesData; - } + Pages = FixedPcdGet32 (PcdAdvancedLoggerPreMemPages); + // This is to avoid the interim buffer being allocated to consume 64KB on ARM64 platforms. + Type = EfiBootServicesData; BufferSize = EFI_PAGES_TO_SIZE (Pages); @@ -623,17 +618,7 @@ AdvancedLoggerGetLoggerInfo ( Status = PeiServicesInstallPpi (mAdvancedLoggerPpiList); ASSERT_EFI_ERROR (Status); - if (FeaturePcdGet (PcdAdvancedLoggerPeiInRAM)) { - LoggerInfo->InPermanentRAM = TRUE; - Status = MmUnblockMemoryRequest (NewLoggerInfo, Pages); - if (EFI_ERROR (Status)) { - if (Status != EFI_UNSUPPORTED) { - DEBUG ((DEBUG_ERROR, "%a: Unable to notify StandaloneMM. Code=%r\n", __FUNCTION__, Status)); - } - } else { - DEBUG ((DEBUG_INFO, "%a: StandaloneMM Hob data published\n", __FUNCTION__)); - } - } else if (FeaturePcdGet (PcdAdvancedLoggerFixedInRAM)) { + if (FeaturePcdGet (PcdAdvancedLoggerFixedInRAM)) { DEBUG ((DEBUG_INFO, "%a: Standalone MM Hob of fixed data published\n", __FUNCTION__)); } else { PeiServicesNotifyPpi (mMemoryDiscoveredNotifyList); diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.inf b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.inf index 5348657e4f..f766a7469d 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.inf +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.inf @@ -54,7 +54,6 @@ gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES [FeaturePcd] - gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPeiInRAM ## CONSUMES gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerFixedInRAM ## CONSUMES gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerAutoWrapEnable From d9d7329681f8c69ea3d1d49aedbcb613982d3418 Mon Sep 17 00:00:00 2001 From: Raymond Diaz Date: Mon, 5 Aug 2024 10:32:29 -0700 Subject: [PATCH 2/3] Addressed review comments. Removed unused type variable --- .../Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c index 60d57203c7..b76006b83f 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c @@ -453,7 +453,6 @@ AdvancedLoggerGetLoggerInfo ( UINTN Pages; CONST EFI_PEI_SERVICES **PeiServices; EFI_STATUS Status; - EFI_MEMORY_TYPE Type; ADVANCED_LOGGER_MESSAGE_ENTRY_V2 *LogEntry; // Try to do the minimum work at the start of this function as this @@ -554,13 +553,11 @@ AdvancedLoggerGetLoggerInfo ( // Pages = FixedPcdGet32 (PcdAdvancedLoggerPreMemPages); - // This is to avoid the interim buffer being allocated to consume 64KB on ARM64 platforms. - Type = EfiBootServicesData; BufferSize = EFI_PAGES_TO_SIZE (Pages); Status = PeiServicesAllocatePages ( - Type, + EfiBootServicesData, Pages, &NewLoggerInfo ); From 38339016109e88a3f4ebaf8a7728b68bde0ca95f Mon Sep 17 00:00:00 2001 From: Raymond Diaz Date: Mon, 5 Aug 2024 14:53:21 -0700 Subject: [PATCH 3/3] Removed reference to PcdAdvancedHdwLoggerDisable in the README --- AdvLoggerPkg/Docs/ReadMe.md | 1 - 1 file changed, 1 deletion(-) diff --git a/AdvLoggerPkg/Docs/ReadMe.md b/AdvLoggerPkg/Docs/ReadMe.md index abde02af9b..cd0c23cbae 100644 --- a/AdvLoggerPkg/Docs/ReadMe.md +++ b/AdvLoggerPkg/Docs/ReadMe.md @@ -27,7 +27,6 @@ PCD's used by Advanced Logger |PcdAdvancedLoggerForceEnable | The default operation is to check if a Logs directory is present in the root of the filesystem. If the UefiLogs directory is present, logging is enabled. When PcdAdvancedLoggerForceEnable is TRUE, and the device is not a USB device, a UefiLogs directory will be created and logging is enabled. When logging is enabled, the proper log files will be created if not already preset.| |PcdAdvancedLoggerFixedInRAM | For systems that have a fixed memory buffer prior to UEFI. The full in memory log buffer is assumed.| |PcdAdvancedHdwLoggerDebugPrintErrorLevel | The standard debug flags filter which log messages are produced. This PCD allow a subset of log messages to be forwarded to the Hdw Port Lib.| -|PcdAdvancedHdwLoggerDisable | Specifies when to disable writing to the Hdw Port.| |PcdAdvancedLoggerPreMemPages | Amount of temporary RAM used for the debug log.| |PcdAdvancedLoggerPages | Amount of system RAM used for the debug log| |PcdAdvancedLoggerLocator | When enabled, the AdvLogger creates a variable "AdvLoggerLocator" with the address of the LoggerInfo buffer|