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

Check if the non-MMRAM buffer is valid in API MmIsBufferOutsideMmValid of StandaloneMmMemLib. #6225

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

td36
Copy link
Contributor

@td36 td36 commented Sep 20, 2024

Description

This PR include code to

  1. Check if the non-MMRAM buffer is inside valid non-mmram range in API MmIsBufferOutsideMmValid of StandaloneMmMemLib.
  2. Remove unnecessary check in API MmIsBufferOutsideMmValid of StandaloneMmMemLib.

Previously, the API MmIsBufferOutsideMmValid only checks if the input buffer is overlapped with MMRAM range. Currently, in the new standalone MM infrastructure, we limit the non-MMRAM access to the ranges reported by the resource HOB. To meet the new design, in this API, we cache all the memory ranges reported by the resource HOB and check if the input buffer is inside valid non-MMRAM ranges reported by the resource HOB.

How This Was Tested

Tested in Intel internal server platform with the X86 standalone MM env and successfully booted into shell

@td36 td36 marked this pull request as draft September 20, 2024 09:00
@td36 td36 force-pushed the dev/duntan/memlib branch 3 times, most recently from 08671b5 to 8c77569 Compare September 23, 2024 07:09
@td36 td36 changed the title Dev/duntan/memlib Check if the non-MMRAM buffer is valid in API MmIsBufferOutsideMmValid of StandaloneMmMemLib. Sep 23, 2024
@td36 td36 marked this pull request as ready for review September 25, 2024 08:15
Add a internal header file for StandaloneMmMemLib. Move some
common reference and declaration into the StandaloneMmMemLib.h.

Signed-off-by: Dun Tan <[email protected]>
Check if the non-MMRAM buffer is inside valid non-mmram
range in API MmIsBufferOutsideMmValid of StandaloneMmMemLib.

Previously, the API only checks if the input buffer is
overlapped with MMRAM range. Currently, in the new standalone
MM infrastructure, we limit the non-MMRAM access to the ranges
reported by the resource HOB. To meet the new design, in this
API, we cache all the memory ranges reported by the resource
HOB and check if the input buffer is inside valid non-MMRAM
ranges reported by the resource HOB.

Signed-off-by: Dun Tan <[email protected]>
Check if the all the resource HOB in the input HobStart of
MmCore only covers non-Mmram ranges.

Signed-off-by: Dun Tan <[email protected]>
Remove unnecessary check in API MmIsBufferOutsideMmValid of
StandaloneMmMemLib.

The API is used to check if a input buffer is outside MMRAM and
inside a valid non-MMRAM range. Previously, the API only checks
if the input buffer is
 overlapped with MMRAM range. In the last
commit, we add logic to check if the input buffer is inside valid
non-MMRAM 
ranges reported by the resource HOB. Since the resource
HOB only covers valid non-MMRAM ranges, we doesn't need to check
if the input buffer is inside the MMRAM anymore.

Signed-off-by: Dun Tan <[email protected]>
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.

1 participant