public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V5 00/27] Disabling safe string constraint assertions
@ 2020-05-12 17:02 Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 01/27] MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib Vitaly Cheptsov
                   ` (26 more replies)
  0 siblings, 27 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel
  Cc: Michael Kinney, Laszlo Ersek, Andrew Fish, Marvin Häuser,
	Liming Gao, Zhichao Gao

CC: Michael Kinney <michael.d.kinney@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
CC: Andrew Fish <afish@apple.com>
CC: Marvin Häuser <mhaeuser@outlook.de>
CC: Liming Gao <liming.gao@intel.com>
CC: Zhichao Gao <zhichao.gao@intel.com>

This changeset hopefully finally resolves the longstanding
https://bugzilla.tianocore.org/show_bug.cgi?id=2054

V5 changeset addressed the review comments of V4. For more
details see: https://edk2.groups.io/g/devel/topic/74138532.

Requesting to merge into edk2-stable202005.

Vitaly Cheptsov (27):
  MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib
  UnitTestFrameworkPkg: Add support for DebugCommonLib
  MdePkg: Add support for DebugCommonLib
  MdeModulePkg: Add support for DebugCommonLib
  ArmPkg: Add support for DebugCommonLib
  ArmPlatformPkg: Add support for DebugCommonLib
  ArmVirtPkg: Add support for DebugCommonLib
  CryptoPkg: Add support for DebugCommonLib
  DynamicTablesPkg: Add support for DebugCommonLib
  EmbeddedPkg: Add support for DebugCommonLib
  EmulatorPkg: Add support for DebugCommonLib
  FatPkg: Add support for DebugCommonLib
  FmpDevicePkg: Add support for DebugCommonLib
  IntelFsp2Pkg: Add support for DebugCommonLib
  IntelFsp2WrapperPkg: Add support for DebugCommonLib
  OvmfPkg: Add support for DebugCommonLib
  NetworkPkg: Add support for DebugCommonLib
  ShellPkg: Add support for DebugCommonLib
  SecurityPkg: Add support for DebugCommonLib
  PcAtChipsetPkg: Add support for DebugCommonLib
  SignedCapsulePkg: Add support for DebugCommonLib
  SourceLevelDebugPkg: Add support for DebugCommonLib
  StandaloneMmPkg: Add support for DebugCommonLib
  UefiCpuPkg: Add support for DebugCommonLib
  UefiPayloadPkg: Add support for DebugCommonLib
  MdePkg: Introduce assertion on constraint debug mask bit
  MdePkg: Use assertion on constraint violation bit in SafeString

 ArmPkg/ArmPkg.dsc                                                                      |   1 +
 ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc                                     |   1 +
 ArmPkg/Library/SemiHostingDebugLib/DebugLib.c                                          |  84 ----------
 ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf                             |   3 +-
 ArmPlatformPkg/ArmPlatformPkg.dsc                                                      |   1 +
 ArmVirtPkg/ArmVirt.dsc.inc                                                             |   1 +
 CryptoPkg/CryptoPkg.dsc                                                                |   2 +
 DynamicTablesPkg/DynamicTablesPkg.dsc                                                  |   1 +
 EmbeddedPkg/EmbeddedPkg.dsc                                                            |   1 +
 EmulatorPkg/EmulatorPkg.dsc                                                            |   1 +
 FatPkg/FatPkg.dsc                                                                      |   1 +
 FmpDevicePkg/FmpDevicePkg.dsc                                                          |   1 +
 IntelFsp2Pkg/IntelFsp2Pkg.dsc                                                          |   1 +
 IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf           |   2 +-
 IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c                              |  97 -----------
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc                                            |   1 +
 MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c                                    | 100 ------------
 MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf                       |   2 +-
 MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c                         |  98 -----------
 MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf |   2 +-
 MdeModulePkg/MdeModulePkg.dsc                                                          |   1 +
 MdePkg/Include/Library/BaseLib.h                                                       | 120 +++++++-------
 MdePkg/Include/Library/DebugCommonLib.h                                                | 172 ++++++++++++++++++++
 MdePkg/Include/Library/DebugLib.h                                                      | 155 +++---------------
 MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf                               |  35 ++++
 MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni                               |  16 ++
 MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c                                     | 133 +++++++++++++++
 MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf                                   |   8 +
 MdePkg/Library/BaseDebugLibNull/DebugLib.c                                             |  98 -----------
 MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf                       |   3 +-
 MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c                                       |  98 -----------
 MdePkg/Library/BaseLib/BaseLib.inf                                                     |   1 +
 MdePkg/Library/BaseLib/SafeString.c                                                    |   2 +-
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c                                 |  98 -----------
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf           |   2 +-
 MdePkg/Library/UefiDebugLibConOut/DebugLib.c                                           |  98 -----------
 MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf                               |   3 +-
 MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c                                |  99 -----------
 MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf         |   3 +-
 MdePkg/Library/UefiDebugLibStdErr/DebugLib.c                                           |  98 -----------
 MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf                               |   3 +-
 MdePkg/MdePkg.dec                                                                      |   6 +-
 MdePkg/MdePkg.dsc                                                                      |   1 +
 MdePkg/MdePkg.uni                                                                      |   3 +-
 NetworkPkg/NetworkPkg.dsc                                                              |   1 +
 OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c                                      |  98 -----------
 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf                      |   3 +-
 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf                   |   3 +-
 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf            |   3 +-
 OvmfPkg/OvmfPkgIa32.dsc                                                                |   1 +
 OvmfPkg/OvmfPkgIa32X64.dsc                                                             |   1 +
 OvmfPkg/OvmfPkgX64.dsc                                                                 |   1 +
 OvmfPkg/OvmfXen.dsc                                                                    |   1 +
 PcAtChipsetPkg/PcAtChipsetPkg.dsc                                                      |   1 +
 SecurityPkg/SecurityPkg.dsc                                                            |   1 +
 ShellPkg/ShellPkg.dsc                                                                  |   1 +
 SignedCapsulePkg/SignedCapsulePkg.dsc                                                  |   1 +
 SourceLevelDebugPkg/SourceLevelDebugPkg.dsc                                            |   1 +
 StandaloneMmPkg/StandaloneMmPkg.dsc                                                    |   1 +
 UefiCpuPkg/UefiCpuPkg.dsc                                                              |   1 +
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc                                                  |   1 +
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc                                               |   1 +
 UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c                       |  94 -----------
 UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf                     |   2 +-
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc                                  |   1 +
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc                                |   1 +
 66 files changed, 497 insertions(+), 1379 deletions(-)
 create mode 100644 MdePkg/Include/Library/DebugCommonLib.h
 create mode 100644 MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
 create mode 100644 MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni
 create mode 100644 MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c

-- 
2.24.2 (Apple Git-127)


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH V5 01/27] MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 02/27] UnitTestFrameworkPkg: Add support for DebugCommonLib Vitaly Cheptsov
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

This library allows to make a common part of all DebugLib instances
and avoid the need to update every DebugLib on extending a new debug
mask PCD bit.

CC: Michael D Kinney <michael.d.kinney@intel.com>
CC: Liming Gao <liming.gao@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 MdePkg/Include/Library/DebugCommonLib.h                  | 154 ++++++++++++++++++++
 MdePkg/Include/Library/DebugLib.h                        | 137 +----------------
 MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf |  35 +++++
 MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni |  16 ++
 MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c       | 113 ++++++++++++++
 MdePkg/MdePkg.dec                                        |   3 +
 MdePkg/MdePkg.dsc                                        |   1 +
 7 files changed, 323 insertions(+), 136 deletions(-)

diff --git a/MdePkg/Include/Library/DebugCommonLib.h b/MdePkg/Include/Library/DebugCommonLib.h
new file mode 100644
index 0000000000..31249f91fa
--- /dev/null
+++ b/MdePkg/Include/Library/DebugCommonLib.h
@@ -0,0 +1,154 @@
+/** @file
+  Provides services to access common debugging features.
+
+  The debug common library interface provides common code for all debug libraries.
+
+  Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __DEBUG_COMMON_LIB_H__
+#define __DEBUG_COMMON_LIB_H__
+
+//
+// Declare bits for PcdDebugPropertyMask
+//
+#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED       0x01
+#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED        0x02
+#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED         0x04
+#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED       0x08
+#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED  0x10
+#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED    0x20
+
+//
+// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
+//
+#define DEBUG_INIT      0x00000001  // Initialization
+#define DEBUG_WARN      0x00000002  // Warnings
+#define DEBUG_LOAD      0x00000004  // Load events
+#define DEBUG_FS        0x00000008  // EFI File system
+#define DEBUG_POOL      0x00000010  // Alloc & Free (pool)
+#define DEBUG_PAGE      0x00000020  // Alloc & Free (page)
+#define DEBUG_INFO      0x00000040  // Informational debug messages
+#define DEBUG_DISPATCH  0x00000080  // PEI/DXE/SMM Dispatchers
+#define DEBUG_VARIABLE  0x00000100  // Variable
+#define DEBUG_BM        0x00000400  // Boot Manager
+#define DEBUG_BLKIO     0x00001000  // BlkIo Driver
+#define DEBUG_NET       0x00004000  // Network Io Driver
+#define DEBUG_UNDI      0x00010000  // UNDI Driver
+#define DEBUG_LOADFILE  0x00020000  // LoadFile
+#define DEBUG_EVENT     0x00080000  // Event messages
+#define DEBUG_GCD       0x00100000  // Global Coherency Database changes
+#define DEBUG_CACHE     0x00200000  // Memory range cachability changes
+#define DEBUG_VERBOSE   0x00400000  // Detailed debug messages that may
+                                    // significantly impact boot performance
+#define DEBUG_ERROR     0x80000000  // Error
+
+//
+// Aliases of debug message mask bits
+//
+#define EFI_D_INIT      DEBUG_INIT
+#define EFI_D_WARN      DEBUG_WARN
+#define EFI_D_LOAD      DEBUG_LOAD
+#define EFI_D_FS        DEBUG_FS
+#define EFI_D_POOL      DEBUG_POOL
+#define EFI_D_PAGE      DEBUG_PAGE
+#define EFI_D_INFO      DEBUG_INFO
+#define EFI_D_DISPATCH  DEBUG_DISPATCH
+#define EFI_D_VARIABLE  DEBUG_VARIABLE
+#define EFI_D_BM        DEBUG_BM
+#define EFI_D_BLKIO     DEBUG_BLKIO
+#define EFI_D_NET       DEBUG_NET
+#define EFI_D_UNDI      DEBUG_UNDI
+#define EFI_D_LOADFILE  DEBUG_LOADFILE
+#define EFI_D_EVENT     DEBUG_EVENT
+#define EFI_D_VERBOSE   DEBUG_VERBOSE
+#define EFI_D_ERROR     DEBUG_ERROR
+
+/**
+  Returns TRUE if ASSERT() macros are enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugAssertEnabled (
+  VOID
+  );
+
+
+/**
+  Returns TRUE if DEBUG() macros are enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintEnabled (
+  VOID
+  );
+
+
+/**
+  Returns TRUE if DEBUG_CODE() macros are enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugCodeEnabled (
+  VOID
+  );
+
+
+/**
+  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugClearMemoryEnabled (
+  VOID
+  );
+
+
+/**
+  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+  @retval  TRUE    Current ErrorLevel is supported.
+  @retval  FALSE   Current ErrorLevel is not supported.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintLevelEnabled (
+  IN  CONST UINTN        ErrorLevel
+  );
+
+
+#endif
diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index baab34bf05..a38e0e2904 100644
--- a/MdePkg/Include/Library/DebugLib.h
+++ b/MdePkg/Include/Library/DebugLib.h
@@ -16,60 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #ifndef __DEBUG_LIB_H__
 #define __DEBUG_LIB_H__
 
-//
-// Declare bits for PcdDebugPropertyMask
-//
-#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED       0x01
-#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED        0x02
-#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED         0x04
-#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED       0x08
-#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED  0x10
-#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED    0x20
-
-//
-// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
-//
-#define DEBUG_INIT      0x00000001  // Initialization
-#define DEBUG_WARN      0x00000002  // Warnings
-#define DEBUG_LOAD      0x00000004  // Load events
-#define DEBUG_FS        0x00000008  // EFI File system
-#define DEBUG_POOL      0x00000010  // Alloc & Free (pool)
-#define DEBUG_PAGE      0x00000020  // Alloc & Free (page)
-#define DEBUG_INFO      0x00000040  // Informational debug messages
-#define DEBUG_DISPATCH  0x00000080  // PEI/DXE/SMM Dispatchers
-#define DEBUG_VARIABLE  0x00000100  // Variable
-#define DEBUG_BM        0x00000400  // Boot Manager
-#define DEBUG_BLKIO     0x00001000  // BlkIo Driver
-#define DEBUG_NET       0x00004000  // Network Io Driver
-#define DEBUG_UNDI      0x00010000  // UNDI Driver
-#define DEBUG_LOADFILE  0x00020000  // LoadFile
-#define DEBUG_EVENT     0x00080000  // Event messages
-#define DEBUG_GCD       0x00100000  // Global Coherency Database changes
-#define DEBUG_CACHE     0x00200000  // Memory range cachability changes
-#define DEBUG_VERBOSE   0x00400000  // Detailed debug messages that may
-                                    // significantly impact boot performance
-#define DEBUG_ERROR     0x80000000  // Error
-
-//
-// Aliases of debug message mask bits
-//
-#define EFI_D_INIT      DEBUG_INIT
-#define EFI_D_WARN      DEBUG_WARN
-#define EFI_D_LOAD      DEBUG_LOAD
-#define EFI_D_FS        DEBUG_FS
-#define EFI_D_POOL      DEBUG_POOL
-#define EFI_D_PAGE      DEBUG_PAGE
-#define EFI_D_INFO      DEBUG_INFO
-#define EFI_D_DISPATCH  DEBUG_DISPATCH
-#define EFI_D_VARIABLE  DEBUG_VARIABLE
-#define EFI_D_BM        DEBUG_BM
-#define EFI_D_BLKIO     DEBUG_BLKIO
-#define EFI_D_NET       DEBUG_NET
-#define EFI_D_UNDI      DEBUG_UNDI
-#define EFI_D_LOADFILE  DEBUG_LOADFILE
-#define EFI_D_EVENT     DEBUG_EVENT
-#define EFI_D_VERBOSE   DEBUG_VERBOSE
-#define EFI_D_ERROR     DEBUG_ERROR
+#include <Library/DebugCommonLib.h>
 
 /**
   Prints a debug message to the debug output device if the specified error level is enabled.
@@ -198,88 +145,6 @@ DebugClearMemory (
   );
 
 
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  );
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  );
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  );
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  );
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  );
-
 /**
   Internal worker macro that calls DebugAssert().
 
diff --git a/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf b/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
new file mode 100644
index 0000000000..4ceefc291b
--- /dev/null
+++ b/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Instance of Debug Common Library interface.
+#  It uses PcdLib to provide a common set of Debug Library interface.
+#
+#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = BaseDebugCommonLib
+  MODULE_UNI_FILE                = BaseDebugCommonLib.uni
+  FILE_GUID                      = 7CD790D2-E13F-4446-AF4F-813F0B9DEFF8
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = DebugCommonLib
+
+[Sources]
+  DebugCommonLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  PcdLib
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue  ## SOMETIMES_CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask      ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
+
diff --git a/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni b/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni
new file mode 100644
index 0000000000..a5ad34298b
--- /dev/null
+++ b/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni
@@ -0,0 +1,16 @@
+// /** @file
+// Instance of Debug Common Library interface.
+//
+// It uses PcdLib to provide a common set of Debug Library interface.
+//
+// Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT             #language en-US "Instance of Debug Common Library interface"
+
+#string STR_MODULE_DESCRIPTION          #language en-US "It uses PcdLib to provide a common set of Debug Library interface."
+
diff --git a/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c b/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c
new file mode 100644
index 0000000000..2291fb5382
--- /dev/null
+++ b/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c
@@ -0,0 +1,113 @@
+/** @file
+  Instance of Debug Common Library interface.
+  It uses PcdLib to provide a common set of Debug Library interface.
+
+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+#include <Library/DebugCommonLib.h>
+#include <Library/PcdLib.h>
+
+
+/**
+  Returns TRUE if ASSERT() macros are enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugAssertEnabled (
+  VOID
+  )
+{
+  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
+}
+
+
+/**
+  Returns TRUE if DEBUG() macros are enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintEnabled (
+  VOID
+  )
+{
+  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
+}
+
+
+/**
+  Returns TRUE if DEBUG_CODE() macros are enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugCodeEnabled (
+  VOID
+  )
+{
+  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
+}
+
+
+/**
+  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugClearMemoryEnabled (
+  VOID
+  )
+{
+  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
+}
+
+
+/**
+  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+  @retval  TRUE    Current ErrorLevel is supported.
+  @retval  FALSE   Current ErrorLevel is not supported.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintLevelEnabled (
+  IN  CONST UINTN        ErrorLevel
+  )
+{
+  return (BOOLEAN) ((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0);
+}
+
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 0b9c4bc40a..a121b9ecab 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -229,6 +229,9 @@ [LibraryClasses]
   #                  library class maps directly on top of the Timer class.
   S3StallLib|Include/Library/S3StallLib.h
 
+  ##  @libraryclass  Provides services to access common debugging features.
+  DebugCommonLib|Include/Library/DebugCommonLib.h
+
   ##  @libraryclass  Defines library APIs used by modules to get/set print error level.
   DebugPrintErrorLevelLib|Include/Library/DebugPrintErrorLevelLib.h
 
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 6cd38e7ec3..1072322450 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -36,6 +36,7 @@ [Components]
   MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
   MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
+  MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
   MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
   MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 02/27] UnitTestFrameworkPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 01/27] MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 03/27] MdePkg: " Vitaly Cheptsov
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Sean Brogan, Bret Barkelew

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Michael D Kinney <michael.d.kinney@intel.com>
CC: Sean Brogan <sean.brogan@microsoft.com>
CC: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c   | 94 --------------------
 UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf |  2 +-
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc              |  1 +
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc            |  1 +
 4 files changed, 3 insertions(+), 95 deletions(-)

diff --git a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c
index 0daea00728..e490a53474 100644
--- a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c
+++ b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c
@@ -183,97 +183,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
diff --git a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf
index 5babbca3b0..9d6d9ab911 100644
--- a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf
+++ b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf
@@ -28,8 +28,8 @@ [LibraryClasses]
   PcdLib
   PrintLib
   BaseLib
+  DebugCommonLib
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue     ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask         ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index e954968efc..194e6ce108 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -12,6 +12,7 @@ [LibraryClasses.common.HOST_APPLICATION]
   CmockaLib|UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf
   UnitTestLib|UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLibCmocka.inf
   DebugLib|UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.inf
 
 [BuildOptions]
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index c29b056fca..d1cb92aa0f 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -17,6 +17,7 @@ [LibraryClasses]
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 03/27] MdePkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 01/27] MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 02/27] UnitTestFrameworkPkg: Add support for DebugCommonLib Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 04/27] MdeModulePkg: " Vitaly Cheptsov
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Michael D Kinney <michael.d.kinney@intel.com>
CC: Liming Gao <liming.gao@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf                           |  8 ++
 MdePkg/Library/BaseDebugLibNull/DebugLib.c                                     | 98 -------------------
 MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf               |  3 +-
 MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c                               | 98 -------------------
 MdePkg/Library/BaseLib/BaseLib.inf                                             |  1 +
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c                         | 98 -------------------
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf   |  2 +-
 MdePkg/Library/UefiDebugLibConOut/DebugLib.c                                   | 98 -------------------
 MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf                       |  3 +-
 MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c                        | 99 --------------------
 MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf |  3 +-
 MdePkg/Library/UefiDebugLibStdErr/DebugLib.c                                   | 98 -------------------
 MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf                       |  3 +-
 13 files changed, 14 insertions(+), 598 deletions(-)

diff --git a/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf b/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
index 81a63a5074..95425b996f 100644
--- a/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+++ b/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
@@ -29,3 +29,11 @@ [Sources]
 [Packages]
   MdePkg/MdePkg.dec
 
+
+[LibraryClasses]
+  DebugCommonLib
+  PcdLib
+
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask         ## CONSUMES
diff --git a/MdePkg/Library/BaseDebugLibNull/DebugLib.c b/MdePkg/Library/BaseDebugLibNull/DebugLib.c
index 20c175ec6d..843be399aa 100644
--- a/MdePkg/Library/BaseDebugLibNull/DebugLib.c
+++ b/MdePkg/Library/BaseDebugLibNull/DebugLib.c
@@ -146,101 +146,3 @@ DebugClearMemory (
   return Buffer;
 }
 
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return FALSE;
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return FALSE;
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return FALSE;
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return FALSE;
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return FALSE;
-}
-
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
index 7504faee67..eb1c2fca5f 100644
--- a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+++ b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
@@ -35,10 +35,9 @@ [LibraryClasses]
   PcdLib
   PrintLib
   BaseLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue  ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask      ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
-
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
index aeeab85737..be801b536c 100644
--- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
+++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
@@ -274,101 +274,3 @@ DebugClearMemory (
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
 
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
-
diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf
index a57ae2da31..d2cb2340df 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -403,6 +403,7 @@ [Packages]
 [LibraryClasses]
   PcdLib
   DebugLib
+  DebugCommonLib
   BaseMemoryLib
 
 [Pcd]
diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
index cc79843b1c..b792c4abf6 100644
--- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
+++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
@@ -335,101 +335,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
index 31d169ad7c..a68a0e8044 100644
--- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
+++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
@@ -36,6 +36,7 @@ [Packages]
 [LibraryClasses]
   BaseLib
   BaseMemoryLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
   PcdLib
   PrintLib
@@ -44,4 +45,3 @@ [LibraryClasses]
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue     ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask         ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
index 8ea38ea7cc..268ca5bfef 100644
--- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
@@ -274,101 +274,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
diff --git a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
index 53bbc8ce3f..4992f5c086 100644
--- a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+++ b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
@@ -44,10 +44,9 @@ [LibraryClasses]
   BaseLib
   PcdLib
   PrintLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel    ## CONSUMES
-
diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
index cd7e2abbd3..e3add1ec22 100644
--- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
@@ -328,102 +328,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
-
diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf b/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
index e12a1025c6..be2a731ffe 100644
--- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
+++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
@@ -44,6 +44,7 @@ [LibraryClasses]
   BaseLib
   PcdLib
   PrintLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Protocols]
@@ -52,5 +53,3 @@ [Protocols]
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel    ## CONSUMES
-
diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
index fcfdafede0..129c85587a 100644
--- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
@@ -275,101 +275,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
diff --git a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf b/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
index 5ecb971a0a..722ae19aad 100644
--- a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
+++ b/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
@@ -42,10 +42,9 @@ [LibraryClasses]
   BaseLib
   PcdLib
   PrintLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue   ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask       ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
-
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 04/27] MdeModulePkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (2 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 03/27] MdePkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 05/27] ArmPkg: " Vitaly Cheptsov
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Jian J Wang <jian.j.wang@intel.com>
CC: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c                                    | 100 --------------------
 MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf                       |   2 +-
 MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c                         |  98 -------------------
 MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf |   2 +-
 MdeModulePkg/MdeModulePkg.dsc                                                          |   1 +
 5 files changed, 3 insertions(+), 200 deletions(-)

diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
index 05a7dab99c..66748ee836 100644
--- a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
+++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
@@ -352,103 +352,3 @@ DebugClearMemory (
 
   return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
-
diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf b/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
index 4df479d742..ca1a3d16e4 100644
--- a/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
+++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
@@ -41,6 +41,7 @@ [Packages]
 [LibraryClasses]
   PcdLib
   BaseMemoryLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
   PeiServicesLib
   PeiServicesTablePointerLib
@@ -52,7 +53,6 @@ [Ppis]
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue         ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask             ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel     ## CONSUMES
 
 [Depex]
   gEdkiiDebugPpiGuid
diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
index fb47401466..ec90cb6e37 100644
--- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
+++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
@@ -501,101 +501,3 @@ DebugClearMemory (
 
   return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
index b52fc5686a..ca724326bd 100644
--- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
@@ -37,12 +37,12 @@ [LibraryClasses]
   ReportStatusCodeLib
   BaseMemoryLib
   BaseLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue  ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask      ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
 
 [Guids]
   gEfiStatusCodeDataTypeDebugGuid    ## SOMETIMES_CONSUMES ## GUID
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 25aea3e2a4..72b6fa755b 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -74,6 +74,7 @@ [LibraryClasses]
   # Misc
   #
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
   PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 05/27] ArmPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (3 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 04/27] MdeModulePkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 06/27] ArmPlatformPkg: " Vitaly Cheptsov
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Leif Lindholm <leif@nuviainc.com>
CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 ArmPkg/ArmPkg.dsc                                          |  1 +
 ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc         |  1 +
 ArmPkg/Library/SemiHostingDebugLib/DebugLib.c              | 84 --------------------
 ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf |  3 +-
 4 files changed, 4 insertions(+), 85 deletions(-)

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 549a2d29ab..fe9691205e 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -35,6 +35,7 @@ [LibraryClasses.common]
   CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
diff --git a/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc b/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
index 2818ce65db..51d7776eb3 100644
--- a/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
+++ b/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
@@ -30,6 +30,7 @@ [LibraryClasses]
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/ArmPkg/Library/SemiHostingDebugLib/DebugLib.c b/ArmPkg/Library/SemiHostingDebugLib/DebugLib.c
index ae762d8bea..58822db098 100644
--- a/ArmPkg/Library/SemiHostingDebugLib/DebugLib.c
+++ b/ArmPkg/Library/SemiHostingDebugLib/DebugLib.c
@@ -250,87 +250,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-
-/**
-
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-
-  Returns TRUE if DEBUG()macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-
-  Returns TRUE if DEBUG_CODE()macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-
-  Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
diff --git a/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf b/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf
index 71bf20b1ca..ef1f97672a 100644
--- a/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf
+++ b/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf
@@ -33,7 +33,8 @@ [LibraryClasses]
   PcdLib
   PrintLib
   SemihostLib
-  DebugLib
+  DebugCommonLib
+  DebugPrintErrorLevelLib
 
 [Pcd.common]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 06/27] ArmPlatformPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (4 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 05/27] ArmPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 07/27] ArmVirtPkg: " Vitaly Cheptsov
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Leif Lindholm <leif@nuviainc.com>
CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 ArmPlatformPkg/ArmPlatformPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 5381c95af2..2a3432d91e 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -45,6 +45,7 @@ [LibraryClasses.common]
   CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
   DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 07/27] ArmVirtPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (5 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 06/27] ArmPlatformPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-13 11:05   ` [edk2-devel] " Laszlo Ersek
  2020-05-12 17:02 ` [PATCH V5 08/27] CryptoPkg: " Vitaly Cheptsov
                   ` (19 subsequent siblings)
  26 siblings, 1 reply; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Laszlo Ersek, Ard Biesheuvel, Leif Lindholm

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Laszlo Ersek <lersek@redhat.com>
CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
CC: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 ArmVirtPkg/ArmVirt.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index cf44fc7389..4f3092a201 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -39,6 +39,7 @@ [LibraryClasses.common]
 !else
   DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
 !endif
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 08/27] CryptoPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (6 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 07/27] ArmVirtPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 09/27] DynamicTablesPkg: " Vitaly Cheptsov
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Xiaoyu Lu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Jian J Wang <jian.j.wang@intel.com>
CC: Xiaoyu Lu <xiaoyux.lu@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 CryptoPkg/CryptoPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index f79ff331cf..72c8429c0a 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -55,6 +55,7 @@ [LibraryClasses]
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
   BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
@@ -88,6 +89,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
 [LibraryClasses]
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 09/27] DynamicTablesPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (7 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 08/27] CryptoPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 10/27] EmbeddedPkg: " Vitaly Cheptsov
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Sami Mujawar <Sami.Mujawar@arm.com>
CC: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 DynamicTablesPkg/DynamicTablesPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 02f04447ff..239f671952 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -24,6 +24,7 @@ [LibraryClasses]
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 10/27] EmbeddedPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (8 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 09/27] DynamicTablesPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 11/27] EmulatorPkg: " Vitaly Cheptsov
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Leif Lindholm <leif@nuviainc.com>
CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 EmbeddedPkg/EmbeddedPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc
index e88d76ab2f..28822c66f4 100644
--- a/EmbeddedPkg/EmbeddedPkg.dsc
+++ b/EmbeddedPkg/EmbeddedPkg.dsc
@@ -43,6 +43,7 @@ [SkuIds]
 [LibraryClasses.common]
 #  DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
 
 
   AndroidBootImgLib|EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 11/27] EmulatorPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (9 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 10/27] EmbeddedPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 12/27] FatPkg: " Vitaly Cheptsov
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Jordan Justen, Andrew Fish, Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Jordan Justen <jordan.l.justen@intel.com>
CC: Andrew Fish <afish@apple.com>
CC: Ray Ni <ray.ni@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 EmulatorPkg/EmulatorPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 1fc924ae5a..3d2bfaad96 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -98,6 +98,7 @@ [LibraryClasses]
   #
   # Misc
   #
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
   DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 12/27] FatPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (10 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 11/27] EmulatorPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 13/27] FmpDevicePkg: " Vitaly Cheptsov
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Ray Ni <ray.ni@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 FatPkg/FatPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/FatPkg/FatPkg.dsc b/FatPkg/FatPkg.dsc
index d86256068b..f811964085 100644
--- a/FatPkg/FatPkg.dsc
+++ b/FatPkg/FatPkg.dsc
@@ -44,6 +44,7 @@ [LibraryClasses]
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
 
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 13/27] FmpDevicePkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (11 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 12/27] FatPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 14/27] IntelFsp2Pkg: " Vitaly Cheptsov
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Michael D Kinney

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Liming Gao <liming.gao@intel.com>
CC: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 FmpDevicePkg/FmpDevicePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index b8fb9d7c19..25ce1bd783 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -47,6 +47,7 @@ [LibraryClasses]
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
 !ifdef CONTINUOUS_INTEGRATION
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 14/27] IntelFsp2Pkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (12 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 13/27] FmpDevicePkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-13  0:09   ` Chiu, Chasel
  2020-05-12 17:02 ` [PATCH V5 15/27] IntelFsp2WrapperPkg: " Vitaly Cheptsov
                   ` (12 subsequent siblings)
  26 siblings, 1 reply; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Chasel Chiu <chasel.chiu@intel.com>
CC: Nate DeSimone <nathaniel.l.desimone@intel.com>
CC: Star Zeng <star.zeng@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 IntelFsp2Pkg/IntelFsp2Pkg.dsc                                                |  1 +
 IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf |  2 +-
 IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c                    | 97 --------------------
 3 files changed, 2 insertions(+), 98 deletions(-)

diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index 02fe9cb188..3b2d2a5b8a 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -21,6 +21,7 @@ [LibraryClasses]
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
diff --git a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf
index 14b1899e6c..9198118106 100644
--- a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf
+++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf
@@ -35,11 +35,11 @@ [LibraryClasses]
   PcdLib
   PrintLib
   BaseLib
+  DebugCommonLib
   DebugDeviceLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue       ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask           ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel   ## CONSUMES
 
diff --git a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
index b34905365d..f2e1de8822 100644
--- a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
+++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
@@ -316,100 +316,3 @@ DebugClearMemory (
 {
   return Buffer;
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugPropertyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugPropertyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 15/27] IntelFsp2WrapperPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (13 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 14/27] IntelFsp2Pkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-13  0:06   ` Chiu, Chasel
  2020-05-12 17:02 ` [PATCH V5 16/27] OvmfPkg: " Vitaly Cheptsov
                   ` (11 subsequent siblings)
  26 siblings, 1 reply; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Chasel Chiu <chasel.chiu@intel.com>
CC: Nate DeSimone <nathaniel.l.desimone@intel.com>
CC: Star Zeng <star.zeng@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
index cb4f69285d..b84de7cf70 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
@@ -22,6 +22,7 @@ [LibraryClasses]
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 16/27] OvmfPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (14 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 15/27] IntelFsp2WrapperPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-13 11:11   ` [edk2-devel] " Laszlo Ersek
  2020-05-12 17:02 ` [PATCH V5 17/27] NetworkPkg: " Vitaly Cheptsov
                   ` (10 subsequent siblings)
  26 siblings, 1 reply; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Jordan Justen, Laszlo Ersek, Ard Biesheuvel

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Jordan Justen <jordan.l.justen@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c                           | 98 --------------------
 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf           |  3 +-
 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf        |  3 +-
 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf |  3 +-
 OvmfPkg/OvmfPkgIa32.dsc                                                     |  1 +
 OvmfPkg/OvmfPkgIa32X64.dsc                                                  |  1 +
 OvmfPkg/OvmfPkgX64.dsc                                                      |  1 +
 OvmfPkg/OvmfXen.dsc                                                         |  1 +
 8 files changed, 7 insertions(+), 104 deletions(-)

diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
index dffb20822d..a4e0861d00 100644
--- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
+++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
@@ -261,101 +261,3 @@ DebugClearMemory (
   //
   return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
 }
-
-
-/**
-  Returns TRUE if ASSERT() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CODE() macros are enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
-  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
-  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
-
-  @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
-  @retval  FALSE   The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
-  VOID
-  )
-{
-  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
-  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
-  @retval  TRUE    Current ErrorLevel is supported.
-  @retval  FALSE   Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
-  IN  CONST UINTN        ErrorLevel
-  )
-{
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
index 94ab910507..6cc62e3acf 100644
--- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
+++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
@@ -39,11 +39,10 @@ [LibraryClasses]
   PcdLib
   PrintLib
   BaseLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort                ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel    ## CONSUMES
-
diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
index 8f721d249d..9f5b20b314 100644
--- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
+++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
@@ -39,11 +39,10 @@ [LibraryClasses]
   PcdLib
   PrintLib
   BaseLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort                ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel    ## CONSUMES
-
diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf
index 6a85b333ee..1708fae44c 100644
--- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf
+++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf
@@ -38,11 +38,10 @@ [LibraryClasses]
   PcdLib
   PrintLib
   BaseLib
+  DebugCommonLib
   DebugPrintErrorLevelLib
 
 [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort                ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel    ## CONSUMES
-
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 7c8b51f43b..c8adf75730 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -180,6 +180,7 @@ [LibraryClasses]
 !endif
 
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index a0596c4416..4df757ae68 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -184,6 +184,7 @@ [LibraryClasses]
 !endif
 
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 2e764b6b72..f0f6226f67 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -184,6 +184,7 @@ [LibraryClasses]
 !endif
 
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 8b3615e0b0..257e2c1740 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -171,6 +171,7 @@ [LibraryClasses]
 !endif
 
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 17/27] NetworkPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (15 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 16/27] OvmfPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 18/27] ShellPkg: " Vitaly Cheptsov
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Maciej Rabeda, Jiaxin Wu, Siyuan Fu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Maciej Rabeda <maciej.rabeda@linux.intel.com>
CC: Jiaxin Wu <jiaxin.wu@intel.com>
CC: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 NetworkPkg/NetworkPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index 503d828f91..6018bc7e00 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -50,6 +50,7 @@ [LibraryClasses]
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
 !endif
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 18/27] ShellPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (16 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 17/27] NetworkPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 19/27] SecurityPkg: " Vitaly Cheptsov
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 ShellPkg/ShellPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index b7ee856b3a..27b148e6b2 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -29,6 +29,7 @@ [LibraryClasses.common]
 !else
   DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
 !endif
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 19/27] SecurityPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (17 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 18/27] ShellPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 20/27] PcAtChipsetPkg: " Vitaly Cheptsov
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Ray Ni <ray.ni@intel.com>
CC: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 SecurityPkg/SecurityPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 53fce05353..aa9814474c 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -19,6 +19,7 @@ [Defines]
 
 [LibraryClasses]
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 20/27] PcAtChipsetPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (18 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 19/27] SecurityPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 21/27] SignedCapsulePkg: " Vitaly Cheptsov
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Ray Ni <ray.ni@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 PcAtChipsetPkg/PcAtChipsetPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dsc b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
index 01a3ee716a..89d66744eb 100644
--- a/PcAtChipsetPkg/PcAtChipsetPkg.dsc
+++ b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
@@ -21,6 +21,7 @@ [LibraryClasses]
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 21/27] SignedCapsulePkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (19 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 20/27] PcAtChipsetPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 22/27] SourceLevelDebugPkg: " Vitaly Cheptsov
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Jiewen Yao, Chao Zhang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Jiewen Yao <jiewen.yao@intel.com>
CC: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 SignedCapsulePkg/SignedCapsulePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
index c5080ec1dd..c3bedb1462 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -71,6 +71,7 @@ [LibraryClasses]
   # Misc
   #
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
   PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 22/27] SourceLevelDebugPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (20 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 21/27] SignedCapsulePkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 23/27] StandaloneMmPkg: " Vitaly Cheptsov
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
index a1a1b81d03..f7468885c1 100644
--- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
+++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
@@ -24,6 +24,7 @@ [Defines]
 
 [LibraryClasses.common]
   DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 23/27] StandaloneMmPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (21 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 22/27] SourceLevelDebugPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 24/27] UefiCpuPkg: " Vitaly Cheptsov
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Sami Mujawar, Jiewen Yao, Supreeth Venkatesh

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
CC: Sami Mujawar <sami.mujawar@arm.com>
CC: Jiewen Yao <jiewen.yao@intel.com>
CC: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 StandaloneMmPkg/StandaloneMmPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index f9546e182e..5d1fb929f7 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -38,6 +38,7 @@ [LibraryClasses]
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
   FvLib|StandaloneMmPkg/Library/FvLib/FvLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (22 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 23/27] StandaloneMmPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-13 11:07   ` [edk2-devel] " Laszlo Ersek
  2020-05-12 17:02 ` [PATCH V5 25/27] UefiPayloadPkg: " Vitaly Cheptsov
                   ` (2 subsequent siblings)
  26 siblings, 1 reply; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Eric Dong, Ray Ni, Laszlo Ersek

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Eric Dong <eric.dong@intel.com>
CC: Ray Ni <ray.ni@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 UefiCpuPkg/UefiCpuPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
index d28cb5cccb..f5f407ad23 100644
--- a/UefiCpuPkg/UefiCpuPkg.dsc
+++ b/UefiCpuPkg/UefiCpuPkg.dsc
@@ -27,6 +27,7 @@ [LibraryClasses]
   CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
   UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 25/27] UefiPayloadPkg: Add support for DebugCommonLib
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (23 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 24/27] UefiCpuPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 26/27] MdePkg: Introduce assertion on constraint debug mask bit Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 27/27] MdePkg: Use assertion on constraint violation bit in SafeString Vitaly Cheptsov
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Maurice Ma, Guo Dong, Benjamin You

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

CC: Maurice Ma <maurice.ma@intel.com>
CC: Guo Dong <guo.dong@intel.com>
CC: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc    | 1 +
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 1 +
 2 files changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
index d52945442e..fdfd37f666 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
@@ -182,6 +182,7 @@ [LibraryClasses]
   #
   # Misc
   #
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
 !if $(SOURCE_DEBUG_ENABLE) == TRUE
diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
index 0736cd9954..56c8f00af3 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
@@ -183,6 +183,7 @@ [LibraryClasses]
   #
   # Misc
   #
+  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
 !if $(SOURCE_DEBUG_ENABLE) == TRUE
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 26/27] MdePkg: Introduce assertion on constraint debug mask bit
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (24 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 25/27] UefiPayloadPkg: " Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  2020-05-12 17:02 ` [PATCH V5 27/27] MdePkg: Use assertion on constraint violation bit in SafeString Vitaly Cheptsov
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

This bit allows to control assertion on constraint violation.

CC: Michael D Kinney <michael.d.kinney@intel.com>
CC: Liming Gao <liming.gao@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 MdePkg/Include/Library/DebugCommonLib.h            | 18 ++++++++++++++++++
 MdePkg/Include/Library/DebugLib.h                  | 18 ++++++++++++++++++
 MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c | 20 ++++++++++++++++++++
 MdePkg/MdePkg.dec                                  |  3 ++-
 MdePkg/MdePkg.uni                                  |  3 ++-
 5 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Library/DebugCommonLib.h b/MdePkg/Include/Library/DebugCommonLib.h
index 31249f91fa..3dc906d02a 100644
--- a/MdePkg/Include/Library/DebugCommonLib.h
+++ b/MdePkg/Include/Library/DebugCommonLib.h
@@ -21,6 +21,7 @@
 #define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED       0x08
 #define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED  0x10
 #define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED    0x20
+#define DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED  0x40
 
 //
 // Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
@@ -135,6 +136,23 @@ DebugClearMemoryEnabled (
   );
 
 
+/**
+  Returns TRUE if ASSERT_CONSTRAINT() macro is enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugAssertConstraintEnabled (
+  VOID
+  );
+
+
 /**
   Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
 
diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index a38e0e2904..8f4b9964b0 100644
--- a/MdePkg/Include/Library/DebugLib.h
+++ b/MdePkg/Include/Library/DebugLib.h
@@ -212,6 +212,24 @@ DebugClearMemory (
   #define ASSERT(Expression)
 #endif
 
+
+/**
+  Macro that calls ASSERT when constraint assertions are enabled.
+
+  If DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of PcdDebugProperyMask is set,
+  then this macro evaluates to an ASSERT macro passing in the original Expression.
+
+  @param  Expression  Boolean expression.
+
+**/
+#define ASSERT_CONSTRAINT(Expression)      \
+  do {                                     \
+    if (DebugAssertConstraintEnabled ()) { \
+      ASSERT (Expression);                 \
+    }                                      \
+  } while (FALSE)
+
+
 /**
   Macro that calls DebugPrint().
 
diff --git a/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c b/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c
index 2291fb5382..870f9ceec5 100644
--- a/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c
+++ b/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c
@@ -93,6 +93,26 @@ DebugClearMemoryEnabled (
 }
 
 
+/**
+  Returns TRUE if ASSERT_CONSTRAINT() macro is enabled.
+
+  This function returns TRUE if the DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of
+  PcdDebugProperyMask is set.  Otherwise, FALSE is returned.
+
+  @retval  TRUE    The DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of PcdDebugProperyMask is set.
+  @retval  FALSE   The DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugAssertConstraintEnabled (
+  VOID
+  )
+{
+  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_CONSTRAINT_ENABLED) != 0);
+}
+
+
 /**
   Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
 
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index a121b9ecab..05a04b92ab 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2136,9 +2136,10 @@ [PcdsFixedAtBuild,PcdsPatchableInModule]
   #  BIT3 - Enable Clear Memory.<BR>
   #  BIT4 - Enable BreakPoint as ASSERT.<BR>
   #  BIT5 - Enable DeadLoop as ASSERT.<BR>
+  #  BIT6 - Treat constraint violations as ASSERT.<BR>
   # @Prompt Debug Property.
   # @Expression  0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask & 0xC0) == 0
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|0x00000005
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|0x00000045
 
   ## This flag is used to control the print out Debug message.<BR><BR>
   #  BIT0  - Initialization message.<BR>
diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni
index 5c1fa24065..89bcf31056 100644
--- a/MdePkg/MdePkg.uni
+++ b/MdePkg/MdePkg.uni
@@ -189,7 +189,8 @@
                                                                                 "BIT2 - Enable Debug Code.<BR>\n"
                                                                                 "BIT3 - Enable Clear Memory.<BR>\n"
                                                                                 "BIT4 - Enable BreakPoint as ASSERT.<BR>\n"
-                                                                                "BIT5 - Enable DeadLoop as ASSERT.<BR>"
+                                                                                "BIT5 - Enable DeadLoop as ASSERT.<BR>\n"
+                                                                                "BIT6 - Treat constraint violations as ASSERT.<BR>"
 
 #string STR_gEfiMdePkgTokenSpaceGuid_ERR_80000002 #language en-US "Reserved bits must be set to zero."
 
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V5 27/27] MdePkg: Use assertion on constraint violation bit in SafeString
  2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
                   ` (25 preceding siblings ...)
  2020-05-12 17:02 ` [PATCH V5 26/27] MdePkg: Introduce assertion on constraint debug mask bit Vitaly Cheptsov
@ 2020-05-12 17:02 ` Vitaly Cheptsov
  26 siblings, 0 replies; 37+ messages in thread
From: Vitaly Cheptsov @ 2020-05-12 17:02 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

This change allows using SafeString interfaces for untrusted data
checking when constraint violation assertions are disabled.

Note, for packages with constraint assertions disabled this change
turn off the assertions on constraint violations.

CC: Michael D Kinney <michael.d.kinney@intel.com>
CC: Liming Gao <liming.gao@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
---
 MdePkg/Include/Library/BaseLib.h    | 120 ++++++++++----------
 MdePkg/Library/BaseLib/SafeString.c |   2 +-
 2 files changed, 61 insertions(+), 61 deletions(-)

diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index b0bbe8cef8..9c9f9fe25f 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -216,7 +216,7 @@ StrnSizeS (
 
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
   If Source is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -252,7 +252,7 @@ StrCpyS (
 
   If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
   If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -290,7 +290,7 @@ StrnCpyS (
 
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
   If Source is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -330,7 +330,7 @@ StrCatS (
 
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
   If Source is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -377,12 +377,12 @@ StrnCatS (
   be ignored. Then, the function stops at the first character that is a not a
   valid decimal character or a Null-terminator, whichever one comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than
   PcdMaximumUnicodeStringLength Unicode characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid decimal digits in the above format, then 0 is stored
   at the location pointed to by Data.
@@ -433,12 +433,12 @@ StrDecimalToUintnS (
   be ignored. Then, the function stops at the first character that is a not a
   valid decimal character or a Null-terminator, whichever one comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than
   PcdMaximumUnicodeStringLength Unicode characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid decimal digits in the above format, then 0 is stored
   at the location pointed to by Data.
@@ -494,12 +494,12 @@ StrDecimalToUint64S (
   the first character that is a not a valid hexadecimal character or NULL,
   whichever one comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than
   PcdMaximumUnicodeStringLength Unicode characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid hexadecimal digits in the above format, then 0 is
   stored at the location pointed to by Data.
@@ -555,12 +555,12 @@ StrHexToUintnS (
   the first character that is a not a valid hexadecimal character or NULL,
   whichever one comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than
   PcdMaximumUnicodeStringLength Unicode characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid hexadecimal digits in the above format, then 0 is
   stored at the location pointed to by Data.
@@ -649,7 +649,7 @@ AsciiStrnSizeS (
 
   This function is similar as strcpy_s defined in C11.
 
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -683,7 +683,7 @@ AsciiStrCpyS (
 
   This function is similar as strncpy_s defined in C11.
 
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -719,7 +719,7 @@ AsciiStrnCpyS (
 
   This function is similar as strcat_s defined in C11.
 
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -757,7 +757,7 @@ AsciiStrCatS (
 
   This function is similar as strncat_s defined in C11.
 
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -804,11 +804,11 @@ AsciiStrnCatS (
   be ignored. Then, the function stops at the first character that is a not a
   valid decimal character or a Null-terminator, whichever one comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If PcdMaximumAsciiStringLength is not zero, and String contains more than
   PcdMaximumAsciiStringLength Ascii characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid decimal digits in the above format, then 0 is stored
   at the location pointed to by Data.
@@ -859,11 +859,11 @@ AsciiStrDecimalToUintnS (
   be ignored. Then, the function stops at the first character that is a not a
   valid decimal character or a Null-terminator, whichever one comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If PcdMaximumAsciiStringLength is not zero, and String contains more than
   PcdMaximumAsciiStringLength Ascii characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid decimal digits in the above format, then 0 is stored
   at the location pointed to by Data.
@@ -918,11 +918,11 @@ AsciiStrDecimalToUint64S (
   character that is a not a valid hexadecimal character or Null-terminator,
   whichever on comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If PcdMaximumAsciiStringLength is not zero, and String contains more than
   PcdMaximumAsciiStringLength Ascii characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid hexadecimal digits in the above format, then 0 is
   stored at the location pointed to by Data.
@@ -977,11 +977,11 @@ AsciiStrHexToUintnS (
   character that is a not a valid hexadecimal character or Null-terminator,
   whichever on comes first.
 
-  If String is NULL, then ASSERT().
-  If Data is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Data is NULL, then ASSERT_CONSTRAINT().
   If PcdMaximumAsciiStringLength is not zero, and String contains more than
   PcdMaximumAsciiStringLength Ascii characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If String has no valid hexadecimal digits in the above format, then 0 is
   stored at the location pointed to by Data.
@@ -1533,15 +1533,15 @@ StrHexToUint64 (
   "::" can be used to compress one or more groups of X when X contains only 0.
   The "::" can only appear once in the String.
 
-  If String is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
 
-  If Address is NULL, then ASSERT().
+  If Address is NULL, then ASSERT_CONSTRAINT().
 
   If String is not aligned in a 16-bit boundary, then ASSERT().
 
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than
   PcdMaximumUnicodeStringLength Unicode characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If EndPointer is not NULL and Address is translated from String, a pointer
   to the character that stopped the scan is stored at the location pointed to
@@ -1594,15 +1594,15 @@ StrToIpv6Address (
   When /P is in the String, the function stops at the first character that is not
   a valid decimal digit character after P is converted.
 
-  If String is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
 
-  If Address is NULL, then ASSERT().
+  If Address is NULL, then ASSERT_CONSTRAINT().
 
   If String is not aligned in a 16-bit boundary, then ASSERT().
 
   If PcdMaximumUnicodeStringLength is not zero, and String contains more than
   PcdMaximumUnicodeStringLength Unicode characters, not including the
-  Null-terminator, then ASSERT().
+  Null-terminator, then ASSERT_CONSTRAINT().
 
   If EndPointer is not NULL and Address is translated from String, a pointer
   to the character that stopped the scan is stored at the location pointed to
@@ -1667,8 +1667,8 @@ StrToIpv4Address (
                   oo          Data4[48:55]
                   pp          Data4[56:63]
 
-  If String is NULL, then ASSERT().
-  If Guid is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Guid is NULL, then ASSERT_CONSTRAINT().
   If String is not aligned in a 16-bit boundary, then ASSERT().
 
   @param  String                   Pointer to a Null-terminated Unicode string.
@@ -1703,16 +1703,16 @@ StrToGuid (
 
   If String is not aligned in a 16-bit boundary, then ASSERT().
 
-  If String is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
 
-  If Buffer is NULL, then ASSERT().
+  If Buffer is NULL, then ASSERT_CONSTRAINT().
 
-  If Length is not multiple of 2, then ASSERT().
+  If Length is not multiple of 2, then ASSERT_CONSTRAINT().
 
   If PcdMaximumUnicodeStringLength is not zero and Length is greater than
-  PcdMaximumUnicodeStringLength, then ASSERT().
+  PcdMaximumUnicodeStringLength, then ASSERT_CONSTRAINT().
 
-  If MaxBufferSize is less than (Length / 2), then ASSERT().
+  If MaxBufferSize is less than (Length / 2), then ASSERT_CONSTRAINT().
 
   @param  String                   Pointer to a Null-terminated Unicode string.
   @param  Length                   The number of Unicode characters to decode.
@@ -1804,7 +1804,7 @@ UnicodeStrToAsciiStr (
   the upper 8 bits, then ASSERT().
 
   If Source is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -1851,7 +1851,7 @@ UnicodeStrToAsciiStrS (
   If any Unicode characters in Source contain non-zero value in the upper 8
   bits, then ASSERT().
   If Source is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -2415,9 +2415,9 @@ AsciiStrHexToUint64 (
   "::" can be used to compress one or more groups of X when X contains only 0.
   The "::" can only appear once in the String.
 
-  If String is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
 
-  If Address is NULL, then ASSERT().
+  If Address is NULL, then ASSERT_CONSTRAINT().
 
   If EndPointer is not NULL and Address is translated from String, a pointer
   to the character that stopped the scan is stored at the location pointed to
@@ -2470,9 +2470,9 @@ AsciiStrToIpv6Address (
   When /P is in the String, the function stops at the first character that is not
   a valid decimal digit character after P is converted.
 
-  If String is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
 
-  If Address is NULL, then ASSERT().
+  If Address is NULL, then ASSERT_CONSTRAINT().
 
   If EndPointer is not NULL and Address is translated from String, a pointer
   to the character that stopped the scan is stored at the location pointed to
@@ -2535,8 +2535,8 @@ AsciiStrToIpv4Address (
                   oo          Data4[48:55]
                   pp          Data4[56:63]
 
-  If String is NULL, then ASSERT().
-  If Guid is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
+  If Guid is NULL, then ASSERT_CONSTRAINT().
 
   @param  String                   Pointer to a Null-terminated ASCII string.
   @param  Guid                     Pointer to the converted GUID.
@@ -2568,16 +2568,16 @@ AsciiStrToGuid (
   decoding stops after Length of characters and outputs Buffer containing
   (Length / 2) bytes.
 
-  If String is NULL, then ASSERT().
+  If String is NULL, then ASSERT_CONSTRAINT().
 
-  If Buffer is NULL, then ASSERT().
+  If Buffer is NULL, then ASSERT_CONSTRAINT().
 
-  If Length is not multiple of 2, then ASSERT().
+  If Length is not multiple of 2, then ASSERT_CONSTRAINT().
 
   If PcdMaximumAsciiStringLength is not zero and Length is greater than
-  PcdMaximumAsciiStringLength, then ASSERT().
+  PcdMaximumAsciiStringLength, then ASSERT_CONSTRAINT().
 
-  If MaxBufferSize is less than (Length / 2), then ASSERT().
+  If MaxBufferSize is less than (Length / 2), then ASSERT_CONSTRAINT().
 
   @param  String                   Pointer to a Null-terminated ASCII string.
   @param  Length                   The number of ASCII characters to decode.
@@ -2659,7 +2659,7 @@ AsciiStrToUnicodeStr (
   equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
 
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then the Destination is unmodified.
 
@@ -2705,7 +2705,7 @@ AsciiStrToUnicodeStrS (
   ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes.
 
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
-  If an error would be returned, then the function will also ASSERT().
+  If an error would be returned, then the function will also ASSERT_CONSTRAINT().
 
   If an error is returned, then Destination and DestinationLength are
   unmodified.
diff --git a/MdePkg/Library/BaseLib/SafeString.c b/MdePkg/Library/BaseLib/SafeString.c
index 7dc03d2caa..f6cdd76c82 100644
--- a/MdePkg/Library/BaseLib/SafeString.c
+++ b/MdePkg/Library/BaseLib/SafeString.c
@@ -14,7 +14,7 @@
 
 #define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status)  \
   do { \
-    ASSERT (Expression); \
+    ASSERT_CONSTRAINT (Expression); \
     if (!(Expression)) { \
       return Status; \
     } \
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH V5 15/27] IntelFsp2WrapperPkg: Add support for DebugCommonLib
  2020-05-12 17:02 ` [PATCH V5 15/27] IntelFsp2WrapperPkg: " Vitaly Cheptsov
@ 2020-05-13  0:06   ` Chiu, Chasel
  0 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2020-05-13  0:06 UTC (permalink / raw)
  To: Vitaly Cheptsov, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L, Zeng, Star


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>


> -----Original Message-----
> From: Vitaly Cheptsov <cheptsov@ispras.ru>
> Sent: Wednesday, May 13, 2020 1:02 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH V5 15/27] IntelFsp2WrapperPkg: Add support for
> DebugCommonLib
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054
> 
> CC: Chasel Chiu <chasel.chiu@intel.com>
> CC: Nate DeSimone <nathaniel.l.desimone@intel.com>
> CC: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> index cb4f69285d..b84de7cf70 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> @@ -22,6 +22,7 @@ [LibraryClasses]
>    PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> 
>    PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> 
>    DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
> +
> DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCom
> monLib.inf
> 
> 
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Base
> DebugPrintErrorLevelLib.inf
> 
>    PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
> 
>    IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> 
> --
> 2.24.2 (Apple Git-127)


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V5 14/27] IntelFsp2Pkg: Add support for DebugCommonLib
  2020-05-12 17:02 ` [PATCH V5 14/27] IntelFsp2Pkg: " Vitaly Cheptsov
@ 2020-05-13  0:09   ` Chiu, Chasel
  0 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2020-05-13  0:09 UTC (permalink / raw)
  To: Vitaly Cheptsov, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L, Zeng, Star


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Vitaly Cheptsov <cheptsov@ispras.ru>
> Sent: Wednesday, May 13, 2020 1:02 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH V5 14/27] IntelFsp2Pkg: Add support for DebugCommonLib
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054
> 
> CC: Chasel Chiu <chasel.chiu@intel.com>
> CC: Nate DeSimone <nathaniel.l.desimone@intel.com>
> CC: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  IntelFsp2Pkg/IntelFsp2Pkg.dsc
> |  1 +
> 
> IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.
> inf |  2 +-
>  IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
> | 97 --------------------
>  3 files changed, 2 insertions(+), 98 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
> index 02fe9cb188..3b2d2a5b8a 100644
> --- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
> +++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
> @@ -21,6 +21,7 @@ [LibraryClasses]
>    BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf+
> DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCom
> monLib.inf
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Base
> DebugPrintErrorLevelLib.inf
> PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
> IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.infdiff --git
> a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPo
> rt.inf
> b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPo
> rt.inf
> index 14b1899e6c..9198118106 100644
> ---
> a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPo
> rt.inf
> +++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSeri
> +++ alPort.inf
> @@ -35,11 +35,11 @@ [LibraryClasses]
>    PcdLib   PrintLib   BaseLib+  DebugCommonLib   DebugDeviceLib
> DebugPrintErrorLevelLib  [Pcd]
> gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue       ##
> CONSUMES   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask
> ## CONSUMES-  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel
> ## CONSUMES diff --git
> a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
> b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
> index b34905365d..f2e1de8822 100644
> --- a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
> +++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
> @@ -316,100 +316,3 @@ DebugClearMemory (
>  {   return Buffer; }---/**-  Returns TRUE if ASSERT() macros are enabled.--
> This function returns TRUE if the
> DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of-
> PcdDebugPropertyMask is set.  Otherwise FALSE is returned.--  @retval
> TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
> PcdDebugPropertyMask is set.-  @retval  FALSE   The
> DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugPropertyMask
> is clear.--**/-BOOLEAN-EFIAPI-DebugAssertEnabled (-  VOID-  )-{-  return
> (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) &
> DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);-}---/**-  Returns TRUE
> if DEBUG() macros are enabled.--  This function returns TRUE if the
> DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of-
> PcdDebugPropertyMask is set.  Otherwise FALSE is returned.--  @retval
> TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
> PcdDebugPropertyMask is set.-  @retval  FALSE   The
> DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugPropertyMask is
> clear.--**/-BOOLEAN-EFIAPI-DebugPrintEnabled (-  VOID-  )-{-  return
> (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) &
> DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);-}--/**-  Returns TRUE if
> DEBUG_CODE() macros are enabled.--  This function returns TRUE if the
> DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of-  PcdDebugPropertyMask
> is set.  Otherwise FALSE is returned.--  @retval  TRUE    The
> DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPropertyMask is
> set.-  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED
> bit of PcdDebugPropertyMask is
> clear.--**/-BOOLEAN-EFIAPI-DebugCodeEnabled (-  VOID-  )-{-  return
> (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) &
> DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);-}---/**-  Returns TRUE if
> DEBUG_CLEAR_MEMORY() macro is enabled.--  This function returns TRUE
> if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of-
> PcdDebugPropertyMask is set.  Otherwise FALSE is returned.--  @retval
> TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
> PcdDebugPropertyMask is set.-  @retval  FALSE   The
> DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
> PcdDebugPropertyMask is
> clear.--**/-BOOLEAN-EFIAPI-DebugClearMemoryEnabled (-  VOID-  )-{-
> return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) &
> DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);-}--/**-  Returns TRUE
> if any one of the bit is set both in ErrorLevel and
> PcdFixedDebugPrintErrorLevel.--  This function compares the bit mask of
> ErrorLevel and PcdFixedDebugPrintErrorLevel.--  @retval  TRUE
> Current ErrorLevel is supported.-  @retval  FALSE   Current ErrorLevel is
> not supported.--**/-BOOLEAN-EFIAPI-DebugPrintLevelEnabled (-  IN
> CONST UINTN        ErrorLevel-  )-{-  return (BOOLEAN) ((ErrorLevel &
> PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);-}--
> 2.24.2 (Apple Git-127)


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-devel] [PATCH V5 07/27] ArmVirtPkg: Add support for DebugCommonLib
  2020-05-12 17:02 ` [PATCH V5 07/27] ArmVirtPkg: " Vitaly Cheptsov
@ 2020-05-13 11:05   ` Laszlo Ersek
  0 siblings, 0 replies; 37+ messages in thread
From: Laszlo Ersek @ 2020-05-13 11:05 UTC (permalink / raw)
  To: devel, cheptsov; +Cc: Ard Biesheuvel, Leif Lindholm

On 05/12/20 19:02, Vitaly Cheptsov wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054
> 
> CC: Laszlo Ersek <lersek@redhat.com>
> CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
> CC: Leif Lindholm <leif@nuviainc.com>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  ArmVirtPkg/ArmVirt.dsc.inc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index cf44fc7389..4f3092a201 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -39,6 +39,7 @@ [LibraryClasses.common]
>  !else
>    DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
>  !endif
> +  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
>    DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>  
>    BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> 

This patch is identical to the v4 one; you should have picked up my R-b
from there:

http://mid.mail-archive.com/2ea78a2b-9736-0b4e-5596-d0bd68a339fa@redhat.com
https://edk2.groups.io/g/devel/message/59199

Anyway:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
  2020-05-12 17:02 ` [PATCH V5 24/27] UefiCpuPkg: " Vitaly Cheptsov
@ 2020-05-13 11:07   ` Laszlo Ersek
  2020-05-13 14:43     ` [EXTERNAL] " Bret Barkelew
  0 siblings, 1 reply; 37+ messages in thread
From: Laszlo Ersek @ 2020-05-13 11:07 UTC (permalink / raw)
  To: devel, cheptsov; +Cc: Eric Dong, Ray Ni

On 05/12/20 19:02, Vitaly Cheptsov wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054
> 
> CC: Eric Dong <eric.dong@intel.com>
> CC: Ray Ni <ray.ni@intel.com>
> CC: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  UefiCpuPkg/UefiCpuPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
> index d28cb5cccb..f5f407ad23 100644
> --- a/UefiCpuPkg/UefiCpuPkg.dsc
> +++ b/UefiCpuPkg/UefiCpuPkg.dsc
> @@ -27,6 +27,7 @@ [LibraryClasses]
>    CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
>    DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>    SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
> +  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
>    DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>    DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
>    UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
> 

Again, identical to the v4 counterpart. Should have picked up my R-b.

http://mid.mail-archive.com/0d0b6b6f-39c8-4056-c496-07151e33cdd5@redhat.com

https://edk2.groups.io/g/devel/message/59202

anyway

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-devel] [PATCH V5 16/27] OvmfPkg: Add support for DebugCommonLib
  2020-05-12 17:02 ` [PATCH V5 16/27] OvmfPkg: " Vitaly Cheptsov
@ 2020-05-13 11:11   ` Laszlo Ersek
  0 siblings, 0 replies; 37+ messages in thread
From: Laszlo Ersek @ 2020-05-13 11:11 UTC (permalink / raw)
  To: devel, cheptsov; +Cc: Jordan Justen, Ard Biesheuvel

On 05/12/20 19:02, Vitaly Cheptsov wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054
> 
> CC: Jordan Justen <jordan.l.justen@intel.com>
> CC: Laszlo Ersek <lersek@redhat.com>
> CC: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c                           | 98 --------------------
>  OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf           |  3 +-
>  OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf        |  3 +-
>  OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf |  3 +-
>  OvmfPkg/OvmfPkgIa32.dsc                                                     |  1 +
>  OvmfPkg/OvmfPkgIa32X64.dsc                                                  |  1 +
>  OvmfPkg/OvmfPkgX64.dsc                                                      |  1 +
>  OvmfPkg/OvmfXen.dsc                                                         |  1 +
>  8 files changed, 7 insertions(+), 104 deletions(-)

Thanks for the updates.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
  2020-05-13 11:07   ` [edk2-devel] " Laszlo Ersek
@ 2020-05-13 14:43     ` Bret Barkelew
  2020-05-13 15:37       ` Laszlo Ersek
  2020-05-13 15:52       ` Laszlo Ersek
  0 siblings, 2 replies; 37+ messages in thread
From: Bret Barkelew @ 2020-05-13 14:43 UTC (permalink / raw)
  To: devel@edk2.groups.io, lersek@redhat.com, cheptsov@ispras.ru
  Cc: Dong, Eric, Ni, Ray

[-- Attachment #1: Type: text/plain, Size: 2850 bytes --]

Having only ever used PRs, what does that mean? He should have copied the “R-b” text and amended that commit message in this version?

- Bret
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Laszlo Ersek via groups.io <lersek=redhat.com@groups.io>
Sent: Wednesday, May 13, 2020 4:07:34 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; cheptsov@ispras.ru <cheptsov@ispras.ru>
Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib

On 05/12/20 19:02, Vitaly Cheptsov wrote:
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2054&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cc382255c73964cb091ed08d7f72ddd70%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637249648679637664&amp;sdata=uE8hQ1goSvrnyjx8orh6l3%2BuS%2BzlOpZtXZylsEEzHBo%3D&amp;reserved=0
>
> CC: Eric Dong <eric.dong@intel.com>
> CC: Ray Ni <ray.ni@intel.com>
> CC: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  UefiCpuPkg/UefiCpuPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
> index d28cb5cccb..f5f407ad23 100644
> --- a/UefiCpuPkg/UefiCpuPkg.dsc
> +++ b/UefiCpuPkg/UefiCpuPkg.dsc
> @@ -27,6 +27,7 @@ [LibraryClasses]
>    CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
>    DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>    SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
> +  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
>    DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>    DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
>    UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
>

Again, identical to the v4 counterpart. Should have picked up my R-b.

https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmid.mail-archive.com%2F0d0b6b6f-39c8-4056-c496-07151e33cdd5%40redhat.com&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cc382255c73964cb091ed08d7f72ddd70%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637249648679637664&amp;sdata=X%2Bvi9LqaswphH3DM63JWIK2UJP8%2B%2BxDOBEkmDCF6%2FPw%3D&amp;reserved=0

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F59202&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cc382255c73964cb091ed08d7f72ddd70%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637249648679637664&amp;sdata=ECkvl%2FeXKWbud%2FsNB2%2BusXff9HY%2F7OWx%2FFD5DejhC3c%3D&amp;reserved=0

anyway

Reviewed-by: Laszlo Ersek <lersek@redhat.com>





[-- Attachment #2: Type: text/html, Size: 5044 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
  2020-05-13 14:43     ` [EXTERNAL] " Bret Barkelew
@ 2020-05-13 15:37       ` Laszlo Ersek
  2020-05-13 15:52       ` Laszlo Ersek
  1 sibling, 0 replies; 37+ messages in thread
From: Laszlo Ersek @ 2020-05-13 15:37 UTC (permalink / raw)
  To: Bret Barkelew, devel@edk2.groups.io, cheptsov@ispras.ru
  Cc: Dong, Eric, Ni, Ray

On 05/13/20 16:43, Bret Barkelew wrote:
> Having only ever used PRs, what does that mean? He should have copied the “R-bâ€&#65533; text and amended that commit message in this version?

Yes, exactly. Perform an interactive git rebase, set "reword" as the
action for the subject patches, and append (cut and paste) the R-b tags
from the emails to the commit messages.

Thanks!
Laszlo

> 
> - Bret
> ________________________________
> From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Laszlo Ersek via groups.io <lersek=redhat.com@groups.io>
> Sent: Wednesday, May 13, 2020 4:07:34 AM
> To: devel@edk2.groups.io <devel@edk2.groups.io>; cheptsov@ispras.ru <cheptsov@ispras.ru>
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [EXTERNAL] Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
> 
> On 05/12/20 19:02, Vitaly Cheptsov wrote:
>> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2054&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cc382255c73964cb091ed08d7f72ddd70%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637249648679637664&amp;sdata=uE8hQ1goSvrnyjx8orh6l3%2BuS%2BzlOpZtXZylsEEzHBo%3D&amp;reserved=0
>>
>> CC: Eric Dong <eric.dong@intel.com>
>> CC: Ray Ni <ray.ni@intel.com>
>> CC: Laszlo Ersek <lersek@redhat.com>
>> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
>> ---
>>  UefiCpuPkg/UefiCpuPkg.dsc | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
>> index d28cb5cccb..f5f407ad23 100644
>> --- a/UefiCpuPkg/UefiCpuPkg.dsc
>> +++ b/UefiCpuPkg/UefiCpuPkg.dsc
>> @@ -27,6 +27,7 @@ [LibraryClasses]
>>    CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
>>    DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>>    SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
>> +  DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf
>>    DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>>    DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
>>    UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
>>
> 
> Again, identical to the v4 counterpart. Should have picked up my R-b.
> 
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmid.mail-archive.com%2F0d0b6b6f-39c8-4056-c496-07151e33cdd5%40redhat.com&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cc382255c73964cb091ed08d7f72ddd70%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637249648679637664&amp;sdata=X%2Bvi9LqaswphH3DM63JWIK2UJP8%2B%2BxDOBEkmDCF6%2FPw%3D&amp;reserved=0
> 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F59202&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cc382255c73964cb091ed08d7f72ddd70%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637249648679637664&amp;sdata=ECkvl%2FeXKWbud%2FsNB2%2BusXff9HY%2F7OWx%2FFD5DejhC3c%3D&amp;reserved=0
> 
> anyway
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
  2020-05-13 14:43     ` [EXTERNAL] " Bret Barkelew
  2020-05-13 15:37       ` Laszlo Ersek
@ 2020-05-13 15:52       ` Laszlo Ersek
  2020-05-13 16:06         ` Michael D Kinney
  1 sibling, 1 reply; 37+ messages in thread
From: Laszlo Ersek @ 2020-05-13 15:52 UTC (permalink / raw)
  To: devel, bret.barkelew, cheptsov@ispras.ru; +Cc: Dong, Eric, Ni, Ray

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=WINDOWS-1252, Size: 549 bytes --]

On 05/13/20 16:43, Bret Barkelew via groups.io wrote:
> Having only ever used PRs, what does that mean? He should have copied the “R-b” text and amended that commit message in this version?

... not that it matters much at this point (as we're transitioning to
github.com-based reviews), but (just for the record) I explained it in
my "unkempt git guide", in step#28 of the "Contributor workflow":

https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers#contrib-28

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH V5 24/27] UefiCpuPkg: Add support for DebugCommonLib
  2020-05-13 15:52       ` Laszlo Ersek
@ 2020-05-13 16:06         ` Michael D Kinney
  0 siblings, 0 replies; 37+ messages in thread
From: Michael D Kinney @ 2020-05-13 16:06 UTC (permalink / raw)
  To: devel@edk2.groups.io, lersek@redhat.com,
	bret.barkelew@microsoft.com, cheptsov@ispras.ru,
	Kinney, Michael D
  Cc: Dong, Eric, Ni, Ray

Hi Laszlo,

Actually it does matter.  The proposed new code review
process does not change the commit message requirements.

The tools/methods to produce correct commit message
contents are still very valuable.  There may be opportunities
to automate some of these steps, but that is captured in
Future Enhancements section of the RFC.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On
> Behalf Of Laszlo Ersek
> Sent: Wednesday, May 13, 2020 8:53 AM
> To: devel@edk2.groups.io; bret.barkelew@microsoft.com;
> cheptsov@ispras.ru
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray
> <ray.ni@intel.com>
> Subject: Re: [EXTERNAL] Re: [edk2-devel] [PATCH V5
> 24/27] UefiCpuPkg: Add support for DebugCommonLib
> 
> On 05/13/20 16:43, Bret Barkelew via groups.io wrote:
> > Having only ever used PRs, what does that mean? He
> should have copied the “R-bâ€&#65533; text and
> amended that commit message in this version?
> 
> ... not that it matters much at this point (as we're
> transitioning to
> github.com-based reviews), but (just for the record) I
> explained it in
> my "unkempt git guide", in step#28 of the "Contributor
> workflow":
> 
> https://github.com/tianocore/tianocore.github.io/wiki/L
> aszlo's-unkempt-git-guide-for-edk2-contributors-and-
> maintainers#contrib-28
> 
> Thanks
> Laszlo
> 
> 
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2020-05-13 16:07 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12 17:02 [PATCH V5 00/27] Disabling safe string constraint assertions Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 01/27] MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 02/27] UnitTestFrameworkPkg: Add support for DebugCommonLib Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 03/27] MdePkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 04/27] MdeModulePkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 05/27] ArmPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 06/27] ArmPlatformPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 07/27] ArmVirtPkg: " Vitaly Cheptsov
2020-05-13 11:05   ` [edk2-devel] " Laszlo Ersek
2020-05-12 17:02 ` [PATCH V5 08/27] CryptoPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 09/27] DynamicTablesPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 10/27] EmbeddedPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 11/27] EmulatorPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 12/27] FatPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 13/27] FmpDevicePkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 14/27] IntelFsp2Pkg: " Vitaly Cheptsov
2020-05-13  0:09   ` Chiu, Chasel
2020-05-12 17:02 ` [PATCH V5 15/27] IntelFsp2WrapperPkg: " Vitaly Cheptsov
2020-05-13  0:06   ` Chiu, Chasel
2020-05-12 17:02 ` [PATCH V5 16/27] OvmfPkg: " Vitaly Cheptsov
2020-05-13 11:11   ` [edk2-devel] " Laszlo Ersek
2020-05-12 17:02 ` [PATCH V5 17/27] NetworkPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 18/27] ShellPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 19/27] SecurityPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 20/27] PcAtChipsetPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 21/27] SignedCapsulePkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 22/27] SourceLevelDebugPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 23/27] StandaloneMmPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 24/27] UefiCpuPkg: " Vitaly Cheptsov
2020-05-13 11:07   ` [edk2-devel] " Laszlo Ersek
2020-05-13 14:43     ` [EXTERNAL] " Bret Barkelew
2020-05-13 15:37       ` Laszlo Ersek
2020-05-13 15:52       ` Laszlo Ersek
2020-05-13 16:06         ` Michael D Kinney
2020-05-12 17:02 ` [PATCH V5 25/27] UefiPayloadPkg: " Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 26/27] MdePkg: Introduce assertion on constraint debug mask bit Vitaly Cheptsov
2020-05-12 17:02 ` [PATCH V5 27/27] MdePkg: Use assertion on constraint violation bit in SafeString Vitaly Cheptsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox