summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@microsoft.com>2025-05-01 12:55:03 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-07-14 07:25:12 +0000
commit1f2adcbba571faead4795bfbeeb232e82166c901 (patch)
treee6d68d5ab266cc1337dacfd58a0b521a6c97a94b
parentdbf45a870b89fb9e307c41c66949288518c24440 (diff)
downloadedk2-1f2adcbba571faead4795bfbeeb232e82166c901.zip
edk2-1f2adcbba571faead4795bfbeeb232e82166c901.tar.gz
edk2-1f2adcbba571faead4795bfbeeb232e82166c901.tar.bz2
SecurityPkg: Remove/Downgrade Noisy TCG Prints
The TCG code is very noisy when a TPM is connected. This commit downgrades some prints to verbose and removes some others that do not have value (such as function enter and exit prints). Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
-rw-r--r--SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c18
-rw-r--r--SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c4
-rw-r--r--SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c2
-rw-r--r--SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c14
4 files changed, 1 insertions, 37 deletions
diff --git a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
index 73719f3..acba11d 100644
--- a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
+++ b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
@@ -323,8 +323,6 @@ Tcg2MeasureGptTable (
if (!EFI_ERROR (Status)) {
mTcg2MeasureGptCount++;
}
-
- DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Cc MeasureGptTable - %r\n", Status));
} else if (Tcg2Protocol != NULL) {
//
// If Tcg2Protocol is installed, then Measure GPT data with this protocol.
@@ -339,8 +337,6 @@ Tcg2MeasureGptTable (
if (!EFI_ERROR (Status)) {
mTcg2MeasureGptCount++;
}
-
- DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Tcg2 MeasureGptTable - %r\n", Status));
}
Exit:
@@ -492,7 +488,6 @@ Tcg2MeasurePeImage (
ImageSize,
CcEvent
);
- DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Cc MeasurePeImage - %r\n", Status));
} else if (Tcg2Protocol != NULL) {
Status = Tcg2Protocol->HashLogExtendEvent (
Tcg2Protocol,
@@ -501,7 +496,6 @@ Tcg2MeasurePeImage (
ImageSize,
Tcg2Event
);
- DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Tcg2 MeasurePeImage - %r\n", Status));
}
if (Status == EFI_VOLUME_FULL) {
@@ -659,15 +653,6 @@ DxeTpm2MeasureBootHandler (
return EFI_SUCCESS;
}
- DEBUG (
- (
- DEBUG_INFO,
- "Tcg2Protocol = %p, CcMeasurementProtocol = %p\n",
- MeasureBootProtocols.Tcg2Protocol,
- MeasureBootProtocols.CcProtocol
- )
- );
-
//
// Copy File Device Path
//
@@ -853,7 +838,6 @@ DxeTpm2MeasureBootHandler (
TRUE
);
if (ToText != NULL) {
- DEBUG ((DEBUG_INFO, "The measured image path is %s.\n", ToText));
FreePool (ToText);
}
@@ -880,8 +864,6 @@ Finish:
FreePool (OrigDevicePathNode);
}
- DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - %r\n", Status));
-
return Status;
}
diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c
index 3dd5f2e..b15f72c 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c
@@ -537,8 +537,7 @@ Tpm2GetCapabilitySupportedAndActivePcrs (
//
// Get supported PCR
//
- Status = Tpm2GetCapabilityPcrs (&Pcrs);
- DEBUG ((DEBUG_INFO, "Supported PCRs - Count = %08x\n", Pcrs.count));
+ Status = Tpm2GetCapabilityPcrs (&Pcrs);
ActivePcrBankCount = 0;
//
// If error, assume that we have at least SHA-1 (and return the error.)
@@ -616,7 +615,6 @@ Tpm2GetCapabilitySupportedAndActivePcrs (
}
}
- DEBUG ((DEBUG_INFO, "GetSupportedAndActivePcrs - Count = %08x\n", ActivePcrBankCount));
return Status;
}
diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c
index 94e93b2..0142cba 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c
@@ -773,8 +773,6 @@ Tpm2PcrReadForActiveBank (
ZeroMem (&PcrValues, sizeof (PcrValues));
ZeroMem (&Pcrs, sizeof (TPML_PCR_SELECTION));
- DEBUG ((DEBUG_INFO, "ReadPcr - %02d\n", PcrIndex));
-
//
// Read TPM capabilities
//
diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index 4d0c241..e063719 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -718,8 +718,6 @@ Tcg2GetEventLog (
{
UINTN Index;
- DEBUG ((DEBUG_INFO, "Tcg2GetEventLog ... (0x%x)\n", EventLogFormat));
-
if (This == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -756,7 +754,6 @@ Tcg2GetEventLog (
if (EventLogLocation != NULL) {
*EventLogLocation = mTcgDxeData.EventLogAreaStruct[Index].Lasa;
- DEBUG ((DEBUG_INFO, "Tcg2GetEventLog (EventLogLocation - %x)\n", *EventLogLocation));
}
if (EventLogLastEntry != NULL) {
@@ -765,17 +762,12 @@ Tcg2GetEventLog (
} else {
*EventLogLastEntry = (EFI_PHYSICAL_ADDRESS)(UINTN)mTcgDxeData.EventLogAreaStruct[Index].LastEvent;
}
-
- DEBUG ((DEBUG_INFO, "Tcg2GetEventLog (EventLogLastEntry - %x)\n", *EventLogLastEntry));
}
if (EventLogTruncated != NULL) {
*EventLogTruncated = mTcgDxeData.EventLogAreaStruct[Index].EventLogTruncated;
- DEBUG ((DEBUG_INFO, "Tcg2GetEventLog (EventLogTruncated - %x)\n", *EventLogTruncated));
}
- DEBUG ((DEBUG_INFO, "Tcg2GetEventLog - %r\n", EFI_SUCCESS));
-
// Dump Event Log for debug purpose
if ((EventLogLocation != NULL) && (EventLogLastEntry != NULL)) {
DumpEventLog (EventLogFormat, *EventLogLocation, *EventLogLastEntry, mTcgDxeData.FinalEventsTable[Index]);
@@ -1132,12 +1124,9 @@ TcgDxeLogHashEvent (
UINT8 *DigestBuffer;
UINT32 *EventSizePtr;
- 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 ((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);
@@ -1406,8 +1395,6 @@ Tcg2SubmitCommand (
{
EFI_STATUS Status;
- DEBUG ((DEBUG_INFO, "Tcg2SubmitCommand ...\n"));
-
if ((This == NULL) ||
(InputParameterBlockSize == 0) || (InputParameterBlock == NULL) ||
(OutputParameterBlockSize == 0) || (OutputParameterBlock == NULL))
@@ -1433,7 +1420,6 @@ Tcg2SubmitCommand (
&OutputParameterBlockSize,
OutputParameterBlock
);
- DEBUG ((DEBUG_INFO, "Tcg2SubmitCommand - %r\n", Status));
return Status;
}