* [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char @ 2022-07-15 1:43 Cosmo Lai 2022-07-18 7:36 ` Wang, Jian J 2022-07-18 8:37 ` Dandan Bi 0 siblings, 2 replies; 4+ messages in thread From: Cosmo Lai @ 2022-07-15 1:43 UTC (permalink / raw) To: devel; +Cc: Cosmo Lai, Jian J Wang, Liming Gao, Dandan Bi From: Cosmo Lai <cosmo.lai@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.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Cosmo Lai <cosmo.lai@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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char 2022-07-15 1:43 [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char Cosmo Lai @ 2022-07-18 7:36 ` Wang, Jian J 2022-07-18 8:37 ` Dandan Bi 1 sibling, 0 replies; 4+ messages in thread From: Wang, Jian J @ 2022-07-18 7:36 UTC (permalink / raw) To: Lai, Cosmo, devel@edk2.groups.io; +Cc: Gao, Liming, Bi, Dandan Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Regards, Jian > -----Original Message----- > From: Lai, Cosmo <cosmo.lai@intel.com> > Sent: Friday, July 15, 2022 9:43 AM > To: devel@edk2.groups.io > Cc: Lai, Cosmo <cosmo.lai@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; > Gao, Liming <gaoliming@byosoft.com.cn>; Bi, Dandan <dandan.bi@intel.com> > Subject: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to > 104 char > > From: Cosmo Lai <cosmo.lai@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.wang@intel.com> > Cc: Liming Gao <gaoliming@byosoft.com.cn> > Cc: Dandan Bi <dandan.bi@intel.com> > > Signed-off-by: Cosmo Lai <cosmo.lai@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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char 2022-07-15 1:43 [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char Cosmo Lai 2022-07-18 7:36 ` Wang, Jian J @ 2022-07-18 8:37 ` Dandan Bi 2022-07-19 1:58 ` 回复: " gaoliming 1 sibling, 1 reply; 4+ messages in thread From: Dandan Bi @ 2022-07-18 8:37 UTC (permalink / raw) To: Lai, Cosmo, devel@edk2.groups.io; +Cc: Wang, Jian J, Gao, Liming 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.lai@intel.com> Sent: Friday, July 15, 2022 9:43 AM To: devel@edk2.groups.io Cc: Lai, Cosmo <cosmo.lai@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Bi, Dandan <dandan.bi@intel.com> Subject: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char From: Cosmo Lai <cosmo.lai@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.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Cosmo Lai <cosmo.lai@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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* 回复: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char 2022-07-18 8:37 ` Dandan Bi @ 2022-07-19 1:58 ` gaoliming 0 siblings, 0 replies; 4+ messages in thread From: gaoliming @ 2022-07-19 1:58 UTC (permalink / raw) To: 'Bi, Dandan', 'Lai, Cosmo', devel; +Cc: 'Wang, Jian J' Dandan: Good point. I suggest to also define EFI_STATUS_CODE_DATA_MAX_SIZE into the MdeModulePkg\Include\Guid\StatusCodeDataTypeDebug.h. Its value can be MAX_EXTENDED_DATA_SIZE + sizeof (EFI_STATUS_CODE_DATA) Thanks Liming > -----邮件原件----- > 发件人: Bi, Dandan <dandan.bi@intel.com> > 发送时间: 2022年7月18日 16:38 > 收件人: Lai, Cosmo <cosmo.lai@intel.com>; devel@edk2.groups.io > 抄送: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming > <gaoliming@byosoft.com.cn> > 主题: RE: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated > to 104 char > > 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.lai@intel.com> > Sent: Friday, July 15, 2022 9:43 AM > To: devel@edk2.groups.io > Cc: Lai, Cosmo <cosmo.lai@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; > Gao, Liming <gaoliming@byosoft.com.cn>; Bi, Dandan > <dandan.bi@intel.com> > Subject: [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to > 104 char > > From: Cosmo Lai <cosmo.lai@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.wang@intel.com> > Cc: Liming Gao <gaoliming@byosoft.com.cn> > Cc: Dandan Bi <dandan.bi@intel.com> > > Signed-off-by: Cosmo Lai <cosmo.lai@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 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-19 1:58 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-07-15 1:43 [PATCH v3] MdeModulePkg/Include: Long debug string is truncated to 104 char Cosmo Lai 2022-07-18 7:36 ` Wang, Jian J 2022-07-18 8:37 ` Dandan Bi 2022-07-19 1:58 ` 回复: " gaoliming
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox