From 055c829c4212f12614ad80dcd161a2b4f5cf6713 Mon Sep 17 00:00:00 2001 From: czhang46 Date: Tue, 28 Aug 2012 03:16:10 +0000 Subject: TcgPei need to measure anything to PCR in S3 bootpath, so skip shadow logic. Signed-off-by: Chao Zhang Reviewed-by : Fu, Siyuan git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13685 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/TcgPei/TcgPei.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'SecurityPkg/Tcg') diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.c b/SecurityPkg/Tcg/TcgPei/TcgPei.c index 08d8293ccb..37302fd0ec 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.c +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.c @@ -583,20 +583,25 @@ PeimEntryMA ( return EFI_UNSUPPORTED; } - Status = (**PeiServices).RegisterForShadow(FileHandle); - if (Status == EFI_ALREADY_STARTED) { - mImageInMemory = TRUE; - } else if (Status == EFI_NOT_FOUND) { - ASSERT_EFI_ERROR (Status); + // + // Initialize TPM device + // + Status = PeiServicesGetBootMode (&BootMode); + ASSERT_EFI_ERROR (Status); + + // + // In S3 path, skip shadow logic. no measurement is required + // + if (BootMode != BOOT_ON_S3_RESUME) { + Status = (**PeiServices).RegisterForShadow(FileHandle); + if (Status == EFI_ALREADY_STARTED) { + mImageInMemory = TRUE; + } else if (Status == EFI_NOT_FOUND) { + ASSERT_EFI_ERROR (Status); + } } if (!mImageInMemory) { - // - // Initialize TPM device - // - Status = PeiServicesGetBootMode (&BootMode); - ASSERT_EFI_ERROR (Status); - TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS; Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle); if (EFI_ERROR (Status)) { -- cgit v1.2.3