* [PATCH v5] MdeModulePkg/Include: Long debug string is truncated to 104 char @ 2022-07-19 5:58 Cosmo Lai 2022-07-21 1:41 ` Dandan Bi 0 siblings, 1 reply; 3+ messages in thread From: Cosmo Lai @ 2022-07-19 5:58 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. This change sets EFI_STATUS_CODE_DATA_MAX_SIZE to 0x200, and moves MAX_EXTENDED_DATA_SIZE definition to the same header file with value of EFI_STATUS_CODE_DATA_MAX_SIZE + sizeof (EFI_STATUS_CODE_DATA) 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 | 10 +++++++++- .../Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c | 6 ------ .../Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c | 5 ----- .../RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c | 5 ----- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h index 16203452e4..6f2688064b 100644 --- a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h +++ b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef _STATUS_CODE_DATA_TYPE_DEBUG_H_ #define _STATUS_CODE_DATA_TYPE_DEBUG_H_ +#include <Pi/PiStatusCode.h> + /// /// The Global ID used to identify a structure of type EFI_DEBUG_INFO. /// @@ -21,7 +23,13 @@ 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 + +/// +/// Define the maximum extended data size that is supported when a +/// status code is reported. +/// +#define MAX_EXTENDED_DATA_SIZE (EFI_STATUS_CODE_DATA_MAX_SIZE + sizeof(EFI_STATUS_CODE_DATA)) /// /// This structure contains the ErrorLevel passed into the DEBUG() macro, followed diff --git a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c index ed01d8aacb..da254b755f 100644 --- a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -19,12 +19,6 @@ #include <Guid/StatusCodeDataTypeId.h> #include <Guid/StatusCodeDataTypeDebug.h> -// -// Define the maximum extended data size that is supported when a status code is -// reported at TPL_HIGH_LEVEL. -// -#define MAX_EXTENDED_DATA_SIZE 0x200 - EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL; /** diff --git a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c index b0a5f61cda..71da0e94fc 100644 --- a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c @@ -17,11 +17,6 @@ #include <Library/OemHookStatusCodeLib.h> #include <Library/PcdLib.h> -// -// Define the maximum extended data size that is supported in the PEI phase -// -#define MAX_EXTENDED_DATA_SIZE 0x200 - /** Internal worker function that reports a status code through the PEI Status Code Service or OEM Hook Status Code Library. diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c index fdda288d33..8fd20ff239 100644 --- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -21,11 +21,6 @@ #include <Guid/StatusCodeDataTypeDebug.h> #include <Guid/EventGroup.h> -// -// Define the maximum extended data size that is supported when a status code is reported. -// -#define MAX_EXTENDED_DATA_SIZE 0x200 - EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL; EFI_EVENT mReportStatusCodeLibVirtualAddressChangeEvent; EFI_EVENT mReportStatusCodeLibExitBootServicesEvent; -- 2.16.2.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v5] MdeModulePkg/Include: Long debug string is truncated to 104 char 2022-07-19 5:58 [PATCH v5] MdeModulePkg/Include: Long debug string is truncated to 104 char Cosmo Lai @ 2022-07-21 1:41 ` Dandan Bi 2022-07-21 3:06 ` 回复: " gaoliming 0 siblings, 1 reply; 3+ messages in thread From: Dandan Bi @ 2022-07-21 1:41 UTC (permalink / raw) To: Lai, Cosmo, devel@edk2.groups.io; +Cc: Wang, Jian J, Gao, Liming Reviewed-by: Dandan Bi <dandan.bi@intel.com> Thanks, Dandan -----Original Message----- From: Lai, Cosmo <cosmo.lai@intel.com> Sent: Tuesday, July 19, 2022 1:59 PM 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 v5] 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. This change sets EFI_STATUS_CODE_DATA_MAX_SIZE to 0x200, and moves MAX_EXTENDED_DATA_SIZE definition to the same header file with value of EFI_STATUS_CODE_DATA_MAX_SIZE + sizeof (EFI_STATUS_CODE_DATA) 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 | 10 +++++++++- .../Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c | 6 ------ .../Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c | 5 ----- .../RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c | 5 ----- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h index 16203452e4..6f2688064b 100644 --- a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h +++ b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef _STATUS_CODE_DATA_TYPE_DEBUG_H_ #define _STATUS_CODE_DATA_TYPE_DEBUG_H_ +#include <Pi/PiStatusCode.h> + /// /// The Global ID used to identify a structure of type EFI_DEBUG_INFO. /// @@ -21,7 +23,13 @@ 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 + +/// +/// Define the maximum extended data size that is supported when a /// +status code is reported. +/// +#define MAX_EXTENDED_DATA_SIZE (EFI_STATUS_CODE_DATA_MAX_SIZE + +sizeof(EFI_STATUS_CODE_DATA)) /// /// This structure contains the ErrorLevel passed into the DEBUG() macro, followed diff --git a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c index ed01d8aacb..da254b755f 100644 --- a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -19,12 +19,6 @@ #include <Guid/StatusCodeDataTypeId.h> #include <Guid/StatusCodeDataTypeDebug.h> -// -// Define the maximum extended data size that is supported when a status code is -// reported at TPL_HIGH_LEVEL. -// -#define MAX_EXTENDED_DATA_SIZE 0x200 - EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL; /** diff --git a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c index b0a5f61cda..71da0e94fc 100644 --- a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c @@ -17,11 +17,6 @@ #include <Library/OemHookStatusCodeLib.h> #include <Library/PcdLib.h> -// -// Define the maximum extended data size that is supported in the PEI phase -// -#define MAX_EXTENDED_DATA_SIZE 0x200 - /** Internal worker function that reports a status code through the PEI Status Code Service or OEM Hook Status Code Library. diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c index fdda288d33..8fd20ff239 100644 --- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCod +++ eLib.c @@ -21,11 +21,6 @@ #include <Guid/StatusCodeDataTypeDebug.h> #include <Guid/EventGroup.h> -// -// Define the maximum extended data size that is supported when a status code is reported. -// -#define MAX_EXTENDED_DATA_SIZE 0x200 - EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL; EFI_EVENT mReportStatusCodeLibVirtualAddressChangeEvent; EFI_EVENT mReportStatusCodeLibExitBootServicesEvent; -- 2.16.2.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* 回复: [PATCH v5] MdeModulePkg/Include: Long debug string is truncated to 104 char 2022-07-21 1:41 ` Dandan Bi @ 2022-07-21 3:06 ` gaoliming 0 siblings, 0 replies; 3+ messages in thread From: gaoliming @ 2022-07-21 3:06 UTC (permalink / raw) To: 'Bi, Dandan', 'Lai, Cosmo', devel; +Cc: 'Wang, Jian J' Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > -----邮件原件----- > 发件人: Bi, Dandan <dandan.bi@intel.com> > 发送时间: 2022年7月21日 9:42 > 收件人: 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 v5] MdeModulePkg/Include: Long debug string is truncated > to 104 char > > Reviewed-by: Dandan Bi <dandan.bi@intel.com> > > > > Thanks, > Dandan > -----Original Message----- > From: Lai, Cosmo <cosmo.lai@intel.com> > Sent: Tuesday, July 19, 2022 1:59 PM > 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 v5] 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. > This change sets EFI_STATUS_CODE_DATA_MAX_SIZE to 0x200, and moves > MAX_EXTENDED_DATA_SIZE definition to the same header file with value of > EFI_STATUS_CODE_DATA_MAX_SIZE + sizeof (EFI_STATUS_CODE_DATA) 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 | > 10 +++++++++- > .../Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c | 6 > ------ > .../Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c | 5 > ----- > .../RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c | 5 > ----- > 4 files changed, 9 insertions(+), 17 deletions(-) > > diff --git a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h > b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h > index 16203452e4..6f2688064b 100644 > --- a/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h > +++ b/MdeModulePkg/Include/Guid/StatusCodeDataTypeDebug.h > @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef > _STATUS_CODE_DATA_TYPE_DEBUG_H_ #define > _STATUS_CODE_DATA_TYPE_DEBUG_H_ > > +#include <Pi/PiStatusCode.h> > + > /// > /// The Global ID used to identify a structure of type EFI_DEBUG_INFO. > /// > @@ -21,7 +23,13 @@ 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 > + > +/// > +/// Define the maximum extended data size that is supported when a /// > +status code is reported. > +/// > +#define MAX_EXTENDED_DATA_SIZE (EFI_STATUS_CODE_DATA_MAX_SIZE > + > +sizeof(EFI_STATUS_CODE_DATA)) > > /// > /// This structure contains the ErrorLevel passed into the DEBUG() macro, > followed diff --git > a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c > b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c > index ed01d8aacb..da254b755f 100644 > --- > a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c > +++ > b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c > @@ -19,12 +19,6 @@ > #include <Guid/StatusCodeDataTypeId.h> > #include <Guid/StatusCodeDataTypeDebug.h> > > -// > -// Define the maximum extended data size that is supported when a status > code is -// reported at TPL_HIGH_LEVEL. > -// > -#define MAX_EXTENDED_DATA_SIZE 0x200 > - > EFI_STATUS_CODE_PROTOCOL > *mReportStatusCodeLibStatusCodeProtocol = NULL; > > /** > diff --git > a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c > b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c > index b0a5f61cda..71da0e94fc 100644 > --- a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c > +++ > b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c > @@ -17,11 +17,6 @@ > #include <Library/OemHookStatusCodeLib.h> #include <Library/PcdLib.h> > > -// > -// Define the maximum extended data size that is supported in the PEI phase > -// -#define MAX_EXTENDED_DATA_SIZE 0x200 > - > /** > Internal worker function that reports a status code through the PEI Status > Code Service or > OEM Hook Status Code Library. > diff --git > a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCod > eLib.c > b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCod > eLib.c > index fdda288d33..8fd20ff239 100644 > --- > a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCod > eLib.c > +++ > b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCod > +++ eLib.c > @@ -21,11 +21,6 @@ > #include <Guid/StatusCodeDataTypeDebug.h> #include > <Guid/EventGroup.h> > > -// > -// Define the maximum extended data size that is supported when a status > code is reported. > -// > -#define MAX_EXTENDED_DATA_SIZE 0x200 > - > EFI_STATUS_CODE_PROTOCOL > *mReportStatusCodeLibStatusCodeProtocol = NULL; > EFI_EVENT > mReportStatusCodeLibVirtualAddressChangeEvent; > EFI_EVENT > mReportStatusCodeLibExitBootServicesEvent; > -- > 2.16.2.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-21 3:06 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-07-19 5:58 [PATCH v5] MdeModulePkg/Include: Long debug string is truncated to 104 char Cosmo Lai 2022-07-21 1:41 ` Dandan Bi 2022-07-21 3:06 ` 回复: " gaoliming
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox