mirror_edk2.git
5 years agoVlv2TbltDevicePkg:Signal EndOfDxe Event.
lushifex [Fri, 29 Jul 2016 09:31:52 +0000 (17:31 +0800)]
Vlv2TbltDevicePkg:Signal EndOfDxe Event.

According to PI spec,EndOfDxe Event should be signaled
before DxeSmmReadyToLock protocol installation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoVlv2TbltDevicePkg:Change RESET_VALUE of FADT
Wei, David [Sat, 30 Jul 2016 07:47:29 +0000 (15:47 +0800)]
Vlv2TbltDevicePkg:Change RESET_VALUE of FADT

Change RESET_VALUE of  ACPI FADT to 0x0E, which could trigger full reset.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Wei <david.wei@intel.com>
5 years agoBaseTools/Ecc: GUID checkpoint
Hess Chen [Wed, 27 Jul 2016 06:14:50 +0000 (14:14 +0800)]
BaseTools/Ecc: GUID checkpoint

Fix a bug of checking duplicate GUID

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Add build info for binary modules that only list in FDF file
Yonghong Zhu [Wed, 27 Jul 2016 08:29:38 +0000 (16:29 +0800)]
BaseTools: Add build info for binary modules that only list in FDF file

If the binary module is list in the FDF file but not list in the DSC
file, current build report would not include these binary module's info
in the report "Module section". The patch fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoShellBinPkg: Ia32/X64 Shell binary update.
Ruiyu Ni [Fri, 29 Jul 2016 02:33:26 +0000 (10:33 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg project 031403460c9782a2563a81a6065ded99046960c2.
The binaries are built with no debug information by building with "RELEASE" target.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdeModulePkg SmbiosDxe: Use definition in IndustryStandard/Smbios.h
Star Zeng [Thu, 28 Jul 2016 02:49:50 +0000 (10:49 +0800)]
MdeModulePkg SmbiosDxe: Use definition in IndustryStandard/Smbios.h

Cc: Feng Tian <feng.tian@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
5 years agoMdeModulePkg UiApp: Use definition in IndustryStandard/Smbios.h
Star Zeng [Fri, 15 Jul 2016 10:56:52 +0000 (18:56 +0800)]
MdeModulePkg UiApp: Use definition in IndustryStandard/Smbios.h

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
5 years agoIntelFrameworkModulePkg BdsDxe: Use definition in IndustryStandard/Smbios.h
Star Zeng [Fri, 15 Jul 2016 10:56:30 +0000 (18:56 +0800)]
IntelFrameworkModulePkg BdsDxe: Use definition in IndustryStandard/Smbios.h

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
5 years agoShellPkg: Unregister hotkey callback when exiting Shell
Ruiyu Ni [Thu, 28 Jul 2016 04:46:25 +0000 (12:46 +0800)]
ShellPkg: Unregister hotkey callback when exiting Shell

Commit 9168df3dea65f707d1e9c32eba5e18ef6b84e5cd
"ShellPkg/ShellProtocol.c: Handle memory allocation failure"
only keeps the protocol clean up in CleanUpShellProtocol() and
creates a new function CleanUpShellEnvironment() which calls
CleanUpShellProtocol(), then unregisters the hotkey callback.

But the commit forgot to change the Shell.c to call
CleanUpShellEnvironment() which causes the hotkey callback is
not unregistered while the callback function doesn't exist
when Shell exits.

This causes system hang when pressing CTRL+C after exiting shell.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoShellPkg: Correct files with CRLF line ending
Liming Gao [Thu, 28 Jul 2016 08:31:57 +0000 (16:31 +0800)]
ShellPkg: Correct files with CRLF line ending

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoMdePkg PeiDxePostCodeLibReportStatusCode: Correct files with CRLF line ending
Liming Gao [Thu, 28 Jul 2016 08:30:52 +0000 (16:30 +0800)]
MdePkg PeiDxePostCodeLibReportStatusCode: Correct files with CRLF line ending

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
5 years agoBaseTools: Correct ReadMe.txt file with CRLF line ending
Liming Gao [Thu, 28 Jul 2016 08:06:52 +0000 (16:06 +0800)]
BaseTools: Correct ReadMe.txt file with CRLF line ending

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
5 years agoArmPlatformPkg: Convert ArmJunoDxe to use common juno revision code
Jeremy Linton [Wed, 27 Jul 2016 19:24:36 +0000 (14:24 -0500)]
ArmPlatformPkg: Convert ArmJunoDxe to use common juno revision code

Now that the code to detect the Juno revision is in
the header go ahead and covert the ArmJunoDxe to use it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPlatformPkg: break out juno revision detection
Jeremy Linton [Wed, 27 Jul 2016 19:24:35 +0000 (14:24 -0500)]
ArmPlatformPkg: break out juno revision detection

The code to detect what juno revision we are running on
is fairly small put it in a common header where it may be
used in a couple places.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg: Add Cortex-A72 CPU type
Jeremy Linton [Wed, 27 Jul 2016 19:24:34 +0000 (14:24 -0500)]
ArmPkg: Add Cortex-A72 CPU type

Add the Cortex-A72 CPU type which is used in JunoR2.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoOvmfPkg/Sec: Support SECTION2 DXEFV types
Thomas Palmer [Wed, 27 Jul 2016 06:48:15 +0000 (01:48 -0500)]
OvmfPkg/Sec: Support SECTION2 DXEFV types

Support down-stream projects that require large DXEFV sizes greater
than 16MB by handling SECTION2 common headers. These are already
created by the build tools when necessary.

Use IS_SECTION2 and SECTION2_SIZE macros to calculate accurate image
sizes when appropriate.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: fix NB->MB typo in commit message]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
5 years agoOvmfPkg/Sec: Use EFI_COMMON_SECTION_HEADER to avoid casts
Thomas Palmer [Wed, 27 Jul 2016 06:48:14 +0000 (01:48 -0500)]
OvmfPkg/Sec: Use EFI_COMMON_SECTION_HEADER to avoid casts

Drop superfluous casts. There is no change in behavior because
EFI_FIRMWARE_VOLUME_IMAGE_SECTION is just a typedef of
EFI_COMMON_SECTION_HEADER.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoPcAtChipsetPkg/PcRtc: Fix a NULL pointer deference issue
Ruiyu Ni [Tue, 26 Jul 2016 13:07:19 +0000 (21:07 +0800)]
PcAtChipsetPkg/PcRtc: Fix a NULL pointer deference issue

When a platform which doesn't support ACPI 1.0 (no XSDT) and FADT
is not produced at the first time when ACPI table is published,
GetCenturyRtcAddress() unconditionally deference Rsdp->RsdtAddress
but Rsdp->RsdtAddress is 0 in this case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoPcAtChipsetPkg/PcRtc: Fix a stack corruption issue
Ruiyu Ni [Tue, 26 Jul 2016 10:20:05 +0000 (18:20 +0800)]
PcAtChipsetPkg/PcRtc: Fix a stack corruption issue

In 32bit environment, ScanTableInSDT() incorrectly copies 8 bytes
of data to 4-byte pointer Table, which causes the stack corruption.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoBaseTools: report error if source module INF is only list in FDF file
Yonghong Zhu [Wed, 20 Jul 2016 05:58:03 +0000 (13:58 +0800)]
BaseTools: report error if source module INF is only list in FDF file

If source module INF is not listed in DSC, it will not be built. And it
is listed in FDF, GenFds will fail to find its build output. To reminder
user this issue early, build tool should report failure to user in early
phase.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoIntelFsp2Pkg: Skip loading Microcode if MicrocodeCodeSize is zero
Yarlagadda, Satya P [Tue, 26 Jul 2016 01:14:17 +0000 (09:14 +0800)]
IntelFsp2Pkg: Skip loading Microcode if MicrocodeCodeSize is zero

During asm to Nasm conversion, we missed the code to skip loading the
microcode and return success if the size is zero. Added additional check to
report error if the microcode size is not zero but less than 2 kB.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoBaseTools/toolsetup.bat: Fix bug caused by 'CONF_PATH' not defined
Hao Wu [Tue, 26 Jul 2016 05:31:20 +0000 (13:31 +0800)]
BaseTools/toolsetup.bat: Fix bug caused by 'CONF_PATH' not defined

In batch script files, setting a variable in an 'if' block will only take
effect after the 'if' block.

This commit fixes the issue of using the variable 'CONF_PATH' right after
it is being set in an 'if' block.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoNetworkPkg UefiPxeBcDxe: Fix build error for lastest VS2015 compiler
Hao Wu [Thu, 21 Jul 2016 03:20:26 +0000 (11:20 +0800)]
NetworkPkg UefiPxeBcDxe: Fix build error for lastest VS2015 compiler

The UefiPxeBcDxe module encounters a build error for IA32 arch using the
latest version of VS2015:

UefiPxeBcDxe.lib(PxeBcBoot.obj) : error LNK2001: unresolved external
symbol __allmul

The cause is line 148 in file NetworkPkg\UefiPxeBcDxe\PxeBcBoot.c. The
third parameter for gBS->SetTimer() function is of type UINT64, so the
multiplication should use the MultU64x32() function now.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoNetworkPkg IScsiDxe: Fix build error for lastest VS2015 compiler
Hao Wu [Thu, 21 Jul 2016 03:15:19 +0000 (11:15 +0800)]
NetworkPkg IScsiDxe: Fix build error for lastest VS2015 compiler

The IScsiDxe module encounters a build error for IA32 arch using the
latest version of VS2015:

IScsiDxe.lib(IScsiProto.obj) : error LNK2001: unresolved external symbol
__allmul

The cause is line 141 in file NetworkPkg\IScsiDxe\IScsiProto.c. The third
parameter for gBS->SetTimer() function is of type UINT64, so the
multiplication should use the MultU64x32() function now.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoIntelFspWrapperPkg: Add missing License.txt.
Jiewen Yao [Sat, 23 Jul 2016 01:24:31 +0000 (09:24 +0800)]
IntelFspWrapperPkg: Add missing License.txt.

Add missing License.txt.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoIntelFspPkg: Add missing License.txt.
Jiewen Yao [Sat, 23 Jul 2016 01:24:11 +0000 (09:24 +0800)]
IntelFspPkg: Add missing License.txt.

Add missing License.txt.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoIntelFsp2WrapperPkg: Add missing License.txt.
Jiewen Yao [Sat, 23 Jul 2016 01:23:52 +0000 (09:23 +0800)]
IntelFsp2WrapperPkg: Add missing License.txt.

Add missing License.txt.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoIntelFsp2Pkg: Add missing License.txt.
Jiewen Yao [Sat, 23 Jul 2016 01:23:29 +0000 (09:23 +0800)]
IntelFsp2Pkg: Add missing License.txt.

Add missing License.txt.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoBaseTools/toolsetup: Do not set CONF_PATH when already set.
Marvin Haeuser [Wed, 20 Jul 2016 15:02:27 +0000 (23:02 +0800)]
BaseTools/toolsetup: Do not set CONF_PATH when already set.

When CONF_PATH is already set, toolsetup.bat overwrites its value.
This is not the case on Linux platforms (BuildEnv) and
contra-productive when using the same Workspace across multiple
Operating Systems.
With this patch, a check is performed prior to setting the variable.
Furthermore, it will not be scanned for Conf directories in
PACKAGES_PATH directories to respect the user's choice.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoPreserve hii section in GCC binaries
Thomas Palmer [Fri, 22 Jul 2016 02:56:49 +0000 (10:56 +0800)]
Preserve hii section in GCC binaries

According to UEFI spec:
Once an image is loaded, LoadImage() installs
EFI_HII_PACKAGE_LIST_PROTOCOL on the handle if the image contains a
custom PE/COFF resource with the type 'HII'. The protocol's
interface pointer points to the HII package list which is contained
in the resource's data.

This is controlled by the UEFI_HII_RESOURCE_SECTION define in the INF
file.  When present the HII resource is linked with the module
binary.

Unfortunately GCC-built binaries have been stripping the .hii section
entirely.  See  "[edk2] HII gEfiHiiPackageListProtocolGuid problem
with  GCC48(VS2012x86 works)"
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/13438
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/14899

This patch tells the linker to preserve the .hii sections

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Bruce Cran <bruce.cran@gmail.com>
Reviewed-by: Bruce Cran <bruce.cran@gmail.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoUpdate edksetup.bat to check NASM system environment variable
Yonghong Zhu [Fri, 15 Jul 2016 09:41:17 +0000 (17:41 +0800)]
Update edksetup.bat to check NASM system environment variable

If the NASM_PREFIX variable is not set, it would report warning message.
If there exist the C:\nasm\nasm.exe file, it would set the NASM_PREFIX
variable to C:\nasm\.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoEmulatorPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:20:57 +0000 (23:20 -0700)]
EmulatorPkg: Fix typos in comments

EFI_UNSUPPORTEDT to EFI_UNSUPPORTED

Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
5 years agoShellBinPkg: Ia32/X64 Shell binary update.
Ruiyu Ni [Mon, 25 Jul 2016 02:48:43 +0000 (10:48 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg project fc41b97f128a0c7f28a9cc250e629a0ad2262ac8.
The binaries are built with no debug information by building with "RELEASE" target.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoShellPkg/LoadPciRom: Fix the ConnectAll() implementation
Ruiyu Ni [Fri, 22 Jul 2016 02:14:05 +0000 (10:14 +0800)]
ShellPkg/LoadPciRom: Fix the ConnectAll() implementation

Old implementation depends on UefiHandleParsingLib and uses
incorrect Index to get handle type.
The simplest ConnectAll() implementation can be just to
locate all handles and call BS.ConnectController() for each
of them recursively. BS.ConnectController() does nothing
to the image handle. Such implementation is borrowed from
BDS core implementation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoShellPkg/If: Fix issue to pass static code checker
Ruiyu Ni [Fri, 22 Jul 2016 02:10:08 +0000 (10:10 +0800)]
ShellPkg/If: Fix issue to pass static code checker

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoShellPkg/UefiHandleParsingLib: Fix issue to pass static code checker
Ruiyu Ni [Fri, 22 Jul 2016 02:09:53 +0000 (10:09 +0800)]
ShellPkg/UefiHandleParsingLib: Fix issue to pass static code checker

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoShellPkg: Fix a potential NULL pointer deference issue
Ruiyu Ni [Fri, 22 Jul 2016 02:08:01 +0000 (10:08 +0800)]
ShellPkg: Fix a potential NULL pointer deference issue

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoShellPkg/DrvDiag: Fix a critical typo bug
Ruiyu Ni [Thu, 21 Jul 2016 05:07:00 +0000 (13:07 +0800)]
ShellPkg/DrvDiag: Fix a critical typo bug

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/XhciDxe: fix a bug on TRB check in async int transfer
Feng Tian [Mon, 11 Jul 2016 03:17:05 +0000 (11:17 +0800)]
MdeModulePkg/XhciDxe: fix a bug on TRB check in async int transfer

The last TRB in transfer ring is a LINK type TRB, which shouldn't
be accounted as a valid item in IsAsyncIntTrb().

Without this fix, the original algo will bring issue on those URBs
whose TRBs crosses the transfer ring.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbBus: reduce the port status polling before port reset
Feng Tian [Wed, 6 Jul 2016 02:18:37 +0000 (10:18 +0800)]
MdeModulePkg/UsbBus: reduce the port status polling before port reset

This change is used to remove the port status polling in port reset
functions.

Why it's needed is because:
1) The same polling on same port has taken place prior to this removed
one. See UsbEnumeratePort()->GetPortStatus(). So this polling in
UsbEnumerateNewDev()->ResetPort() is redundant.
2) EDKII Xhci driver hooks all GetPortStatus() operations. If we don't
remove this one, XHCI driver's XhcPollPortStatusChange() may enter twice
in reset process and wrongly think the device is unplugged.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbBus: remove redundant host controller reset in UsbBus
Feng Tian [Wed, 6 Jul 2016 02:01:30 +0000 (10:01 +0800)]
MdeModulePkg/UsbBus: remove redundant host controller reset in UsbBus

The Host Controller reset has been done at EDKII UHCI/EHCI/XHCI, The
original code will do twice host controller initialization which is
unnecessary. It also bring issues on some USB HCs.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoIntelFsp2Pkg: Remove CarBase and CarSize from FSP_GLOBAL_DATA
Satya Yarlagadda [Wed, 20 Jul 2016 06:49:15 +0000 (14:49 +0800)]
IntelFsp2Pkg: Remove CarBase and CarSize from FSP_GLOBAL_DATA

CarBase and CarSize in Fsp Global data structure are no longer needed as
Boot loader doesn't pass them to FSP even in case that BL chooses to skip calling
the FspTempRamInit API. In case of FspTempramInit is called, we can use the PCDs
to identify the CarBase and Size. Hence we remove the relevant code.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoFix IPv6 HTTPClient vendor class data
Michael Chang [Thu, 21 Jul 2016 01:58:44 +0000 (09:58 +0800)]
Fix IPv6 HTTPClient vendor class data

The size of the ClassIdentifier is apparently wrong in the structure. In my
testing it caused the vendor class data to be displayed as bogus
"HTTPClient:Arch00016x:UNDI00300". After correcting the size the vendor class
data is "HTTPClient:Arch00016:UNDI003000" which looks good to me.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
5 years agoSecurityPkg: AuthVariableLib: Revert UserPhysicalPresent feature from AuthVariableLib
Zhang, Chao B [Thu, 21 Jul 2016 06:59:54 +0000 (14:59 +0800)]
SecurityPkg: AuthVariableLib: Revert UserPhysicalPresent feature from AuthVariableLib

Physical Presence state reporting is constrained by physical presence caching in variable driver. For example, reporting must be prior to Physical Presence caching. Physical Presence state becomes constant rather than instant after caching. Therefore, PlatformSecureLib is responsible for reporting Physical Presence state in expected way.

This reverts commit 90fa53213ec458b5c4f8851c09aeb3de977531e5.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
5 years agoBaseTools/tools_def: switch GCC/X64 to the PIE small model
Ard Biesheuvel [Fri, 15 Jul 2016 22:16:11 +0000 (00:16 +0200)]
BaseTools/tools_def: switch GCC/X64 to the PIE small model

The ordinary small code model for x86_64 cannot be used in UEFI, since
it assumes the executable is loaded in the first 2 GB of memory.
Therefore, we use the large model instead, which can execute anywhere,
but uses absolute 64-bit wide quantities for all symbol references,
which is costly in terms of code size.

So switch to the PIE small code model, this uses 32-bit relative
references where possible, but does not make any assumptions about the
load address (i.e., all absolute symbol references are 64-bits wide).
Note that, due to the 'protected' visibility pragma introduced in an
earlier patch, there is no need for the EDK2 build system to deal with
GOT related ELF relocation types.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg X64: force 'protected' visibility when building with -fpic
Ard Biesheuvel [Fri, 15 Jul 2016 22:16:10 +0000 (00:16 +0200)]
MdePkg X64: force 'protected' visibility when building with -fpic

When building position independent (PIC) ELF objects, the GCC compiler
assumes that each symbol with external linkage may potentially end up
being exported from a shared library, which means that each of those
symbols may be subject to symbol preemption, i.e., the executable
linking to the shared library at runtime may override symbols exported
by the shared library, and every internal reference held by the shared
library itself *must* be made to point to the overridden version instead.

For this reason, PIC code symbol references always go via the Global
Offset Table (GOT), even if the code in question references symbols that
are defined in the same compilation unit. The GOT refers to each symbol
by absolute address, and so each entry is subject to runtime relocation.

Since not every symbol with external linkage is ultimately exported from
a shared library, the GCC compiler allows control over symbol visibility
using attributes, command line arguments and pragmas, where 'protected'
means that the symbol is only referenced by the shared library itself.
Due to the poor hygiene in EDK2 regarding the use of the 'static'
modifier, many symbols that are local to their compilation unit end up
being referenced indirectly via the GOT when building PIC code.

In UEFI, there are no shared libraries and so there is no need to deal
with symbol preemption, and we can mark every symbol reference protected.
The only method that applies to all symbol definitions as well as
declarations is the #pragma. So set the visibility 'protected' pragma when
building PIC code for X64 using GCC. Note that this affects code generated
with the -fpie compiler switch as well as the -fpic compiler switch.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg CryptoPkg EdkCompatibilityPkg: retire NO_BUILTIN_VA_FUNCS define
Ard Biesheuvel [Sun, 17 Jul 2016 10:12:16 +0000 (12:12 +0200)]
MdePkg CryptoPkg EdkCompatibilityPkg: retire NO_BUILTIN_VA_FUNCS define

This is never set anymore, so unsetting it or testing whether it is unset
no longer makes any sense.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def: enable Os optimization for GCC X64 builds
Ard Biesheuvel [Fri, 15 Jul 2016 22:16:09 +0000 (00:16 +0200)]
BaseTools/tools_def: enable Os optimization for GCC X64 builds

Now that we switched to the __builtin_ms_va_list VA_LIST type for
GCC/X64, we can trust the compiler to do the right thing even under
optimization, and so we can enable -Os optimization all the way back
to GCC44, and drop the -D define that prevents the use of the __builtin
VA_LIST types. Note that this requires the -maccumulate-outgoing-args
switch as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoEdkCompatibilityPkg: Enable new MS VA intrinsics for GNUC x86 64bits build
Ard Biesheuvel [Sun, 17 Jul 2016 10:11:32 +0000 (12:11 +0200)]
EdkCompatibilityPkg: Enable new MS VA intrinsics for GNUC x86 64bits build

Align EdkCompatibilityPkg with this change from MdePkg

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: Enable new MS VA intrinsics for GNUC x86 64bits build
Shi, Steven [Fri, 15 Jul 2016 22:16:08 +0000 (00:16 +0200)]
MdePkg: Enable new MS VA intrinsics for GNUC x86 64bits build

Both GCC and LLVM 3.8 64bits support new variable argument (VA)
intrinsics for Microsoft ABI, enable these new VA intrinsics for
GNUC family 64bits code build. These VA intrinsics are only
permitted use in 64bits code, so not use them in 32bits code build.
The original 32bits GNU VA intrinsics has the same calling convention
as MS, so we don't need change them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
[ardb: update CPP logic so that the change only applies to X64]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoCryptoPkg: set new define to avoid MS ABI VA_LIST on GCC/X64
Ard Biesheuvel [Sun, 17 Jul 2016 09:57:45 +0000 (11:57 +0200)]
CryptoPkg: set new define to avoid MS ABI VA_LIST on GCC/X64

Set the #define NO_MSABI_VA_FUNCS that will be introduced in a subsequent
patch to avoid the use of the MS ABI in variadic functions. In EDK2, such
functions normally require the EFIAPI modifier to be used, but for external
libraries such as OpenSSL, which lack these annotations, it is easier to
simply revert to the default SysV style VA_LIST ABI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: avoid __builtin_unreachable() on GCC v4.4
Ard Biesheuvel [Thu, 14 Jul 2016 12:10:14 +0000 (14:10 +0200)]
MdePkg: avoid __builtin_unreachable() on GCC v4.4

GCC v4.4 does not implement __builtin_unreachable(), so avoid using
it when building with this version or earlier.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: SMM_CPU_DATA_BLOCK is not cleared
Jeff Fan [Fri, 15 Jul 2016 06:24:28 +0000 (14:24 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: SMM_CPU_DATA_BLOCK is not cleared

The commit 8b9311 changed the zeroing of mSmmMpSyncData of type
SMM_DISPATCHER_MP_SYNC_DATA by the following patch.
 -    ZeroMem (mSmmMpSyncData, mSmmMpSyncDataSize);
 +    mSmmMpSyncData->SwitchBsp = FALSE;

mSmmMpSyncDataSize not only includes SMM_DISPATCHER_MP_SYNC_DATA, but
also includes the SMM_CPU_DATA_BLOCK array and one BOOLEAN variable
array as shown here:

  mSmmMpSyncDataSize = sizeof (SMM_DISPATCHER_MP_SYNC_DATA) +
       (sizeof (SMM_CPU_DATA_BLOCK) + sizeof (BOOLEAN)) *
       gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus;

This patch restores the original ZeroMem() to clear all CPU Sync data.
The commit 8b9311 may cause unexpected behavior.

v2:
  Mentioned CandidateBsp array in comments to make it more accurate.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
5 years agoCryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2h
Qin Long [Wed, 13 Jul 2016 05:27:11 +0000 (13:27 +0800)]
CryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2h

OpenSSL 1.0.2h was released with several severity fixes at
03-May-2016 (https://www.openssl.org/news/secadv/20160503.txt).
Upgrade the supported OpenSSL version in CryptoPkg/OpensslLib to
catch the latest release 1.0.2h.

Cc: Ting Ye <ting.ye@intel.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg RamDiskDxe: Not use hardcode 'SectionInstance' to locate SSDT
Hao Wu [Tue, 12 Jul 2016 12:10:42 +0000 (20:10 +0800)]
MdeModulePkg RamDiskDxe: Not use hardcode 'SectionInstance' to locate SSDT

This commit will scan all the EFI raw section instances within the
module's FV to make sure the NVDIMM root device SSDT can be properly
located.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
5 years agoMdePkg BaseLib: Add the missing nasm source file InternalSwitchStack.nasm
Liming Gao [Thu, 14 Jul 2016 06:02:47 +0000 (14:02 +0800)]
MdePkg BaseLib: Add the missing nasm source file InternalSwitchStack.nasm

BaseLib Ia32 InternalSwitchStack.S has no matched InternalSwitchStack.nasm.
Use ObjDump to verify the output object files be same.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
5 years agoIntelFsp2Pkg: Add missing modules in Package DSC
Liming Gao [Fri, 8 Jul 2016 14:22:51 +0000 (22:22 +0800)]
IntelFsp2Pkg: Add missing modules in Package DSC

Package DSC is used to verify the module source build.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoIntelFsp2WrapperPkg: Add missing modules in Package DSC
Liming Gao [Fri, 8 Jul 2016 14:22:26 +0000 (22:22 +0800)]
IntelFsp2WrapperPkg: Add missing modules in Package DSC

Package DSC is used to verify the module source build.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoIntelFsp2WrapperPkg SecFspWrapperPlatformSecLibSample:Update code to pass build
Liming Gao [Mon, 11 Jul 2016 02:24:16 +0000 (10:24 +0800)]
IntelFsp2WrapperPkg SecFspWrapperPlatformSecLibSample:Update code to pass build

1. Update its library class to PlatformSecLib
2. Update source code to refer to the matched header file

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
5 years agoVlv2TbltDevicePkg/PlatformInitPei: Explicit call to dump MTRR Setting
Jeff Fan [Tue, 19 Jul 2016 00:50:08 +0000 (08:50 +0800)]
Vlv2TbltDevicePkg/PlatformInitPei: Explicit call to dump MTRR Setting

Mtrr library instance removed MtrrDebugPrintAllMtrrs() from MtrrSetAllMtrrs() to
make MP safe. We need to explicitly call MtrrDebugPrintAllMtrrs() to dump MTRR
setting.

CC: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
5 years agoUefiCpuPkg/CpuDxe: StartupAllAPs in parallel mode
Jeff Fan [Fri, 1 Jul 2016 07:52:40 +0000 (15:52 +0800)]
UefiCpuPkg/CpuDxe: StartupAllAPs in parallel mode

SetMemoryAttributes() will sync BSP's MTRRs settings to all APs by StartupAllAPs
service in serial mode. It may caused much performance impact if there are too
much processors in system. This update is to invoke StartupAllAps in parallel
mode. IA32 SDM does suggest to program MTRRs in parallel mode.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
5 years agoUefiCpuPkg/MtrrLib: Add notes for usage by BSP/APs
Jeff Fan [Tue, 19 Jul 2016 00:41:57 +0000 (08:41 +0800)]
UefiCpuPkg/MtrrLib: Add notes for usage by BSP/APs

Except for MtrrSetAllMtrrs(), others services are not suggested to be invoked by
APs because they are not necessary and may invoke DEBUG() to dump MTRR setting.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed: Laszlo Ersek <lersek@redhat.com>

5 years agoUefiCpuPkg/MtrrLib: Remove MTRRs display from MtrrSetAllMtrrs()
Jeff Fan [Tue, 12 Jul 2016 14:08:58 +0000 (22:08 +0800)]
UefiCpuPkg/MtrrLib: Remove MTRRs display from MtrrSetAllMtrrs()

MtrrSetAllMtrrs() maybe used by APs to sync BSP's MTRR settings. BSP's MTRR
setting should be displayed if EFI_D_CACHE flag is set when MTRR updated. In
MtrrSetAllMtrrs(), it's not necessary to display MTRR setting again due to the
MTRR settings should be always same among BSP/APs. This updating could avoid
APs output MTRR setting at the same time and make display message corrupted.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
5 years agoShellPkg: Fix echo to support displaying special characters
Ruiyu Ni [Mon, 18 Jul 2016 09:50:20 +0000 (17:50 +0800)]
ShellPkg: Fix echo to support displaying special characters

Run 'echo -t' without the patch will get the result:
  echo: Unknown flag - '-t'
  The expected result is to display '-t' literally.
  This patch adds special handle for 'echo'. 'echo' will not use the
  general parameter parsing library.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib
Ruiyu Ni [Mon, 18 Jul 2016 09:46:59 +0000 (17:46 +0800)]
ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib
Ruiyu Ni [Mon, 18 Jul 2016 10:06:33 +0000 (18:06 +0800)]
ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib

And add Shell prefix to the two library APIs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/ShellCommandLib.h: Formalize EOL
Ruiyu Ni [Mon, 18 Jul 2016 10:01:35 +0000 (18:01 +0800)]
ShellPkg/ShellCommandLib.h: Formalize EOL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/UefiShellCommandLib.c: Formalize EOL
Ruiyu Ni [Mon, 18 Jul 2016 02:48:40 +0000 (10:48 +0800)]
ShellPkg/UefiShellCommandLib.c: Formalize EOL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg: Fix VS2010/2012 build failure
Ruiyu Ni [Tue, 19 Jul 2016 02:26:19 +0000 (10:26 +0800)]
ShellPkg: Fix VS2010/2012 build failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
5 years agoOvmfPkg/PlatformPei: silence X64 VS2015x86 warning
Laszlo Ersek [Thu, 14 Jul 2016 15:59:44 +0000 (17:59 +0200)]
OvmfPkg/PlatformPei: silence X64 VS2015x86 warning

VS2015x86 reports the following warning for
"OvmfPkg/PlatformPei/MemDetect.c":

> MemDetect.c(357): error C2220: warning treated as error - no 'object'
>                   file generated
> MemDetect.c(357): warning C4244: '=': conversion from 'UINT64' to
>                   'UINT32', possible loss of data

LowerMemorySize is first assigned from GetSystemMemorySizeBelow4gb(),
which returns UINT32. Change the type of LowerMemorySize accordingly.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoOvmfPkg/PciHostBridgeLib: silence IA32 VS2015x86 warnings
Laszlo Ersek [Thu, 14 Jul 2016 15:34:38 +0000 (17:34 +0200)]
OvmfPkg/PciHostBridgeLib: silence IA32 VS2015x86 warnings

When compiling "OvmfPkg\Library\PciHostBridgeLib\XenSupport.c" for IA32,
the VS2015x86 compiler emits the following:

> XenSupport.c(41): error C2220: warning treated as error - no 'object'
>                                file generated
> XenSupport.c(41): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(48): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(49): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(50): warning C4244: 'function': conversion from 'UINT64' to
>                                  'UINTN', possible loss of data
> XenSupport.c(222): warning C4244: 'function': conversion from 'UINT64'
>                                   to 'UINTN', possible loss of data
> XenSupport.c(241): warning C4244: 'function': conversion from 'UINT64'
>                                   to 'UINTN', possible loss of data

PciLib functions take UINTN addresses that were encoded with the
PCI_LIB_ADDRESS() macro. We carry addresses from the macro invocations to
the function calls in two UINT64 variables however. This loses no data,
but it alerts VS2015x86. Change the variable types to UINTN.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: remove superfluous ENDs from NASM source
Laszlo Ersek [Thu, 14 Jul 2016 14:36:37 +0000 (16:36 +0200)]
UefiCpuPkg/PiSmmCpuDxeSmm: remove superfluous ENDs from NASM source

Commits 28ee5816465b1 and 246cd9085f806 added these ENDs as part of the
manual conversion from *.asm files. However, the ENDs makes no sense for
NASM. Although they don't break the build, NASM complains about them:

  label alone on a line without a colon might be in error

(This NASM warning category dates back to NASM 0.95, commit
6768eb71d8deb.)

Remove the ENDs.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: bump minimum required NASM versions
Laszlo Ersek [Thu, 14 Jul 2016 11:29:10 +0000 (13:29 +0200)]
BaseTools/tools_def.template: bump minimum required NASM versions

NASM had been unable to assemble segment register operations before the
following git commit:

  http://repo.or.cz/nasm.git/commitdiff/21d4ccc3c338

That commit was first released in NASM 2.10:

  http://repo.or.cz/nasm.git/commitdiff/ff62f33da0a2

This makes NASM 2.07 unusable for edk2 in general, because now we have a
lot of X64 assembly code that works with segment registers. For example
in:

  UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm

Bump the minimum required version to 2.10, for use with GCC toolchains.

Furthermore, list NASM 2.12.01 as a requirement for all other toolchains.
In particular, for source level debugging, VS20xx requires CodeView 8
debug symbols, and only NASM 2.12.01 and later produce those. (Suggested
by Liming, Mike, and Andrew.)

Cc: Andrew Fish <afish@apple.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: http://thread.gmane.org/gmane.comp.bios.edk2.devel/14612
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/PciHostBridgeDxe: fix Ia32 GCC44 build error
Laszlo Ersek [Thu, 14 Jul 2016 09:53:50 +0000 (11:53 +0200)]
MdeModulePkg/PciHostBridgeDxe: fix Ia32 GCC44 build error

> cc1: warnings being treated as errors
> MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c:
>   In function 'GetProposedResources':
> MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c:1388:
>   error: integer constant is too large for 'long' type

Append a ULL suffix to the replacement text of PCI_RESOURCE_LESS that is
aligned with the style of the EFI_RESOURCE_SATISFIED and
EFI_RESOURCE_NOT_SATISFIED macros.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoIntelFsp2Pkg BaseFspPlatformLib: Remove Boot Loader tempram Migration
Satya Yarlagadda [Wed, 13 Jul 2016 13:02:46 +0000 (21:02 +0800)]
IntelFsp2Pkg BaseFspPlatformLib: Remove Boot Loader tempram Migration

In FSP2.0, Boot loader should migrate its temp ram before
calling the tempramexit API to tear down the tempram. so, we don't need the
function to migrate the BL TempRam in the IntelFsp2Pkg.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoShellPkg/Ping6: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:43:47 +0000 (17:43 +0800)]
ShellPkg/Ping6: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Ifconfig6: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:41:19 +0000 (17:41 +0800)]
ShellPkg/Ifconfig6: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/UefiShellLib.c: Handle memory allocation failure
Ruiyu Ni [Thu, 14 Jul 2016 05:15:34 +0000 (13:15 +0800)]
ShellPkg/UefiShellLib.c: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/IfConfig: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:39:58 +0000 (17:39 +0800)]
ShellPkg/IfConfig: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/UefiShellLib: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:39:37 +0000 (17:39 +0800)]
ShellPkg/UefiShellLib: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Mv: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:38:51 +0000 (17:38 +0800)]
ShellPkg/Mv: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Cp: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:38:24 +0000 (17:38 +0800)]
ShellPkg/Cp: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Cd: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 09:38:05 +0000 (17:38 +0800)]
ShellPkg/Cd: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/If: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 07:47:16 +0000 (15:47 +0800)]
ShellPkg/If: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/For: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 07:45:08 +0000 (15:45 +0800)]
ShellPkg/For: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/DrvDiag: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 07:44:43 +0000 (15:44 +0800)]
ShellPkg/DrvDiag: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/DrvCfg: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 07:44:23 +0000 (15:44 +0800)]
ShellPkg/DrvCfg: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/DevTree: Handle memory allocation failure
Ruiyu Ni [Wed, 13 Jul 2016 07:43:55 +0000 (15:43 +0800)]
ShellPkg/DevTree: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Edit: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 10:13:41 +0000 (18:13 +0800)]
ShellPkg/Edit: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/LoadPciRom: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 10:06:58 +0000 (18:06 +0800)]
ShellPkg/LoadPciRom: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/EfiDecompress: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 10:00:01 +0000 (18:00 +0800)]
ShellPkg/EfiDecompress: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/EfiCompress: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 09:52:41 +0000 (17:52 +0800)]
ShellPkg/EfiCompress: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/DMem: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 09:39:43 +0000 (17:39 +0800)]
ShellPkg/DMem: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/UefiShellCommandLib.c: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 09:38:06 +0000 (17:38 +0800)]
ShellPkg/UefiShellCommandLib.c: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/ConsistMapping.c: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 07:01:17 +0000 (15:01 +0800)]
ShellPkg/ConsistMapping.c: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/UefiShellBcfgCommandLib: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 05:56:04 +0000 (13:56 +0800)]
ShellPkg/UefiShellBcfgCommandLib: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/UefiHandleParsingLib.c: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 05:51:54 +0000 (13:51 +0800)]
ShellPkg/UefiHandleParsingLib.c: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Dp: Handle memory allocation failure
Ruiyu Ni [Tue, 12 Jul 2016 05:42:59 +0000 (13:42 +0800)]
ShellPkg/Dp: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/ShellProtocol.c: Handle memory allocation failure
Ruiyu Ni [Thu, 14 Jul 2016 07:04:38 +0000 (15:04 +0800)]
ShellPkg/ShellProtocol.c: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/ShellAddEnvVarToList: Handle memory allocation failure
Ruiyu Ni [Mon, 11 Jul 2016 05:56:49 +0000 (13:56 +0800)]
ShellPkg/ShellAddEnvVarToList: Handle memory allocation failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>