Update TcgPei and TrEEPei driver to make gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported to be used as patchable PCD instead of Fixed PCD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15848 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Dong, Guo 2014-08-20 09:37:26 +00:00 committed by gdong1
parent df0cee8d8c
commit b5412eac9e
4 changed files with 22 additions and 8 deletions

View File

@ -37,6 +37,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
#include <Library/PeiServicesTablePointerLib.h> #include <Library/PeiServicesTablePointerLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h>
#include "TpmComm.h" #include "TpmComm.h"
@ -48,10 +49,10 @@ EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList = {
NULL NULL
}; };
EFI_PLATFORM_FIRMWARE_BLOB mMeasuredBaseFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredBaseFvInfo;
UINT32 mMeasuredBaseFvIndex = 0; UINT32 mMeasuredBaseFvIndex = 0;
EFI_PLATFORM_FIRMWARE_BLOB mMeasuredChildFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredChildFvInfo;
UINT32 mMeasuredChildFvIndex = 0; UINT32 mMeasuredChildFvIndex = 0;
EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *mMeasurementExcludedFvPpi; EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *mMeasurementExcludedFvPpi;
@ -369,8 +370,8 @@ MeasureFvImage (
// //
// Add new FV into the measured FV list. // Add new FV into the measured FV list.
// //
ASSERT (mMeasuredBaseFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)); ASSERT (mMeasuredBaseFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported));
if (mMeasuredBaseFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) { if (mMeasuredBaseFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported)) {
mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobBase = FvBase; mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobBase = FvBase;
mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobLength = FvLength; mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobLength = FvLength;
mMeasuredBaseFvIndex++; mMeasuredBaseFvIndex++;
@ -484,8 +485,8 @@ FirmwareVolmeInfoPpiNotifyCallback (
// //
if (Fv->ParentFvName != NULL || Fv->ParentFileName != NULL ) { if (Fv->ParentFvName != NULL || Fv->ParentFileName != NULL ) {
ASSERT (mMeasuredChildFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)); ASSERT (mMeasuredChildFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported));
if (mMeasuredChildFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) { if (mMeasuredChildFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported)) {
// //
// Check whether FV is in the measured child FV list. // Check whether FV is in the measured child FV list.
// //
@ -667,6 +668,11 @@ PeimEntryMP (
); );
// Do not check status, because it is optional // Do not check status, because it is optional
mMeasuredBaseFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));
ASSERT (mMeasuredBaseFvInfo != NULL);
mMeasuredChildFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));
ASSERT (mMeasuredChildFvInfo != NULL);
TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS; TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS;
Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle); Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {

View File

@ -48,6 +48,7 @@
PeiServicesTablePointerLib PeiServicesTablePointerLib
BaseLib BaseLib
PcdLib PcdLib
MemoryAllocationLib
[Guids] [Guids]
gTcgEventEntryHobGuid gTcgEventEntryHobGuid

View File

@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PeiServicesTablePointerLib.h> #include <Library/PeiServicesTablePointerLib.h>
#include <Protocol/TrEEProtocol.h> #include <Protocol/TrEEProtocol.h>
#include <Library/PerformanceLib.h> #include <Library/PerformanceLib.h>
#include <Library/MemoryAllocationLib.h>
#define PERF_ID_TREE_PEI 0x3080 #define PERF_ID_TREE_PEI 0x3080
@ -63,10 +64,10 @@ EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList = {
NULL NULL
}; };
EFI_PLATFORM_FIRMWARE_BLOB mMeasuredBaseFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredBaseFvInfo;
UINT32 mMeasuredBaseFvIndex = 0; UINT32 mMeasuredBaseFvIndex = 0;
EFI_PLATFORM_FIRMWARE_BLOB mMeasuredChildFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredChildFvInfo;
UINT32 mMeasuredChildFvIndex = 0; UINT32 mMeasuredChildFvIndex = 0;
/** /**
@ -592,6 +593,11 @@ PeimEntryMP (
); );
// Do not check status, because it is optional // Do not check status, because it is optional
mMeasuredBaseFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));
ASSERT (mMeasuredBaseFvInfo != NULL);
mMeasuredChildFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));
ASSERT (mMeasuredChildFvInfo != NULL);
if (PcdGet8 (PcdTpm2ScrtmPolicy) == 1) { if (PcdGet8 (PcdTpm2ScrtmPolicy) == 1) {
Status = MeasureCRTMVersion (); Status = MeasureCRTMVersion ();
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -44,6 +44,7 @@
Tpm2DeviceLib Tpm2DeviceLib
HashLib HashLib
PerformanceLib PerformanceLib
MemoryAllocationLib
[Guids] [Guids]
gTcgEventEntryHobGuid gTcgEventEntryHobGuid