From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: "Zhao, ZhiqiangX" <zhiqiangx.zhao@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH] BaseTools: Check the max size for string PCD.
Date: Wed, 31 Oct 2018 16:15:38 +0000 [thread overview]
Message-ID: <CB6E33457884FA40993F35157061515CA419546C@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <20181031103547.140588-1-zhiqiangx.zhao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Zhaozh1x
> Sent: Wednesday, October 31, 2018 3:36 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [PATCH] BaseTools: Check the max size for string PCD.
>
> According to PCD_DATABASE_INIT in
> edk2\MdeModulePkg\Include\Guid\PcdDataBaseSignatureGuid.h,
> the max size for string PCD should not exceed USHRT_MAX 65535(0xffff).
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> ---
> BaseTools/Source/Python/AutoGen/AutoGen.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index 9c3759c0f5..33f7e6471d 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -1397,6 +1397,13 @@ class PlatformAutoGen(AutoGen):
> self.VariableInfo = self.CollectVariables(self._DynamicPcdList)
> vardump = self.VariableInfo.dump()
> if vardump:
> + #
> + #According to PCD_DATABASE_INIT in
> edk2\MdeModulePkg\Include\Guid\PcdDataBaseSignatureGuid.h,
> + #the max size for string PCD should not exceed USHRT_MAX
> 65535(0xffff).
> + #typedef UINT16 SIZE_INFO;
> + #//SIZE_INFO SizeTable[];
> + if len(vardump.split(",")) > 0xffff:
> + EdkLogger.error("build", RESOURCE_OVERFLOW, 'The current
> length of PCD %s value is %d, it exceeds to the max size of String PCD.'
> %(".".join([PcdNvStoreDfBuffer.TokenSpaceGuidCName,PcdNvStoreDfBuffe
> r.TokenCName]) ,len(vardump.split(","))))
> PcdNvStoreDfBuffer.DefaultValue = vardump
> for skuname in PcdNvStoreDfBuffer.SkuInfoList:
> PcdNvStoreDfBuffer.SkuInfoList[skuname].DefaultValue =
> vardump
> --
> 2.14.1.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2018-10-31 16:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-31 10:35 [PATCH] BaseTools: Check the max size for string PCD Zhaozh1x
2018-10-31 16:15 ` Carsey, Jaben [this message]
2018-11-02 8:56 ` Feng, Bob C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CB6E33457884FA40993F35157061515CA419546C@FMSMSX103.amr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox