microsoft / mu_feature_mm_supv

Project Mu - Feature Repo - MM Supervisor
https://microsoft.github.io/mu
Other
48 stars 29 forks source link

SpamBinBuild: Patch aux file hash into Stm.bin #255

Closed Javagedes closed 7 months ago

Javagedes commented 8 months ago

Description

Adds the framework to consume and patch a pcd that represents the 32 byte hash of the auxiliary file. This includes a new patchable pcd, PcdAuxBinHash, and the post-build logic to patch the hash into the stm binary.

NOTE: The platform build will fail in the newly added step as the pcd gets optimized out of the binary due to not being used.

You can force it to be used by adding the following code to StmInit.c

L26:

volatile UINT8                  *mMyValue;

L805:

  mMyValue = PatchPcdGet8(PcdAuxBinHash);
  if (mMyValue != 0) {
    DEBUG((EFI_D_INFO, "PcdAuxBinHash - %x\n", (UINTN)mMyValue));
  }

How This Was Tested

N/A

Integration Instructions

N/A