Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REBASE & FF] Advanced Logger Cherry-Picks From 202311 #520

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

os-d
Copy link
Contributor

@os-d os-d commented Jul 11, 2024

Description

This PR cherry-picks one full commit and one very small part of another commit from 202311:

Remove NVMe Check from File Logger

This is a complete cherry-pick from c024ed1. It adds support for File Logger to create the UefiLogs directory on non-NVMe devices.

Allocate AdvLogger Pre-Mem Pages as EfiBootServicesData

This is a part of be9a3d2. The rest of this commit is not taken because it is a new feature (a new version of the AdvLogger structure). This portion of the commit was taken because it is a bugfix for when ARM64 switched over to 64k runtime page allocation granularity. Because PeiCore has a hardcoded assumption it is operating pre-mem, which is not true for ARM64, we cannot allocate a minimum of 16 pages for a runtime type at the start of PeiCore (when AdvLogger is initialized there). We instead need to allocate as EfiBootServicesData (which does not have the runtime page allocation granularity) and reallocate as EfiRuntimeServicesData after permanent memory is installed.

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

N/A

Integration Instructions

N/A

os-d added 2 commits July 11, 2024 08:07
…reation

Currently, File Logger will only create the UefiLogs directory on
the ESP if the device is an NVMe device. This is an unneccesary
restriction and is removed in this patch.
This is a very small portion cherry-picked from
be9a3d2. This fixes a breakage
for ARM64 platforms that initialize AdvLogger in PeiCore, which
has a hardcoded assumption that memory is not available at its
start (not true for ARM64 platforms) and so allocating a minimum
of 16 pages for the runtime granularity will fail. This "pre-mem"
buffer gets freed as soon as permanent memory is installed, so we
can allocate it as EfiBootServicesData (which does not use the
runtime allocation granularity of 64k). This also works on x86.
If PcdAdvancedLoggerPeiInRAM is true, we can allocate the full
amount and need the correct runtime type (I do not think this
feature works, for the reason listed above, but that is outside
the scope of this commit).
@os-d os-d added the type:bug Something isn't working label Jul 11, 2024
@os-d os-d requested review from makubacki, kuqin12 and apop5 July 11, 2024 15:15
@github-actions github-actions bot added the impact:non-functional Does not have a functional impact label Jul 11, 2024
@os-d os-d merged commit 2603491 into microsoft:release/202302 Jul 12, 2024
30 checks passed
@os-d os-d deleted the osde/advlogger_2302 branch July 12, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants