Skip to content

Conversation

apop5
Copy link
Collaborator

@apop5 apop5 commented Mar 25, 2025

Description

MmSupervisorPkg's MmSupervisorCore.inf (MM_CORE_STANDALONE) uses Both SmmCpuPlatformHookLib and MmSaveStateLib.

Edk2 limited the scope of the libraries to not support MM_CORE_STANDALONE, and this works okay for the Edk2's StandaloneMmPkg, but it breaks the expectations of the MmSupervisorPkg's Core.

Add MM_CORE_STANDALONE as an allowed Module Type for these libraries.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?
  • Backport to release branch?

How This Was Tested

Building on silicon vendor codebase which consumed MmSupervisorCore.

Integration Instructions

No integration required.

@apop5 apop5 requested review from kuqin12 and makubacki March 25, 2025 19:57
@github-actions github-actions bot added the impact:non-functional Does not have a functional impact label Mar 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (dev/202502@c7881cf). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff              @@
##             dev/202502   #1312   +/-   ##
============================================
  Coverage              ?   4.86%           
============================================
  Files                 ?     140           
  Lines                 ?   26732           
  Branches              ?     527           
============================================
  Hits                  ?    1301           
  Misses                ?   25407           
  Partials              ?      24           
Flag Coverage Δ
UefiCpuPkg 4.86% <ø> (?)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Instead of going in as reverts of edk2 commits should this go in as MU_CHANGEs?

@makubacki
Copy link
Member

Instead of going in as reverts of edk2 commits should this go in as MU_CHANGEs?

Also, @apop5, are you going to make the upstream change to the allowed Standalone MM types? If so, I'd rather just make that be the MU_CHANGE since it is closer to what upstream will have.

@apop5
Copy link
Collaborator Author

apop5 commented Apr 1, 2025

Instead of going in as reverts of edk2 commits should this go in as MU_CHANGEs?

Also, @apop5, are you going to make the upstream change to the allowed Standalone MM types? If so, I'd rather just make that be the MU_CHANGE since it is closer to what upstream will have.

This revert is happening because SupvMM is attempting to consume these libraries.
StandaloneMmPkg does not attempt to consume them.
My hope is to rework the MM Supv to be more in sync with standalonemmcore, and that these changes can be dropped.

Alternatives are:
Make Stmm versions of these libraries (in the SupvMM package)

I don't think these changes should be upstreamed to edk2, because this is happening because SupvMM is attempting to consume them.

@apop5 apop5 force-pushed the personal/apop5/reusesmmlibsstmm branch from 1b6dd7c to 3e41da1 Compare April 1, 2025 23:37
@apop5 apop5 changed the title [Merge & FF] Revert limiting of SmmCpuPlatformHookLib and MmSaveStateLib UefiCpuPkg: Enable MM_CORE_STANDALONE for IntelMmSaveStateLib, SmmCpuPlatformHookLibNull Apr 1, 2025
@makubacki
Copy link
Member

I don't think these changes should be upstreamed to edk2, because this is happening because SupvMM is attempting to consume them.

I think that's why it should be supported. These are in UefiCpuPkg which should support all MM implementations. I don't see a reason the upstream needs to restrict the linking module types to exclude Standalone MM for these library instances.

@apop5
Copy link
Collaborator Author

apop5 commented Apr 2, 2025

I don't think these changes should be upstreamed to edk2, because this is happening because SupvMM is attempting to consume them.

I think that's why it should be supported. These are in UefiCpuPkg which should support all MM implementations. I don't see a reason the upstream needs to restrict the linking module types to exclude Standalone MM for these library instances.

I'll get a PR up for edk2

@apop5
Copy link
Collaborator Author

apop5 commented Apr 3, 2025

PR to edk2 is up

tianocore/edk2#10914

…PlatformHookLibNull.

IntelMmSaveStateLib and SmmCpuPlatformHookLibNull were limited to
DXE_SMM_DRIVER MM_STANDALONE, where as previously not supported module
types were listed.

Add MM_CORE_STANDALONE as a supported module type for these libraries.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
@apop5 apop5 force-pushed the personal/apop5/reusesmmlibsstmm branch from 3e41da1 to ef2cf1b Compare April 11, 2025 17:52
@apop5 apop5 changed the title UefiCpuPkg: Enable MM_CORE_STANDALONE for IntelMmSaveStateLib, SmmCpuPlatformHookLibNull [Cherry-Pick] UefiCpuPkg: Enable MM_CORE_STANDALONE for IntelMmSaveStateLib, SmmCpuPlatformHookLibNull Apr 11, 2025
@github-actions github-actions bot added the type:backport Backport changes in a dev branch PR to its release branch. label Apr 11, 2025
@apop5 apop5 merged commit 285b8fd into microsoft:dev/202502 Apr 11, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact type:backport Backport changes in a dev branch PR to its release branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants