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

Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE attribute. #851

Merged

Conversation

Patrick-Payne
Copy link

@Patrick-Payne Patrick-Payne commented May 15, 2024

Description

Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE resource attribute as per the PI 1.8 spec. This flag is used to indicate that the memory should be treated as special purpose memory (SPM).

Also adds GCD code that marks the SPM with the EFI_MEMORY_SP bit in the memory map and sets the GCD memory type to EfiGcdMemoryTypeSystemMemory.

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • This change impacts how special purpose memory is represented in HOBs and in the memory map.
  • 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

stuart_ci_build passed clean.

Manual testing using UEFI firmware on a device showed the expected behavior when HOBs are marked with EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE.

Integration Instructions

N/A

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2024

Codecov Report

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

Project coverage is 1.22%. Comparing base (4ef1dc9) to head (73fd883).

Files Patch % Lines
MdeModulePkg/Core/Dxe/Gcd/Gcd.c 0.00% 15 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/202311     #851      +/-   ##
==================================================
- Coverage            1.22%    1.22%   -0.01%     
==================================================
  Files                1303     1303              
  Lines              335695   335701       +6     
  Branches             3189     3189              
==================================================
  Hits                 4118     4118              
- Misses             331501   331507       +6     
  Partials               76       76              
Flag Coverage Δ
MdeModulePkg 0.68% <0.00%> (-0.01%) ⬇️
MdePkg 5.37% <ø> (ø)
NetworkPkg 0.00% <ø> (ø)
PolicyServicePkg 30.41% <ø> (ø)

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.

@makubacki makubacki requested a review from os-d May 16, 2024 18:52
@makubacki makubacki added the type:enhancement New feature or pull request label May 16, 2024
@Patrick-Payne Patrick-Payne force-pushed the patpa/spm_resource_attribute branch 2 times, most recently from c2a1ce6 to 8565e3c Compare May 16, 2024 20:14
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.

Can you add [CHERRY-PICK] to the commit title that was cherry-picked from edk2? Additionally, can you wrap each of the changes in your commit with:

// MU_CHANGE BEGIN: Add EFI_MEMORY_SP
...
// MU_CHANGE END: Add EFI_MEMORY_SP

Or for single line changes:

...; // MU_CHANGE: Add EFI_MEMORY_SP

This helps us track what to upstream to edk2 and how to integrate it when we pull down new edk2 releases.

MdeModulePkg/Core/Dxe/Gcd/Gcd.c Show resolved Hide resolved
@Patrick-Payne Patrick-Payne force-pushed the patpa/spm_resource_attribute branch 5 times, most recently from 17caad8 to ac542a9 Compare May 17, 2024 23:22
sachinami and others added 2 commits May 17, 2024 16:24
Defined Encrypted and Special Purpose resource attributes as
defined in PI 1.8 Specification

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE resource attribute as per
the PI 1.8 spec. This flag is used to indicate that the memory should be
treated as special purpose memory (SPM).

Also adds GCD code that marks the SPM with the EFI_MEMORY_SP bit and
sets the GCD memory type to EfiGcdMemoryTypeSystemMemory.
@os-d os-d enabled auto-merge (rebase) May 17, 2024 23:25
@os-d os-d merged commit b324d96 into microsoft:release/202311 May 17, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants