]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
6 years agoBaseTools: DSC Components section support flexible PCD
Yunhua Feng [Sat, 3 Mar 2018 01:12:18 +0000 (09:12 +0800)]
BaseTools: DSC Components section support flexible PCD

DSC Components section support flexible PCD, and for binary driver, we
need patch this value. Update the split char ',' not ', ' because some
value may have space, while others may not have this space.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
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>
6 years agoMdeModulePkg/Mtftp4Dxe: Separate the timer ticking to calculate the packet live time.
Fu Siyuan [Fri, 2 Mar 2018 03:33:28 +0000 (11:33 +0800)]
MdeModulePkg/Mtftp4Dxe: Separate the timer ticking to calculate the packet live time.

TPL deadlock issue was enrolled by the commit of 39b0867d. To resolve the issue,
this patch separated the timer ticking for all the MTFTP clients to calculate the
packet live time in TPL_NOTIFY level.

Cc: Wang Fan <fan.wang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoBaseTools: Dsc/Fdf conditional statement parse issue
Feng, YunhuaX [Thu, 1 Mar 2018 12:42:01 +0000 (20:42 +0800)]
BaseTools: Dsc/Fdf conditional statement parse issue

Set PCD value with --pcd argument not replace DSC/Fdf PCD value.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoMdePkg/Include/IndustryStandard: Add PCI Express 4.0 header file
Felix Polyudov [Fri, 2 Mar 2018 15:48:30 +0000 (23:48 +0800)]
MdePkg/Include/IndustryStandard: Add PCI Express 4.0 header file

v3: LaneEqualizationControl is changed to be an array.

v2: The structure is updated to include all the fields defined
in the PCI-E specification.

The header includes Physical Layer PCI Express Extended Capability definitions
described in section 7.7.5 of PCI Express Base Specification rev. 4.0.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Felix Polyudov <felixp@ami.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoSecurityPkg/Tcg2Pei: drop Tcg2PhysicalPresenceLib dependency
Marc-André Lureau [Fri, 23 Feb 2018 13:23:05 +0000 (14:23 +0100)]
SecurityPkg/Tcg2Pei: drop Tcg2PhysicalPresenceLib dependency

Apparently, unnecessary. Avoids extra build dependency and churn.

CC: Laszlo Ersek <lersek@redhat.com>
CC: Stefan Berger <stefanb@linux.vnet.ibm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdeModulePkg: Fix incorrect commit introduced by commit SHA-1:052c98
Dandan Bi [Thu, 1 Mar 2018 07:08:01 +0000 (15:08 +0800)]
MdeModulePkg: Fix incorrect commit introduced by commit SHA-1:052c98

The default value of PcdExtFpdtBootRecordPadSize is 0x20000
But the following commit in master update it to 0 by mistake.
SHA-1: 052c98ce246a1ffb0b4c5185a644aa9f902650f7
Subject: MdeModulePkg: Add ResetSystemPei PEIM

This patch is to restore the value.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT
Dandan Bi [Thu, 1 Mar 2018 05:40:48 +0000 (13:40 +0800)]
MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT

Currently DxeCorePerformanceLib will get SMM performance data based
on SMM communication handler. If SMM communication handler returns error,
the library will ASSERT. In fact, if SMM perf data is not found.
DXE perf data can still be dumped. So using status check instead of
ASSERT is better.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/DebugLibReportStatusCode: Fix hang if format is too long
Ruiyu Ni [Thu, 1 Mar 2018 06:33:43 +0000 (14:33 +0800)]
MdeModulePkg/DebugLibReportStatusCode: Fix hang if format is too long

The previous commit 137ed15511e2045a7333e33ae7f1e873ce1961dd
* MdeModulePkg/DebugLib: Print partial when format string is too long
copies partial format string to DEBUG_INFO buffer but when parsing
the format modifier, the original format string is still used.

The patch fixes this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNetworkPkg/HttpDxe: Support HTTP Delete Method.
Jiaxin Wu [Tue, 27 Feb 2018 03:11:46 +0000 (11:11 +0800)]
NetworkPkg/HttpDxe: Support HTTP Delete Method.

Per the request to support HttpMethodDelete:
https://bugzilla.tianocore.org/show_bug.cgi?id=879,
This patch is to enable the HTTP Delete Method.

Cc: Karunakar P <karunakarp@amiindia.co.in>
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: Fu Siyuan <siyuan.fu@intel.com>
6 years agoNetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address.
Jiaxin Wu [Thu, 1 Mar 2018 09:24:20 +0000 (17:24 +0800)]
NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address.

The issue was enrolled by the commit of ceec3638. One of the change in the commit
was to return the status from NetMapIterate in Udp6Groups function. But it should
not return EFI_ABORTED directly in case McastIp is not NULL, which means to terminate
the iteration and leave the McastIp successfully.

Cc: Wang Fan <fan.wang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoNetworkPkg/HttpBootDxe: Fix the incorrect error message output.
Jiaxin Wu [Thu, 1 Mar 2018 04:59:57 +0000 (12:59 +0800)]
NetworkPkg/HttpBootDxe: Fix the incorrect error message output.

For IPv6 case, if one invalid URL returned from DHCP server, HttpBootDxe
driver could not retrieve the URL host address from DNS server. In such a
case, the error message should be printed as:
  Error: Could not retrieve the host address from DNS server.
Instead of:
  Error: Could not discover the boot information for DHCP server.
Then, we can still output as following:
  Error: Could not retrieve NBP file size from HTTP server.

Besides, currently implementation in HttpBootLoadFile will always output
error message even the HTTP process is correct.

This patch is to fix above issue.

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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoNetworkPkg/HttpBootDxe: Correct the parameter check for the usage of HttpBootGetFileF...
Jiaxin Wu [Thu, 1 Mar 2018 03:52:28 +0000 (11:52 +0800)]
NetworkPkg/HttpBootDxe: Correct the parameter check for the usage of HttpBootGetFileFromCache.

The patch is to fix the incorrect parameter check for the HttpBootGetFileFromCache().

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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoBaseTools: report error if flag in LABEL() invalid
Feng, YunhuaX [Thu, 1 Mar 2018 08:22:08 +0000 (16:22 +0800)]
BaseTools: report error if flag in LABEL() invalid

Flag in LABEL() is not valid C variable name, will report error.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Fix the bug for display incorrect *M flag in report
Yonghong Zhu [Thu, 1 Mar 2018 05:48:31 +0000 (13:48 +0800)]
BaseTools: Fix the bug for display incorrect *M flag in report

The root cause is the byte array value in the driver Pcd, some bytes
have additional space character, while the value in DSC file doesn't
have this space, it cause the string compare return false, so we remove
the extra space.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Fix eval parse string issue
Feng, YunhuaX [Thu, 1 Mar 2018 02:16:07 +0000 (10:16 +0800)]
BaseTools: Fix eval parse string issue

eval argument start with " or ', but it is unicode string,
will encounter error:
    List = list(eval(Value)) # translate escape character
  File "<string>", line 1
    'j??=????????F??
             ^
SyntaxError: EOL while scanning string literal

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoMaintainers.txt: Add Jiewen to be co-maintainer of SecurityPkg.
Jiewen Yao [Wed, 28 Feb 2018 01:48:20 +0000 (09:48 +0800)]
Maintainers.txt: Add Jiewen to be co-maintainer of SecurityPkg.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
6 years agoBaseTools: GlobalData.gConfDirectory is None when run GenFds
Feng, YunhuaX [Thu, 1 Mar 2018 02:23:14 +0000 (10:23 +0800)]
BaseTools: GlobalData.gConfDirectory is None when run GenFds

When run GenFds,  GlobalData.gConfDirectory is None, On Linux
self._ToolChainFamily default Value is "MSFT", and then
generate the wrong PcdValueInit Makefile

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Fix the bug for single module build with GenC/GenMake
Yonghong Zhu [Wed, 28 Feb 2018 16:07:48 +0000 (00:07 +0800)]
BaseTools: Fix the bug for single module build with GenC/GenMake

copy the same logic from _BuildPa() function.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoShellPkg/UefiShellDebug1CommandsLib: remove I/O address limit from 'mm'
Ard Biesheuvel [Thu, 1 Mar 2018 09:27:31 +0000 (09:27 +0000)]
ShellPkg/UefiShellDebug1CommandsLib: remove I/O address limit from 'mm'

Neither the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL nor the EFI_CPU_IO2_PROTOCOL
impose any restrictions when it comes to the range of valid I/O
addresses. Even so, the 'mm' command in -IO mode refuses to perform
accesses to addresses >= 0xffff.

It is not up to 'mm' to impose this restriction, so remove it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoBaseTools: Align WIN_CERTIFICATE_UEFI_GUID definition to MdePkg one.
Liming Gao [Wed, 28 Feb 2018 08:35:59 +0000 (16:35 +0800)]
BaseTools: Align WIN_CERTIFICATE_UEFI_GUID definition to MdePkg one.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Enhance FV info report file path to support absolute path
Yonghong Zhu [Wed, 28 Feb 2018 03:09:39 +0000 (11:09 +0800)]
BaseTools: Enhance FV info report file path to support absolute path

When generate build report, Tool will get the info like size, Fv Name,
etc from the xx.Fv.txt file and add these info into the build report.
This patch support the xx.Fv.txt to use absolute file path format since
user may provide specified FV path.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol
Kinney, Michael D [Wed, 20 Dec 2017 20:47:39 +0000 (12:47 -0800)]
MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol

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

Based on content from the following branch/commit:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d

Add check to see if the Boot Logo 2 Protocol is available
and attempt to set the location and size of the boot logo
using both the Boot Logo Protocol and the Boot Logo 2
Protocol.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
6 years agoMdeModulePkg/BootGraphicsResourceDxe: Add Boot Logo 2 Protocol
Michael D Kinney [Tue, 2 Jan 2018 16:46:58 +0000 (08:46 -0800)]
MdeModulePkg/BootGraphicsResourceDxe: Add Boot Logo 2 Protocol

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

Based on content from the following branch/commit:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d

Update BootGraphicsResourceDxe to produce both the Boot Logo
Protocol and the Boot Logo 2 Protocol.

The Boot Logo 2 Protocol service GetBootLogo() is amended
to return the pointer to the GOP BLT buffer previously
registered with the SetBootLogo() service.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
6 years agoMdeModulePkg: Add Boot Logo 2 Protocol
Kinney, Michael D [Wed, 20 Dec 2017 20:43:50 +0000 (12:43 -0800)]
MdeModulePkg: Add Boot Logo 2 Protocol

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

Based on content from the following branch/commit:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d

Add new Boot Logo 2 Protocol that adds a GetBootLogo()
service that can be used to retrieve the GOP BLT buffer,
location, and size of the boot logo that was previously
registered with the SetBootLogo() service.

The Boot Logo 2 Protocol service GetBootLogo() is amended
to return the pointer to the GOP BLT buffer previously
registered with the SetBootLogo() service.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
6 years agoArmPlatformPkg/MemoryInitPeiLib: reserve rather than remove FV memory
Ard Biesheuvel [Wed, 28 Feb 2018 15:31:34 +0000 (15:31 +0000)]
ArmPlatformPkg/MemoryInitPeiLib: reserve rather than remove FV memory

Instead of completely removing the memory occupied by the primary PrePi
FV from the memory map, thereby making it inaccessible to the OS, mark
it as boot services data. This will ensure that the memory is left
untouched by the firmware, but will release it to the OS when it calls
ExitBootServices().

Note that for reasons that are not entirely clear, this only works as
desired if the memory allocation HOB and the resource descriptor HOB
that describe the region are identical in offset and size, and so we
still need to iterate over the descriptors and split them up.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoArmPlatformPkg/MemoryInitPeiLib: revert "don't reserve primary FV in memory"
Ard Biesheuvel [Wed, 28 Feb 2018 15:27:15 +0000 (15:27 +0000)]
ArmPlatformPkg/MemoryInitPeiLib: revert "don't reserve primary FV in memory"

Commit 8ae5fc182941 ("ArmPlatformPkg/MemoryInitPeiLib: don't reserve
primary FV in memory") deleted the code that removes the memory covering
the primary firmware volume from the memory map. The assumption was that
this is no longer necessary now that we no longer expose compression and
PE/COFF loader library code from the PrePi module to DXE core.

However, the FV is still declared, and so code may attempt to access it
anyway, which may cause unexpected results depending on whether the
memory has been reused for other purposes in the mean time. So revert
this change in preparation of dealing with this in a better way.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoBaseTools: Improve build performance of structure PCD value generation
Feng, Bob C [Wed, 28 Feb 2018 05:59:21 +0000 (13:59 +0800)]
BaseTools: Improve build performance of structure PCD value generation

Optimized the PcdValueInit.c size by abstract the common logic in the funciton.

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>
6 years agoBaseTool: GUID format PCD value assignment fail in Structure PCD field
BobCF [Wed, 28 Feb 2018 05:59:20 +0000 (13:59 +0800)]
BaseTool: GUID format PCD value assignment fail in Structure PCD field

If Structure PCD field is assigned as GUID format, its data type should be
the fixed GUID structure. No flexible check is required.

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>
6 years agoBaseTools: Improve build performance of structure PCD value generation
Feng, Bob C [Wed, 28 Feb 2018 05:59:19 +0000 (13:59 +0800)]
BaseTools: Improve build performance of structure PCD value generation

Add cache for building PcdValueInit.c. If PcdValueInit.c is not changed,
it will not be regenerated.

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>
6 years agoBaseTools: Fixed the pcd value override issue.
Feng, Bob C [Wed, 28 Feb 2018 05:59:18 +0000 (13:59 +0800)]
BaseTools: Fixed the pcd value override issue.

1. the issue in the overriding value from command line.
2. dec fully value < dec field assign value <
   dsc fully value < dsc field assign value

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>
6 years agoBaseTools/tools_def: use separate PP definition for DTC
Ard Biesheuvel [Tue, 27 Feb 2018 17:47:06 +0000 (17:47 +0000)]
BaseTools/tools_def: use separate PP definition for DTC

Clang's preprocessor behaves differently from GCC's, and produces
intermediate device tree source that still contains #pragma pack()
and other directives that the device tree compiler chokes on.

For assembling device tree sources, it matters very little which
preprocessor is being used, so let's just use GNU CPP explicitly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg/CpuExceptionHandlerLib: fix incorrect init of exception stack
Jian J Wang [Tue, 27 Feb 2018 01:04:23 +0000 (09:04 +0800)]
UefiCpuPkg/CpuExceptionHandlerLib: fix incorrect init of exception stack

This issue is introduced at following commit, which tried to add stack
switch support on behalf of Stack Guard feature.

    0ff5aa9cae1ea276668fa4398d047aa9fda3c2c7

The field KnownGoodStackTop in CPU_EXCEPTION_INIT_DATA is initialized to
the start address of array mNewStack. This is wrong. It must be the end
of mNewStack. This patch fixes this mistake.

Cc: Ruiyu Ni <ruiyu.ni@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: Laszlo Ersek <lersek@redhat.com>
6 years agoMdeModulePkg/PlatformLogo.h: Correct function header comments
Ruiyu Ni [Sat, 24 Feb 2018 07:46:52 +0000 (15:46 +0800)]
MdeModulePkg/PlatformLogo.h: Correct function header comments

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/Logo.idf: Remove incorrect comments.
Ruiyu Ni [Sat, 24 Feb 2018 08:02:06 +0000 (16:02 +0800)]
MdeModulePkg/Logo.idf: Remove incorrect comments.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoBaseTools: Fix a bug override Pcd by DSC Components section
Yonghong Zhu [Mon, 26 Feb 2018 07:36:47 +0000 (15:36 +0800)]
BaseTools: Fix a bug override Pcd by DSC Components section

The case is: define a VOID* pcd in DEC file, eg: Value is {0x1}.
then override this PCD on DSC component section, eg: Value is
{0x1, 0x2, 0x3}, the max size of this PCD is calculate wrong
which cause build error.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg/BaseSafeIntLib: Fix VS2015 IA32 NOOPT build failure
Dandan Bi [Mon, 26 Feb 2018 03:55:15 +0000 (11:55 +0800)]
MdePkg/BaseSafeIntLib: Fix VS2015 IA32 NOOPT build failure

v2: Add [LibraryClasses] section in INF file and refine coding style.

There are VS2015 NOOPT IA32 build failure like below in BaseSafeIntLib.
XXX.lib(XXX.obj): error LNK2001: unresolved external symbol __allmul
XXX.lib(XXX.obj): error LNK2001: unresolved external symbol __allshl
XXX.lib(XXX.obj): error LNK2001: unresolved external symbol __aullshr

This patch replaces direct shift/multiplication of 64-bit integer
with related function call to fix these failure.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoBaseTools: Fix report not used --pcd value incorrectly
Feng, YunhuaX [Tue, 27 Feb 2018 07:38:18 +0000 (15:38 +0800)]
BaseTools: Fix report not used --pcd value incorrectly

Argument --pcd gUefiOvmfPkgTokenSpaceGuid.test10=H"{1}",
If the PCD is not used, report value {0x01, 0x00}, is incorrect.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Fix flexible PCD single quote and double quote bugs
Feng, YunhuaX [Mon, 26 Feb 2018 08:42:30 +0000 (16:42 +0800)]
BaseTools: Fix flexible PCD single quote and double quote bugs

1.The " and ' inside the string, must use escape character format
  (\", \')
2.'string' and L'string' format in --pcd, it must be double quoted
  first.

  Some examples that to match --pcd format and DSC format
  --pcd                             DSC format
  L"ABC"                            L"ABC"
  "AB\\\"C"                         "AB\"C"
  "AB\\\'C"                         "AB\'C"
  L"\'AB\\\"C\'"                    L'AB\"C'
  "\'AB\\\'C\'"                     'AB\'C'
  H"{0, L\"AB\\\"B\", \'ab\\\"c\'}" {0, L"AB\"B", 'ab\"c'}

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoMdeModulePkg PCD: Fix the issue to set the big SkuId
Liming Gao [Tue, 27 Feb 2018 05:37:11 +0000 (13:37 +0800)]
MdeModulePkg PCD: Fix the issue to set the big SkuId

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>
6 years agoMdeModulePkg PCD: Add more debug message to show SkuId update
Liming Gao [Tue, 27 Feb 2018 05:38:05 +0000 (13:38 +0800)]
MdeModulePkg PCD: Add more debug message to show SkuId update

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>
6 years agoBaseTools: Update GenFw to correct DebugEntry Offset when convert XIP image
Liming Gao [Mon, 26 Feb 2018 05:51:44 +0000 (13:51 +0800)]
BaseTools: Update GenFw to correct DebugEntry Offset when convert XIP image

DebugEntry FileOffset is required to be updated to the virtual address if
the input image is converted to XIP image.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Add more error message when PcdValue is wrong
Liming Gao [Mon, 26 Feb 2018 07:15:02 +0000 (15:15 +0800)]
BaseTools: Add more error message when PcdValue is wrong

For structure PCD, its field name is wrong and cause build failure. Its
build error message will output to let user aware what's wrong.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Resolve BaseTools C tool build failure
Liming Gao [Tue, 27 Feb 2018 08:56:48 +0000 (16:56 +0800)]
BaseTools: Resolve BaseTools C tool build failure

New GUID definition is conflicted with GUID in Windows Kits guiddef.h.
GUID definition will be defined when it is undefined.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoEmulatorPkg: Undefine CR3 macro in Host.h
Liming Gao [Fri, 23 Feb 2018 06:21:19 +0000 (14:21 +0800)]
EmulatorPkg: Undefine CR3 macro in Host.h

CR3 has been used as structure field name in BaseLib IA32_TASK_STATE_SEGMENT.
Undefine CR3 to make sure there is no conflict to it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoBaseTools:Override the MAKE_FLAGS by BuildOptions in DSC
Yonghong Zhu [Sat, 24 Feb 2018 13:41:13 +0000 (21:41 +0800)]
BaseTools:Override the MAKE_FLAGS by BuildOptions in DSC

The issue that *_*_*_MAKE_FLAGS doesn't work in DSC [BuildOptions]
section. It means MAKE flags can't be set in platform DSC file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/NullMemoryTest: Handle more reliable memory
Ruiyu Ni [Sat, 10 Feb 2018 14:23:18 +0000 (22:23 +0800)]
MdeModulePkg/NullMemoryTest: Handle more reliable memory

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

Today's implementation converts the untested more reliable memory
from reserved GCD type to system memory GCD type.
Though it doesn't impact the return result of gBS->GetMemoryMap().
But it impacts the return result of gDS->GetMemorySpaceDescriptor().
The patch fixes the bug to convert the untested more reliable memory
from reserved GCD type to more reliable memory GCD type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/GenericMemoryTest: Handle more reliable memory
Ruiyu Ni [Sat, 10 Feb 2018 14:22:15 +0000 (22:22 +0800)]
MdeModulePkg/GenericMemoryTest: Handle more reliable memory

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=650
Today's implementation converts the untested more reliable memory
from reserved GCD type to system memory GCD type.
Though it doesn't impact the return result of gBS->GetMemoryMap().
But it impacts the return result of gDS->GetMemorySpaceDescriptor().
The patch fixes the bug to convert the untested more reliable memory
from reserved GCD type to more reliable memory GCD type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg SmmLockBox: Return updated Length for EFI_BUFFER_TOO_SMALL
Star Zeng [Sat, 24 Feb 2018 08:02:07 +0000 (16:02 +0800)]
MdeModulePkg SmmLockBox: Return updated Length for EFI_BUFFER_TOO_SMALL

The updated Length value should be returned
for EFI_BUFFER_TOO_SMALL case.

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>
6 years agoMdePkg BaseCpuLib: Make it pass VS ARM build
Liming Gao [Wed, 7 Feb 2018 01:56:43 +0000 (09:56 +0800)]
MdePkg BaseCpuLib: Make it pass VS ARM build

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Pete Batard <pete@akeo.ie>
6 years agoMdeModulePkg PeiCore: Add error message to describe PEIM load failure
Liming Gao [Thu, 8 Feb 2018 08:18:39 +0000 (16:18 +0800)]
MdeModulePkg PeiCore: Add error message to describe PEIM load failure

If PEIM image address doesn't meet with its section alignment, it will
load fail. PeiCore adds more debug message to report it.

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>
6 years agoBaseTools GenFv: Update error message to describe PE image alignment
Liming Gao [Thu, 8 Feb 2018 07:29:45 +0000 (15:29 +0800)]
BaseTools GenFv: Update error message to describe PE image 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>
6 years agoBaseTools: Add the missing basic definition in C BaseType.h
Liming Gao [Thu, 8 Feb 2018 13:13:49 +0000 (21:13 +0800)]
BaseTools: Add the missing basic definition in C BaseType.h

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoMdeModulePkg/RamDiskDxe: Perform MediaId check first in BlkIo services
Hao Wu [Fri, 9 Feb 2018 02:16:53 +0000 (10:16 +0800)]
MdeModulePkg/RamDiskDxe: Perform MediaId check first in BlkIo services

The commit places the check for MediaId at the beginning of Block IO
services:
RamDiskBlkIoReadBlocks and
RamDiskBlkIoWriteBlocks

This aligns with the Block IO protocol implementations for other
devices.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools: Add *B Flag for the field that from command line
Yonghong Zhu [Fri, 23 Feb 2018 05:05:34 +0000 (13:05 +0800)]
BaseTools: Add *B Flag for the field that from command line

For structure PCD, the field value may override in the command line,
so in the report when we print the field info we add *B Flag for those
field.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Update ValueExpressionEx for flexible PCD
Feng, YunhuaX [Fri, 23 Feb 2018 11:47:30 +0000 (19:47 +0800)]
BaseTools: Update ValueExpressionEx for flexible PCD

1. Byte  array number should less than 0xFF.
2. Add SplitPcdValueString for PCD split

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools/Expression: Use 2nd passes on PCD values
Kinney, Michael D [Wed, 21 Feb 2018 04:08:32 +0000 (20:08 -0800)]
BaseTools/Expression: Use 2nd passes on PCD values

Use 2 passes when evaluating PCD values to discover
all the LABEL() operators and compute the byte offset
of each LABEL().  The 2nd pass then has the information
to replace the OFFSET_OF() operator with the computed
byte offset.  The 2 passes allows OFFSET_OF() to be used
before a LABEL() is declared.

fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=880
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoArmVirtPkg: switch to DXE runtime version of DebugLib where appropriate
Ard Biesheuvel [Tue, 20 Feb 2018 10:58:31 +0000 (10:58 +0000)]
ArmVirtPkg: switch to DXE runtime version of DebugLib where appropriate

Switch all users of ArmVirt.dsc.inc to the new DebugLib implementation
that was created especially for DXE_RUNTIME_DRIVER modules, ensuring
that DEBUG() calls do not touch the UART at runtime.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoMdePkg: introduce DxeRuntimeDebugLibSerialPort
Ard Biesheuvel [Tue, 20 Feb 2018 10:53:10 +0000 (10:53 +0000)]
MdePkg: introduce DxeRuntimeDebugLibSerialPort

Introduce a variant of BaseDebugLibSerialPort that behaves correctly with
regards to the use of the serial port after ExitBootServices(). At boot
time, all DEBUG() prints and ASSERT() invocations are executed normally.
At runtime, DEBUG() prints are dropped entirely, and ASSERT()s omit the
serial output as well, and only perform the configured post-ASSERT()
action, i.e., issue a CPU breakpoint or enter a deadloop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdeModulePkg/RecoveryDevice.h: Remove semicolon after GUID definitions
Hao Wu [Fri, 23 Feb 2018 00:44:20 +0000 (08:44 +0800)]
MdeModulePkg/RecoveryDevice.h: Remove semicolon after GUID definitions

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

Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoEmbeddedPkg: use central variable definitions in .vfr files
Leif Lindholm [Wed, 13 Dec 2017 12:04:40 +0000 (12:04 +0000)]
EmbeddedPkg: use central variable definitions in .vfr files

Use UefiMultiPhase.h in Vfr.vfr instead of duplicating EFI_VARIABLE_*
definitions.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6 years agoMdeModulePkg: use central variable definitions in DriverSampleDxe
Leif Lindholm [Wed, 13 Dec 2017 12:01:04 +0000 (12:01 +0000)]
MdeModulePkg: use central variable definitions in DriverSampleDxe

Use UefiMultiPhase.h in Vfr.vfr instead of duplicating EFI_VARIABLE_*
definitions.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg: restrict UefiMultiPhase.h contents if VFRCOMPILE defined
Leif Lindholm [Fri, 15 Dec 2017 16:08:17 +0000 (16:08 +0000)]
MdePkg: restrict UefiMultiPhase.h contents if VFRCOMPILE defined

Turns out all .vfr files in the tree interacting with DynamicPcds
manually copy the same set of EFI_VARIABLE_* definitions, since the rest
of UefiMultiPhase.h is incompatible with VfrCompile.

For now, reshuffle these definitions to the start of the file, and put
the rest of the file behind #ifndef VFRCOMPILE to permit direct
inclusion in .vfr source files.

https://bugzilla.tianocore.org/show_bug.cgi?id=878 has been raised to
request VfrCompile is extended to support the original format.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoShellPkg/Ping: fix loss of first packet
Meenakshi Aggarwal [Fri, 16 Feb 2018 08:45:11 +0000 (14:15 +0530)]
ShellPkg/Ping: fix loss of first packet

Issue:
Reply for first ping packet was getting dropped.

Cause:
Sometimes reply message comes even before trasmit
function returns, hence missing 1st reply

Fix:
Prepare the TxList before calling Transmit function.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools: Fix the bug to display the single SKUID info
Yonghong Zhu [Wed, 21 Feb 2018 02:09:03 +0000 (10:09 +0800)]
BaseTools: Fix the bug to display the single SKUID info

when defined SKUID_IDENTIFIER = DEFAULT|TEST in DSC [Defines] section,
per spec it means current SKUID is single, the bug is build report print
both DEFAULT and TEST info, it should only print TEST.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Add check for INF statement must be a .inf file
Yonghong Zhu [Wed, 7 Feb 2018 06:41:11 +0000 (14:41 +0800)]
BaseTools: Add check for INF statement must be a .inf file

Per FDF spec, INF statement must use a .inf file, we add this error
check.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Add WindowsLike path in front of PATH Env
Yonghong Zhu [Thu, 22 Feb 2018 02:30:41 +0000 (10:30 +0800)]
BaseTools: Add WindowsLike path in front of PATH Env

Original BaseTools source build append WindowsLike path to PATH Env,
while WINDDK installation has a "build.exe", if user place WINDDK
folder to PATH either during WINDDK installation or manually, it will
block the BaseTools' build.bat.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Mult()
Laszlo Ersek [Thu, 15 Feb 2018 16:09:43 +0000 (17:09 +0100)]
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Mult()

If we have to negate UnsignedResult (due to exactly one of Multiplicand
and Multiplier being negative), and UnsignedResult is exactly
MIN_INT64_MAGNITUDE (value 2^63), then the statement

        *Result = - ((INT64)UnsignedResult);

invokes both implementation-defined behavior and undefined behavior.

First, MIN_INT64_MAGNITUDE is not representable as INT64, therefore the
result of the (inner) conversion

  (INT64)MIN_INT64_MAGNITUDE

is implementation-defined, or an implementation-defined signal is raised,
according to ISO C99 6.3.1.3p3.

Second, if we assume that the C language implementation defines the
conversion to INT64 simply as reinterpreting the bit pattern
0x8000_0000_0000_0000 as a signed integer in two's complement
representation, then the conversion immediately produces the negative
value MIN_INT64 (value -(2^63)). In turn, the (outer) negation

  -(MIN_INT64)

invokes undefined behavior, because the mathematical result of the
negation, namely 2^63, cannot be represented in an INT64 object. (Not even
mentioning the fact that the mathematical result would be incorrect.) In
practice, the undefined negation of MIN_INT64 happens to produce an
unchanged, valid-looking result on x86, i.e. (-(MIN_INT64)) == MIN_INT64.

We can summarize this as the undefined -- effectless -- negation canceling
out the botched -- auto-negating -- implementation-defined conversion.
Instead of relying on such behavior, dedicate a branch to this situation:
assign MIN_INT64 directly. The branch can be triggered e.g. by multiplying
(2^62) by (-2).

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdePkg/BaseSafeIntLib: clean up parentheses in MIN_INT64_MAGNITUDE
Laszlo Ersek [Thu, 15 Feb 2018 16:09:43 +0000 (17:09 +0100)]
MdePkg/BaseSafeIntLib: clean up parentheses in MIN_INT64_MAGNITUDE

The definition of the MIN_INT64_MAGNITUDE macro is correct, but it's
harder to read than necessary: the sub-expression

      (( (UINT64) - (MIN_INT64 + 1) ))

is doubly parenthesized. Reusing one pair of the outer parens, rewrite the
sub-expression (without change in meaning) so that the minus sign cannot
be mistaken for subtraction:

      ( (UINT64)(- (MIN_INT64 + 1)) )

The resultant macro definition matches the following expressions in
SafeInt64Mult():

>     //
>     // Avoid negating the most negative number.
>     //
>     UnsignedMultiplicand = ((UINT64)(- (Multiplicand + 1))) + 1;

and

>     //
>     // Avoid negating the most negative number.
>     //
>     UnsignedMultiplier = ((UINT64)(- (Multiplier + 1))) + 1;

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Add()
Laszlo Ersek [Thu, 15 Feb 2018 13:47:11 +0000 (14:47 +0100)]
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Add()

The addition in the assignment

  SignedResult = Augend + Addend;

is performed with unchecked INT64 operands. According to ISO C, if the
mathematical result of signed integer addition cannot be represented in
the result type, the behavior is undefined. (Refer to ISO C99 6.5p5.
6.2.5p9 only exempts unsigned integers, and 6.3.1.3p3 does not apply
because it treats the conversion of integers that have been successfully
evaluated first.)

Replace the after-the-fact result checking with checks on the operands,
and only perform the addition if it is safe.

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Sub()
Laszlo Ersek [Thu, 15 Feb 2018 13:47:11 +0000 (14:47 +0100)]
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Sub()

The subtraction in the assignment

  SignedResult = Minuend - Subtrahend;

is performed with unchecked INT64 operands. According to ISO C, if the
mathematical result of signed integer subtraction cannot be represented in
the result type, the behavior is undefined. (Refer to ISO C99 6.5p5.
6.2.5p9 only exempts unsigned integers, and 6.3.1.3p3 does not apply
because it treats the conversion of integers that have been successfully
evaluated first.)

Replace the after-the-fact result checking with checks on the operands,
and only perform the subtraction if it is safe.

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoEmbeddedPkg/FdtLib: incorporate missing overlay support
Ard Biesheuvel [Thu, 15 Feb 2018 10:30:33 +0000 (10:30 +0000)]
EmbeddedPkg/FdtLib: incorporate missing overlay support

Commit a099239015eb ("EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5")
updated our FdtLib implementation to a more recent upstream version,
but omitted fdt_overlay.c due to its ambiguous licensing situation.
This has been resolved now, so take the latest upstream version of
the file (which received no other modifications in the mean time)
and add it to FdtLib.

Note that fdt_overlay.c has a dependency on strtoul() which EDK does
not provide natively, so add a private implementation that wraps the
BaseLib routines that do roughly the same.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoMdeModulePkg/UsbMass: Fix hot-plug USB CDROM can't be recognized
Ruiyu Ni [Tue, 13 Feb 2018 07:21:48 +0000 (15:21 +0800)]
MdeModulePkg/UsbMass: Fix hot-plug USB CDROM can't be recognized

In below calling stack:
UsbBootIsUnitReady()
 UsbBootExecCmdWithRetry()
  UsbBootExecCmd()
    UsbBootRequestSense()
When USB CDROM is hot-plugged, UsbBootRequestSense() retrieves sense
key (6 = UnitAttention), additional sense code (29h = Power ON).
But it wrongly maps such sense data to Device Error status.
It causes UsbBootExecCmd() executed again.
In the second time call to UsbBootExecCmd(), UsbBootRequestSense()
retrieves sense key (6 = UnitAttention), additional sense code
(28h = media changed).

The above analysis explains why hot-plug USB CDROM cannot be
recognized after below commit:
SHA1 a662afb5b023a187ef638d3cb0e0c313ad39a7fc
* MdeModulePkg/UsbStorage: Fix "map -r" cannot detect media change,
which removes the media changed status check in UsbBootDetectMedia().

The proper fix to this problem is to map the ASC (additional sense
code 29h) properly to success status so that no second call to
UsbBootExecCmd() is made.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
6 years agoShellPkg/ShellLib: Fix a bug in InternalShellIsHexOrDecimalNumber
Ruiyu Ni [Tue, 13 Feb 2018 08:39:31 +0000 (15:39 +0700)]
ShellPkg/ShellLib: Fix a bug in InternalShellIsHexOrDecimalNumber

InternalShellIsHexOrDecimalNumber() wrongly treats "-" as a number.
The patch fixes this issue.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/[hex]edit: Fix CTRL+<Alpha> doesn't work from hyper terminal
Ruiyu Ni [Tue, 13 Feb 2018 09:29:55 +0000 (17:29 +0800)]
ShellPkg/[hex]edit: Fix CTRL+<Alpha> doesn't work from hyper terminal

After commit 20ddbc133f679b7895dfdaf2fd58ec4c8183a1d8
* MdeModulePkg/ConSplitter: ReadKeyStrokeEx always return key state

When one physical console supports to report the shift key state,
the key data returned from ConSplitter driver at least carries
the shift key valid bit.
The patch fixes the edit/hexedit to accept Unicode (1) when
the no shift key is pressed or reported.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/ResetUtilityLib: Fix GCC build failure
Ruiyu Ni [Tue, 13 Feb 2018 03:02:30 +0000 (11:02 +0800)]
MdeModulePkg/ResetUtilityLib: Fix GCC build failure

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdeModulePkg/BmpSupportLib: Refine type cast for pointer subtraction
Hao Wu [Tue, 13 Feb 2018 02:23:51 +0000 (10:23 +0800)]
MdeModulePkg/BmpSupportLib: Refine type cast for pointer subtraction

Since the pointer subtraction here is not performed by pointers to
elements of the same array object. This might lead to potential issues,
such behavior is undefined according to C11 standard.

Refine the pointer subtraction expressions by casting each pointer to
UINTN first and then perform the subtraction.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoNetworkPkg: Read HttpTlsCipherList variable and configure it for HTTPS session.
Jiaxin Wu [Fri, 9 Feb 2018 03:52:06 +0000 (11:52 +0800)]
NetworkPkg: Read HttpTlsCipherList variable and configure it for HTTPS session.

v2:
* Refine the error handling returned from GetVariable.

This patch is to read the HttpTlsCipherList variable and configure it for the
later HTTPS session.

If the variable is not set by any platform, EFI_NOT_FOUND will be returned
from GetVariable service. In such a case, the default CipherList created in
TlsDxe driver will be used.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Zimmer Vincent <vincent.zimmer@intel.com>
Cc: Yao Jiewen <jiewen.yao@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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoNetworkPkg: Define one private variable for HTTPS to set Tls CipherList.
Jiaxin Wu [Fri, 9 Feb 2018 03:44:57 +0000 (11:44 +0800)]
NetworkPkg: Define one private variable for HTTPS to set Tls CipherList.

v2:
* Rename the file/variable name.

This variable (HttpTlsCipherList) can be set by any platform that want to
control its own preferred Tls CipherList for the later HTTPS session.

The valid contents of variable must follow the TLS CipherList format defined
in RFC 5246. The valid length of variable must be an integral multiple of 2.
For example, if below cipher suites are preferred:
    CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C}
    CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = {0x00,0x3D}
Then, the contents of variable should be:
    {0x00,0x3C,0x00,0x3D}

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Zimmer Vincent <vincent.zimmer@intel.com>
Cc: Yao Jiewen <jiewen.yao@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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoShellPkg: remove superfluous TimerLib resolution
Laszlo Ersek [Mon, 12 Feb 2018 13:03:44 +0000 (14:03 +0100)]
ShellPkg: remove superfluous TimerLib resolution

TimerLib had to be resolved in commit 5ab97a64b51c ("ShellPkg/bcfg: Add
Shell Spec 2.2 modification functionality", 2017-03-01) because:

- the BCFG command started making calls to UefiBootManagerLib
  (EfiBootManagerVariableToLoadOption(),
  EfiBootManagerLoadOptionToVariable(), EfiBootManagerFreeLoadOption()),

- and "MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf"
  depended on TimerLib.

Because TimerLib is platform-specific, but "ShellPkg/ShellPkg.dsc" is
meant to produce a UEFI shell binary that is platform-independent (see
"ShellBinPkg/ReadMe.txt"), we resolved TimerLib to
"BaseTimerLibNullTemplate.inf". (TimerLib functionality was never actually
needed on UefiBootManagerLib code paths that were exercised by the shell /
BCFG.)

Thanks to the last patch, UefiBootManagerLib no longer depends on
TimerLib, thus we can drop the TimerLib resolution entirely.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/UefiBootManagerLib: remove superfluous TimerLib dependency
Laszlo Ersek [Mon, 12 Feb 2018 12:43:46 +0000 (13:43 +0100)]
MdeModulePkg/UefiBootManagerLib: remove superfluous TimerLib dependency

In commit 3a039a567a5f ("MdeModulePkg/UefiBootManagerLib: Remove the
useless perf codes", 2018-02-12), the BmWriteBootToOsPerformanceData()
function was removed. No TimerLib API calls are left, thus remove the
TimerLib class dependency from "InternalBm.h" and "UefiBootManagerLib.inf"
as well.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoOvmfPkg: drop stale SafeBlockIoLib and SafeOpenProtocolLib resolutions
Laszlo Ersek [Mon, 12 Feb 2018 12:16:14 +0000 (13:16 +0100)]
OvmfPkg: drop stale SafeBlockIoLib and SafeOpenProtocolLib resolutions

These are listed under "ShellPkg/Application/Shell/Shell.inf", but they
have been commented out ever since commit 345a0c8fce38 ("OvmfPkg: Add
support for UEFI shell", 2011-06-26). No such lib classes exist in edk2.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/[hex]edit: Fix wrongly use gST->ConIn as the console handle
Ruiyu Ni [Mon, 12 Feb 2018 15:32:22 +0000 (23:32 +0800)]
ShellPkg/[hex]edit: Fix wrongly use gST->ConIn as the console handle

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/[hex]edit: use SimpleTextInEx to read console
Ruiyu Ni [Mon, 12 Feb 2018 13:42:55 +0000 (21:42 +0800)]
ShellPkg/[hex]edit: use SimpleTextInEx to read console

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

Edit and HexEdit commands assume that SimpleTxtIn translates
Ctrl+<Alpha-Key> key combinations into Unicode control characters
(0x1-0x1A).

Such translation does not seem to be required by the UEFI spec.
Shell should not rely on implementation specific behavior.
It should instead use SimpleTextInEx to read Ctrl+<Alpha-Key> key
combinations.

The patch changes edit and hexedit to only consumes SimpleTextInEx
so that the implementation specific behavior dependency is removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reported-by: Felix <felixp@mail.ru>
Cc: Felix <felixp@mail.ru>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/help: Fix "-?" may not show manual sometimes
Ruiyu Ni [Sun, 11 Feb 2018 15:17:22 +0000 (23:17 +0800)]
ShellPkg/help: Fix "-?" may not show manual sometimes
Shell core was enhanced to find the manual string in PE resource
section. But the finding algorithm is too strict: If the manual is
written beginning with:
.TH command 0 "descripton of command"

but user types "COMMAND.efi -?". The finding algorithm uses
case-sensitive compare between "command" and "COMMAND" resulting
in the manual cannot be found.

The patch fixes this issue by using existing ManFileFindTitleSection
and ManFileFindSections which compare command case-insensitive.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/Performance.h: Remove the useless definition
Dandan Bi [Wed, 31 Jan 2018 01:57:57 +0000 (09:57 +0800)]
MdeModulePkg/Performance.h: Remove the useless definition

Remove the definitions related to old perf codes.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoVlv2TbltDevicePkg/Override/GenericBdsLib:Remove useless Perf code
Dandan Bi [Wed, 31 Jan 2018 05:09:44 +0000 (13:09 +0800)]
Vlv2TbltDevicePkg/Override/GenericBdsLib:Remove useless Perf code

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: zwei4 <david.wei@intel.com>
6 years agoIntelFrameworkModulePkg/GenericBdsLib: Remove the useless Perf codes
Dandan Bi [Wed, 31 Jan 2018 02:36:39 +0000 (10:36 +0800)]
IntelFrameworkModulePkg/GenericBdsLib: Remove the useless Perf codes

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelFrameworkModulePkg/BdsDxe: Remove the useless Perf codes
Dandan Bi [Wed, 31 Jan 2018 02:35:17 +0000 (10:35 +0800)]
IntelFrameworkModulePkg/BdsDxe: Remove the useless Perf codes

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/UefiBootManagerLib: Remove the useless perf codes
Dandan Bi [Wed, 24 Jan 2018 05:36:09 +0000 (13:36 +0800)]
MdeModulePkg/UefiBootManagerLib: Remove the useless perf codes

V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/BdsDxe: Remove useless perf Code
Dandan Bi [Wed, 24 Jan 2018 05:27:09 +0000 (13:27 +0800)]
MdeModulePkg/BdsDxe: Remove useless perf Code

V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoUefiCpuPkg/S3Resume: Remove useless perf code
Dandan Bi [Wed, 24 Jan 2018 05:19:59 +0000 (13:19 +0800)]
UefiCpuPkg/S3Resume: Remove useless perf code

V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4)can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/DxeCapsuleLibFmp: Verify nested capsule with FMP
Kinney, Michael D [Wed, 7 Feb 2018 01:43:32 +0000 (17:43 -0800)]
MdeModulePkg/DxeCapsuleLibFmp: Verify nested capsule with FMP

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

Update IsNestedFmpCapsule() to verify the CapsuleGuid in
the CapsuleHeader against the installed Firmware Management
Protocol instances.  The current logic that uses the ESRT
Table does not work because capsules are processed before
the ESRT Table is published at the Ready To Boot event.

Cc: Jiewen Yao <jiewen.yao@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: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoArmVirtPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Tue, 2 Jan 2018 23:09:05 +0000 (15:09 -0800)]
ArmVirtPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

The BootGraphicsResourceTableDxe module uses the BmpSupportLib
and SafeIntLib to convert a GOP BLT buffer to a BMP graphics image.
Add library mappings for these new library classes.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoEmulatorPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Thu, 28 Dec 2017 00:38:44 +0000 (16:38 -0800)]
EmulatorPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib and SafeIntLib mappings that are required
by GenericBdsLib.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoDuetPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Thu, 28 Dec 2017 00:38:29 +0000 (16:38 -0800)]
DuetPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib and SafeIntLib mappings that are required
by GenericBdsLib.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoQuarkPlatformPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Thu, 28 Dec 2017 00:39:58 +0000 (16:39 -0800)]
QuarkPlatformPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib and SafeIntLib mappings that are required
by the DxeCapsuleLib when CAPSULE_ENABLE is set.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoVlv2TbltDevicePkg/Override/GenericBdsLib: Use BmpSupportLib
Michael D Kinney [Thu, 28 Dec 2017 00:10:39 +0000 (16:10 -0800)]
Vlv2TbltDevicePkg/Override/GenericBdsLib: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Update GenericBdsLib to use BmpSupportLib to convert a BMP
graphics image to a GOP BLT buffer to display the boot logo.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoOvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Sat, 30 Dec 2017 02:59:21 +0000 (18:59 -0800)]
OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

The BootGraphicsResourceTableDxe module uses the BmpSupportLib
and SafeIntLib to convert a GOP BLT buffer to a BMP graphics image.
Add library mappings for these new library classes.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoIntelFrameworkModulePkg/GenericBdsLib: Use BmpSupportLib
Michael D Kinney [Thu, 28 Dec 2017 00:09:55 +0000 (16:09 -0800)]
IntelFrameworkModulePkg/GenericBdsLib: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Update GenericBdsLib to use BmpSupportLib to convert a BMP
graphics image to a GOP BLT Buffer to display the boot logo.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoMdeModulePkg/BootGraphicsResourceTableDxe: Use BmpSupportLib
Michael D Kinney [Fri, 29 Dec 2017 19:26:42 +0000 (11:26 -0800)]
MdeModulePkg/BootGraphicsResourceTableDxe: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Use BmpSupportLib to convert a GOP BLT Buffer to the BMP graphics
image that is published in an ACPI BGRT table.

* Remove use of IndustryStandard/Bmp.h include file
* Remove mBmpImageHeaderTemplate.  This is handled by BmpSupportLib
* Clean up code style with function prototypes at top
  and all module global variables together
* Update SetBootLogo() to use SafeIntLib to check input parameters
  for overflows.
* Remove internal function BgrtAcpiTableChecksum().  Use
  CalculateCheckSum8() directly from BgrtReadyToBootEventNotify()
* Remove InstallBootGraphicsResourceTable().  Move all the code into
  BgrtReadyToBootEventNotify() that is signaled at ready to boot.
* Remove all logic that converts a GOP BLT buffer to a BMP graphics image
  and use BmpSupportLib function TranslateGopBltToBmp() instead.
* Use AllocatePool() instead of AllocatePages() to allocate copy of
  BMP image that is provided by BGRT.  This is required to be compatible
  with BmpSupportLib function TranslateGopBltToBmp() that uses
  AllocatePool().
* Zero OemId in BGRT header before filling in value from PCD.
* Get size of PcdAcpiDefaultOemId and only copy the the size of the PCD
  if it is smaller than the size of the OemId field in the BGRT header.
* Use WriteUnaligned24() instead of CopyMem() for the OemTableId field
  of the BGRT header.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>