forked from microsoft/mu_basecore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring the MM implementation to support both Standalone MM and T…
…raditional MM (microsoft#461) Issue microsoft#867 cherry-pick from ad777e9 Please ensure you have read the [contribution docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior to submitting the pull request. In particular, [pull request guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices). Refactoring the MM implementation to support both Standalone MM and Traditional MM 1. Add DXE_SMM_DRIVER to LIBRARY_CLASS of MmPolicyLib.inf 2. Refactor the PolicyMm module to have a common entrypoint, and both Standalone MM and Traditional MM entrypoint call the common entrypoint. 3. Add Traditional MM description to Readme.md. This PR resolves microsoft#460. For each item, place an "x" in between `[` and `]` if true. Example: `[x]`. _(you can also check items in the GitHub UI)_ - [x] 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, ... - [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, ... Verified with the CI build N/A
- Loading branch information
1 parent
d2a1cc6
commit 130efe9
Showing
9 changed files
with
145 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** @file | ||
Implements the Standalone MM policy protocol, providing services to publish and | ||
access system policy. | ||
Copyright (c) Microsoft Corporation | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Uefi.h> | ||
#include <Library/MmServicesTableLib.h> | ||
|
||
/** | ||
Common Entry of the MM policy service module. | ||
@retval Status From internal routine or boot object, should not fail | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
PolicyMmCommonEntry ( | ||
VOID | ||
); | ||
|
||
/** | ||
Entry to the Standalone MM policy service module. | ||
@param[in] ImageHandle The image handle. | ||
@param[in] SystemTable The system table. | ||
@retval Status From internal routine or boot object, should not fail | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
PolicyStandaloneMmEntry ( | ||
IN EFI_HANDLE ImageHandle, | ||
IN EFI_MM_SYSTEM_TABLE *SystemTable | ||
) | ||
{ | ||
return PolicyMmCommonEntry (); | ||
} |
39 changes: 39 additions & 0 deletions
39
PolicyServicePkg/PolicyService/DxeMm/PolicyTraditionalMm.c
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** @file | ||
Implements the Traditional MM policy protocol, providing services to publish and | ||
access system policy. | ||
Copyright (c) Microsoft Corporation | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Uefi.h> | ||
|
||
/** | ||
Common Entry of the MM policy service module. | ||
@retval Status From internal routine or boot object, should not fail | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
PolicyMmCommonEntry ( | ||
VOID | ||
); | ||
|
||
/** | ||
Entry to the Traditional MM policy service module. | ||
@param[in] ImageHandle The image handle. | ||
@param[in] SystemTable The system table. | ||
@retval Status From internal routine or boot object, should not fail | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
PolicyTraditionalMmEntry ( | ||
IN EFI_HANDLE ImageHandle, | ||
IN EFI_SYSTEM_TABLE *SystemTable | ||
) | ||
{ | ||
return PolicyMmCommonEntry (); | ||
} |
47 changes: 47 additions & 0 deletions
47
PolicyServicePkg/PolicyService/DxeMm/PolicyTraditionalMm.inf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## @file | ||
# | ||
# This is a driver for Traditional MM policy service module. | ||
# | ||
# Copyright (C) Microsoft Corporation. All rights reserved. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
## | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010017 | ||
PI_SPECIFICATION_VERSION = 0x00010032 | ||
BASE_NAME = PolicyTraditionalMm | ||
FILE_GUID = 51084E31-393D-4D06-A867-BDE321D4E4F5 | ||
MODULE_TYPE = DXE_SMM_DRIVER | ||
VERSION_STRING = 1.0 | ||
ENTRY_POINT = PolicyTraditionalMmEntry | ||
|
||
[Sources] | ||
PolicyTraditionalMm.c | ||
PolicyMm.c | ||
PolicyCommon.c | ||
PolicyCommon.h | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
MdeModulePkg/MdeModulePkg.dec | ||
PolicyServicePkg/PolicyServicePkg.dec | ||
|
||
[LibraryClasses] | ||
BaseLib | ||
DebugLib | ||
HobLib | ||
UefiDriverEntryPoint | ||
MmServicesTableLib | ||
MemoryAllocationLib | ||
|
||
[Pcd] | ||
|
||
[Guids] | ||
gPolicyHobGuid | ||
|
||
[Protocols] | ||
gMmPolicyProtocolGuid ## PRODUCES | ||
|
||
[Depex] | ||
TRUE |
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
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
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