mirror_edk2.git
3 years agoUefiCpuPkg: Update AESNI support checking logic
Song, BinX [Mon, 25 Dec 2017 03:11:21 +0000 (11:11 +0800)]
UefiCpuPkg: Update AESNI support checking logic

With correct model CPU, current checking logic will
always execute AsmReadMsr64 operation and then check
ECX.AESNI[bit 25] = 1. Update checking logic to check
ECX.AESNI[bit 25] = 1 first and then do AsmReadMsr64
operation.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
3 years agoUefiCpuPkg: Delete redundant PcdGetSize PcdCpuFeaturesSupport
Song, BinX [Thu, 21 Dec 2017 12:01:18 +0000 (20:01 +0800)]
UefiCpuPkg: Delete redundant PcdGetSize PcdCpuFeaturesSupport

When CpuCommonFeaturesLib use RegisterCpuFeaturesLib to register
CPU features, the CpuFeaturesData->BitMaskSize has already been
initialized. So delete redundant PcdGetSize PcdCpuFeaturesSupport
in CpuInitDataInitialize.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
3 years agoRevert "UefiCpuPkg: Check invalid RegisterCpuFeature parameter"
Eric Dong [Thu, 21 Dec 2017 11:46:51 +0000 (19:46 +0800)]
Revert "UefiCpuPkg: Check invalid RegisterCpuFeature parameter"

This reverts commit 5c59537c1092a1372913274636a8d766fdd97e61.

Current code already has function IsCpuFeatureSupported to do
the feature validation, not need this check logic anymore.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
3 years agoBaseTools: Support PCD flexible values format
Yonghong Zhu [Tue, 26 Dec 2017 08:17:13 +0000 (16:17 +0800)]
BaseTools: Support PCD flexible values format

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
3 years agoBaseTools: Add Platform Override Build Options for PcdValueInit
Yonghong Zhu [Tue, 26 Dec 2017 05:16:17 +0000 (13:16 +0800)]
BaseTools: Add Platform Override Build Options for PcdValueInit

Add Platform's CC_FLAGS /D option for PcdValueInit generation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
3 years agoBaseTools: Update copyright year info of DSC/DEC/INF BuilData.py file
Yonghong Zhu [Tue, 26 Dec 2017 05:24:20 +0000 (13:24 +0800)]
BaseTools: Update copyright year info of DSC/DEC/INF BuilData.py file

The DecBuildData.py, DscBuildData.py and InfBuildData.py were separated
from WorkspaceDatabase.py, so we updated to use same copyright year
info.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
3 years agoEdk2: Update Maintainers.txt to remove PerformancePkg
Liming Gao [Wed, 27 Dec 2017 02:49:33 +0000 (10:49 +0800)]
Edk2: Update Maintainers.txt to remove PerformancePkg

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
3 years agoPerformancePkg: Remove it
Liming Gao [Wed, 27 Dec 2017 02:48:57 +0000 (10:48 +0800)]
PerformancePkg: Remove it

PerformancePkg contains following components:
1. TscTimerLib
2. Dp_App
3. Header files.

#1 has already been deprecated.
#2 can be removed because DpApp was added to ShellPkg.
#3 Header files are not used by DpApp and
   MdeModulePkg/PerformanceLib instances.

In summary, this package is no longer useful.

All related platforms have been updated to remove the references.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
3 years agoBaseTools: Update Python Makefile to include the new added python files
Liming Gao [Tue, 26 Dec 2017 15:13:39 +0000 (23:13 +0800)]
BaseTools: Update Python Makefile to include the new added python files

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
3 years agoBaseTools: Update SkuId checker to make sure it be valid UINT64 value
Liming Gao [Tue, 26 Dec 2017 07:59:09 +0000 (15:59 +0800)]
BaseTools: Update SkuId checker to make sure it be valid UINT64 value

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
3 years agoCryptoPkg: Remove Cryptest Application from CryptoPkg
Long Qin [Fri, 22 Dec 2017 07:01:06 +0000 (15:01 +0800)]
CryptoPkg: Remove Cryptest Application from CryptoPkg

BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=819
Remove Cryptest application from CryptoPkg, which was only for
unit test.

Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
3 years agoSecurityPkg: Remove RngTest Application from SecurityPkg
Long Qin [Fri, 22 Dec 2017 06:52:04 +0000 (14:52 +0800)]
SecurityPkg: Remove RngTest Application from SecurityPkg

BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=820
Remove the RngTest application from SecurityPkg, which was only for
unit test.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
3 years agoCryptoPkg/OpensslLib: Update OpenSSL version to 1.1.0g
Long Qin [Fri, 22 Dec 2017 06:07:39 +0000 (14:07 +0800)]
CryptoPkg/OpensslLib: Update OpenSSL version to 1.1.0g

Update the supported OpenSSL version to the latest 1.1.0g (02-Nov-2017).
The changes includes:
 - Re-generate the OpensslLib[crypto].inf using process_files.pl script
   to reflect the openssl source changes.
 - Update OpenSSL-HOWTO.txt
 - On Visual Studio Build: adding "/wd4819" to disable one addition build
   warning issue, which was already fixed in OpenSSL-HEAD
   https://github.com/openssl/openssl/pull/4691.
 - On GCC Build: openssl-1.1.0g introduced one additional build warning:
    ...\openssl\crypto\asn1\x_int64.c:105:32: error: format '%ld' expects
        argument of type 'long int', but argument 3 has type 'int64_t
        {aka long long int}' [-Werror=format=]
    return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
                                ^
    Adding "-Wno-error=format" to GCC build flag to suppress this warning,
    since we have no real printf usage in BaseCryptLib, and BIO_printf()
    was already wrappered as the dummy implementation in CryptoPkg.

Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
3 years agoMdeModulePkg/Core: Fix heap guard issues
Jian J Wang [Wed, 20 Dec 2017 08:47:15 +0000 (16:47 +0800)]
MdeModulePkg/Core: Fix heap guard issues

Three issues addressed here:

a. Make NX memory protection and heap guard to be compatible
The solution is to check PcdDxeNxMemoryProtectionPolicy in Heap Guard to
see if the free memory should be set to NX, and set the Guard page to NX
before it's freed back to memory pool. This can solve the issue which NX
setting would be overwritten by Heap Guard feature in certain
configuration.

b. Returned pool address was not 8-byte aligned sometimes
This happened only when BIT7 is not set in PcdHeapGuardPropertyMask. Since
8-byte alignment is UEFI spec required, letting allocated pool adjacent to
tail guard page cannot be guaranteed.

c. NULL address handling due to allocation failure
When allocation failure, normally a NULL will be returned. But Heap Guard
code will still try to adjust the starting address of it, which will cause
a non-NULL pointer returned.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.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>
3 years agoMdeModulePkg HiiDataBaseDxe: Add the check for the memory allocation return
Liming Gao [Tue, 26 Dec 2017 08:36:11 +0000 (16:36 +0800)]
MdeModulePkg HiiDataBaseDxe: Add the check for the memory allocation return

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
3 years agoMdeModulePkg Variable: Update Pointer Minus with UINTN type
Liming Gao [Tue, 26 Dec 2017 08:34:10 +0000 (16:34 +0800)]
MdeModulePkg Variable: Update Pointer Minus with UINTN type

In V2, reduce unnecessary () in the expression.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
3 years agoNetworkPkg/TcpDxe: Remove the redundant code.
Jiaxin Wu [Fri, 22 Dec 2017 03:32:33 +0000 (11:32 +0800)]
NetworkPkg/TcpDxe: Remove the redundant code.

The function SockGroup() is not used by any other code. So,
it can be deleted.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wang Fan <fan.wang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
3 years agoNetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use
Jiaxin Wu [Fri, 22 Dec 2017 03:28:42 +0000 (11:28 +0800)]
NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use

According the Spec, the FragmentBuffers in FragmentTable are allocated
by the application when calling Receive() function. This patch is to
check whether the FragmentBuffer is valid or not.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wang Fan <fan.wang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
3 years agoBaseTools: Fix building FatPkg failed issue
Feng, Bob C [Tue, 26 Dec 2017 03:33:33 +0000 (11:33 +0800)]
BaseTools: Fix building FatPkg failed issue

Using property instead of vairable for DecPcds.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
3 years agoFix License Header.
zwei4 [Mon, 25 Dec 2017 08:30:50 +0000 (16:30 +0800)]
Fix License Header.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wei, David <david.wei@intel.com>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Wu, Mike <mike.wu@intel.com>
3 years agoUefiCpuPkg: Update code to use new structure field names
Jian J Wang [Tue, 26 Dec 2017 00:43:59 +0000 (08:43 +0800)]
UefiCpuPkg: Update code to use new structure field names

Due to coding style fix of the structure definition in BaseLib.h, all
code referencing those structure must be updated accordingly.

Cc: Dandan Bi <dandan.bi@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: Dandan Bi <dandan.bi@intel.com>
3 years agoUefiCpuPkg/UefiCpuPkg.uni: Add missing string definition for new PCDs
Jian J Wang [Tue, 26 Dec 2017 00:43:44 +0000 (08:43 +0800)]
UefiCpuPkg/UefiCpuPkg.uni: Add missing string definition for new PCDs

Cc: Dandan Bi <dandan.bi@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: Dandan Bi <dandan.bi@intel.com>
3 years agoMdeModulePkg/Core: Coding style clean-up
Jian J Wang [Tue, 26 Dec 2017 00:43:30 +0000 (08:43 +0800)]
MdeModulePkg/Core: Coding style clean-up

Cc: Dandan Bi <dandan.bi@intel.com>
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>
3 years agoMdePkg/BaseLib.h: Coding style clean-up
Jian J Wang [Fri, 22 Dec 2017 12:47:41 +0000 (20:47 +0800)]
MdePkg/BaseLib.h: Coding style clean-up

Cc: Dandan Bi <dandan.bi@intel.com>
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: Dandan Bi <dandan.bi@intel.com>
3 years agoMdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout
Wang Fan [Mon, 25 Dec 2017 02:41:18 +0000 (10:41 +0800)]
MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout

Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
3 years agoMdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference
Liming Gao [Mon, 25 Dec 2017 10:24:19 +0000 (18:24 +0800)]
MdeModulePkg HiiDataBaseDxe: Initialize the local variable before reference

Make VS2012x86 and GCC48 pass build

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
3 years agoMdeModulePkg: Update PCD driver to support the optimized PcdDataBase
Liming Gao [Fri, 22 Dec 2017 05:41:54 +0000 (13:41 +0800)]
MdeModulePkg: Update PCD driver to support the optimized PcdDataBase

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>
3 years agoMdeModulePkg PCD: Enable Firmware to retrieve the default setting
Liming Gao [Fri, 22 Dec 2017 04:42:00 +0000 (12:42 +0800)]
MdeModulePkg PCD: Enable Firmware to retrieve the default setting

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>
3 years agoMdeModulePkg HiiDataBase: Enable Firmware to retrieve the default setting
Liming Gao [Fri, 22 Dec 2017 03:51:45 +0000 (11:51 +0800)]
MdeModulePkg HiiDataBase: Enable Firmware to retrieve the default setting

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>
3 years agoMdeModulePkg: Enable Firmware to retrieve the default setting
Liming Gao [Fri, 22 Dec 2017 03:50:49 +0000 (11:50 +0800)]
MdeModulePkg: Enable Firmware to retrieve the default setting

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>
3 years agoMdeModulePkg VariableDxe: Update it supports normal format variable storage
Liming Gao [Fri, 22 Dec 2017 04:44:19 +0000 (12:44 +0800)]
MdeModulePkg VariableDxe: Update it supports normal format variable storage

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>
3 years agoBaseTools: Fixed the issue of structure pcd filed sku inherit override
Liming Gao [Fri, 22 Dec 2017 12:53:01 +0000 (20:53 +0800)]
BaseTools: Fixed the issue of structure pcd filed sku inherit override

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>
3 years agoBaseTools: Fix VPD data optimization issue
Liming Gao [Tue, 19 Dec 2017 08:26:16 +0000 (16:26 +0800)]
BaseTools: Fix VPD data optimization issue

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>
3 years agoBaseTools: Support nest field name in DSC/DEC
Liming Gao [Tue, 19 Dec 2017 08:01:38 +0000 (16:01 +0800)]
BaseTools: Support nest field name in DSC/DEC

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>
3 years agoBaseTools: Check PCD DataType and the maxsize.
BobCF [Fri, 1 Dec 2017 06:15:59 +0000 (14:15 +0800)]
BaseTools: Check PCD DataType and the maxsize.

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>
3 years agoBaseTools: Correct PCD generation logic to make sure DB is use
Liming Gao [Mon, 18 Dec 2017 04:42:41 +0000 (12:42 +0800)]
BaseTools: Correct PCD generation logic to make sure DB is use

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>
3 years agoBaseTools: Generate correct VPD PCD value to store the default setting
Liming Gao [Fri, 22 Dec 2017 12:23:21 +0000 (20:23 +0800)]
BaseTools: Generate correct VPD PCD value to store the 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>
3 years agoBaseTools: Add error message if Structure PCD value is wrong
Liming Gao [Fri, 15 Dec 2017 04:12:58 +0000 (12:12 +0800)]
BaseTools: Add error message if Structure PCD value is wrong

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
3 years agoBaseTools: Fixed the issue of Multiple Skus are always disables
Liming Gao [Fri, 1 Dec 2017 14:00:07 +0000 (22:00 +0800)]
BaseTools: Fixed the issue of Multiple Skus are always disables

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>
3 years agoBaseTools: Optimize VPD PCD value for the different SKUs
Liming Gao [Fri, 22 Dec 2017 12:19:20 +0000 (20:19 +0800)]
BaseTools: Optimize VPD PCD value for the different SKUs

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>
3 years agoBaseTools: Update SkuId as SKU_ID type to follow current implementation
Liming Gao [Wed, 20 Dec 2017 09:16:28 +0000 (17:16 +0800)]
BaseTools: Update SkuId as SKU_ID type to follow current implementation

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>
3 years agoBaseTools: Update NV Default Header format to include the max size
Liming Gao [Fri, 22 Dec 2017 12:14:29 +0000 (20:14 +0800)]
BaseTools: Update NV Default Header format to include the max size

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>
3 years agoBaseTools: Report Structure PCD value and SKU, DefaultStore info
Liming Gao [Fri, 22 Dec 2017 12:07:54 +0000 (20:07 +0800)]
BaseTools: Report Structure PCD value and SKU, DefaultStore info

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>
3 years agoBaseTools: PcdDataBase Optimization for multiple SkuIds
Liming Gao [Fri, 22 Dec 2017 12:04:04 +0000 (20:04 +0800)]
BaseTools: PcdDataBase Optimization for multiple SkuIds

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>
3 years agoBaseTools: Support Structure PCD value inherit between the different SKUs
Liming Gao [Fri, 22 Dec 2017 12:46:15 +0000 (20:46 +0800)]
BaseTools: Support Structure PCD value inherit between the different SKUs

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>
3 years agoBaseTools: Collect DynamicHii PCD values and assign it to VPD PCD Value
Liming Gao [Fri, 24 Nov 2017 06:46:58 +0000 (14:46 +0800)]
BaseTools: Collect DynamicHii PCD values and assign it to VPD PCD Value

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>
3 years agoBaseTools: Support Structure PCD value assignment in DEC/DSC
Liming Gao [Fri, 24 Nov 2017 06:30:11 +0000 (14:30 +0800)]
BaseTools: Support Structure PCD value assignment in DEC/DSC

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>
3 years agoBaseTools: Add PcdValueCommon logic into C source CommonLib
Liming Gao [Thu, 23 Nov 2017 12:49:36 +0000 (20:49 +0800)]
BaseTools: Add PcdValueCommon logic into C source CommonLib

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>
3 years agoBaseTools: Update Makefile to work at absolute path
Liming Gao [Thu, 23 Nov 2017 12:48:10 +0000 (20:48 +0800)]
BaseTools: Update Makefile to work at absolute path

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
3 years agoBaseTools/GenSec: Fix potential null pointer dereference
Hao Wu [Mon, 18 Dec 2017 08:08:52 +0000 (16:08 +0800)]
BaseTools/GenSec: Fix potential null pointer dereference

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>
3 years agoBaseTools/GenSec: Fix potential memory leak
Hao Wu [Mon, 18 Dec 2017 07:59:53 +0000 (15:59 +0800)]
BaseTools/GenSec: Fix potential memory leak

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>
3 years agoBaseTools/GenFfs: Enlarge the size of 'AlignmentBuffer'
Hao Wu [Mon, 18 Dec 2017 07:52:33 +0000 (15:52 +0800)]
BaseTools/GenFfs: Enlarge the size of 'AlignmentBuffer'

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>
3 years agoBaseTools/VfrCompile: Resolve uninit class variables in constructor
Hao Wu [Mon, 18 Dec 2017 02:11:57 +0000 (10:11 +0800)]
BaseTools/VfrCompile: Resolve uninit class variables in constructor

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>
3 years agoBaseTools/VfrCompile: Add/refine boundary checks for strcpy/strcat
Hao Wu [Mon, 18 Dec 2017 01:20:09 +0000 (09:20 +0800)]
BaseTools/VfrCompile: Add/refine boundary checks for strcpy/strcat

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>
3 years agoBaseTools/GenVtf: Add/refine boundary checks for strcpy/strcat calls
Hao Wu [Mon, 18 Dec 2017 01:19:23 +0000 (09:19 +0800)]
BaseTools/GenVtf: Add/refine boundary checks for strcpy/strcat calls

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>
3 years agoBaseTools/GenFv: Add/refine boundary checks for strcpy/strcat calls
Hao Wu [Mon, 18 Dec 2017 01:18:58 +0000 (09:18 +0800)]
BaseTools/GenFv: Add/refine boundary checks for strcpy/strcat calls

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>
3 years agoBaseTools/GenBootSector: Add/refine boundary checks for strcpy/strcat
Hao Wu [Mon, 18 Dec 2017 01:17:52 +0000 (09:17 +0800)]
BaseTools/GenBootSector: Add/refine boundary checks for strcpy/strcat

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>
3 years agoBaseTools/EfiRom: Add/refine boundary checks for strcpy/strcat calls
Hao Wu [Mon, 18 Dec 2017 01:16:00 +0000 (09:16 +0800)]
BaseTools/EfiRom: Add/refine boundary checks for strcpy/strcat calls

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>
3 years agoBaseTools/C/Common: Refine using sprintf() with '%s' in format string
Hao Wu [Mon, 18 Dec 2017 06:26:12 +0000 (14:26 +0800)]
BaseTools/C/Common: Refine using sprintf() with '%s' in format string

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>
3 years agoBaseTools/C/Common: Add/refine boundary checks for strcpy/strcat calls
Hao Wu [Mon, 18 Dec 2017 00:57:27 +0000 (08:57 +0800)]
BaseTools/C/Common: Add/refine boundary checks for strcpy/strcat calls

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>
3 years agoBaseTools/GenFv: Add check to ensure the file handle status is correct
Hao Wu [Thu, 30 Nov 2017 08:44:14 +0000 (16:44 +0800)]
BaseTools/GenFv: Add check to ensure the file handle status is correct

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>
3 years agoBaseTools/VfrCompile: Assign 'NULL' for closed file handle
Hao Wu [Thu, 30 Nov 2017 08:40:42 +0000 (16:40 +0800)]
BaseTools/VfrCompile: Assign 'NULL' for closed file handle

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>
3 years agoBaseTools/C/Common: Remove redundant type cast
Hao Wu [Thu, 30 Nov 2017 08:38:47 +0000 (16:38 +0800)]
BaseTools/C/Common: Remove redundant type cast

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>
3 years agoBaseTools/LzmaCompress: Fix possible uninitialized variable
Hao Wu [Thu, 30 Nov 2017 07:22:48 +0000 (15:22 +0800)]
BaseTools/LzmaCompress: Fix possible uninitialized variable

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>
3 years agoBaseTools/EfiRom: Refine the logic in main()
Hao Wu [Thu, 30 Nov 2017 06:42:05 +0000 (14:42 +0800)]
BaseTools/EfiRom: Refine the logic in main()

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>
3 years agoBaseTools/C/Common: Add checks for array access
Hao Wu [Thu, 30 Nov 2017 06:29:25 +0000 (14:29 +0800)]
BaseTools/C/Common: Add checks for array access

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>
3 years agoNetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet redirect status.
Jiaxin Wu [Thu, 21 Dec 2017 06:34:58 +0000 (14:34 +0800)]
NetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet 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>
3 years agoNetworkPkg/HttpBootDxe: Avoid the potential memory leak when eror happen.
Jiaxin Wu [Thu, 21 Dec 2017 05:32:20 +0000 (13:32 +0800)]
NetworkPkg/HttpBootDxe: Avoid the potential memory leak when eror happen.

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>
3 years agoCryptoPkg/TlsLib: Add some parameter check and clarification.
Jiaxin Wu [Thu, 21 Dec 2017 05:08:31 +0000 (13:08 +0800)]
CryptoPkg/TlsLib: Add some parameter check and clarification.

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>
3 years agoNetworkPkg: Recycle the ICMP error message in PXE driver.
Fu Siyuan [Thu, 21 Dec 2017 07:19:26 +0000 (15:19 +0800)]
NetworkPkg: Recycle the ICMP error message in PXE driver.

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>
3 years agoNetworkPkg: Remove redundant check in PXE driver.
Fu Siyuan [Thu, 21 Dec 2017 07:31:22 +0000 (15:31 +0800)]
NetworkPkg: Remove redundant check in PXE driver.

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>
3 years agoMdeModulePkg/DpcLib: return error if failed to locate DPC protocol.
Fu Siyuan [Fri, 22 Dec 2017 06:13:12 +0000 (14:13 +0800)]
MdeModulePkg/DpcLib: return error if failed to locate DPC protocol.

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>
3 years agoUefiCpuPkg/MpInitLib: Add missing Guard page setup for APs
Jian J Wang [Thu, 21 Dec 2017 01:25:51 +0000 (09:25 +0800)]
UefiCpuPkg/MpInitLib: Add missing Guard page setup for APs

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>
3 years agoMdeModulePkg: Clarify usage of PcdHeapGuardPropertyMask
Jian J Wang [Thu, 21 Dec 2017 05:06:24 +0000 (13:06 +0800)]
MdeModulePkg: Clarify usage of PcdHeapGuardPropertyMask

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>
3 years agoMdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.
Fu Siyuan [Wed, 13 Dec 2017 02:07:46 +0000 (10:07 +0800)]
MdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.

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>
3 years agoMdeModulePkg/Ip4Dxe: Remove redundant code in Ip4Config2InitInstance().
Fu Siyuan [Wed, 13 Dec 2017 02:21:53 +0000 (10:21 +0800)]
MdeModulePkg/Ip4Dxe: Remove redundant code in Ip4Config2InitInstance().

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>
3 years agoMdeModulePkg/IpIoLib: Check the input parameters before use them.
Fu Siyuan [Wed, 13 Dec 2017 08:06:42 +0000 (16:06 +0800)]
MdeModulePkg/IpIoLib: Check the input parameters before use them.

This patch updates the DxeIpIoLib to check the input parameters before using.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
3 years agoMdeModulePkg/IpIoDxe: Update API description to match the function implementation.
Fu Siyuan [Wed, 13 Dec 2017 07:30:14 +0000 (15:30 +0800)]
MdeModulePkg/IpIoDxe: Update API description to match the function implementation.

This patch updates some API descriptions in DxeIpIoLib to match the real
implementation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
3 years agoMdeModulePkg/IpIoLib: add more error handling code to DxeIpIoLib.
Fu Siyuan [Wed, 13 Dec 2017 07:06:16 +0000 (15:06 +0800)]
MdeModulePkg/IpIoLib: add more error handling code to DxeIpIoLib.

In DxeIpIo, there are several places not check the returned value of called functions.
This patch is to add the error handling to these functions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
3 years agoMdePkg Acpi60.h: Add missing PCCT subspace type 1 and 2 definitions
Star Zeng [Wed, 20 Dec 2017 09:18:24 +0000 (17:18 +0800)]
MdePkg Acpi60.h: Add missing PCCT subspace type 1 and 2 definitions

Same change is done for Acpi61.h.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
3 years agoFatBinPkg: New EnhancedFatDxe binaries for IA32, X64, EBC and IPF
Ruiyu Ni [Fri, 22 Dec 2017 01:40:18 +0000 (09:40 +0800)]
FatBinPkg: New EnhancedFatDxe binaries for IA32, X64, EBC and IPF

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
3 years agoShellBinPkg: Ia32/X64 Shell binary update.
Ruiyu Ni [Fri, 22 Dec 2017 01:22:05 +0000 (09:22 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
3 years agoIntelSiliconPkg MicrocodeUpdateDxe: Fix (ExtendedTableLength & 0x3)!=0
Star Zeng [Thu, 21 Dec 2017 02:32:39 +0000 (10:32 +0800)]
IntelSiliconPkg MicrocodeUpdateDxe: Fix (ExtendedTableLength & 0x3)!=0

The first 48 bytes contain the microcode update header.
DataSize must be a multiple of DWORDs.
TotalSize is always a multiple of 1024.
Both size of CPU_MICROCODE_EXTENDED_TABLE_HEADER and
CPU_MICROCODE_EXTENDED_TABLE are multiple of DWORDs.

So (ExtendedTableLength & 0x3)!=0 should be
(ExtendedTableLength & 0x3)==0.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
3 years agoArmPkg/ArmMmuLib ARM: fix page size granularity in initial MMU setting
Michael Zimmermann [Wed, 20 Dec 2017 20:51:00 +0000 (20:51 +0000)]
ArmPkg/ArmMmuLib ARM: fix page size granularity in initial MMU setting

From what I can see this bug dates back to the commit from 2011 where
support for this was added: 2cf4b60895f8a

The first problem is that PopulateLevel2PageTable overflows the
translation table buffer because it doesn't verify that the size
actually fits within one level 2 page table.

The second problem is that the loop in FillTranslationTable doesn't
care about the PhysicalBase or the RemainLength and always substracts
one section size from RemainLength.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
3 years agoMdeModulePkg/Core: Fix incorrect memory map generated in a rare case
Jian J Wang [Sat, 16 Dec 2017 09:22:35 +0000 (17:22 +0800)]
MdeModulePkg/Core: Fix incorrect memory map generated in a rare case

The root cause is that mImagePropertiesPrivateData.CodeSegmentCountMax was
not updated with correct value due to the fact that SortImageRecord() called
before might change the content of current ImageRecord. This will in turn
cause incorrect memory map entries generated in SplitTable().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.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>
3 years agoSecurityPkg TcgMor: Remove wrong comments
Star Zeng [Mon, 18 Dec 2017 06:19:43 +0000 (14:19 +0800)]
SecurityPkg TcgMor: Remove wrong comments

and free the HandleBuffer after used.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
3 years agoMdePkg MemoryOverwriteControl.h: Correct typo 'bi' to 'bit'
Star Zeng [Fri, 4 Aug 2017 07:07:08 +0000 (15:07 +0800)]
MdePkg MemoryOverwriteControl.h: Correct typo 'bi' to 'bit'

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
3 years agoShellPkg: Fix a build error in Ping6 shell command.
fanwang2 [Mon, 18 Dec 2017 09:41:48 +0000 (17:41 +0800)]
ShellPkg: Fix a build error in Ping6 shell command.

Last check in involved a build error, this patch is to
fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
3 years agoShellPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.
fanwang2 [Mon, 18 Dec 2017 01:21:22 +0000 (09:21 +0800)]
ShellPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.

Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting
state handling, and it is forward compatible. So apply this Api in ShellPkg.

V2:
   *Define time period in a macro instead of hard code.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: fanwang2 <fan.wang@intel.com>
3 years agoNetworkPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.
fanwang2 [Mon, 18 Dec 2017 01:20:26 +0000 (09:20 +0800)]
NetworkPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.

Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting
state handling, and it is forward compatible. So apply this Api in NetworkPkg.

V2:
   *Define time period in a macro instead of hard code.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: fanwang2 <fan.wang@intel.com>
3 years agoMdeModulePkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.
fanwang2 [Mon, 18 Dec 2017 01:16:36 +0000 (09:16 +0800)]
MdeModulePkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.

Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting
state handling, and it is forward compatible. So apply this Api in MdeModulePkg.

V2:
   *Define time period in a macro instead of hard code.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: fanwang2 <fan.wang@intel.com>
3 years agoMdeModulePkg/IpIoLib: return error instead of ASSERT if input parameter is incorrect.
Fu Siyuan [Wed, 13 Dec 2017 06:41:37 +0000 (14:41 +0800)]
MdeModulePkg/IpIoLib: return error instead of ASSERT if input parameter is incorrect.

This patch updates the DxeIpIoLib to return EFI_INVALID_PARAMETER instead of
ASSERT if the input pointers are not correct.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
3 years agoMdeModulePkg/Ip4Dxe: return error on memory allocate failure instead of ASSERT.
Fu Siyuan [Wed, 13 Dec 2017 02:42:42 +0000 (10:42 +0800)]
MdeModulePkg/Ip4Dxe: return error on memory allocate failure instead of ASSERT.

This patch updates the IP4 driver to use error status code instead of ASSERT
if failed to allocate memory buffer.

Reviewed-by: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
3 years agoEmbeddedPkg: add ConsolePrefDxe to package .dsc
Leif Lindholm [Fri, 15 Dec 2017 16:22:03 +0000 (16:22 +0000)]
EmbeddedPkg: add ConsolePrefDxe to package .dsc

Add an entry for ConsolePrefDxe under [Components.common],
to permit building standalone.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
3 years agoMdeModulePkg/Variable/RuntimeDxe: Modify function return status
chenc2 [Thu, 7 Dec 2017 05:38:03 +0000 (13:38 +0800)]
MdeModulePkg/Variable/RuntimeDxe: Modify function return status

Make VariableServiceSetVariable and VariableServiceQueryVariableInfo
functions return status following UEFI 2.7 spec.

Cc: Zhang Chao <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: chenc2 <chen.a.chen@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
3 years agoUefiCpuPkg: Singularize function name
Song, BinX [Mon, 11 Dec 2017 08:16:54 +0000 (16:16 +0800)]
UefiCpuPkg: Singularize function name

Change GetSupportPcds and GetConfigurationPcds to be singular

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
3 years agoMdeModulePkg/DxeIplPeim: fix incorrect page table split during protecting
Jian J Wang [Fri, 15 Dec 2017 02:25:12 +0000 (10:25 +0800)]
MdeModulePkg/DxeIplPeim: fix incorrect page table split during protecting

The root cause of this issue is that, during splitting page table, the page
size should be the value of next level (smaller one) instead of current level.
The wrong page size will then cause wrong page table introduced, which will
break the normal boot.

Validation works include booting to Windows 10 and Fedora 26 on real Intel
platform and OVMF emulated platform in addition to manual checks on page
table with JTAG tool.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
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>
3 years agoMdeModulePkg PiSmmCore: Use SxDispatch in SmmEndOfDxeHandler()
Star Zeng [Thu, 14 Dec 2017 08:20:32 +0000 (16:20 +0800)]
MdeModulePkg PiSmmCore: Use SxDispatch in SmmEndOfDxeHandler()

As some implementation of SMM Child Dispatcher (including SxDispatch)
may deny the handler registration after SmmReadyToLock, using
SxDispatch in SmmReadyToBootHandler() will be too late.

This patch updates code to use SxDispatch in SmmEndOfDxeHandler()
instead of SmmReadyToBootHandler().

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
3 years agoMdePkg/Include/Pi: Modify specification number encoding
Hao Wu [Thu, 6 Jul 2017 05:08:28 +0000 (13:08 +0800)]
MdePkg/Include/Pi: Modify specification number encoding

Change the PEI and DXE service table revisions to 1.6.

The SMM part is already done by commit:
07c6a47e70ba54709b0e26237770f3c38685e860 &
2f208e59e4b994978a1a24affc306eb694a00327

Cc: Michael D Kinney <michael.d.kinney@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>
3 years agoMdePkg/UefiSpec.h: Update the UEFI version to reflect new revision
Hao Wu [Wed, 14 Jun 2017 07:47:38 +0000 (15:47 +0800)]
MdePkg/UefiSpec.h: Update the UEFI version to reflect new revision

Cc: Michael D Kinney <michael.d.kinney@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>