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] Add AdvLogger PRM Module #471

Merged
merged 2 commits into from May 2, 2024

Conversation

os-d
Copy link
Contributor

@os-d os-d commented Apr 19, 2024

Description

This adds a PRM Module to fetch the Advanced Logger Log. It includes a sample Windows drive to query the PRM module and get the log. It also updates the Advanced Logger structure to V5 to use offsets instead of pointers for LogCurrent and LogBuffer. It updates DecodeUefiLog.py to be able to read this V5 structure.

  • 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

Tested on Q35 on mu_tiano_platforms by booting to Windows, running the sample driver to fetch the log, then decoding with DecodeUefiLog.py. Also tested on various physical platforms.

Integration Instructions

See README updates for integration instructions.

@github-actions github-actions bot added language:python Pull requests that update Python code impact:breaking-change Requires integration attention impact:security Has a security impact type:documentation Improvements or additions to documentation labels Apr 19, 2024
@os-d os-d changed the title Add AdvLogger PRM Module [REBASE & FF] Add AdvLogger PRM Module Apr 21, 2024
@os-d os-d force-pushed the osde/rebase_advloggerprm branch 3 times, most recently from 6f24439 to ee20e98 Compare April 25, 2024 22:03
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 62.37624% with 76 lines in your changes are missing coverage. Please review.

Project coverage is 10.86%. Comparing base (b35d771) to head (29200dc).

Files Patch % Lines
...rary/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c 0.00% 17 Missing ⚠️
...g/Library/AdvancedLoggerLib/AdvancedLoggerCommon.c 0.00% 10 Missing ⚠️
...ibrary/AdvLoggerMmAccessLib/AdvLoggerMmAccessLib.c 0.00% 7 Missing ⚠️
...rary/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c 0.00% 7 Missing ⚠️
...rary/AdvLoggerSmmAccessLib/AdvLoggerSmmAccessLib.c 0.00% 6 Missing ⚠️
...rary/AdvancedLoggerLib/Runtime/AdvancedLoggerLib.c 0.00% 6 Missing ⚠️
...rary/AdvancedLoggerLib/SmmCore/AdvancedLoggerLib.c 0.00% 6 Missing ⚠️
.../AdvLoggerOsConnectorPrm/AdvLoggerOsConnectorPrm.c 90.47% 4 Missing ⚠️
...torPrmConfigLib/AdvLoggerOsConnectorPrmConfigLib.c 95.65% 4 Missing ⚠️
.../AdvancedLoggerAccessLib/AdvancedLoggerAccessLib.c 0.00% 3 Missing ⚠️
... and 2 more
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/202311     #471      +/-   ##
==================================================
- Coverage           12.13%   10.86%   -1.28%     
==================================================
  Files                 110      142      +32     
  Lines               18991    22379    +3388     
  Branches             1756     1808      +52     
==================================================
+ Hits                 2305     2431     +126     
- Misses              16654    19916    +3262     
  Partials               32       32              
Flag Coverage Δ
AdvLoggerPkg 3.71% <62.37%> (?)

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.

.pytool/CISettings.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added the impact:testing Affects testing label Apr 27, 2024
@os-d os-d force-pushed the osde/rebase_advloggerprm branch 2 times, most recently from 1989cd9 to 5511e4b Compare April 27, 2024 15:19
The V4 Adv Logger Info structure uses pointers for LogCurrent and
LogBuffer. These pointers are not required and have additional
safety overhead. Furthermore, the pointers do not support a
runtime logger in an ARM64 environment, as StMM requires the
pointers to be physical but the runtime logger requires the
pointers to be virtual.

The V5 structure moves these to two new fields, LogCurrentOffset
and LogBufferOffset, respectively, to avoid using pointers and
be able to support runtime logging on ARM64.

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [x] 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, ...
- [x] 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, ...

Tested on various physical and virtual platforms to confirm the
log is output as expected with the V5 structure.

Update to this commit and use the new version of DecodeUefiLog.py
to correctly decode a V5 Adv Logger Log.
@os-d os-d force-pushed the osde/rebase_advloggerprm branch 2 times, most recently from a674a7c to 2c836d4 Compare May 2, 2024 23:03
This commit adds the Adv Logger PRM Module. It is an alternate
way to fetch the Adv Logger Log that does not require SMM/Secure World
access. It also is independently serviceable from the OS.

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [x] 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, ...
- [x] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [x] 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, ...

Tested on various physical and virtual platforms to ensure the
log was the same between the GetVariable interface and the PRM
interface.

See the README update for integration instructions.
@os-d os-d force-pushed the osde/rebase_advloggerprm branch from 2c836d4 to 29200dc Compare May 2, 2024 23:05
@os-d os-d merged commit 8d7bae0 into microsoft:release/202311 May 2, 2024
29 checks passed
@os-d os-d deleted the osde/rebase_advloggerprm branch May 2, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:breaking-change Requires integration attention impact:security Has a security impact impact:testing Affects testing language:python Pull requests that update Python code type:documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants