Skip to content

Conversation

@makubacki
Copy link
Member

@makubacki makubacki commented Nov 26, 2025

Description

Note: PR is in draft while WIP


Right now, the PEI Core instance of AdvancedLoggerLib will always allocate the logger buffer as EfiRuntimeServicesData. This means it is not allocated into the DXE Core managed RT Services Data memory bucket. The DXE Core instance of AdvancedLoggerLib either continues to use this buffer it is provided or allocates a new EfiReservedMemoryType buffer.

This change always allocates a EfiReservedMemoryType buffer in the DXE Core instance to ensure it is allocated from the reserved memory type buckets setup by the DXE Core. The PEI Core logger buffer is updated to be EfiBootServicesData so it does not affect runtime allocations.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • CI
  • Boot on a physical Intel platform and confirm the logger is functional
    • Note: Has not been tested on an ARM64 platform yet

Integration Instructions

  • N/A

@makubacki makubacki self-assigned this Nov 26, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 0% with 29 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/202502@e5d9f29). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...rary/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c 0.00% 29 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             release/202502    #799   +/-   ##
================================================
  Coverage                  ?   5.08%           
================================================
  Files                     ?      35           
  Lines                     ?    3892           
  Branches                  ?     247           
================================================
  Hits                      ?     198           
  Misses                    ?    3692           
  Partials                  ?       2           
Flag Coverage Δ
AdvLoggerPkg 5.08% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@makubacki
Copy link
Member Author

makubacki commented Nov 26, 2025

My understanding is that there are at least two additional changes likely needed.

  1. Allow an option for platforms to use a static memory region throughout all of boot. This region would be platform-defined (fixed) and not dynamically allocated. This will split the incoming buffer to DXE into either a "static" and "dynamic" case. DXE will only migrate the buffer if it falls under the "dynamic" case. The case might be able to be simply detected by checked with: PcdAdvancedLoggerBase != 0.

  2. In the "dynamic" buffer case, where it is migrated to a DXE allocated buffer, the MM Core AdvancedLoggerLib instance will initially start working with the Boot Services Data buffer as described in gAdvancedLoggerHobGuid, but we'd need to send the updated shared buffer to the MM Core when it is allocated by the DXE Core instance.

For others that have worked more with adv logger, is that true? Also, any quick sanity checks of the current changes (while those updates are being made) is appreciated.

Copy link
Contributor

@os-d os-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted offline, I think this works, but we should only do this if we aren't doing the fixed buffer region

Right now, the PEI Core instance of AdvancedLoggerLib will always
allocate the logger buffer as `EfiRuntimeServicesData`. This means
it is not allocated into the DXE Core managed RT Services Data
memory bucket. The DXE Core instance of AdvancedLoggerLib either
continues to use this buffer it is provided or allocates a new
`EfiReservedMemoryType` buffer.

This change always allocates a `EfiReservedMemoryType` buffer in
the DXE Core instance to ensure it is allocated from the reserved
memory type buckets setup by the DXE Core. The PEI Core logger
buffer is updated to be `EfiBootServicesData` so it does not affect
runtime allocations.

Signed-off-by: Michael Kubacki <[email protected]>
Update the library to use the standard C predefined identifier
`__func__` instead of `__FUNCTION__` to improve code portability.

This was started in some recently modified lines in the library.
The remaining instances have been updated for consistency in this
change.

Signed-off-by: Michael Kubacki <[email protected]>
@makubacki makubacki force-pushed the adv_logger_bucket_frag branch from 85a781d to af44b6e Compare December 5, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants