Skip to content

AdvLoggerPkg: Drop buffer migration#868

Open
makubacki wants to merge 1 commit intomicrosoft:release/202511from
makubacki:drop_adv_logger_buffer_migration
Open

AdvLoggerPkg: Drop buffer migration#868
makubacki wants to merge 1 commit intomicrosoft:release/202511from
makubacki:drop_adv_logger_buffer_migration

Conversation

@makubacki
Copy link
Copy Markdown
Member

@makubacki makubacki commented Apr 8, 2026

Description

Effectively reverts commits af0f64c and 9fc8521 preserving structure compatibility and general cleanup.

The advanced logger buffer starts accumulating messages in the first phase advanced logger is active, and the buffer continues to be used throughout remaining phases. Each phase has to account for either allocating or using an existing logger buffer. Due to the persistent nature of the buffer throughout boot, it is allocated as a runtime memory type early in boot to support its preservation and access at OS runtime.

However, S4 resume relies upon a stable memory map across suspend and resume. Since the advanced logger buffer is allocated as a runtime memory type prior to DXE, it is in a buffer outside the DXE memory bins. This leads to an increased likelihood of the buffer being at a different address across suspend and resume affecting hibernate resume. Advanced logger buffer migration was a mechanism to address this but doing so complicates MM treatment of the buffer.

Because a single advanced logger buffer is used across all phases, including a shared buffer between PEI and MM and DXE and MM, the buffer must be unlocked for MM access to accommodate a PEI MM IPL. This creates a problem where both requirements cannot simultaneously be met without additional complexity in MM access code. In addition, MM environments are inconsistent in their support for memory unlocking.

In the end, hibernation has always been a best effort scenario with this flow and other MM solutions already require runtime allocations outside of DXE memory bins, so this change removes the functional logic for migration.

The memory bin scenario will be addressed in the future when the bins are allocated in a pre-DXE phase (e.g. PEI) and picked up by DXE.

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

How This Was Tested

  • AdvLoggerPkg CI
  • Boot to OS on QEMU Q35 and SBSA

Integration Instructions

  • N/A

@makubacki makubacki self-assigned this Apr 8, 2026
@mu-automation mu-automation bot added impact:non-functional Does not have a functional impact and removed impact:non-functional Does not have a functional impact labels Apr 8, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 8, 2026

Codecov Report

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

Files with missing lines Patch % Lines
...rary/AdvancedLoggerLib/Runtime/AdvancedLoggerLib.c 0.00% 9 Missing ⚠️
...rary/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c 0.00% 4 Missing ⚠️
...rary/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             release/202511    #868   +/-   ##
================================================
  Coverage                  ?   3.08%           
================================================
  Files                     ?      36           
  Lines                     ?    4246           
  Branches                  ?      73           
================================================
  Hits                      ?     131           
  Misses                    ?    4109           
  Partials                  ?       6           
Flag Coverage Δ
AdvLoggerPkg 3.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 makubacki force-pushed the drop_adv_logger_buffer_migration branch from b97e867 to f923ebd Compare April 8, 2026 19:03
@mu-automation
Copy link
Copy Markdown
Contributor

mu-automation bot commented Apr 8, 2026

✅ QEMU Validation Passed

Source Dependencies

Repository Commit
mu_plus 4afb60c
mu_tiano_platforms e7f5cec

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ✅ success ✅ success 0m 15s Build Logs Boot Logs
SBSA DEBUG ✅ success ✅ success 0m 32s Build Logs Boot Logs

Workflow run: https://github.com/microsoft/mu_plus/actions/runs/24160924905

This comment was automatically generated by the Mu QEMU PR Validation workflow.

Effectively reverts commits af0f64c and 9fc8521 preserving structure
compatibility and general cleanup.

The advanced logger buffer starts accumulating messages in the first
phase advanced logger is active, and the buffer continues to be used
throughout remaining phases. Each phase has to account for either
allocating or using an existing logger buffer. Due to the persistent
nature of the buffer throughout boot, it is allocated as a runtime
memory type early in boot to support its preservation and access at OS
runtime.

However, S4 resume relies upon a stable memory map across suspend and
resume. Since the advanced logger buffer is allocated as a runtime
memory type prior to DXE, it is in a buffer outside the DXE memory
bins. This leads to an increased likelihood of the buffer being at
a different address across suspend and resume affecting hibernate
resume. Advanced logger buffer migration was a mechanism to address
this but doing so complicates MM treatment of the buffer.

Because a single advanced logger buffer is used across all phases,
including a shared buffer between PEI and MM and DXE and MM, the
buffer must be unlocked for MM access to accommodate a PEI MM IPL.
This creates a problem where both requirements cannot simultaneously
be met without additional complexity in MM access code. In addition,
MM environments are inconsistent in their support for memory
unlocking.

In the end, hibernation has always been a best effort scenario with
this flow and other MM solutions already require runtime allocations
outside of DXE memory bins so this change removes the functional
logic for migration.

The memory bin scenario will be addressed in the future when the bins
are allocated in a pre-DXE phase (e.g. PEI) and picked up by DXE.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki force-pushed the drop_adv_logger_buffer_migration branch from f923ebd to 4afb60c Compare April 8, 2026 21:44
@makubacki makubacki marked this pull request as ready for review April 9, 2026 00:28
@makubacki makubacki requested review from cfernald, kuqin12 and os-d April 9, 2026 00:28
EFI_TIME Time; // Uefi Time Field
UINT32 HwPrintLevel; // Logging level to be printed at hw port
UINT32 Reserved3; //
EFI_PHYSICAL_ADDRESS NewLoggerInfoAddress; // If non-zero, this field holds the address of new logger info that should be used
Copy link
Copy Markdown
Contributor

@cfernald cfernald Apr 9, 2026

Choose a reason for hiding this comment

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

Should we mark NewLoggerInfoAddress reserved/deprecated?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should, as long as we say that Reserved fields cannot be used in the future.

Copy link
Copy Markdown
Contributor

@cfernald cfernald left a comment

Choose a reason for hiding this comment

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

re-approving since github seems to have glitched and didn't count it before.

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.

5 participants