summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-12-25MdeModulePkg: Update PCD driver to support the optimized PcdDataBaseLiming Gao8-460/+346
https://bugzilla.tianocore.org/show_bug.cgi?id=546 BaseTools will generate the optimized PCD database to save the image size at build time for multiple SKUs. The optimized PCD database layout will be like below, the PCD database will be composed of the full default SKU data (PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA). PCD driver will build HOB to store the full default SKU data, and patch HOB data based on non-default SKU delta data for the SKU set by SetSku(), it can save memory resource at boot time. // // PCD database layout: // +---------------------------------+ // | PCD_DATABASE_INIT (DEFAULT SKU) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU A) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU B) | // +---------------------------------+ // | ...... | // +---------------------------------+ // BaseTools, PCD database and driver updates are needed for this proposal. For single SKU (default) case, this proposal is expected to have no impact. For multi-SKU case, PCD database format will be changed. So, PcdDataBase Version is also updated from 6 to 7. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25MdeModulePkg PCD: Enable Firmware to retrieve the default settingLiming Gao3-1/+111
https://bugzilla.tianocore.org/show_bug.cgi?id=611 Update PCD driver to retrieve the default setting and set the initial EFI variable when PcdSetNvStoreDefaultId is set. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25MdeModulePkg HiiDataBase: Enable Firmware to retrieve the default settingLiming Gao3-2/+523
https://bugzilla.tianocore.org/show_bug.cgi?id=611 Update HiiDataBase to retrieve the default setting and patch IFR data Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25MdeModulePkg: Enable Firmware to retrieve the default settingLiming Gao3-0/+89
https://bugzilla.tianocore.org/show_bug.cgi?id=611 Add two PCDs and new PCD DB format definition Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25MdeModulePkg VariableDxe: Update it supports normal format variable storageLiming Gao1-1/+112
PEI may report the normal format variable storage HOB for the default EFI variable. VariableDxe needs to support it and set them into NV variable region. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-25BaseTools: Fixed the issue of structure pcd filed sku inherit overrideLiming Gao2-58/+118
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Fix VPD data optimization issueLiming Gao3-16/+29
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Support nest field name in DSC/DECLiming Gao2-13/+16
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Check PCD DataType and the maxsize.BobCF2-6/+33
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Correct PCD generation logic to make sure DB is useLiming Gao1-12/+12
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Generate correct VPD PCD value to store the default settingLiming Gao2-34/+42
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Add error message if Structure PCD value is wrongLiming Gao1-3/+35
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25BaseTools: Fixed the issue of Multiple Skus are always disablesLiming Gao5-35/+67
When multiple skus are enabled, PCD database should record the supported SKUs. This patch fixes PCD database to add the missing supported SKUs. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@Intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Optimize VPD PCD value for the different SKUsLiming Gao2-27/+50
If VPD PCD value is same in the different SKUs, the different SKUs will save the same offset for this PCD in VPD region. That means there is only one PCD value copy in VPD region to save VPD space. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Update SkuId as SKU_ID type to follow current implementationLiming Gao2-22/+29
Update PCD DB and Default setting format as nature alignment. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25BaseTools: Update NV Default Header format to include the max sizeLiming Gao3-81/+130
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@Intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Report Structure PCD value and SKU, DefaultStore infoLiming Gao9-67/+299
https://bugzilla.tianocore.org/show_bug.cgi?id=706 Add Structure PCD support for Build report. Structure PCD field value described in DEC/DSC will be display in build report. And, PCD value for each SKU and Default store will also be shown in build report. Contributed-under: TianoCore Contribution Agreement 1.1 Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: PcdDataBase Optimization for multiple SkuIdsLiming Gao8-172/+254
https://bugzilla.tianocore.org/show_bug.cgi?id=546 BaseTools will generate the optimized PCD database to save the image size at build time for multiple SKUs. The optimized PCD database layout will be like below, the PCD database will be composed of the full default SKU data (PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA). PCD driver will build HOB to store the full default SKU data, and patch HOB data based on non-default SKU delta data for the SKU set by SetSku(), it can save memory resource at boot time. // // PCD database layout: // +---------------------------------+ // | PCD_DATABASE_INIT (DEFAULT SKU) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU A) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU B) | // +---------------------------------+ // | ...... | // +---------------------------------+ // BaseTools, PCD database and driver updates are needed for this proposal. For single SKU (default) case, this proposal is expected to have no impact. For multi-SKU case, PCD database format will be changed. So, PcdDataBase Version is also updated from 6 to 7. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Support Structure PCD value inherit between the different SKUsLiming Gao13-280/+533
https://bugzilla.tianocore.org/show_bug.cgi?id=543 Structure PCD field value can inherit between the different SKUIds. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Collect DynamicHii PCD values and assign it to VPD PCD ValueLiming Gao5-25/+356
https://bugzilla.tianocore.org/show_bug.cgi?id=661 Collect all DynamicHii and DynamicExHii PCD value into PCD PcdNvStoreDefaultValueBuffer, then firmware can access this PCD value to get the variable default setting. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools: Support Structure PCD value assignment in DEC/DSCLiming Gao15-2985/+3806
https://bugzilla.tianocore.org/show_bug.cgi?id=542 This is pure BaseTools enhancement to support PCD with one structure. User can specify PCD value based on its structure field. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25BaseTools: Add PcdValueCommon logic into C source CommonLibLiming Gao4-2/+978
PcdValueCommon is used to calculate structure pcd value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25BaseTools: Update Makefile to work at absolute pathLiming Gao2-3/+3
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-12-25BaseTools/GenSec: Fix potential null pointer dereferenceHao Wu1-0/+16
Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/GenSec: Fix potential memory leakHao Wu1-1/+5
Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/GenFfs: Enlarge the size of 'AlignmentBuffer'Hao Wu1-1/+6
As a workaround for the static code checkers, enlarge the size of the string buffer 'AlignmentBuffer' so that it can hold all the digits of an unsigned 32-bit integer plus the size unit character (e.g. 'M' & 'K'). Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/VfrCompile: Resolve uninit class variables in constructorHao Wu3-0/+10
The commit initializes those possibly uninitialized class variables in class constructors. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/VfrCompile: Add/refine boundary checks for strcpy/strcatHao Wu1-4/+10
Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/GenVtf: Add/refine boundary checks for strcpy/strcat callsHao Wu1-6/+37
Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/GenFv: Add/refine boundary checks for strcpy/strcat callsHao Wu1-4/+22
Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/GenBootSector: Add/refine boundary checks for strcpy/strcatHao Wu1-2/+15
Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/EfiRom: Add/refine boundary checks for strcpy/strcat callsHao Wu1-1/+7
Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/C/Common: Refine using sprintf() with '%s' in format stringHao Wu1-9/+12
The commit removes the usages of sprintf() function calls with '%s' in the format string. And uses strncpy/strncat instead to ensure the destination string buffers will not be accessed beyond their boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/C/Common: Add/refine boundary checks for strcpy/strcat callsHao Wu2-13/+20
Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/GenFv: Add check to ensure the file handle status is correctHao Wu1-18/+20
Add an extra NULL check for the file handle to ensure that its status is correct. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/VfrCompile: Assign 'NULL' for closed file handleHao Wu1-1/+2
Assign 'NULL' value to the already-closed file handle to avoid closing the handle multiple times. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/C/Common: Remove redundant type castHao Wu1-7/+5
Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/LzmaCompress: Fix possible uninitialized variableHao Wu1-1/+1
Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/EfiRom: Refine the logic in main()Hao Wu1-5/+7
This commit refines the logic for main(). It makes the logic more straightforward to prevent possible mis-reports by static code checkers. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-25BaseTools/C/Common: Add checks for array accessHao Wu2-11/+9
Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-22NetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet ↵Jiaxin Wu1-0/+1
redirect status. In HttpBootCallback(), when data type is HttpBootHttpResponse, function may meet the resource redirect error. In current implementation, function will still go ahead to find header for HTTP_HEADER_CONTENT_LENGTH, this is not expected. Function should break in redirect status error handling. Cc: Wang Fan <fan.wang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com>
2017-12-22NetworkPkg/HttpBootDxe: Avoid the potential memory leak when eror happen.Jiaxin Wu2-1/+8
Cc: Wang Fan <fan.wang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com>
2017-12-22CryptoPkg/TlsLib: Add some parameter check and clarification.Jiaxin Wu2-1/+13
Cc: Ye Ting <ting.ye@intel.com> Cc: Long Qin <qin.long@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
2017-12-22NetworkPkg: Recycle the ICMP error message in PXE driver.Fu Siyuan1-16/+14
This patch updates PxeBcIcmpErrorDpcHandle() and PxeBcIcmp6ErrorDpcHandle() to recycle the ICMP packet after copy it to PXE mode data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-12-22NetworkPkg: Remove redundant check in PXE driver.Fu Siyuan1-15/+9
The IP protocol has been configured to only receive ICMP packet in PXE driver. So this patch removes the unnecessary check for NextHeader field and replace it with ASSERT. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-12-22MdeModulePkg/DpcLib: return error if failed to locate DPC protocol.Fu Siyuan1-1/+1
This patch updates the constructor of DpcLib to return error if failed to locate DPC protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-12-22UefiCpuPkg/MpInitLib: Add missing Guard page setup for APsJian J Wang2-3/+32
AP has its own stack for code execution. If PcdCpuStackGuard is enabled, the page at the bottom of stack of AP will be disabled (NOT PRESENT) to monitor the stack overflow issue. This requires PcdCpuApStackSize to be set with value more than one page of memory. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-22MdeModulePkg: Clarify usage of PcdHeapGuardPropertyMaskJian J Wang2-4/+12
Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-22MdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.Fu Siyuan1-0/+1
This patch fixes a bug in Ip4ConfigProtocol, that new created IP interface is not freed if Open ARP protocol failed. Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-22MdeModulePkg/Ip4Dxe: Remove redundant code in Ip4Config2InitInstance().Fu Siyuan1-12/+0
Instance->Dhcp4Event is not necessary to be created in Ip4Config2InitInstance. Because it will created in Ip4StartAutoConfig() later. Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>