summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@microsoft.com>2025-06-17 09:08:44 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-07-14 07:25:12 +0000
commitdbf45a870b89fb9e307c41c66949288518c24440 (patch)
treea030d17c40c7b72bca18f12c045e427de4669d31
parenta1b509c1a453815acbc6c8b0fc5882fd03a6f2c0 (diff)
downloadedk2-dbf45a870b89fb9e307c41c66949288518c24440.zip
edk2-dbf45a870b89fb9e307c41c66949288518c24440.tar.gz
edk2-dbf45a870b89fb9e307c41c66949288518c24440.tar.bz2
MdePkg: Add DEBUG_SECURITY Bit in PcdDebugPrintErrorLevel
Tcg2Dxe and its libraries are currently the noisiest modules in edk2. For a sample platform printing at INFO level, Tcg2Dxe printed 4,000 lines out of 5,700 total lines printed. This commit defines a DEBUG_SECURITY bit to control the debug output of Tcg2Dxe and other security related components. Most of the output is not useful except for deep debugging of TPM transactions, so it is appropriate to only print when the DEBUG_SECURITY bit is present. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
-rw-r--r--MdePkg/Include/Library/DebugLib.h3
-rw-r--r--MdePkg/MdePkg.dec2
2 files changed, 4 insertions, 1 deletions
diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index b48e08a..915844b 100644
--- a/MdePkg/Include/Library/DebugLib.h
+++ b/MdePkg/Include/Library/DebugLib.h
@@ -57,7 +57,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
// significantly impact boot performance
#define DEBUG_MANAGEABILITY 0x00800000 // Detailed debug and payload manageability messages
// related to modules such as Redfish, IPMI, MCTP etc.
-#define DEBUG_ERROR 0x80000000 // Error
+#define DEBUG_SECURITY 0x01000000 // Security and security HW related messages, such as TPM
+#define DEBUG_ERROR 0x80000000 // Error
//
// Aliases of debug message mask bits
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index ea8bf0f..842abaa 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2292,6 +2292,7 @@
# BIT21 - Memory range cachability changes message.<BR>
# BIT22 - Detailed debug message.<BR>
# BIT23 - Manageability debug message.<BR>
+ # BIT24 - Security debug message.<BR>
# BIT31 - Error message.<BR>
# @Prompt Fixed Debug Message Print Level.
gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0xFFFFFFFF|UINT32|0x30001016
@@ -2399,6 +2400,7 @@
# BIT21 - Memory range cachability changes message.<BR>
# BIT22 - Detailed debug message.<BR>
# BIT23 - Manageability messages.<BR>
+ # BIT24 - Security debug message.<BR>
# BIT31 - Error message.<BR>
# @Prompt Debug Message Print Level.
# @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel & 0x7F84AA00) == 0