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

[Cherry-Pick] Tcg2Smm: Added support for Standalone Mm [RB&FF] #351

Merged

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Oct 31, 2024

Description

Cherry-Picking tianocore/edk2#5728 from edk2.

This change added Standalone MM instance of Tcg2. The notify function for
Standalone MM instance is left empty.

A dependency DXE driver with a Depex of gEfiMmCommunication2ProtocolGuid
was created to indicate the readiness of Standalone MM Tcg2 driver.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Platform using standalone mm required these changes for Tcg2 MM support to corectly work.

Integration Instructions

There should be no changes for existing platforms using smm.

This new Guid HOB contains a TPM instance Guid which
is the same as PcdTpmInstanceGuid. The HOB is used for
StandaloneMm driver which needs to consume the dynamic
PcdTpmInstanceGuid.

Signed-off-by: Dun Tan <dun.tan@intel.com>
…rsion

Add a new gEdkiiTcgPhysicalPresenceInterfaceVerHobGuid.
This new Guid HOB contains a a string of the Version of
Physical Presence interface which is the same as
PcdTcgPhysicalPresenceInterfaceVer. The HOB is used for
StandaloneMm driver which needs to consume the dynamic
PcdTcgPhysicalPresenceInterfaceVer.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Build following two new HOBs:
  gEdkiiTcgPhysicalPresenceInterfaceVerHobGuid
  gEdkiiTpmInstanceHobGuid
The two HOBs will be used by Tcg2StandaloneMm driver
to avoid using the related dynamic PCDs.

Signed-off-by: Dun Tan <dun.tan@intel.com>
…obGuid

Consume gEdkiiTpmInstanceHobGuid in Tcg2StandaloneMm
driver. It's to avoid using dynamic PcdTpmInstanceGuid
in StandaloneMm driver.

Signed-off-by: Dun Tan <dun.tan@intel.com>
…erHobGuid

Consume gEdkiiTcgPhysicalPresenceInterfaceVerHobGuid in
StandaloneMmTcg2PhysicalPresenceLib. This is to avoid
using the dynamic PcdTcgPhysicalPresenceInterfaceVer in
StandaloneMm module.

Signed-off-by: Dun Tan <dun.tan@intel.com>
…Guid

Add a new GUID HOB gEdkiiTcg2AcpiCommunicateBufferHobGuid.
This Tcg2 Acpi Communicate Buffer HOB is used to store the
address of a buffer reserved for Tcg2Acpi driver. The buffer
will be used to retrive information from Standalone mm
environment.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Install a callback of gEfiPeiMemoryDiscoveredPpiGuid to
build the gEdkiiTcg2AcpiCommunicateBufferHobGuid in the
Tcg2ConfigPei PEIM.
The HOB contains a buffer reserved by MmUnblockMemoryLib.
The buffer will be used in Tcg2Acpi driver to retrive
information from standalone mm environment.

Signed-off-by: Dun Tan <dun.tan@intel.com>
…Guid

Consume gEdkiiTcg2AcpiCommunicateBufferHobGuid in Tcg2Acpi
driver. Tcg2Acpi will use the buffer stored in the HOB to
exchange information with Tcg2StandaloneMm by the
MM_COMMUNICATION_PROTOCOL.

Signed-off-by: Dun Tan <dun.tan@intel.com>
@apop5 apop5 force-pushed the personal/apop5/release/cherrypicktcg2mm branch from d190f9e to 10a54e2 Compare October 31, 2024 22:17
@apop5 apop5 enabled auto-merge (rebase) October 31, 2024 22:17
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2024

Codecov Report

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

Project coverage is 1.43%. Comparing base (5de67ba) to head (10a54e2).

Files with missing lines Patch % Lines
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c 0.00% 52 Missing ⚠️
SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c 0.00% 15 Missing ⚠️
...sicalPresenceLib/MmTcg2PhysicalPresenceLibCommon.c 0.00% 2 Missing ⚠️
SecurityPkg/Tcg/Tcg2Smm/Tcg2StandaloneMm.c 0.00% 2 Missing ⚠️
...lPresenceLib/StandaloneMmTcg2PhysicalPresenceLib.c 0.00% 1 Missing ⚠️
SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c 0.00% 1 Missing ⚠️
SecurityPkg/Tcg/Tcg2Smm/Tcg2TraditionalMm.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           release/202405    #351      +/-   ##
=================================================
- Coverage            1.44%   1.43%   -0.01%     
=================================================
  Files                 159     159              
  Lines               37091   37157      +66     
  Branches              273     273              
=================================================
  Hits                  535     535              
- Misses              36556   36622      +66     
Flag Coverage Δ
SecurityPkg 0.99% <0.00%> (-0.01%) ⬇️

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.

@apop5 apop5 merged commit 430fabd into microsoft:release/202405 Oct 31, 2024
18 checks passed
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.

6 participants