Hi Cosmo,

Could you set the value of macro EFI_STATUS_CODE_DATA_MAX_SIZE  less than the 
value of  MAX_EXTENDED_DATA_SIZE (also 0x200)- sizeof (EFI_STATUS_CODE_DATA)?

For example, the implementation of ReportStatusCodeEx in 
MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c has following 
check,
It may cause some debug msg missed if setting EFI_STATUS_CODE_DATA_MAX_SIZE 
same with MAX_EXTENDED_DATA_SIZE, right?

if (ExtendedDataSize > (MAX_EXTENDED_DATA_SIZE - sizeof 
(EFI_STATUS_CODE_DATA))) {
  //
  // The local variable Buffer not large enough to hold the extended data 
associated
  // with the status code being reported.
  //
  DEBUG ((DEBUG_ERROR, "Status code extended data is too large to be 
reported!\n"));
  return EFI_OUT_OF_RESOURCES;
}

Thanks,
Dandan

-----Original Message-----
From: Lai, Cosmo <cosmo....@intel.com> 
Sent: Friday, July 15, 2022 9:43 AM
To: devel@edk2.groups.io
Cc: Lai, Cosmo <cosmo....@intel.com>; Wang, Jian J <jian.j.w...@intel.com>; 
Gao, Liming <gaolim...@byosoft.com.cn>; Bi, Dandan <dandan...@intel.com>
Subject: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 
char

From: Cosmo Lai <cosmo....@intel.com>

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

The EFI_STATUS_CODE_DATA_MAX_SIZE is defined as 200 in MdeModulePkg.
After reducing 96byte buffer for variable parameters it is limited to only 104 
char debug string. This is a non-necessary limitation.
It can be set to 0x200 to follow MAX_EXTENDED_DATA_SIZE (also 0x200) which is 
used in ReportStatusCodeLib to support longer debug string.

Cc: Jian J Wang <jian.j.w...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Dandan Bi <dandan...@intel.com>

Signed-off-by: Cosmo Lai <cosmo....@intel.com>
---
 MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h 
b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h
index 16203452e4..2f408a5622 100644
--- a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h
+++ b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h
@@ -21,7 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  ///  /// The 
maximum size of an EFI_DEBUG_INFO structure.
 ///
-#define EFI_STATUS_CODE_DATA_MAX_SIZE  200
+#define EFI_STATUS_CODE_DATA_MAX_SIZE  0x200
 
 ///
 /// This structure contains the ErrorLevel passed into the DEBUG() macro, 
followed
--
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91441): https://edk2.groups.io/g/devel/message/91441
Mute This Topic: https://groups.io/mt/92401813/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to