From e905fbb05adfc050e2953309e64f44e8562c0ddd Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Tue, 16 Nov 2021 19:21:36 -0800 Subject: SecurityPkg: Change use of EFI_D_* to DEBUG_* REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael Kubacki Signed-off-by: Michael D Kinney Reviewed-by: Jian J Wang --- SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c | 20 +-- .../TcgMorLockSmm.c | 3 +- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c | 4 +- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 2 +- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | 6 +- SecurityPkg/Tcg/Tcg2Config/TpmDetection.c | 6 +- SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 188 ++++++++++----------- SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 22 +-- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 9 +- SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDriver.c | 4 +- SecurityPkg/Tcg/TcgDxe/TcgDxe.c | 28 +-- SecurityPkg/Tcg/TcgPei/TcgPei.c | 8 +- SecurityPkg/Tcg/TcgSmm/TcgSmm.c | 19 +-- 13 files changed, 157 insertions(+), 162 deletions(-) (limited to 'SecurityPkg/Tcg') diff --git a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c index 32b64a31d1..e5dd06ebcf 100644 --- a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c +++ b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c @@ -40,7 +40,7 @@ OnReadyToBoot ( // // Clear MOR_CLEAR_MEMORY_BIT // - DEBUG ((EFI_D_INFO, "TcgMor: Clear MorClearMemory bit\n")); + DEBUG ((DEBUG_INFO, "TcgMor: Clear MorClearMemory bit\n")); mMorControl &= 0xFE; DataSize = sizeof (mMorControl); @@ -168,7 +168,7 @@ InitiateTPerReset ( // Found a TCG device. // TcgFlag = TRUE; - DEBUG ((EFI_D_INFO, "This device is a TCG protocol device\n")); + DEBUG ((DEBUG_INFO, "This device is a TCG protocol device\n")); break; } @@ -177,13 +177,13 @@ InitiateTPerReset ( // Found a IEEE 1667 device. // IeeeFlag = TRUE; - DEBUG ((EFI_D_INFO, "This device is a IEEE 1667 protocol device\n")); + DEBUG ((DEBUG_INFO, "This device is a IEEE 1667 protocol device\n")); break; } } if (!TcgFlag && !IeeeFlag) { - DEBUG ((EFI_D_INFO, "Neither a TCG nor IEEE 1667 protocol device is found\n")); + DEBUG ((DEBUG_INFO, "Neither a TCG nor IEEE 1667 protocol device is found\n")); goto Exit; } @@ -203,9 +203,9 @@ InitiateTPerReset ( ); if (!EFI_ERROR (Status)) { - DEBUG ((EFI_D_INFO, "Send TPer Reset Command Successfully !\n")); + DEBUG ((DEBUG_INFO, "Send TPer Reset Command Successfully !\n")); } else { - DEBUG ((EFI_D_INFO, "Send TPer Reset Command Fail !\n")); + DEBUG ((DEBUG_INFO, "Send TPer Reset Command Fail !\n")); } } @@ -213,7 +213,7 @@ InitiateTPerReset ( // // TBD : Perform a TPer Reset via IEEE 1667 Protocol // - DEBUG ((EFI_D_INFO, "IEEE 1667 Protocol didn't support yet!\n")); + DEBUG ((DEBUG_INFO, "IEEE 1667 Protocol didn't support yet!\n")); } Exit: @@ -336,7 +336,7 @@ MorDriverEntryPoint ( DataSize, &mMorControl ); - DEBUG ((EFI_D_INFO, "TcgMor: Create MOR variable! Status = %r\n", Status)); + DEBUG ((DEBUG_INFO, "TcgMor: Create MOR variable! Status = %r\n", Status)); } else { // // Create a Ready To Boot Event and Clear the MorControl bit in the call back function. @@ -355,7 +355,7 @@ MorDriverEntryPoint ( // // Register EFI_END_OF_DXE_EVENT_GROUP_GUID event. // - DEBUG ((EFI_D_INFO, "TcgMor: Create EndofDxe Event for Mor TPer Reset!\n")); + DEBUG ((DEBUG_INFO, "TcgMor: Create EndofDxe Event for Mor TPer Reset!\n")); Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, @@ -371,5 +371,3 @@ MorDriverEntryPoint ( return Status; } - - diff --git a/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLockSmm.c b/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLockSmm.c index 8c92317313..8e775cb96c 100644 --- a/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLockSmm.c +++ b/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLockSmm.c @@ -123,7 +123,7 @@ MorLockDriverEntryPointSmm ( // // This driver link to Smm Variable driver // - DEBUG ((EFI_D_INFO, "MorLockDriverEntryPointSmm\n")); + DEBUG ((DEBUG_INFO, "MorLockDriverEntryPointSmm\n")); Status = gSmst->SmmLocateProtocol ( &gEfiSmmVariableProtocolGuid, @@ -149,4 +149,3 @@ MorLockDriverEntryPointSmm ( return Status; } - diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c index 10d1c5cc78..fca5ae2645 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c @@ -355,7 +355,7 @@ Tcg2ConfigDriverEntryPoint ( &Tcg2DeviceDetection ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_DEVICE_DETECTION_NAME\n")); + DEBUG ((DEBUG_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_DEVICE_DETECTION_NAME\n")); Status = gRT->SetVariable ( TCG2_DEVICE_DETECTION_NAME, &gTcg2ConfigFormSetGuid, @@ -377,7 +377,7 @@ Tcg2ConfigDriverEntryPoint ( &Tcg2Configuration ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n")); + DEBUG ((DEBUG_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n")); } // diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c index 2946f95db0..a7446ef2f6 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c @@ -960,7 +960,7 @@ InstallTcg2ConfigForm ( &Tcg2ConfigInfo ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_INFO_NAME\n")); + DEBUG ((DEBUG_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_INFO_NAME\n")); } return EFI_SUCCESS; diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c index 0f9bad724e..8abc33efd4 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c @@ -104,11 +104,11 @@ Tcg2ConfigPeimEntryPoint ( // // Although we have SetupVariable info, we still need detect TPM device manually. // - DEBUG ((EFI_D_INFO, "Tcg2Configuration.TpmDevice from Setup: %x\n", Tcg2Configuration.TpmDevice)); + DEBUG ((DEBUG_INFO, "Tcg2Configuration.TpmDevice from Setup: %x\n", Tcg2Configuration.TpmDevice)); if (PcdGetBool (PcdTpmAutoDetection)) { TpmDevice = DetectTpmDevice (Tcg2Configuration.TpmDevice); - DEBUG ((EFI_D_INFO, "TpmDevice final: %x\n", TpmDevice)); + DEBUG ((DEBUG_INFO, "TpmDevice final: %x\n", TpmDevice)); if (TpmDevice != TPM_DEVICE_NULL) { Tcg2Configuration.TpmDevice = TpmDevice; } @@ -129,7 +129,7 @@ Tcg2ConfigPeimEntryPoint ( Size = sizeof(mTpmInstanceId[Index].TpmInstanceGuid); Status = PcdSetPtrS (PcdTpmInstanceGuid, &Size, &mTpmInstanceId[Index].TpmInstanceGuid); ASSERT_EFI_ERROR (Status); - DEBUG ((EFI_D_INFO, "TpmDevice PCD: %g\n", &mTpmInstanceId[Index].TpmInstanceGuid)); + DEBUG ((DEBUG_INFO, "TpmDevice PCD: %g\n", &mTpmInstanceId[Index].TpmInstanceGuid)); break; } } diff --git a/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c b/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c index eeaadc5e2f..57d3638f0c 100644 --- a/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c +++ b/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c @@ -47,7 +47,7 @@ DetectTpmDevice ( // In S3, we rely on normal boot Detection, because we save to ReadOnly Variable in normal boot. // if (BootMode == BOOT_ON_S3_RESUME) { - DEBUG ((EFI_D_INFO, "DetectTpmDevice: S3 mode\n")); + DEBUG ((DEBUG_INFO, "DetectTpmDevice: S3 mode\n")); Status = PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, NULL, (VOID **) &VariablePpi); ASSERT_EFI_ERROR (Status); @@ -65,12 +65,12 @@ DetectTpmDevice ( if (!EFI_ERROR (Status) && (Tcg2DeviceDetection.TpmDeviceDetected >= TPM_DEVICE_MIN) && (Tcg2DeviceDetection.TpmDeviceDetected <= TPM_DEVICE_MAX)) { - DEBUG ((EFI_D_ERROR, "TpmDevice from DeviceDetection: %x\n", Tcg2DeviceDetection.TpmDeviceDetected)); + DEBUG ((DEBUG_ERROR, "TpmDevice from DeviceDetection: %x\n", Tcg2DeviceDetection.TpmDeviceDetected)); return Tcg2DeviceDetection.TpmDeviceDetected; } } - DEBUG ((EFI_D_INFO, "DetectTpmDevice:\n")); + DEBUG ((DEBUG_INFO, "DetectTpmDevice:\n")); // dTPM available and not disabled by setup // We need check if it is TPM1.2 or TPM2.0 diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c index 6d17616c1c..02320bec98 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c @@ -158,7 +158,7 @@ InternalDumpData ( { UINTN Index; for (Index = 0; Index < Size; Index++) { - DEBUG ((EFI_D_INFO, "%02x", (UINTN)Data[Index])); + DEBUG ((DEBUG_INFO, "%02x", (UINTN)Data[Index])); } } @@ -261,15 +261,15 @@ InternalDumpHex ( Count = Size / COLUME_SIZE; Left = Size % COLUME_SIZE; for (Index = 0; Index < Count; Index++) { - DEBUG ((EFI_D_INFO, "%04x: ", Index * COLUME_SIZE)); + DEBUG ((DEBUG_INFO, "%04x: ", Index * COLUME_SIZE)); InternalDumpData (Data + Index * COLUME_SIZE, COLUME_SIZE); - DEBUG ((EFI_D_INFO, "\n")); + DEBUG ((DEBUG_INFO, "\n")); } if (Left != 0) { - DEBUG ((EFI_D_INFO, "%04x: ", Index * COLUME_SIZE)); + DEBUG ((DEBUG_INFO, "%04x: ", Index * COLUME_SIZE)); InternalDumpData (Data + Index * COLUME_SIZE, Left); - DEBUG ((EFI_D_INFO, "\n")); + DEBUG ((DEBUG_INFO, "\n")); } } @@ -402,7 +402,7 @@ Tcg2GetCapability ( ProtocolCapability->StructureVersion.Minor = 0; ProtocolCapability->ProtocolVersion.Major = 1; ProtocolCapability->ProtocolVersion.Minor = 0; - DEBUG ((EFI_D_ERROR, "TreeGetCapability (Compatible) - %r\n", EFI_SUCCESS)); + DEBUG ((DEBUG_ERROR, "TreeGetCapability (Compatible) - %r\n", EFI_SUCCESS)); return EFI_SUCCESS; } } @@ -427,15 +427,15 @@ DumpEvent ( { UINTN Index; - DEBUG ((EFI_D_INFO, " Event:\n")); - DEBUG ((EFI_D_INFO, " PCRIndex - %d\n", EventHdr->PCRIndex)); - DEBUG ((EFI_D_INFO, " EventType - 0x%08x\n", EventHdr->EventType)); - DEBUG ((EFI_D_INFO, " Digest - ")); + DEBUG ((DEBUG_INFO, " Event:\n")); + DEBUG ((DEBUG_INFO, " PCRIndex - %d\n", EventHdr->PCRIndex)); + DEBUG ((DEBUG_INFO, " EventType - 0x%08x\n", EventHdr->EventType)); + DEBUG ((DEBUG_INFO, " Digest - ")); for (Index = 0; Index < sizeof(TCG_DIGEST); Index++) { - DEBUG ((EFI_D_INFO, "%02x ", EventHdr->Digest.digest[Index])); + DEBUG ((DEBUG_INFO, "%02x ", EventHdr->Digest.digest[Index])); } - DEBUG ((EFI_D_INFO, "\n")); - DEBUG ((EFI_D_INFO, " EventSize - 0x%08x\n", EventHdr->EventSize)); + DEBUG ((DEBUG_INFO, "\n")); + DEBUG ((DEBUG_INFO, " EventSize - 0x%08x\n", EventHdr->EventSize)); InternalDumpHex ((UINT8 *)(EventHdr + 1), EventHdr->EventSize); } @@ -455,33 +455,33 @@ DumpTcgEfiSpecIdEventStruct ( UINT8 *VendorInfo; UINT32 NumberOfAlgorithms; - DEBUG ((EFI_D_INFO, " TCG_EfiSpecIDEventStruct:\n")); - DEBUG ((EFI_D_INFO, " signature - '")); + DEBUG ((DEBUG_INFO, " TCG_EfiSpecIDEventStruct:\n")); + DEBUG ((DEBUG_INFO, " signature - '")); for (Index = 0; Index < sizeof(TcgEfiSpecIdEventStruct->signature); Index++) { - DEBUG ((EFI_D_INFO, "%c", TcgEfiSpecIdEventStruct->signature[Index])); + DEBUG ((DEBUG_INFO, "%c", TcgEfiSpecIdEventStruct->signature[Index])); } - DEBUG ((EFI_D_INFO, "'\n")); - DEBUG ((EFI_D_INFO, " platformClass - 0x%08x\n", TcgEfiSpecIdEventStruct->platformClass)); - DEBUG ((EFI_D_INFO, " specVersion - %d.%d%d\n", TcgEfiSpecIdEventStruct->specVersionMajor, TcgEfiSpecIdEventStruct->specVersionMinor, TcgEfiSpecIdEventStruct->specErrata)); - DEBUG ((EFI_D_INFO, " uintnSize - 0x%02x\n", TcgEfiSpecIdEventStruct->uintnSize)); + DEBUG ((DEBUG_INFO, "'\n")); + DEBUG ((DEBUG_INFO, " platformClass - 0x%08x\n", TcgEfiSpecIdEventStruct->platformClass)); + DEBUG ((DEBUG_INFO, " specVersion - %d.%d%d\n", TcgEfiSpecIdEventStruct->specVersionMajor, TcgEfiSpecIdEventStruct->specVersionMinor, TcgEfiSpecIdEventStruct->specErrata)); + DEBUG ((DEBUG_INFO, " uintnSize - 0x%02x\n", TcgEfiSpecIdEventStruct->uintnSize)); CopyMem (&NumberOfAlgorithms, TcgEfiSpecIdEventStruct + 1, sizeof(NumberOfAlgorithms)); - DEBUG ((EFI_D_INFO, " NumberOfAlgorithms - 0x%08x\n", NumberOfAlgorithms)); + DEBUG ((DEBUG_INFO, " NumberOfAlgorithms - 0x%08x\n", NumberOfAlgorithms)); DigestSize = (TCG_EfiSpecIdEventAlgorithmSize *)((UINT8 *)TcgEfiSpecIdEventStruct + sizeof(*TcgEfiSpecIdEventStruct) + sizeof(NumberOfAlgorithms)); for (Index = 0; Index < NumberOfAlgorithms; Index++) { - DEBUG ((EFI_D_INFO, " digest(%d)\n", Index)); - DEBUG ((EFI_D_INFO, " algorithmId - 0x%04x\n", DigestSize[Index].algorithmId)); - DEBUG ((EFI_D_INFO, " digestSize - 0x%04x\n", DigestSize[Index].digestSize)); + DEBUG ((DEBUG_INFO, " digest(%d)\n", Index)); + DEBUG ((DEBUG_INFO, " algorithmId - 0x%04x\n", DigestSize[Index].algorithmId)); + DEBUG ((DEBUG_INFO, " digestSize - 0x%04x\n", DigestSize[Index].digestSize)); } VendorInfoSize = (UINT8 *)&DigestSize[NumberOfAlgorithms]; - DEBUG ((EFI_D_INFO, " VendorInfoSize - 0x%02x\n", *VendorInfoSize)); + DEBUG ((DEBUG_INFO, " VendorInfoSize - 0x%02x\n", *VendorInfoSize)); VendorInfo = VendorInfoSize + 1; - DEBUG ((EFI_D_INFO, " VendorInfo - ")); + DEBUG ((DEBUG_INFO, " VendorInfo - ")); for (Index = 0; Index < *VendorInfoSize; Index++) { - DEBUG ((EFI_D_INFO, "%02x ", VendorInfo[Index])); + DEBUG ((DEBUG_INFO, "%02x ", VendorInfo[Index])); } - DEBUG ((EFI_D_INFO, "\n")); + DEBUG ((DEBUG_INFO, "\n")); } /** @@ -524,34 +524,34 @@ DumpEvent2 ( UINT32 EventSize; UINT8 *EventBuffer; - DEBUG ((EFI_D_INFO, " Event:\n")); - DEBUG ((EFI_D_INFO, " PCRIndex - %d\n", TcgPcrEvent2->PCRIndex)); - DEBUG ((EFI_D_INFO, " EventType - 0x%08x\n", TcgPcrEvent2->EventType)); + DEBUG ((DEBUG_INFO, " Event:\n")); + DEBUG ((DEBUG_INFO, " PCRIndex - %d\n", TcgPcrEvent2->PCRIndex)); + DEBUG ((DEBUG_INFO, " EventType - 0x%08x\n", TcgPcrEvent2->EventType)); - DEBUG ((EFI_D_INFO, " DigestCount: 0x%08x\n", TcgPcrEvent2->Digest.count)); + DEBUG ((DEBUG_INFO, " DigestCount: 0x%08x\n", TcgPcrEvent2->Digest.count)); DigestCount = TcgPcrEvent2->Digest.count; HashAlgo = TcgPcrEvent2->Digest.digests[0].hashAlg; DigestBuffer = (UINT8 *)&TcgPcrEvent2->Digest.digests[0].digest; for (DigestIndex = 0; DigestIndex < DigestCount; DigestIndex++) { - DEBUG ((EFI_D_INFO, " HashAlgo : 0x%04x\n", HashAlgo)); - DEBUG ((EFI_D_INFO, " Digest(%d): ", DigestIndex)); + DEBUG ((DEBUG_INFO, " HashAlgo : 0x%04x\n", HashAlgo)); + DEBUG ((DEBUG_INFO, " Digest(%d): ", DigestIndex)); DigestSize = GetHashSizeFromAlgo (HashAlgo); for (Index = 0; Index < DigestSize; Index++) { - DEBUG ((EFI_D_INFO, "%02x ", DigestBuffer[Index])); + DEBUG ((DEBUG_INFO, "%02x ", DigestBuffer[Index])); } - DEBUG ((EFI_D_INFO, "\n")); + DEBUG ((DEBUG_INFO, "\n")); // // Prepare next // CopyMem (&HashAlgo, DigestBuffer + DigestSize, sizeof(TPMI_ALG_HASH)); DigestBuffer = DigestBuffer + DigestSize + sizeof(TPMI_ALG_HASH); } - DEBUG ((EFI_D_INFO, "\n")); + DEBUG ((DEBUG_INFO, "\n")); DigestBuffer = DigestBuffer - sizeof(TPMI_ALG_HASH); CopyMem (&EventSize, DigestBuffer, sizeof(TcgPcrEvent2->EventSize)); - DEBUG ((EFI_D_INFO, " EventSize - 0x%08x\n", EventSize)); + DEBUG ((DEBUG_INFO, " EventSize - 0x%08x\n", EventSize)); EventBuffer = DigestBuffer + sizeof(TcgPcrEvent2->EventSize); InternalDumpHex (EventBuffer, EventSize); } @@ -617,7 +617,7 @@ DumpEventLog ( TCG_EfiSpecIDEventStruct *TcgEfiSpecIdEventStruct; UINTN NumberOfEvents; - DEBUG ((EFI_D_INFO, "EventLogFormat: (0x%x)\n", EventLogFormat)); + DEBUG ((DEBUG_INFO, "EventLogFormat: (0x%x)\n", EventLogFormat)); switch (EventLogFormat) { case EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2: @@ -627,11 +627,11 @@ DumpEventLog ( EventHdr = (TCG_PCR_EVENT_HDR *)((UINTN)EventHdr + sizeof(TCG_PCR_EVENT_HDR) + EventHdr->EventSize); } if (FinalEventsTable == NULL) { - DEBUG ((EFI_D_INFO, "FinalEventsTable: NOT FOUND\n")); + DEBUG ((DEBUG_INFO, "FinalEventsTable: NOT FOUND\n")); } else { - DEBUG ((EFI_D_INFO, "FinalEventsTable: (0x%x)\n", FinalEventsTable)); - DEBUG ((EFI_D_INFO, " Version: (0x%x)\n", FinalEventsTable->Version)); - DEBUG ((EFI_D_INFO, " NumberOfEvents: (0x%x)\n", FinalEventsTable->NumberOfEvents)); + DEBUG ((DEBUG_INFO, "FinalEventsTable: (0x%x)\n", FinalEventsTable)); + DEBUG ((DEBUG_INFO, " Version: (0x%x)\n", FinalEventsTable->Version)); + DEBUG ((DEBUG_INFO, " NumberOfEvents: (0x%x)\n", FinalEventsTable->NumberOfEvents)); EventHdr = (TCG_PCR_EVENT_HDR *)(UINTN)(FinalEventsTable + 1); for (NumberOfEvents = 0; NumberOfEvents < FinalEventsTable->NumberOfEvents; NumberOfEvents++) { @@ -657,11 +657,11 @@ DumpEventLog ( } if (FinalEventsTable == NULL) { - DEBUG ((EFI_D_INFO, "FinalEventsTable: NOT FOUND\n")); + DEBUG ((DEBUG_INFO, "FinalEventsTable: NOT FOUND\n")); } else { - DEBUG ((EFI_D_INFO, "FinalEventsTable: (0x%x)\n", FinalEventsTable)); - DEBUG ((EFI_D_INFO, " Version: (0x%x)\n", FinalEventsTable->Version)); - DEBUG ((EFI_D_INFO, " NumberOfEvents: (0x%x)\n", FinalEventsTable->NumberOfEvents)); + DEBUG ((DEBUG_INFO, "FinalEventsTable: (0x%x)\n", FinalEventsTable)); + DEBUG ((DEBUG_INFO, " Version: (0x%x)\n", FinalEventsTable->Version)); + DEBUG ((DEBUG_INFO, " NumberOfEvents: (0x%x)\n", FinalEventsTable->NumberOfEvents)); TcgPcrEvent2 = (TCG_PCR_EVENT2 *)(UINTN)(FinalEventsTable + 1); for (NumberOfEvents = 0; NumberOfEvents < FinalEventsTable->NumberOfEvents; NumberOfEvents++) { @@ -704,7 +704,7 @@ Tcg2GetEventLog ( { UINTN Index; - DEBUG ((EFI_D_INFO, "Tcg2GetEventLog ... (0x%x)\n", EventLogFormat)); + DEBUG ((DEBUG_INFO, "Tcg2GetEventLog ... (0x%x)\n", EventLogFormat)); if (This == NULL) { return EFI_INVALID_PARAMETER; @@ -739,7 +739,7 @@ Tcg2GetEventLog ( if (EventLogLocation != NULL) { *EventLogLocation = mTcgDxeData.EventLogAreaStruct[Index].Lasa; - DEBUG ((EFI_D_INFO, "Tcg2GetEventLog (EventLogLocation - %x)\n", *EventLogLocation)); + DEBUG ((DEBUG_INFO, "Tcg2GetEventLog (EventLogLocation - %x)\n", *EventLogLocation)); } if (EventLogLastEntry != NULL) { @@ -748,15 +748,15 @@ Tcg2GetEventLog ( } else { *EventLogLastEntry = (EFI_PHYSICAL_ADDRESS)(UINTN)mTcgDxeData.EventLogAreaStruct[Index].LastEvent; } - DEBUG ((EFI_D_INFO, "Tcg2GetEventLog (EventLogLastEntry - %x)\n", *EventLogLastEntry)); + DEBUG ((DEBUG_INFO, "Tcg2GetEventLog (EventLogLastEntry - %x)\n", *EventLogLastEntry)); } if (EventLogTruncated != NULL) { *EventLogTruncated = mTcgDxeData.EventLogAreaStruct[Index].EventLogTruncated; - DEBUG ((EFI_D_INFO, "Tcg2GetEventLog (EventLogTruncated - %x)\n", *EventLogTruncated)); + DEBUG ((DEBUG_INFO, "Tcg2GetEventLog (EventLogTruncated - %x)\n", *EventLogTruncated)); } - DEBUG ((EFI_D_INFO, "Tcg2GetEventLog - %r\n", EFI_SUCCESS)); + DEBUG ((DEBUG_INFO, "Tcg2GetEventLog - %r\n", EFI_SUCCESS)); // Dump Event Log for debug purpose if ((EventLogLocation != NULL) && (EventLogLastEntry != NULL)) { @@ -979,8 +979,8 @@ TcgDxeLogEvent ( // Increase the NumberOfEvents in FinalEventsTable // (mTcgDxeData.FinalEventsTable[Index])->NumberOfEvents ++; - DEBUG ((EFI_D_INFO, "FinalEventsTable->NumberOfEvents - 0x%x\n", (mTcgDxeData.FinalEventsTable[Index])->NumberOfEvents)); - DEBUG ((EFI_D_INFO, " Size - 0x%x\n", (UINTN)EventLogAreaStruct->EventLogSize)); + DEBUG ((DEBUG_INFO, "FinalEventsTable->NumberOfEvents - 0x%x\n", (mTcgDxeData.FinalEventsTable[Index])->NumberOfEvents)); + DEBUG ((DEBUG_INFO, " Size - 0x%x\n", (UINTN)EventLogAreaStruct->EventLogSize)); } } @@ -1100,12 +1100,12 @@ TcgDxeLogHashEvent ( UINT8 *DigestBuffer; UINT32 *EventSizePtr; - DEBUG ((EFI_D_INFO, "SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs)); + DEBUG ((DEBUG_INFO, "SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs)); RetStatus = EFI_SUCCESS; for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) { if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) { - DEBUG ((EFI_D_INFO, " LogFormat - 0x%08x\n", mTcg2EventInfo[Index].LogFormat)); + DEBUG ((DEBUG_INFO, " LogFormat - 0x%08x\n", mTcg2EventInfo[Index].LogFormat)); switch (mTcg2EventInfo[Index].LogFormat) { case EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2: Status = GetDigestFromDigestList (TPM_ALG_SHA1, DigestList, &NewEventHdr->Digest); @@ -1223,7 +1223,7 @@ TcgDxeHashLogExtendEvent ( } if (Status == EFI_DEVICE_ERROR) { - DEBUG ((EFI_D_ERROR, "TcgDxeHashLogExtendEvent - %r. Disable TPM.\n", Status)); + DEBUG ((DEBUG_ERROR, "TcgDxeHashLogExtendEvent - %r. Disable TPM.\n", Status)); mTcgDxeData.BsCap.TPMPresentFlag = FALSE; REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -1307,7 +1307,7 @@ Tcg2HashLogExtendEvent ( } } if (Status == EFI_DEVICE_ERROR) { - DEBUG ((EFI_D_ERROR, "MeasurePeImageAndExtend - %r. Disable TPM.\n", Status)); + DEBUG ((DEBUG_ERROR, "MeasurePeImageAndExtend - %r. Disable TPM.\n", Status)); mTcgDxeData.BsCap.TPMPresentFlag = FALSE; REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -1353,7 +1353,7 @@ Tcg2SubmitCommand ( { EFI_STATUS Status; - DEBUG ((EFI_D_INFO, "Tcg2SubmitCommand ...\n")); + DEBUG ((DEBUG_INFO, "Tcg2SubmitCommand ...\n")); if ((This == NULL) || (InputParameterBlockSize == 0) || (InputParameterBlock == NULL) || @@ -1378,7 +1378,7 @@ Tcg2SubmitCommand ( &OutputParameterBlockSize, OutputParameterBlock ); - DEBUG ((EFI_D_INFO, "Tcg2SubmitCommand - %r\n", Status)); + DEBUG ((DEBUG_INFO, "Tcg2SubmitCommand - %r\n", Status)); return Status; } @@ -1424,7 +1424,7 @@ Tcg2SetActivePCRBanks ( EFI_STATUS Status; UINT32 ReturnCode; - DEBUG ((EFI_D_INFO, "Tcg2SetActivePCRBanks ... (0x%x)\n", ActivePcrBanks)); + DEBUG ((DEBUG_INFO, "Tcg2SetActivePCRBanks ... (0x%x)\n", ActivePcrBanks)); if (ActivePcrBanks == 0) { return EFI_INVALID_PARAMETER; @@ -1451,7 +1451,7 @@ Tcg2SetActivePCRBanks ( Status = EFI_DEVICE_ERROR; } - DEBUG ((EFI_D_INFO, "Tcg2SetActivePCRBanks - %r\n", Status)); + DEBUG ((DEBUG_INFO, "Tcg2SetActivePCRBanks - %r\n", Status)); return Status; } @@ -1532,7 +1532,7 @@ SetupEventLog ( UINT32 NumberOfAlgorithms; TCG_EfiStartupLocalityEvent StartupLocalityEvent; - DEBUG ((EFI_D_INFO, "SetupEventLog\n")); + DEBUG ((DEBUG_INFO, "SetupEventLog\n")); // // 1. Create Log Area @@ -1939,7 +1939,7 @@ MeasureSeparatorEvent ( TCG_PCR_EVENT_HDR TcgEvent; UINT32 EventData; - DEBUG ((EFI_D_INFO, "MeasureSeparatorEvent Pcr - %x\n", PCRIndex)); + DEBUG ((DEBUG_INFO, "MeasureSeparatorEvent Pcr - %x\n", PCRIndex)); EventData = 0; TcgEvent.PCRIndex = PCRIndex; @@ -1984,8 +1984,8 @@ MeasureVariable ( UINTN VarNameLength; UEFI_VARIABLE_DATA *VarLog; - DEBUG ((EFI_D_INFO, "Tcg2Dxe: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)PCRIndex, (UINTN)EventType)); - DEBUG ((EFI_D_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid)); + DEBUG ((DEBUG_INFO, "Tcg2Dxe: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)PCRIndex, (UINTN)EventType)); + DEBUG ((DEBUG_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid)); VarNameLength = StrLen (VarName); TcgEvent.PCRIndex = PCRIndex; @@ -2335,11 +2335,11 @@ MeasureSecureBootPolicy ( if (PcdGetBool (PcdFirmwareDebuggerInitialized)) { Status = MeasureLaunchOfFirmwareDebugger (); - DEBUG ((EFI_D_INFO, "MeasureLaunchOfFirmwareDebugger - %r\n", Status)); + DEBUG ((DEBUG_INFO, "MeasureLaunchOfFirmwareDebugger - %r\n", Status)); } Status = MeasureAllSecureVariables (); - DEBUG ((EFI_D_INFO, "MeasureAllSecureVariables - %r\n", Status)); + DEBUG ((DEBUG_INFO, "MeasureAllSecureVariables - %r\n", Status)); // // We need measure Separator(7) here, because this event must be between SecureBootPolicy (Configure) @@ -2348,7 +2348,7 @@ MeasureSecureBootPolicy ( // the Authority measurement happen before ReadToBoot event. // Status = MeasureSeparatorEvent (7); - DEBUG ((EFI_D_INFO, "MeasureSeparatorEvent - %r\n", Status)); + DEBUG ((DEBUG_INFO, "MeasureSeparatorEvent - %r\n", Status)); return ; } @@ -2379,7 +2379,7 @@ OnReadyToBoot ( // Status = MeasureHandoffTables (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "HOBs not Measured. Error!\n")); + DEBUG ((DEBUG_ERROR, "HOBs not Measured. Error!\n")); } // @@ -2387,7 +2387,7 @@ OnReadyToBoot ( // Status = MeasureAllBootVariables (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Boot Variables not Measured. Error!\n")); + DEBUG ((DEBUG_ERROR, "Boot Variables not Measured. Error!\n")); } // @@ -2398,7 +2398,7 @@ OnReadyToBoot ( EFI_CALLING_EFI_APPLICATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION)); } // @@ -2432,7 +2432,7 @@ OnReadyToBoot ( EFI_RETURNING_FROM_EFI_APPLICATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATION)); } // @@ -2444,11 +2444,11 @@ OnReadyToBoot ( EFI_CALLING_EFI_APPLICATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION)); } } - DEBUG ((EFI_D_INFO, "TPM2 Tcg2Dxe Measure Data when ReadyToBoot\n")); + DEBUG ((DEBUG_INFO, "TPM2 Tcg2Dxe Measure Data when ReadyToBoot\n")); // // Increase boot attempt counter. // @@ -2482,7 +2482,7 @@ OnExitBootServices ( EFI_EXIT_BOOT_SERVICES_INVOCATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_INVOCATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_INVOCATION)); } // @@ -2493,7 +2493,7 @@ OnExitBootServices ( EFI_EXIT_BOOT_SERVICES_SUCCEEDED ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_SUCCEEDED)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_SUCCEEDED)); } } @@ -2523,7 +2523,7 @@ OnExitBootServicesFailed ( EFI_EXIT_BOOT_SERVICES_FAILED ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_FAILED)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_FAILED)); } } @@ -2646,13 +2646,13 @@ DriverEntry ( } if (GetFirstGuidHob (&gTpmErrorHobGuid) != NULL) { - DEBUG ((EFI_D_ERROR, "TPM2 error!\n")); + DEBUG ((DEBUG_ERROR, "TPM2 error!\n")); return EFI_DEVICE_ERROR; } Status = Tpm2RequestUseTpm (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TPM2 not detected!\n")); + DEBUG ((DEBUG_ERROR, "TPM2 not detected!\n")); return Status; } @@ -2667,14 +2667,14 @@ DriverEntry ( mTcgDxeData.BsCap.StructureVersion.Major = 1; mTcgDxeData.BsCap.StructureVersion.Minor = 1; - DEBUG ((EFI_D_INFO, "Tcg2.ProtocolVersion - %02x.%02x\n", mTcgDxeData.BsCap.ProtocolVersion.Major, mTcgDxeData.BsCap.ProtocolVersion.Minor)); - DEBUG ((EFI_D_INFO, "Tcg2.StructureVersion - %02x.%02x\n", mTcgDxeData.BsCap.StructureVersion.Major, mTcgDxeData.BsCap.StructureVersion.Minor)); + DEBUG ((DEBUG_INFO, "Tcg2.ProtocolVersion - %02x.%02x\n", mTcgDxeData.BsCap.ProtocolVersion.Major, mTcgDxeData.BsCap.ProtocolVersion.Minor)); + DEBUG ((DEBUG_INFO, "Tcg2.StructureVersion - %02x.%02x\n", mTcgDxeData.BsCap.StructureVersion.Major, mTcgDxeData.BsCap.StructureVersion.Minor)); Status = Tpm2GetCapabilityManufactureID (&mTcgDxeData.BsCap.ManufacturerID); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tpm2GetCapabilityManufactureID fail!\n")); + DEBUG ((DEBUG_ERROR, "Tpm2GetCapabilityManufactureID fail!\n")); } else { - DEBUG ((EFI_D_INFO, "Tpm2GetCapabilityManufactureID - %08x\n", mTcgDxeData.BsCap.ManufacturerID)); + DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityManufactureID - %08x\n", mTcgDxeData.BsCap.ManufacturerID)); } DEBUG_CODE ( @@ -2683,19 +2683,19 @@ DriverEntry ( Status = Tpm2GetCapabilityFirmwareVersion (&FirmwareVersion1, &FirmwareVersion2); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tpm2GetCapabilityFirmwareVersion fail!\n")); + DEBUG ((DEBUG_ERROR, "Tpm2GetCapabilityFirmwareVersion fail!\n")); } else { - DEBUG ((EFI_D_INFO, "Tpm2GetCapabilityFirmwareVersion - %08x %08x\n", FirmwareVersion1, FirmwareVersion2)); + DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityFirmwareVersion - %08x %08x\n", FirmwareVersion1, FirmwareVersion2)); } ); Status = Tpm2GetCapabilityMaxCommandResponseSize (&MaxCommandSize, &MaxResponseSize); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tpm2GetCapabilityMaxCommandResponseSize fail!\n")); + DEBUG ((DEBUG_ERROR, "Tpm2GetCapabilityMaxCommandResponseSize fail!\n")); } else { mTcgDxeData.BsCap.MaxCommandSize = (UINT16)MaxCommandSize; mTcgDxeData.BsCap.MaxResponseSize = (UINT16)MaxResponseSize; - DEBUG ((EFI_D_INFO, "Tpm2GetCapabilityMaxCommandResponseSize - %08x, %08x\n", MaxCommandSize, MaxResponseSize)); + DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityMaxCommandResponseSize - %08x, %08x\n", MaxCommandSize, MaxResponseSize)); } // @@ -2722,7 +2722,7 @@ DriverEntry ( } else { mTcgDxeData.BsCap.NumberOfPCRBanks = PcdGet32 (PcdTcg2NumberOfPCRBanks); if (PcdGet32 (PcdTcg2NumberOfPCRBanks) > NumberOfPCRBanks) { - DEBUG ((EFI_D_ERROR, "ERROR: PcdTcg2NumberOfPCRBanks(0x%x) > NumberOfPCRBanks(0x%x)\n", PcdGet32 (PcdTcg2NumberOfPCRBanks), NumberOfPCRBanks)); + DEBUG ((DEBUG_ERROR, "ERROR: PcdTcg2NumberOfPCRBanks(0x%x) > NumberOfPCRBanks(0x%x)\n", PcdGet32 (PcdTcg2NumberOfPCRBanks), NumberOfPCRBanks)); mTcgDxeData.BsCap.NumberOfPCRBanks = NumberOfPCRBanks; } } @@ -2735,10 +2735,10 @@ DriverEntry ( mTcgDxeData.BsCap.SupportedEventLogs &= ~EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2; } - DEBUG ((EFI_D_INFO, "Tcg2.SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs)); - DEBUG ((EFI_D_INFO, "Tcg2.HashAlgorithmBitmap - 0x%08x\n", mTcgDxeData.BsCap.HashAlgorithmBitmap)); - DEBUG ((EFI_D_INFO, "Tcg2.NumberOfPCRBanks - 0x%08x\n", mTcgDxeData.BsCap.NumberOfPCRBanks)); - DEBUG ((EFI_D_INFO, "Tcg2.ActivePcrBanks - 0x%08x\n", mTcgDxeData.BsCap.ActivePcrBanks)); + DEBUG ((DEBUG_INFO, "Tcg2.SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs)); + DEBUG ((DEBUG_INFO, "Tcg2.HashAlgorithmBitmap - 0x%08x\n", mTcgDxeData.BsCap.HashAlgorithmBitmap)); + DEBUG ((DEBUG_INFO, "Tcg2.NumberOfPCRBanks - 0x%08x\n", mTcgDxeData.BsCap.NumberOfPCRBanks)); + DEBUG ((DEBUG_INFO, "Tcg2.ActivePcrBanks - 0x%08x\n", mTcgDxeData.BsCap.ActivePcrBanks)); if (mTcgDxeData.BsCap.TPMPresentFlag) { // @@ -2795,7 +2795,7 @@ DriverEntry ( // Install Tcg2Protocol // Status = InstallTcg2 (); - DEBUG ((EFI_D_INFO, "InstallTcg2 - %r\n", Status)); + DEBUG ((DEBUG_INFO, "InstallTcg2 - %r\n", Status)); return Status; } diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c index 93a8803ff6..7eb02f08f9 100644 --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c @@ -267,7 +267,7 @@ SyncPcrAllocationsAndPcrMask ( UINT32 Tpm2PcrMask; UINT32 NewTpm2PcrMask; - DEBUG ((EFI_D_ERROR, "SyncPcrAllocationsAndPcrMask!\n")); + DEBUG ((DEBUG_ERROR, "SyncPcrAllocationsAndPcrMask!\n")); // // Determine the current TPM support and the Platform PCR mask. @@ -297,9 +297,9 @@ SyncPcrAllocationsAndPcrMask ( if ((TpmActivePcrBanks & Tpm2PcrMask) != TpmActivePcrBanks) { NewTpmActivePcrBanks = TpmActivePcrBanks & Tpm2PcrMask; - DEBUG ((EFI_D_INFO, "%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __FUNCTION__, TpmActivePcrBanks, NewTpmActivePcrBanks)); + DEBUG ((DEBUG_INFO, "%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __FUNCTION__, TpmActivePcrBanks, NewTpmActivePcrBanks)); if (NewTpmActivePcrBanks == 0) { - DEBUG ((EFI_D_ERROR, "%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__)); ASSERT (FALSE); } else { Status = Tpm2PcrAllocateBanks (NULL, (UINT32)TpmHashAlgorithmBitmap, NewTpmActivePcrBanks); @@ -307,7 +307,7 @@ SyncPcrAllocationsAndPcrMask ( // // We can't do much here, but we hope that this doesn't happen. // - DEBUG ((EFI_D_ERROR, "%a - Failed to reallocate PCRs!\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __FUNCTION__)); ASSERT_EFI_ERROR (Status); } // @@ -324,9 +324,9 @@ SyncPcrAllocationsAndPcrMask ( if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) != Tpm2PcrMask) { NewTpm2PcrMask = Tpm2PcrMask & TpmHashAlgorithmBitmap; - DEBUG ((EFI_D_INFO, "%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __FUNCTION__, Tpm2PcrMask, NewTpm2PcrMask)); + DEBUG ((DEBUG_INFO, "%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __FUNCTION__, Tpm2PcrMask, NewTpm2PcrMask)); if (NewTpm2PcrMask == 0) { - DEBUG ((EFI_D_ERROR, "%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__)); ASSERT (FALSE); } @@ -365,7 +365,7 @@ LogHashEvent ( RetStatus = EFI_SUCCESS; for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) { if ((SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) { - DEBUG ((EFI_D_INFO, " LogFormat - 0x%08x\n", mTcg2EventInfo[Index].LogFormat)); + DEBUG ((DEBUG_INFO, " LogFormat - 0x%08x\n", mTcg2EventInfo[Index].LogFormat)); switch (mTcg2EventInfo[Index].LogFormat) { case EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2: Status = GetDigestFromDigestList (TPM_ALG_SHA1, DigestList, &NewEventHdr->Digest); @@ -476,7 +476,7 @@ HashLogExtendEvent ( } if (Status == EFI_DEVICE_ERROR) { - DEBUG ((EFI_D_ERROR, "HashLogExtendEvent - %r. Disable TPM.\n", Status)); + DEBUG ((DEBUG_ERROR, "HashLogExtendEvent - %r. Disable TPM.\n", Status)); BuildGuidHob (&gTpmErrorHobGuid,0); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -1011,7 +1011,7 @@ PeimEntryMA ( } if (GetFirstGuidHob (&gTpmErrorHobGuid) != NULL) { - DEBUG ((EFI_D_ERROR, "TPM2 error!\n")); + DEBUG ((DEBUG_ERROR, "TPM2 error!\n")); return EFI_DEVICE_ERROR; } @@ -1075,7 +1075,7 @@ PeimEntryMA ( for (PcrIndex = 0; PcrIndex < 8; PcrIndex++) { Status = MeasureSeparatorEventWithError (PcrIndex); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Separator Event with Error not Measured. Error!\n")); + DEBUG ((DEBUG_ERROR, "Separator Event with Error not Measured. Error!\n")); } } } @@ -1106,7 +1106,7 @@ PeimEntryMA ( Done: if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TPM2 error! Build Hob\n")); + DEBUG ((DEBUG_ERROR, "TPM2 error! Build Hob\n")); BuildGuidHob (&gTpmErrorHobGuid,0); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c index f49eccb0bd..9f5111552b 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -203,7 +203,7 @@ MemoryClearCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } @@ -213,7 +213,7 @@ MemoryClearCallback ( MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK; } else { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter)); + DEBUG ((DEBUG_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter)); return EFI_SUCCESS; } @@ -227,7 +227,7 @@ MemoryClearCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status)); } return EFI_SUCCESS; @@ -285,7 +285,7 @@ InitializeTcgCommon ( EFI_HANDLE NotifyHandle; if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm20DtpmGuid)){ - DEBUG ((EFI_D_ERROR, "No TPM2 DTPM instance required!\n")); + DEBUG ((DEBUG_ERROR, "No TPM2 DTPM instance required!\n")); return EFI_UNSUPPORTED; } @@ -372,4 +372,3 @@ Cleanup: return Status; } - diff --git a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDriver.c b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDriver.c index 8210548077..4bc6086454 100644 --- a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDriver.c +++ b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDriver.c @@ -33,13 +33,13 @@ TcgConfigDriverEntryPoint ( EFI_TCG_PROTOCOL *TcgProtocol; if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){ - DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n")); + DEBUG ((DEBUG_ERROR, "No TPM12 instance required!\n")); return EFI_UNSUPPORTED; } Status = Tpm12RequestUseTpm (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TPM not detected!\n")); + DEBUG ((DEBUG_ERROR, "TPM not detected!\n")); return Status; } diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c index 3990d1e937..7019c666b1 100644 --- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c +++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c @@ -588,7 +588,7 @@ TcgDxeHashLogExtendEventI ( Done: if ((Status == EFI_DEVICE_ERROR) || (Status == EFI_TIMEOUT)) { - DEBUG ((EFI_D_ERROR, "TcgDxeHashLogExtendEventI - %r. Disable TPM.\n", Status)); + DEBUG ((DEBUG_ERROR, "TcgDxeHashLogExtendEventI - %r. Disable TPM.\n", Status)); TcgData->BsCap.TPMPresentFlag = FALSE; REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -1127,7 +1127,7 @@ OnReadyToBoot ( // Status = MeasureHandoffTables (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "HOBs not Measured. Error!\n")); + DEBUG ((DEBUG_ERROR, "HOBs not Measured. Error!\n")); } // @@ -1135,7 +1135,7 @@ OnReadyToBoot ( // Status = MeasureAllBootVariables (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Boot Variables not Measured. Error!\n")); + DEBUG ((DEBUG_ERROR, "Boot Variables not Measured. Error!\n")); } // @@ -1145,7 +1145,7 @@ OnReadyToBoot ( EFI_CALLING_EFI_APPLICATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION)); } // @@ -1177,11 +1177,11 @@ OnReadyToBoot ( EFI_RETURNING_FROM_EFI_APPLICATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATION)); } } - DEBUG ((EFI_D_INFO, "TPM TcgDxe Measure Data when ReadyToBoot\n")); + DEBUG ((DEBUG_INFO, "TPM TcgDxe Measure Data when ReadyToBoot\n")); // // Increase boot attempt counter. // @@ -1260,7 +1260,7 @@ InstallAcpiTable ( } if (EFI_ERROR (Status)) { - DEBUG((EFI_D_ERROR, "Tcg Acpi Table installation failure")); + DEBUG((DEBUG_ERROR, "Tcg Acpi Table installation failure")); } } @@ -1289,7 +1289,7 @@ OnExitBootServices ( EFI_EXIT_BOOT_SERVICES_INVOCATION ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_INVOCATION)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_INVOCATION)); } // @@ -1299,7 +1299,7 @@ OnExitBootServices ( EFI_EXIT_BOOT_SERVICES_SUCCEEDED ); if (EFI_ERROR (Status)){ - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_SUCCEEDED)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_SUCCEEDED)); } } @@ -1328,7 +1328,7 @@ OnExitBootServicesFailed ( EFI_EXIT_BOOT_SERVICES_FAILED ); if (EFI_ERROR (Status)){ - DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_FAILED)); + DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_FAILED)); } } @@ -1381,25 +1381,25 @@ DriverEntry ( VOID *Registration; if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){ - DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n")); + DEBUG ((DEBUG_ERROR, "No TPM12 instance required!\n")); return EFI_UNSUPPORTED; } if (GetFirstGuidHob (&gTpmErrorHobGuid) != NULL) { - DEBUG ((EFI_D_ERROR, "TPM error!\n")); + DEBUG ((DEBUG_ERROR, "TPM error!\n")); return EFI_DEVICE_ERROR; } Status = Tpm12RequestUseTpm (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TPM not detected!\n")); + DEBUG ((DEBUG_ERROR, "TPM not detected!\n")); return Status; } Status = GetTpmStatus (&mTcgDxeData.BsCap.TPMDeactivatedFlag); if (EFI_ERROR (Status)) { DEBUG (( - EFI_D_ERROR, + DEBUG_ERROR, "DriverEntry: TPM not working properly\n" )); return Status; diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.c b/SecurityPkg/Tcg/TcgPei/TcgPei.c index db33daed37..536bd5a408 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.c +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.c @@ -351,7 +351,7 @@ HashLogExtendEvent ( Done: if ((Status == EFI_DEVICE_ERROR) || (Status == EFI_TIMEOUT)) { - DEBUG ((EFI_D_ERROR, "HashLogExtendEvent - %r. Disable TPM.\n", Status)); + DEBUG ((DEBUG_ERROR, "HashLogExtendEvent - %r. Disable TPM.\n", Status)); BuildGuidHob (&gTpmErrorHobGuid,0); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, @@ -844,12 +844,12 @@ PeimEntryMA ( EFI_BOOT_MODE BootMode; if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){ - DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n")); + DEBUG ((DEBUG_ERROR, "No TPM12 instance required!\n")); return EFI_UNSUPPORTED; } if (GetFirstGuidHob (&gTpmErrorHobGuid) != NULL) { - DEBUG ((EFI_D_ERROR, "TPM error!\n")); + DEBUG ((DEBUG_ERROR, "TPM error!\n")); return EFI_DEVICE_ERROR; } @@ -913,7 +913,7 @@ PeimEntryMA ( Done: if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TPM error! Build Hob\n")); + DEBUG ((DEBUG_ERROR, "TPM error! Build Hob\n")); BuildGuidHob (&gTpmErrorHobGuid,0); REPORT_STATUS_CODE ( EFI_ERROR_CODE | EFI_ERROR_MINOR, diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c index a60efc7d69..25f443c04f 100644 --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c @@ -62,13 +62,13 @@ PhysicalPresenceCallback ( &PpData ); - DEBUG ((EFI_D_INFO, "[TPM] PP callback, Parameter = %x\n", mTcgNvs->PhysicalPresence.Parameter)); + DEBUG ((DEBUG_INFO, "[TPM] PP callback, Parameter = %x\n", mTcgNvs->PhysicalPresence.Parameter)); if (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS) { if (EFI_ERROR (Status)) { mTcgNvs->PhysicalPresence.ReturnCode = PP_RETURN_TPM_OPERATION_RESPONSE_FAILURE; mTcgNvs->PhysicalPresence.LastRequest = 0; mTcgNvs->PhysicalPresence.Response = 0; - DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } mTcgNvs->PhysicalPresence.ReturnCode = PP_RETURN_TPM_OPERATION_RESPONSE_SUCCESS; @@ -78,7 +78,7 @@ PhysicalPresenceCallback ( || (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2)) { if (EFI_ERROR (Status)) { mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } if (mTcgNvs->PhysicalPresence.Request == PHYSICAL_PRESENCE_SET_OPERATOR_AUTH) { @@ -124,7 +124,7 @@ PhysicalPresenceCallback ( } else if (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST) { if (EFI_ERROR (Status)) { mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION; - DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } // @@ -140,7 +140,7 @@ PhysicalPresenceCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION; - DEBUG ((EFI_D_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status)); return EFI_SUCCESS; } @@ -257,7 +257,7 @@ MemoryClearCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } @@ -267,7 +267,7 @@ MemoryClearCallback ( MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK; } else { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter)); + DEBUG ((DEBUG_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter)); return EFI_SUCCESS; } @@ -281,7 +281,7 @@ MemoryClearCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; - DEBUG ((EFI_D_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status)); } return EFI_SUCCESS; @@ -424,7 +424,7 @@ InitializeTcgSmm ( EFI_HANDLE SwHandle; if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){ - DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n")); + DEBUG ((DEBUG_ERROR, "No TPM12 instance required!\n")); return EFI_UNSUPPORTED; } @@ -460,4 +460,3 @@ InitializeTcgSmm ( return EFI_SUCCESS; } - -- cgit v1.2.3