-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tianocore-assign-reviewers
bot
requested review from
jiaxinwu,
niruiyu and
samimujawar
September 20, 2024 09:00
td36
force-pushed
the
dev/duntan/memlib
branch
3 times, most recently
from
September 23, 2024 07:09
08671b5
to
8c77569
Compare
td36
changed the title
Dev/duntan/memlib
Check if the non-MMRAM buffer is valid in API MmIsBufferOutsideMmValid of StandaloneMmMemLib.
Sep 23, 2024
td36
force-pushed
the
dev/duntan/memlib
branch
2 times, most recently
from
September 27, 2024 06:48
80622ed
to
872d5d0
Compare
jiaxinwu
reviewed
Oct 15, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
Show resolved
Hide resolved
td36
force-pushed
the
dev/duntan/memlib
branch
from
October 15, 2024 08:22
872d5d0
to
a04adc3
Compare
td36
commented
Oct 15, 2024
td36
commented
Oct 15, 2024
niruiyu
reviewed
Oct 18, 2024
niruiyu
reviewed
Oct 18, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.h
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 18, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.h
Outdated
Show resolved
Hide resolved
td36
force-pushed
the
dev/duntan/memlib
branch
from
October 21, 2024 09:48
a04adc3
to
53fd5f3
Compare
xuweiintel
reviewed
Oct 23, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
Outdated
Show resolved
Hide resolved
td36
force-pushed
the
dev/duntan/memlib
branch
4 times, most recently
from
October 24, 2024 01:55
b709130
to
ad1eaf7
Compare
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLibInternal.h
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLibInternal.h
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLibInternal.h
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLibInternal.h
Outdated
Show resolved
Hide resolved
niruiyu
reviewed
Oct 30, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
Outdated
Show resolved
Hide resolved
td36
force-pushed
the
dev/duntan/memlib
branch
from
October 31, 2024 01:56
ad1eaf7
to
71b8ee4
Compare
jiaxinwu
reviewed
Oct 31, 2024
StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
Show resolved
Hide resolved
others good to me. |
td36
force-pushed
the
dev/duntan/memlib
branch
3 times, most recently
from
November 4, 2024 09:39
d57afa5
to
e6f1a2f
Compare
td36
force-pushed
the
dev/duntan/memlib
branch
2 times, most recently
from
November 5, 2024 07:39
4313335
to
04a454f
Compare
Remove unneeded check MmIsBufferOutsideMmValid() when StandaloneMmCore checks if the BS data memory described by a memory allocation HOB needs to be migrated to Mmram. Currently, the API MmIsBufferOutsideMmValid() return TRUE when input memory range belongs to non-Mmram memory. Now the API will be changed in following 5 commits to return TRUE when a memory range belongs to non-Mmram memroy and the memory is inside a range described by resource HOB. This may cause PF when some SMI handler access the memory from a memory allocation HOB that is not migrated. To solve this issue, we can directly remove the check MmIsBufferOutsideMmValid() and always migrate the BS data memory described by a memory allocation HOB to Mmram. Signed-off-by: Dun Tan <[email protected]>
Add a internal header file for StandaloneMmMemLib. Move some common reference and declaration into StandaloneMmMemLibInternal.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]>
Separate a function called InitializeMmHobList() to gather all the operations related to initializing HOB. It doesn't change any code logic. Signed-off-by: Dun Tan <[email protected]>
Check if the all the resource HOB in the input HOB list of MmCore entry only covers non-Mmram ranges. The Resource HOB is to describe the accessible non-Mmram range. All Resource HOB should not overlap with any Mmram range. 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]>
td36
force-pushed
the
dev/duntan/memlib
branch
from
November 5, 2024 07:45
04a454f
to
e4a4e3c
Compare
niruiyu
approved these changes
Nov 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR include code to
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