SecurityPkg: Update code to be more C11 compliant by using __func__

__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
SecurityPkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Rebecca Cran
2023-04-06 13:50:26 -06:00
committed by mergify[bot]
parent 7b82da70ed
commit dd0b33e3e5
17 changed files with 109 additions and 109 deletions

View File

@ -314,7 +314,7 @@ FreezeLockDevice (
FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK))); FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK)));
DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status; return Status;
} }
@ -449,7 +449,7 @@ HddPasswordEndOfDxeEventNotify (
EFI_STATUS Status; EFI_STATUS Status;
ATA_IDENTIFY_DATA IdentifyData; ATA_IDENTIFY_DATA IdentifyData;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
mHddPasswordEndOfDxe = TRUE; mHddPasswordEndOfDxe = TRUE;
@ -503,7 +503,7 @@ HddPasswordEndOfDxeEventNotify (
} }
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
gBS->CloseEvent (Event); gBS->CloseEvent (Event);
} }
@ -620,7 +620,7 @@ SaveHddPasswordVariable (
UINT8 HashData[SHA256_DIGEST_SIZE]; UINT8 HashData[SHA256_DIGEST_SIZE];
UINT8 SaltData[PASSWORD_SALT_SIZE]; UINT8 SaltData[PASSWORD_SALT_SIZE];
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Delete = FALSE; Delete = FALSE;
if (!PasswordIsFullZero (Password)) { if (!PasswordIsFullZero (Password)) {
@ -765,7 +765,7 @@ SaveHddPasswordVariable (
FreePool (Variable); FreePool (Variable);
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**
@ -791,7 +791,7 @@ GetSavedHddPasswordVariable (
UINTN VariableSize; UINTN VariableSize;
BOOLEAN Found; BOOLEAN Found;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Variable = NULL; Variable = NULL;
VariableSize = 0; VariableSize = 0;
@ -835,7 +835,7 @@ GetSavedHddPasswordVariable (
DEBUG ((DEBUG_INFO, "The variable node for the HDD password device is not found\n")); DEBUG ((DEBUG_INFO, "The variable node for the HDD password device is not found\n"));
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
return Found; return Found;
} }
@ -864,7 +864,7 @@ ValidateHddPassword (
BOOLEAN HashOk; BOOLEAN HashOk;
UINT8 HashData[SHA256_DIGEST_SIZE]; UINT8 HashData[SHA256_DIGEST_SIZE];
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
if (!GetSavedHddPasswordVariable (ConfigFormEntry, &HddPasswordVariable)) { if (!GetSavedHddPasswordVariable (ConfigFormEntry, &HddPasswordVariable)) {
DEBUG ((DEBUG_INFO, "GetSavedHddPasswordVariable failed\n")); DEBUG ((DEBUG_INFO, "GetSavedHddPasswordVariable failed\n"));
@ -884,7 +884,7 @@ ValidateHddPassword (
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
} }
DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __func__, Status));
return Status; return Status;
} }
@ -982,7 +982,7 @@ UnlockHddPassword (
ZeroMem (Buffer, sizeof (Buffer)); ZeroMem (Buffer, sizeof (Buffer));
DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status; return Status;
} }
@ -1080,7 +1080,7 @@ DisableHddPassword (
ZeroMem (Buffer, sizeof (Buffer)); ZeroMem (Buffer, sizeof (Buffer));
DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status; return Status;
} }
@ -1185,7 +1185,7 @@ SetHddPassword (
ZeroMem (Buffer, sizeof (Buffer)); ZeroMem (Buffer, sizeof (Buffer));
DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status; return Status;
} }
@ -1357,7 +1357,7 @@ HddPasswordRequestPassword (
RetryCount = 0; RetryCount = 0;
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
UnicodeSPrint (PopUpString, sizeof (PopUpString), L"Unlock: %s", ConfigFormEntry->HddString); UnicodeSPrint (PopUpString, sizeof (PopUpString), L"Unlock: %s", ConfigFormEntry->HddString);
@ -1541,7 +1541,7 @@ ProcessHddPasswordRequestSetUserPwd (
RetryCount = 0; RetryCount = 0;
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) { if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) {
DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString)); DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString));
@ -1685,7 +1685,7 @@ ProcessHddPasswordRequestSetMasterPwd (
RetryCount = 0; RetryCount = 0;
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) { if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) {
DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString)); DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString));
@ -1812,7 +1812,7 @@ ProcessHddPasswordRequest (
HDD_PASSWORD_REQUEST_VARIABLE *Variable; HDD_PASSWORD_REQUEST_VARIABLE *Variable;
UINTN VariableSize; UINTN VariableSize;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
if (mHddPasswordRequestVariable == NULL) { if (mHddPasswordRequestVariable == NULL) {
Status = GetVariable2 ( Status = GetVariable2 (
@ -1873,7 +1873,7 @@ ProcessHddPasswordRequest (
TempVariable += 1; TempVariable += 1;
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**
@ -1892,7 +1892,7 @@ GetSavedHddPasswordRequest (
HDD_PASSWORD_REQUEST_VARIABLE *Variable; HDD_PASSWORD_REQUEST_VARIABLE *Variable;
UINTN VariableSize; UINTN VariableSize;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Variable = NULL; Variable = NULL;
VariableSize = 0; VariableSize = 0;
@ -1934,7 +1934,7 @@ GetSavedHddPasswordRequest (
FreePool (Variable); FreePool (Variable);
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**
@ -1956,7 +1956,7 @@ SaveHddPasswordRequest (
HDD_PASSWORD_REQUEST_VARIABLE *NewVariable; HDD_PASSWORD_REQUEST_VARIABLE *NewVariable;
UINTN NewVariableSize; UINTN NewVariableSize;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@ -2047,7 +2047,7 @@ SaveHddPasswordRequest (
FreePool (Variable); FreePool (Variable);
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**
@ -2865,7 +2865,7 @@ HddPasswordDxeInit (
HDD_PASSWORD_VARIABLE_NAME, HDD_PASSWORD_VARIABLE_NAME,
&mHddPasswordVendorGuid &mHddPasswordVendorGuid
); );
DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __FUNCTION__, HDD_PASSWORD_VARIABLE_NAME, Status)); DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __func__, HDD_PASSWORD_VARIABLE_NAME, Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
} }

View File

@ -103,7 +103,7 @@ UnlockDevice (
ZeroMem (Buffer, sizeof (Buffer)); ZeroMem (Buffer, sizeof (Buffer));
DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status; return Status;
} }
@ -186,7 +186,7 @@ FreezeLockDevice (
FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK))); FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK)));
DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status; return Status;
} }
@ -321,11 +321,11 @@ HddPasswordAtaPassThruNotify (
IN VOID *Ppi IN VOID *Ppi
) )
{ {
DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __func__));
UnlockHddPassword ((EDKII_PEI_ATA_PASS_THRU_PPI *)Ppi); UnlockHddPassword ((EDKII_PEI_ATA_PASS_THRU_PPI *)Ppi);
DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __func__));
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -360,7 +360,7 @@ HddPasswordPeiInit (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__));
Status = PeiServicesNotifyPpi (&mHddPasswordAtaPassThruPpiNotifyDesc); Status = PeiServicesNotifyPpi (&mHddPasswordAtaPassThruPpiNotifyDesc);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -1126,7 +1126,7 @@ CalculatePrivAuthVarSignChainSHA256Digest (
// //
Status = X509GetCommonName (SignerCert, SignerCertSize, CertCommonName, &CertCommonNameSize); Status = X509GetCommonName (SignerCert, SignerCertSize, CertCommonName, &CertCommonNameSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __func__, Status));
return EFI_ABORTED; return EFI_ABORTED;
} }
@ -1134,7 +1134,7 @@ CalculatePrivAuthVarSignChainSHA256Digest (
// Get TopLevelCert tbsCertificate // Get TopLevelCert tbsCertificate
// //
if (!X509GetTBSCert (TopLevelCert, TopLevelCertSize, &TbsCert, &TbsCertSize)) { if (!X509GetTBSCert (TopLevelCert, TopLevelCertSize, &TbsCert, &TbsCertSize)) {
DEBUG ((DEBUG_INFO, "%a Get Top-level Cert tbsCertificate failed!\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a Get Top-level Cert tbsCertificate failed!\n", __func__));
return EFI_ABORTED; return EFI_ABORTED;
} }

View File

@ -205,7 +205,7 @@ DisableTpmPlatformHierarchy (
// Make sure that we have use of the TPM. // Make sure that we have use of the TPM.
Status = Tpm2RequestUseTpm (); Status = Tpm2RequestUseTpm ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiCallerBaseName, __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiCallerBaseName, __func__, Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return Status; return Status;
} }
@ -224,9 +224,9 @@ DisableTpmPlatformHierarchy (
TPM_RH_PLATFORM, // Hierarchy TPM_RH_PLATFORM, // Hierarchy
NO // State NO // State
); );
DEBUG ((DEBUG_VERBOSE, "%a:%a() - Disable PH = %r\n", gEfiCallerBaseName, __FUNCTION__, Status)); DEBUG ((DEBUG_VERBOSE, "%a:%a() - Disable PH = %r\n", gEfiCallerBaseName, __func__, Status));
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a:%a() - Disable PH Failed! %r\n", gEfiCallerBaseName, __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a:%a() - Disable PH Failed! %r\n", gEfiCallerBaseName, __func__, Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
} }

View File

@ -33,7 +33,7 @@ DisablePKProtection (
EFI_STATUS Status; EFI_STATUS Status;
EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy;
DEBUG ((DEBUG_INFO, "%a() Entry...\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() Entry...\n", __func__));
// IMPORTANT NOTE: This operation is sticky and leaves variable protections disabled. // IMPORTANT NOTE: This operation is sticky and leaves variable protections disabled.
// The system *MUST* be reset after performing this operation. // The system *MUST* be reset after performing this operation.

View File

@ -276,7 +276,7 @@ CreateTimeBasedPayload (
UINTN DescriptorSize; UINTN DescriptorSize;
if ((Data == NULL) || (DataSize == NULL) || (Time == NULL)) { if ((Data == NULL) || (DataSize == NULL) || (Time == NULL)) {
DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __func__));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -292,7 +292,7 @@ CreateTimeBasedPayload (
DescriptorSize = OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo) + OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData); DescriptorSize = OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo) + OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData);
NewData = (UINT8 *)AllocateZeroPool (DescriptorSize + PayloadSize); NewData = (UINT8 *)AllocateZeroPool (DescriptorSize + PayloadSize);
if (NewData == NULL) { if (NewData == NULL) {
DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __func__));
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -603,13 +603,13 @@ DeleteSecureBootVariables (
{ {
EFI_STATUS Status, TempStatus; EFI_STATUS Status, TempStatus;
DEBUG ((DEBUG_INFO, "%a - Attempting to delete the Secure Boot variables.\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a - Attempting to delete the Secure Boot variables.\n", __func__));
// //
// Step 1: Notify that a PK update is coming shortly... // Step 1: Notify that a PK update is coming shortly...
Status = DisablePKProtection (); Status = DisablePKProtection ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a - Failed to signal PK update start! %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to signal PK update start! %r\n", __func__, Status));
// Classify this as a PK deletion error. // Classify this as a PK deletion error.
Status = EFI_ABORTED; Status = EFI_ABORTED;
} }
@ -619,7 +619,7 @@ DeleteSecureBootVariables (
// Let's try to nuke the PK, why not... // Let's try to nuke the PK, why not...
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = DeletePlatformKey (); Status = DeletePlatformKey ();
DEBUG ((DEBUG_INFO, "%a - PK Delete = %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a - PK Delete = %r\n", __func__, Status));
// If the PK is not found, then our work here is done. // If the PK is not found, then our work here is done.
if (Status == EFI_NOT_FOUND) { if (Status == EFI_NOT_FOUND) {
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
@ -646,25 +646,25 @@ DeleteSecureBootVariables (
// the variables anyway. // the variables anyway.
// //
TempStatus = DeleteKEK (); TempStatus = DeleteKEK ();
DEBUG ((DEBUG_INFO, "%a - KEK Delete = %r\n", __FUNCTION__, TempStatus)); DEBUG ((DEBUG_INFO, "%a - KEK Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) { if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED; Status = EFI_ACCESS_DENIED;
} }
TempStatus = DeleteDb (); TempStatus = DeleteDb ();
DEBUG ((DEBUG_INFO, "%a - db Delete = %r\n", __FUNCTION__, TempStatus)); DEBUG ((DEBUG_INFO, "%a - db Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) { if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED; Status = EFI_ACCESS_DENIED;
} }
TempStatus = DeleteDbx (); TempStatus = DeleteDbx ();
DEBUG ((DEBUG_INFO, "%a - dbx Delete = %r\n", __FUNCTION__, TempStatus)); DEBUG ((DEBUG_INFO, "%a - dbx Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) { if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED; Status = EFI_ACCESS_DENIED;
} }
TempStatus = DeleteDbt (); TempStatus = DeleteDbt ();
DEBUG ((DEBUG_INFO, "%a - dbt Delete = %r\n", __FUNCTION__, TempStatus)); DEBUG ((DEBUG_INFO, "%a - dbt Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) { if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED; Status = EFI_ACCESS_DENIED;
} }
@ -752,7 +752,7 @@ EnrollFromInput (
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"error: %a (\"%s\", %g): %r\n", "error: %a (\"%s\", %g): %r\n",
__FUNCTION__, __func__,
VariableName, VariableName,
VendorGuid, VendorGuid,
Status Status
@ -795,21 +795,21 @@ SetSecureBootVariablesToDefault (
UINT8 *Data; UINT8 *Data;
UINTN DataSize; UINTN DataSize;
DEBUG ((DEBUG_INFO, "%a() Entry\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() Entry\n", __func__));
if (SecureBootPayload == NULL) { if (SecureBootPayload == NULL) {
DEBUG ((DEBUG_ERROR, "%a - Invalid SecureBoot payload is supplied!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a - Invalid SecureBoot payload is supplied!\n", __func__));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
// //
// Right off the bat, if SecureBoot is currently enabled, bail. // Right off the bat, if SecureBoot is currently enabled, bail.
if (IsSecureBootEnabled ()) { if (IsSecureBootEnabled ()) {
DEBUG ((DEBUG_ERROR, "%a - Cannot set default keys while SecureBoot is enabled!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a - Cannot set default keys while SecureBoot is enabled!\n", __func__));
return EFI_ABORTED; return EFI_ABORTED;
} }
DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __FUNCTION__, SecureBootPayload->SecureBootKeyName)); DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __func__, SecureBootPayload->SecureBootKeyName));
// //
// Start running down the list, creating variables in our wake. // Start running down the list, creating variables in our wake.
@ -834,10 +834,10 @@ SetSecureBootVariablesToDefault (
Data Data
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DB %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DB %r!\n", __func__, Status));
} }
} else { } else {
DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __func__, Status));
} }
// Keep it going. Keep it going. dbt if supplied... // Keep it going. Keep it going. dbt if supplied...
@ -851,7 +851,7 @@ SetSecureBootVariablesToDefault (
Data Data
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBT %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBT %r!\n", __func__, Status));
} }
} }
@ -866,7 +866,7 @@ SetSecureBootVariablesToDefault (
Data Data
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a - Failed to enroll KEK %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to enroll KEK %r!\n", __func__, Status));
} }
} }
@ -889,7 +889,7 @@ SetSecureBootVariablesToDefault (
// //
// Report PK creation errors. // Report PK creation errors.
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __func__, Status));
Status = EFI_SECURITY_VIOLATION; Status = EFI_SECURITY_VIOLATION;
} }
} }

View File

@ -82,7 +82,7 @@ MockSetVariable (
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"%a %s %g %x %x %p\n", "%a %s %g %x %x %p\n",
__FUNCTION__, __func__,
VariableName, VariableName,
VendorGuid, VendorGuid,
Attributes, Attributes,
@ -139,7 +139,7 @@ MockGetVariable (
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"%a %s %g %p %x %p\n", "%a %s %g %p %x %p\n",
__FUNCTION__, __func__,
VariableName, VariableName,
VendorGuid, VendorGuid,
Attributes, Attributes,

View File

@ -81,7 +81,7 @@ SecureBootFetchData (
if (Status == EFI_SUCCESS) { if (Status == EFI_SUCCESS) {
RsaPubKey = NULL; RsaPubKey = NULL;
if (RsaGetPublicKeyFromX509 (Buffer, Size, &RsaPubKey) == FALSE) { if (RsaGetPublicKeyFromX509 (Buffer, Size, &RsaPubKey) == FALSE) {
DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __FUNCTION__, KeyIndex)); DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __func__, KeyIndex));
if (EfiSig != NULL) { if (EfiSig != NULL) {
FreePool (EfiSig); FreePool (EfiSig);
} }

View File

@ -491,7 +491,7 @@ OpalEndOfDxeEventNotify (
{ {
OPAL_DRIVER_DEVICE *TmpDev; OPAL_DRIVER_DEVICE *TmpDev;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
mOpalEndOfDxe = TRUE; mOpalEndOfDxe = TRUE;
@ -529,7 +529,7 @@ OpalEndOfDxeEventNotify (
// //
SendBlockSidCommand (); SendBlockSidCommand ();
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
gBS->CloseEvent (Event); gBS->CloseEvent (Event);
} }
@ -888,7 +888,7 @@ OpalDriverRequestPassword (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1074,7 +1074,7 @@ ProcessOpalRequestEnableFeature (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1223,7 +1223,7 @@ ProcessOpalRequestDisableUser (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1339,7 +1339,7 @@ ProcessOpalRequestPsidRevert (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1478,7 +1478,7 @@ ProcessOpalRequestRevert (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1646,7 +1646,7 @@ ProcessOpalRequestSecureErase (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1784,7 +1784,7 @@ ProcessOpalRequestSetUserPwd (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -1990,7 +1990,7 @@ ProcessOpalRequestSetAdminPwd (
return; return;
} }
DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString); PopUpString = OpalGetPopUpString (Dev, RequestString);
@ -2182,7 +2182,7 @@ ProcessOpalRequest (
UINTN DevicePathSize; UINTN DevicePathSize;
BOOLEAN KeepUserData; BOOLEAN KeepUserData;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
if (mOpalRequestVariable == NULL) { if (mOpalRequestVariable == NULL) {
Status = GetVariable2 ( Status = GetVariable2 (
@ -2278,7 +2278,7 @@ ProcessOpalRequest (
TempVariable = (OPAL_REQUEST_VARIABLE *)((UINTN)TempVariable + TempVariable->Length); TempVariable = (OPAL_REQUEST_VARIABLE *)((UINTN)TempVariable + TempVariable->Length);
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**

View File

@ -95,7 +95,7 @@ GetSavedOpalRequest (
EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN DevicePathSize; UINTN DevicePathSize;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Variable = NULL; Variable = NULL;
VariableSize = 0; VariableSize = 0;
@ -141,7 +141,7 @@ GetSavedOpalRequest (
FreePool (Variable); FreePool (Variable);
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**
@ -169,7 +169,7 @@ SaveOpalRequest (
EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN DevicePathSize; UINTN DevicePathSize;
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@ -264,7 +264,7 @@ SaveOpalRequest (
FreePool (Variable); FreePool (Variable);
} }
DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
} }
/** /**

View File

@ -280,7 +280,7 @@ UnlockOpalPassword (
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"%a() OpalUtilUpdateGlobalLockingRange() Result = 0x%x\n", "%a() OpalUtilUpdateGlobalLockingRange() Result = 0x%x\n",
__FUNCTION__, __func__,
Result Result
)); ));
} }
@ -302,7 +302,7 @@ UnlockOpalPassword (
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"%a() OpalBlockSid() Result = 0x%x\n", "%a() OpalBlockSid() Result = 0x%x\n",
__FUNCTION__, __func__,
Result Result
)); ));
} }
@ -427,11 +427,11 @@ OpalPasswordStorageSecurityPpiNotify (
IN VOID *Ppi IN VOID *Ppi
) )
{ {
DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __func__));
UnlockOpalPasswordDevices ((EDKII_PEI_STORAGE_SECURITY_CMD_PPI *)Ppi); UnlockOpalPasswordDevices ((EDKII_PEI_STORAGE_SECURITY_CMD_PPI *)Ppi);
DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __func__));
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -466,7 +466,7 @@ OpalPasswordPeiInit (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__));
Status = PeiServicesNotifyPpi (&mOpalPasswordStorageSecurityPpiNotifyDesc); Status = PeiServicesNotifyPpi (&mOpalPasswordStorageSecurityPpiNotifyDesc);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -188,14 +188,14 @@ ExchangeCommonBuffer (
// Step 0: Sanity check for input argument // Step 0: Sanity check for input argument
if (TcgNvs == NULL) { if (TcgNvs == NULL) {
DEBUG ((DEBUG_ERROR, "%a - Input argument is NULL!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a - Input argument is NULL!\n", __func__));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
// Step 1: Grab the common buffer header // Step 1: Grab the common buffer header
Status = EfiGetSystemConfigurationTable (&gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **)&PiSmmCommunicationRegionTable); Status = EfiGetSystemConfigurationTable (&gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **)&PiSmmCommunicationRegionTable);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common buffer - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common buffer - %r!\n", __func__, Status));
return Status; return Status;
} }
@ -215,7 +215,7 @@ ExchangeCommonBuffer (
if (Index >= PiSmmCommunicationRegionTable->NumberOfEntries) { if (Index >= PiSmmCommunicationRegionTable->NumberOfEntries) {
// Could not find one that meets our goal... // Could not find one that meets our goal...
DEBUG ((DEBUG_ERROR, "%a - Could not find a common buffer that is big enough for NVS!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a - Could not find a common buffer that is big enough for NVS!\n", __func__));
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -236,9 +236,9 @@ ExchangeCommonBuffer (
Status = gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid, NULL, (VOID **)&MmCommunication); Status = gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid, NULL, (VOID **)&MmCommunication);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = MmCommunication->Communicate (MmCommunication, CommHeader, &CommBufferSize); Status = MmCommunication->Communicate (MmCommunication, CommHeader, &CommBufferSize);
DEBUG ((DEBUG_INFO, "%a - Communicate() = %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_INFO, "%a - Communicate() = %r\n", __func__, Status));
} else { } else {
DEBUG ((DEBUG_ERROR, "%a - Failed to locate MmCommunication protocol - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a - Failed to locate MmCommunication protocol - %r\n", __func__, Status));
return Status; return Status;
} }
@ -250,7 +250,7 @@ ExchangeCommonBuffer (
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"%a Communication returned software SMI value. PP: 0x%x; MC: 0x%x.\n", "%a Communication returned software SMI value. PP: 0x%x; MC: 0x%x.\n",
__FUNCTION__, __func__,
TcgNvs->PhysicalPresence.SoftwareSmi, TcgNvs->PhysicalPresence.SoftwareSmi,
TcgNvs->MemoryClear.SoftwareSmi TcgNvs->MemoryClear.SoftwareSmi
)); ));

View File

@ -312,10 +312,10 @@ SyncPcrAllocationsAndPcrMask (
NewTpmActivePcrBanks &= BiosHashAlgorithmBitmap; NewTpmActivePcrBanks &= BiosHashAlgorithmBitmap;
DEBUG ((DEBUG_INFO, "NewTpmActivePcrBanks 0x%08x\n", NewTpmActivePcrBanks)); DEBUG ((DEBUG_INFO, "NewTpmActivePcrBanks 0x%08x\n", NewTpmActivePcrBanks));
DEBUG ((DEBUG_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", __func__, TpmActivePcrBanks, NewTpmActivePcrBanks));
if (NewTpmActivePcrBanks == 0) { if (NewTpmActivePcrBanks == 0) {
DEBUG ((DEBUG_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", __func__));
ASSERT (FALSE); ASSERT (FALSE);
} else { } else {
DEBUG ((DEBUG_ERROR, "Tpm2PcrAllocateBanks (TpmHashAlgorithmBitmap: 0x%08x, NewTpmActivePcrBanks: 0x%08x)\n", TpmHashAlgorithmBitmap, NewTpmActivePcrBanks)); DEBUG ((DEBUG_ERROR, "Tpm2PcrAllocateBanks (TpmHashAlgorithmBitmap: 0x%08x, NewTpmActivePcrBanks: 0x%08x)\n", TpmHashAlgorithmBitmap, NewTpmActivePcrBanks));
@ -324,7 +324,7 @@ SyncPcrAllocationsAndPcrMask (
// //
// We can't do much here, but we hope that this doesn't happen. // We can't do much here, but we hope that this doesn't happen.
// //
DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __func__));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
} }
@ -342,9 +342,9 @@ SyncPcrAllocationsAndPcrMask (
if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) != Tpm2PcrMask) { if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) != Tpm2PcrMask) {
NewTpm2PcrMask = Tpm2PcrMask & TpmHashAlgorithmBitmap; NewTpm2PcrMask = Tpm2PcrMask & TpmHashAlgorithmBitmap;
DEBUG ((DEBUG_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", __func__, Tpm2PcrMask, NewTpm2PcrMask));
if (NewTpm2PcrMask == 0) { if (NewTpm2PcrMask == 0) {
DEBUG ((DEBUG_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", __func__));
ASSERT (FALSE); ASSERT (FALSE);
} }

View File

@ -57,7 +57,7 @@ TpmNvsCommunciate (
UINTN TempCommBufferSize; UINTN TempCommBufferSize;
TPM_NVS_MM_COMM_BUFFER *CommParams; TPM_NVS_MM_COMM_BUFFER *CommParams;
DEBUG ((DEBUG_VERBOSE, "%a()\n", __FUNCTION__)); DEBUG ((DEBUG_VERBOSE, "%a()\n", __func__));
// //
// If input is invalid, stop processing this SMI // If input is invalid, stop processing this SMI
@ -69,12 +69,12 @@ TpmNvsCommunciate (
TempCommBufferSize = *CommBufferSize; TempCommBufferSize = *CommBufferSize;
if (TempCommBufferSize != sizeof (TPM_NVS_MM_COMM_BUFFER)) { if (TempCommBufferSize != sizeof (TPM_NVS_MM_COMM_BUFFER)) {
DEBUG ((DEBUG_ERROR, "[%a] MM Communication buffer size is invalid for this handler!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "[%a] MM Communication buffer size is invalid for this handler!\n", __func__));
return EFI_ACCESS_DENIED; return EFI_ACCESS_DENIED;
} }
if (!IsBufferOutsideMmValid ((UINTN)CommBuffer, TempCommBufferSize)) { if (!IsBufferOutsideMmValid ((UINTN)CommBuffer, TempCommBufferSize)) {
DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid location!\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid location!\n", __func__));
return EFI_ACCESS_DENIED; return EFI_ACCESS_DENIED;
} }
@ -85,14 +85,14 @@ TpmNvsCommunciate (
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
switch (CommParams->Function) { switch (CommParams->Function) {
case TpmNvsMmExchangeInfo: case TpmNvsMmExchangeInfo:
DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_INFO\n", __FUNCTION__)); DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_INFO\n", __func__));
CommParams->RegisteredPpSwiValue = mPpSoftwareSmi; CommParams->RegisteredPpSwiValue = mPpSoftwareSmi;
CommParams->RegisteredMcSwiValue = mMcSoftwareSmi; CommParams->RegisteredMcSwiValue = mMcSoftwareSmi;
mTcgNvs = (TCG_NVS *)(UINTN)CommParams->TargetAddress; mTcgNvs = (TCG_NVS *)(UINTN)CommParams->TargetAddress;
break; break;
default: default:
DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __FUNCTION__, CommParams->Function)); DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __func__, CommParams->Function));
Status = EFI_UNSUPPORTED; Status = EFI_UNSUPPORTED;
break; break;
} }
@ -301,7 +301,7 @@ InitializeTcgCommon (
Status = gMmst->MmiHandlerRegister (TpmNvsCommunciate, &gTpmNvsMmGuid, &mReadyToLockHandle); Status = gMmst->MmiHandlerRegister (TpmNvsCommunciate, &gTpmNvsMmGuid, &mReadyToLockHandle);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a] Failed to register NVS communicate as root MM handler - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "[%a] Failed to register NVS communicate as root MM handler - %r!\n", __func__, Status));
goto Cleanup; goto Cleanup;
} }
@ -311,7 +311,7 @@ InitializeTcgCommon (
Status = gMmst->MmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NULL, (VOID **)&SwDispatch); Status = gMmst->MmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NULL, (VOID **)&SwDispatch);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a] Failed to locate Sw dispatch protocol - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "[%a] Failed to locate Sw dispatch protocol - %r!\n", __func__, Status));
goto Cleanup; goto Cleanup;
} }
@ -319,7 +319,7 @@ InitializeTcgCommon (
Status = SwDispatch->Register (SwDispatch, PhysicalPresenceCallback, &SwContext, &PpSwHandle); Status = SwDispatch->Register (SwDispatch, PhysicalPresenceCallback, &SwContext, &PpSwHandle);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM handler - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM handler - %r!\n", __func__, Status));
goto Cleanup; goto Cleanup;
} }
@ -329,7 +329,7 @@ InitializeTcgCommon (
Status = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &McSwHandle); Status = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &McSwHandle);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __func__, Status));
goto Cleanup; goto Cleanup;
} }
@ -342,7 +342,7 @@ InitializeTcgCommon (
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
// Should not happen // Should not happen
DEBUG ((DEBUG_ERROR, "[%a] Failed to locate SMM variable protocol - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "[%a] Failed to locate SMM variable protocol - %r!\n", __func__, Status));
goto Cleanup; goto Cleanup;
} }
@ -350,7 +350,7 @@ InitializeTcgCommon (
Status = gMmst->MmRegisterProtocolNotify (&gEfiMmReadyToLockProtocolGuid, TcgMmReadyToLock, &NotifyHandle); Status = gMmst->MmRegisterProtocolNotify (&gEfiMmReadyToLockProtocolGuid, TcgMmReadyToLock, &NotifyHandle);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notification - %r!\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notification - %r!\n", __func__, Status));
goto Cleanup; goto Cleanup;
} }

View File

@ -1353,12 +1353,12 @@ TdHashLogExtendEvent (
} }
if (CcEvent->Header.MrIndex == CC_MR_INDEX_0_MRTD) { if (CcEvent->Header.MrIndex == CC_MR_INDEX_0_MRTD) {
DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __FUNCTION__)); DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __func__));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (CcEvent->Header.MrIndex >= CC_MR_INDEX_INVALID) { if (CcEvent->Header.MrIndex >= CC_MR_INDEX_INVALID) {
DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __FUNCTION__, CcEvent->Header.MrIndex)); DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __func__, CcEvent->Header.MrIndex));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -2514,7 +2514,7 @@ DriverEntry (
// //
// Cc measurement feature is crucial to a td-guest and it shall stop running immediately // Cc measurement feature is crucial to a td-guest and it shall stop running immediately
// when it is failed to be installed. // when it is failed to be installed.
DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __func__, Status));
CpuDeadLoop (); CpuDeadLoop ();
} }

View File

@ -167,7 +167,7 @@ GetCurrentTime (
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"%a(), GetTime() failed, status = '%r'\n", "%a(), GetTime() failed, status = '%r'\n",
__FUNCTION__, __func__,
Status Status
)); ));
return Status; return Status;

View File

@ -42,35 +42,35 @@ SecureBootDefaultKeysEntryPoint (
Status = SecureBootInitPKDefault (); Status = SecureBootInitPKDefault ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__, Status));
return Status; return Status;
} }
Status = SecureBootInitKEKDefault (); Status = SecureBootInitKEKDefault ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func__, Status));
return Status; return Status;
} }
Status = SecureBootInitDbDefault (); Status = SecureBootInitDbDefault ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __func__, Status));
return Status; return Status;
} }
Status = SecureBootInitDbtDefault (); Status = SecureBootInitDbtDefault ();
if (Status == EFI_NOT_FOUND) { if (Status == EFI_NOT_FOUND) {
DEBUG ((DEBUG_INFO, "%a: dbtDefault not initialized\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a: dbtDefault not initialized\n", __func__));
} else if (EFI_ERROR (Status)) { } else if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __func__, Status));
return Status; return Status;
} }
Status = SecureBootInitDbxDefault (); Status = SecureBootInitDbxDefault ();
if (Status == EFI_NOT_FOUND) { if (Status == EFI_NOT_FOUND) {
DEBUG ((DEBUG_INFO, "%a: dbxDefault not initialized\n", __FUNCTION__)); DEBUG ((DEBUG_INFO, "%a: dbxDefault not initialized\n", __func__));
} else if (EFI_ERROR (Status)) { } else if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __FUNCTION__, Status)); DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __func__, Status));
return Status; return Status;
} }