]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
4 years agoBaseTools: Update build_rule.txt to generate dependent files.
Bob Feng [Mon, 2 Dec 2019 08:25:32 +0000 (16:25 +0800)]
BaseTools: Update build_rule.txt to generate dependent files.

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

Enable the dependent files generation function for compilers
and Trim tool.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Generate dependent files for ASL and ASM files
Bob Feng [Wed, 20 Nov 2019 02:58:28 +0000 (10:58 +0800)]
BaseTools: Generate dependent files for ASL and ASM files

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

Implement the function in Trim tool to get the included
file list for ASL and ASM file.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Add build option for dependency file generation
Bob Feng [Mon, 2 Dec 2019 08:24:19 +0000 (16:24 +0800)]
BaseTools: Add build option for dependency file generation

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

Add /showIncludes for msvc and -MMD -MF $@.deps
for GCC and CLANG

Remove /MP for msvc since /MP does not work with
/showIncludes

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMaintainers: assume co-maintainership of StandaloneMmPkg
Ard Biesheuvel [Fri, 6 Dec 2019 15:21:33 +0000 (15:21 +0000)]
Maintainers: assume co-maintainership of StandaloneMmPkg

Achin has indicated that he no longer has the bandwidth available to
co-maintain StandaloneMmPkg, and has asked Sami and me to step in.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Jiewen Yao <Jiewen.Yao@intel.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoEmbeddedPkg: implement EDK2 IoMmu protocol wrapping DmaLib
Ard Biesheuvel [Thu, 21 Nov 2019 08:32:27 +0000 (09:32 +0100)]
EmbeddedPkg: implement EDK2 IoMmu protocol wrapping DmaLib

Implement a version of the EDK2 IoMmu protocol that is a simple wrapper
around DmaLib. This is intended to be used to wrap NonCoherentDmaLib so
that the generic PCI infrastructure can be used to implement support for
non cache-coherent DMA.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Tested-by: Pete Batard <pete@akeo.ie>
4 years agoEmbeddedPkg/NonCoherentDmaLib: implement support for DMA range limits
Ard Biesheuvel [Thu, 21 Nov 2019 08:32:26 +0000 (09:32 +0100)]
EmbeddedPkg/NonCoherentDmaLib: implement support for DMA range limits

Implement support for driving peripherals with limited DMA ranges to
NonCoherentDmaLib, by adding a device address limit, and taking it,
along with the device offset, into account when allocating or mapping
DMA buffers.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Pete Batard <pete@akeo.ie>
Acked-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time
Eric Dong [Fri, 6 Dec 2019 03:36:35 +0000 (11:36 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time

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

Token is new introduced by MM MP Protocol. Current logic allocate Token
every time when need to use it. The logic caused SMI latency raised to
very high. Update logic to allocate Token buffer at driver's entry point.
Later use the token from the allocated token buffer. Only when all the
buffer have been used, then need to allocate new buffer.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
4 years agoBaseTools: Avoid "is" with a literal Python 3.8 warnings
Philippe Mathieu-Daude [Thu, 5 Dec 2019 11:19:41 +0000 (19:19 +0800)]
BaseTools: Avoid "is" with a literal Python 3.8 warnings

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

The following statement produces a SyntaxWarning with Python 3.8:

  if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in \
    str(FdRegion.RegionDataList):
  BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py:168: SyntaxWarning: \
    "is" with a literal. Did you mean "=="?

Change the 'is' operator by the conventional '==' comparator.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years ago.pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
Philippe Mathieu-Daude [Thu, 5 Dec 2019 11:19:42 +0000 (19:19 +0800)]
.pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins

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

To avoid SyntaxWarning with Python 3.8, change the 'is' operator
by the conventional '==' comparator.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoArmPkg: Dispatch deferred images after EndOfDxe
Sami Mujawar [Thu, 11 Apr 2019 18:41:36 +0000 (11:41 -0700)]
ArmPkg: Dispatch deferred images after EndOfDxe

Third party driver images loaded from Option ROM get queued
for execution after EndOfDxe. These queued images need to be
dispatched from the PlatformBootManagerLib.

Since the queued images were not dispatched, the PCI Option
ROM drivers were not getting loaded on Juno. Therefore,
add call to EfiBootManagerDispatchDeferredImages() for
dispatching deferred images from PlatformBootManagerLib.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoShellPkg/UefiHandleParsingLib: Fix error allocate pool
Zhichao Gao [Mon, 15 Jul 2019 06:23:21 +0000 (14:23 +0800)]
ShellPkg/UefiHandleParsingLib: Fix error allocate pool

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

For function InsertNewGuidNameMapping, it rellocate the
mGuidList with new size
"mGuidListCount+1 * sizeof(GUID_INFO_BLOCK)". That isn't
its purpose and would cause a overflow operation in
"mGuidList[mGuidListCount - 1].xxx = xxx". Its purpose
is to increase 1 block size of mGuidList. Change it to
"(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK)".

Adjust the coding style of this function.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoShellPkg/edit: typo "%d Lines Wrote"
Heinrich Schuchardt [Sun, 24 Nov 2019 10:33:20 +0000 (18:33 +0800)]
ShellPkg/edit: typo "%d Lines Wrote"

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

When a file is saved in the edit command a status message L"%d Lines Wrote"
is displayed. The hexedit command suffers from the same typo.

Change the message to L"%d Lines Written".

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoShellPkg: acpiview: IORT Spec Rev D updates
Sami Mujawar [Mon, 25 Nov 2019 09:18:13 +0000 (17:18 +0800)]
ShellPkg: acpiview: IORT Spec Rev D updates

Updated IORT parser to conform to the IO Remapping
Table, Platform Design Document, Revision D, March 2018.

The following structure parsers have been updated:
  1. SMMUv3 - added proximity domain and device Id
              mapping index.
  2. RootComplex - added memory address size limit.
  2. PMCG - added page 1 support.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Add support for parsing FACS
Sami Mujawar [Fri, 22 Nov 2019 11:31:45 +0000 (19:31 +0800)]
ShellPkg: acpiview: Add support for parsing FACS

Add support for parsing the ACPI FACS table.

The FADT parser has also been updated as it
links the FACS table using the FIRMWARE_CTRL
or X_FIRMWARE_CTRL fields.

Since the FACS table does not follow the standard
ACPI header, the FADT parser extracts the FACS
signature, length and version fields before invoking
the FACS parser.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoMdeModulePkg: Add ARM/Aarch64 support which were missing
Zhiguang Liu [Wed, 4 Dec 2019 00:45:35 +0000 (08:45 +0800)]
MdeModulePkg: Add ARM/Aarch64 support which were missing

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

Add ARM/Aarch64 which were missing to VALID_ARCHITECTURES
 in LzmaCustomDecompressLib.inf

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
4 years agoMdeModulePkg: LzmaCustomDecompressLib.inf don't support EBC anymore
Zhiguang Liu [Wed, 4 Dec 2019 00:43:24 +0000 (08:43 +0800)]
MdeModulePkg: LzmaCustomDecompressLib.inf don't support EBC anymore

After unifying the definition of size_t, EBC compiler has failure.
So don't compile this inf file for EBC

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
4 years agoBaseTools:Enhance the way to handling included dsc file
Fan, ZhijuX [Tue, 3 Dec 2019 09:04:25 +0000 (17:04 +0800)]
BaseTools:Enhance the way to handling included dsc file

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

In Dsc Parser, included dsc file is parsed always no matter
if its condition is False

  gUefiOvmfPkgTokenSpaceGuid.test1|FALSE
!if gUefiOvmfPkgTokenSpaceGuid.test1 == FALSE
  !include OvmfPkg/test1.dsc
!else
  !include OvmfPkg/test2.dsc
!endif

The patch avoids processing redundant dsc files and improves
the way Tool handles them.

In the above case, since the conditional result is FALSE,
"test2.dsc" is not parsed.

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoUefiCpuPkg: Update the coding styles
Shenglei Zhang [Thu, 14 Nov 2019 11:00:10 +0000 (16:30 +0530)]
UefiCpuPkg: Update the coding styles

In MpLib.c, remove the white space on a new line.
In PageTbl.c and PiSmmCpuDxeSmm.h, update the comment style.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoUefiCpuPkg/UefiCpuPkg.uni: Add missing strings for PCD
Shenglei Zhang [Thu, 14 Nov 2019 10:46:59 +0000 (16:16 +0530)]
UefiCpuPkg/UefiCpuPkg.uni: Add missing strings for PCD

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoNetworkPkg/NetworkPkg.uni: Add missing strings for PCD
Shenglei Zhang [Thu, 14 Nov 2019 10:43:14 +0000 (16:13 +0530)]
NetworkPkg/NetworkPkg.uni: Add missing strings for PCD

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
4 years agoMdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD
Shenglei Zhang [Wed, 13 Nov 2019 04:30:34 +0000 (10:00 +0530)]
MdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoNetworkPkg: Fixes to static code analysis hits
Maciej Rabeda [Thu, 28 Nov 2019 14:46:06 +0000 (15:46 +0100)]
NetworkPkg: Fixes to static code analysis hits

Introducing fixes to memory leak issues identified by static code analysis
tool.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
4 years agoCryptoPkg/OpensslLib.inf: list OpenSSL local header "ms/uplink.h"
Laszlo Ersek [Thu, 21 Nov 2019 08:01:10 +0000 (09:01 +0100)]
CryptoPkg/OpensslLib.inf: list OpenSSL local header "ms/uplink.h"

Commit 8906f076de35 ("CryptoPkg/OpensslLib: Add missing header files in
INF file", 2019-08-16) incorrectly placed "ms/uplink.h" in the
auto-generated part of [Sources], in "OpensslLib.inf".

("ms/uplink.h" was added in the right spot in "OpensslLibCrypto.inf".)

Subsequently, when commit 9f4fbd56d430 ("CryptoPkg/OpensslLib: Update
process_files.pl to generate .h files", 2019-10-30) re-generated that part
of "OpensslLib.inf", the "ms/uplink.h" file reference was lost. This
triggers a warning from the "build" utility now.

Name the header file in the right spot in [Sources].

This change makes "OpensslLib.inf" consistent with "OpensslLibCrypto.inf".

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Fixes: 8906f076de35b222a7d62bcf6ed1a4a2498a5791
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoCryptoPkg/OpensslLib: improve INF file consistency
Laszlo Ersek [Thu, 21 Nov 2019 07:46:10 +0000 (08:46 +0100)]
CryptoPkg/OpensslLib: improve INF file consistency

When diffing "OpensslLib.inf" against "OpensslLibCrypto.inf", the *only*
differences should be:

- BASE_NAME, MODULE_UNI_FILE, and FILE_GUID are expected to differ, in
  [Defines];

- "OpensslLib.inf" is expected to list "$(OPENSSL_PATH)/ssl/..." source
  files in the auto-generated part of the [Sources] section.

Commit 8906f076de35 ("CryptoPkg/OpensslLib: Add missing header files in
INF file", 2019-08-16) broke that invariant, by adding "buildinf.h" and
"rand_pool_noise.h" in different order to both INF files.

Fix that order in "OpensslLib.inf" now. (Note that this does not
re-establish full consistency between both INF files -- it just highlights
another problem, which we'll fix in the next patch.)

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Fixes: 8906f076de35b222a7d62bcf6ed1a4a2498a5791
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoMdeModulePkg/VariableSmmRuntimeDxe.inf: list local header "Variable.h"
Laszlo Ersek [Thu, 21 Nov 2019 07:31:24 +0000 (08:31 +0100)]
MdeModulePkg/VariableSmmRuntimeDxe.inf: list local header "Variable.h"

Commit aab3b9b9a1e5 ("MdeModulePkg/Variable: Add RT GetVariable() cache
support", 2019-11-05) added "VariableParsing.h" to
"VariableSmmRuntimeDxe.inf".

"VariableParsing.h" includes "Variable.h", so the "build" utility is right
to warn us that "Variable.h" should be listed in [Sources] too.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Fixes: aab3b9b9a1e5e1f3fa966fb1667fc3e6c47e7706
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoMdeModulePkg/Variable: Initialize local variable "RtPtrTrack" edk2-stable201911
Kubacki, Michael A [Thu, 21 Nov 2019 23:02:36 +0000 (07:02 +0800)]
MdeModulePkg/Variable: Initialize local variable "RtPtrTrack"

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

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

This patch initializes the local variable "RtPtrTrack" in
FindVariableInRuntimeCache ().

This ensures the pointers in the structure are initialized
in the case no variable stores exist in the list of variable
stores.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/Variable: Initialize local variable "Variable"
Kubacki, Michael A [Thu, 21 Nov 2019 23:02:35 +0000 (07:02 +0800)]
MdeModulePkg/Variable: Initialize local variable "Variable"

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

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

This patch initializes the local variable "Variable" in
VariableServiceGetNextVariableInternal ().

This ensures the pointers in the structure are initialized
in the case no variable stores exist in the list of variable
stores.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoStandaloneMmPkg: Fix build failure - Bug 2253
Sami Mujawar [Mon, 25 Nov 2019 09:06:04 +0000 (17:06 +0800)]
StandaloneMmPkg: Fix build failure - Bug 2253

The StandaloneMmPkg currently has code for supporting
Arm architecture only. Support for X64 and IA32 is
currently under development on a separate branch.

However, StandaloneMmPkg/StandaloneMmPkg.dsc is
indicating that support for X64 and IA32 is
available which is causing build failures.
This has been reported in
https://bugzilla.tianocore.org/show_bug.cgi?id=2253

This issue has been discussed earlier on the list:
(1) https://edk2.groups.io/g/devel/message/47276

(2) https://edk2.groups.io/g/devel/message/47283

In light of the above, this patch removes IA32 and X64
from SUPPORTED_ARCHITECTURES, until support for the
respective architectures is merged into StandaloneMmPkg.

Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
4 years agoBaseTools:fix regression issue for platform .map file
Fan, ZhijuX [Fri, 22 Nov 2019 10:54:39 +0000 (18:54 +0800)]
BaseTools:fix regression issue for platform .map file

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

This patch is to fix a build tool regression issue which was introduced
by commit b8ac0b7f28.This issue caused map file lost the line of IMAGE=***.
For example,in Ovmf.map, there is no line of (IMAGE=<path to efi> ) under
each of modules item.

The path to the efi file generated by each module is written on this line
The purpose of this line is add the debug image full path.
there is no information about the module in the map file other than FVName,
it allows us to quickly know which module this part corresponds to.

In commit b8ac0b7f28,add a line ("self.BuildModules = []") in function,
but it's used to calculate the variable ModuleList in the following code.

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdePkg: Update the comments of IsLanguageSupported
Shenglei Zhang [Thu, 14 Nov 2019 11:46:41 +0000 (19:46 +0800)]
MdePkg: Update the comments of IsLanguageSupported

Keep the comment style of IsLanguageSupported align with
other functions.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools:Add [packages] section in dsc file
Fan, ZhijuX [Thu, 14 Nov 2019 01:27:42 +0000 (09:27 +0800)]
BaseTools:Add [packages] section in dsc file

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

Currently a PCD (e.g. FeaturePCD) cannot be used in a conditional
statement in a DSC/FDF file without a module in the build referencing
the PCD package DEC file.

An example implementation that to support this is to allow a [Packages]
section in the DSC file to list additional package dependencies for PCD
references in the package DSC/FDF files.

this patch is going to  add the ability to have the [packages] section
defined in the DSC file

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Acked-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdeModulePkg/NvmExpressDxe: Fix wrong queue size for async IO queues
Sean Brogan [Tue, 3 Sep 2019 23:52:26 +0000 (16:52 -0700)]
MdeModulePkg/NvmExpressDxe: Fix wrong queue size for async IO queues

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

When a packet is queued/completed for the asynchronous IO queue, the logic
to roll over to the front of the queue doesn't account for actual size of
the IO Submission/Completion queue.

This causes a device to hang due to doorbell being outside of visible
queue. An example would be if an NVMe drive only supported a queue size of
128 while the driver supports 256.

Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg DSC and WinHost.inf: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:04:36 +0000 (16:04 +0800)]
EmulatorPkg DSC and WinHost.inf: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoOvmfPkg DSC: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:04:01 +0000 (16:04 +0800)]
OvmfPkg DSC: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoCryptoPkg CryptoLib: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:03:24 +0000 (16:03 +0800)]
CryptoPkg CryptoLib: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg RegularExpressionDxe: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:02:18 +0000 (16:02 +0800)]
MdeModulePkg RegularExpressionDxe: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoBaseTools: Rename tool chain CLANG9 to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:00:53 +0000 (16:00 +0800)]
BaseTools: Rename tool chain CLANG9 to CLANGPDB

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

Based on feedback from https://edk2.groups.io/g/devel/message/50466,
CLANGPDB is the most acceptable tool chain name,
because this tool chain generates PE/COFF image with PDB debug symbol.
The following changes are made in this patch.
1. Update tool chain name from CLANG9 to CLANGPDB.
2. Update tool chain BUILDRULEFAMILY from CLANGPE to CLANGPDB.
3. Update CLANG9_BIN env name to CLANG_BIN without version info.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdeModulePkg: Unify the definitions of size_t
Zhiguang Liu [Tue, 12 Nov 2019 08:47:44 +0000 (16:47 +0800)]
MdeModulePkg: Unify the definitions of size_t

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

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/Variable: Fix volatile variable RT cache update logic
Michael Kubacki [Mon, 11 Nov 2019 04:03:21 +0000 (20:03 -0800)]
MdeModulePkg/Variable: Fix volatile variable RT cache update logic

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

During a SetVariable () invocation, UpdateVariable () is called.
UpdateVariable () contains logic to determine whether a volatile or
non-volatile UEFI variable was set so the corresponding runtime
cache can be updated to reflect the change. The current logic simply
evaluates Variable->Volatile to determine which runtime cache should
be updated.

The problem is Variable->Volatile does not always reflect whether a
volatile variable is being set. Variable->Volatile is set to TRUE
only in the case a pre-existing variable is found in the volatile
variable store. Therefore, the value is FALSE when a new volatile
variable is written.

This change updates the logic to take this into account. If a new
variable is written successfully, the Attributes will accurately
reflect whether the variable is non-volatile. If a pre-existing
variable is modified, the Volatile field will reflect the type of
variable (Attributes are not reliable; e.g. 0x0 indicates deletion).

* Observable symptom: A volatile variable that was set successfully
  might return EFI_NOT_FOUND when the variable should be found.

* The issue is a regression introduced to the variable services only
  when the variable runtime cache is enabled by the following PCD
  being set to TRUE:
  gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache

* The issue was implemented in commit aab3b9b9a1 but the PCD was not
  set to TRUE by default enabling the issue until commit e07b7d024a.

Fixes: aab3b9b9a1e5e1f3fa966fb1667fc3e6c47e7706
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoShellPkg/SmbiosView: SMBIOS 3.3.0 Update "Intel persistent memory"
Gao, Zhichao [Tue, 12 Nov 2019 03:49:00 +0000 (09:19 +0530)]
ShellPkg/SmbiosView: SMBIOS 3.3.0 Update "Intel persistent memory"

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

Memory Device (Type 17):
- SMBIOSCR00179: update the string for Intel persistent memory

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoShellPkg/SmbiosView: SMBIOS 3.3.0 Add value HBM and Die for type 17
Gao, Zhichao [Tue, 12 Nov 2019 03:48:59 +0000 (09:18 +0530)]
ShellPkg/SmbiosView: SMBIOS 3.3.0 Add value HBM and Die for type 17

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

Memory Device (Type 17):
- SMBIOSCR00178: add new memory device type value (HBM) and new form
factor value (Die)

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoShellPkg/SmbiosView: SMBIOS 3.3.0 add support for CXL Flexbus
Gao, Zhichao [Tue, 12 Nov 2019 03:48:58 +0000 (09:18 +0530)]
ShellPkg/SmbiosView: SMBIOS 3.3.0 add support for CXL Flexbus

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

Various:
- SMBIOSCR00183: add support for CXL Flexbus

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoShellPkg/SmbiosView: SMBIOS 3.3.0 add PCI gen4 values for type 9
Gao, Zhichao [Tue, 12 Nov 2019 03:48:57 +0000 (09:18 +0530)]
ShellPkg/SmbiosView: SMBIOS 3.3.0 add PCI gen4 values for type 9

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

System Slots (Type 9):
- SMBIOSCR00184: add PCI Express Gen 4 values

Add the SmBios.h to use the MARCOs or enums.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoMdePkg/SmBios.h: SMBIOS 3.3.0 Update Intel Persistent Memory string
Gao, Zhichao [Tue, 12 Nov 2019 03:48:56 +0000 (09:18 +0530)]
MdePkg/SmBios.h: SMBIOS 3.3.0 Update Intel Persistent Memory string

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

Memory Device (Type 17):
- SMBIOSCR00179: update the string for Intel persistent memory

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoMdePkg/SmBios.h: SMBIOS 3.3.0 Add value HBM and Die for type 17
Gao, Zhichao [Tue, 12 Nov 2019 03:48:55 +0000 (09:18 +0530)]
MdePkg/SmBios.h: SMBIOS 3.3.0 Add value HBM and Die for type 17

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

Memory Device (Type 17):
- SMBIOSCR00178: add new memory device type value (HBM) and new form
factor value (Die)

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoMdePkg/SmBios.h: SMBIOS 3.3.0 add support for CXL Flexbus
Gao, Zhichao [Tue, 12 Nov 2019 03:48:54 +0000 (09:18 +0530)]
MdePkg/SmBios.h: SMBIOS 3.3.0 add support for CXL Flexbus

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

Various:
- SMBIOSCR00183: add support for CXL Flexbus

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoMdePkg/SmBios.h: SMBIOS 3.3.0 add PCI gen4 values for type 9
Gao, Zhichao [Tue, 12 Nov 2019 03:48:53 +0000 (09:18 +0530)]
MdePkg/SmBios.h: SMBIOS 3.3.0 add PCI gen4 values for type 9

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

System Slots (Type 9):
- SMBIOSCR00184: add PCI Express Gen 4 values

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoMdePkg: add null version of RngLib
Jian J Wang [Tue, 12 Nov 2019 08:45:48 +0000 (16:45 +0800)]
MdePkg: add null version of RngLib

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

This is null version of RngLib which should be used with modules that
inherit an (indirect) dependency on the RngLib class, but never actually
call RngLib APIs for consuming randomness.

To be more specific, if following components or functionalities are used
in a platform, the BaseRngLibNull should *not* be used. Instead, a non-Null
version of RngLib must be used (like BaseRngLib for IA32/X64, or future
DxeRngLibRngProtocol for all ARCHs).

- HddPasswordDxe.inf
- AES, TLS (TlsDxe.inf, TlsLib.inf), RSA_OAEP, RSA_PK1
- (If BaseRngLibNull interface ASSERTed at boot time)

Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoUefiCpuPkg/RegisterCpuFeature: Remove CPU_FEATURE_XD macro
Ray Ni [Mon, 11 Nov 2019 03:05:48 +0000 (11:05 +0800)]
UefiCpuPkg/RegisterCpuFeature: Remove CPU_FEATURE_XD macro

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

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
4 years agoUefiCpuPkg/CpuCommonFeaturesLib: Remove XD enable/disable logic
Ray Ni [Mon, 11 Nov 2019 02:47:47 +0000 (10:47 +0800)]
UefiCpuPkg/CpuCommonFeaturesLib: Remove XD enable/disable logic

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

XD (ExecutionDisable) feature, when turned on, allows page table
entry BIT63 set to 1 indicating the memory pointed by the page table
is disallowed to execute.
DxeIpl::CreateIdentityMappingPageTables() enables the XD when CPU
supports it.
Later DxeCore modifies the page table to set the BIT63 to protect
the stack/heap to disallow code execution in stack/heap.

UefiCpuPkg/CpuCommonFeaturesLib enables/disables the XD feature
according to PcdCpuFeaturesSetting.
When XD is disabled, GP fault is generated immediately because some
page entries have BIT63 set.

To fix this issue, this patch removes the XD feature logic from
UefiCpuPkg/CpuCommonFeaturesLib so the XD feature is only taken
care of by DxeIpl.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
4 years agoBaseTools: Fix build failure when using python38
Ni, Ray [Tue, 12 Nov 2019 06:17:35 +0000 (14:17 +0800)]
BaseTools: Fix build failure when using python38

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

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Bob C Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Enable MACRO for DSC Components section tag
Feng, Bob C [Thu, 24 Oct 2019 00:35:44 +0000 (08:35 +0800)]
BaseTools: Enable MACRO for DSC Components section tag

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

This patch is to enable MACRO for Components section architecture
modifier.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoEmulatorPkg/PlatformSmbiosDxe: fix a spell error of platform.
Tan, Ming [Mon, 11 Nov 2019 07:18:50 +0000 (15:18 +0800)]
EmulatorPkg/PlatformSmbiosDxe: fix a spell error of platform.

Old code use platfomr.
Change PlatfomrSmbiosDriverEntryPoint to PlatformSmbiosDriverEntryPoint.

Signed-off-by: Ming Tan <ming.tan@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoReadme.md: Update EDK II CI build branch name
Michael D Kinney [Tue, 12 Nov 2019 01:39:28 +0000 (17:39 -0800)]
Readme.md: Update EDK II CI build branch name

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

Update Readme.md to indicate that that status badges are for
the edk2/master branch.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
4 years agoReadme.md: Update EDK II CI build status badge and links
Michael D Kinney [Mon, 11 Nov 2019 23:13:10 +0000 (15:13 -0800)]
Readme.md: Update EDK II CI build status badge and links

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

Update Readme.md with the status badges from the Azure
Pipelines, tianocore organization, edk2-ci project

    https://dev.azure.com/tianocore/edk2-ci/_build

* Windows VS2019 CI pipeline badges and results
* Ubuntu GCC5 CI pipeline badges and results

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
4 years agoReadme.md: Add CI build status badges
Michael D Kinney [Mon, 28 Oct 2019 20:48:49 +0000 (13:48 -0700)]
Readme.md: Add CI build status badges

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

Update Readme.md with status badges from the most recent
EDK II Continuous Integration(CI) build.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years ago.mergify: Add Mergify YML pull request rules configuration file
Michael D Kinney [Fri, 18 Oct 2019 22:22:36 +0000 (15:22 -0700)]
.mergify: Add Mergify YML pull request rules configuration file

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

Add directory for the Mergify YML configuration files that
provides rules and actions used to process a pull request.

* Auto commit a PR from EDK II Maintainer with 'push' label
  set and all CI checks pass
* Auto close a PR from any developers without 'push' label
  set and all CI checks pass.
* Auto close a PR from a non EDK II Maintainer that has
  the 'push' label set.
* Post a comment to a PR that has a merge conflict.
  Submitter can resolved conflicts and reopen the PR.
* Post a comment to a PR that fails PatchCheck.py
  Submitter can resolve PatchCheck.py issues and
  reopen the PR.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years ago.azurepipelines: Add Azure Pipelines YML configuration files
Sean Brogan [Tue, 8 Oct 2019 03:34:34 +0000 (20:34 -0700)]
.azurepipelines: Add Azure Pipelines YML configuration files

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

Add YML configuration files used to run the EDK II Continuous
Integration (CI) checks on Azure Pipelines agents.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years ago.pytool: Add CISettings.py and Readme.md
Sean Brogan [Tue, 8 Oct 2019 03:25:30 +0000 (20:25 -0700)]
.pytool: Add CISettings.py and Readme.md

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

Add main python script for EDK II Continuous Integration (CI)
builds along with a Readme.md that provides a summary of the
packages, platforms, and checks performs during a CI build.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoSignedCapsulePkg: Use BaseCryptLibNull to reduce package CI time
Michael D Kinney [Fri, 25 Oct 2019 20:53:34 +0000 (13:53 -0700)]
SignedCapsulePkg: Use BaseCryptLibNull to reduce package CI time

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

Use BaseCryptLibNull for package CI builds to reduce package
build times.  Enabled with PYTOOL_CONTINUOUS_INTEGRATION in YAML
files.  By default PYTOOL_CONTINUOUS_INTEGRATION is not defined,
and the original lib mappings are preserved.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoUefiCpuPkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:21:54 +0000 (13:21 -0700)]
UefiCpuPkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoShellPkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:21:41 +0000 (13:21 -0700)]
ShellPkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Zhichao Gao <zhichao.gao@intel.com>
Acked-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoSecurityPkg: Add YAML files for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:21:26 +0000 (13:21 -0700)]
SecurityPkg: Add YAML files for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Use BaseCryptLibNull for package CI builds to reduce package
build times.  Enabled with CONTINUOUS_INTEGRATION in YAML
files.  By default CONTINUOUS_INTEGRATION is not defined,
and the original lib mappings are preserved.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoPcAtChipsetPkg: Add YAML files for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:21:07 +0000 (13:21 -0700)]
PcAtChipsetPkg: Add YAML files for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoNetworkPkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:20:40 +0000 (13:20 -0700)]
NetworkPkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Use BaseCryptLibNull and TlsLibNull for package CI
builds to reduce package build times.  Enabled with
CONTINUOUS_INTEGRATION in YAML files.  By default
CONTINUOUS_INTEGRATION is not defined, and the
original lib mappings are preserved.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:20:17 +0000 (13:20 -0700)]
MdePkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:20:04 +0000 (13:20 -0700)]
MdeModulePkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoFmpDevicePkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:19:46 +0000 (13:19 -0700)]
FmpDevicePkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Use BaseCryptLibNull for package CI builds to reduce package
build times.  Enabled with CONTINUOUS_INTEGRATION in YAML
files.  By default CONTINUOUS_INTEGRATION is not defined,
and the original lib mappings are preserved.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoFatPkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:19:28 +0000 (13:19 -0700)]
FatPkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoCryptoPkg: Add YAML file for CI builds
Michael D Kinney [Mon, 28 Oct 2019 20:19:09 +0000 (13:19 -0700)]
CryptoPkg: Add YAML file for CI builds

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

Add YAML file to the package directory with the
configuration of the checks to perform during a
CI build.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Signed-off-by: Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years ago.pytool/Plugin: Add CI plugins
Sean Brogan [Fri, 18 Oct 2019 04:40:58 +0000 (21:40 -0700)]
.pytool/Plugin: Add CI plugins

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

Add .pytool directory to the edk2 repository with the
following plugins.  These plugins are in a top level
directory because that can be used with all packages
and platforms.

* CharEncodingCheck
* CompilerPlugin
* DependencyCheck
* DscCompleteCheck
* GuidCheck
* LibraryClassCheck
* SpellCheck

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Add BaseTools plugins to support CI
Sean Brogan [Tue, 8 Oct 2019 02:57:30 +0000 (19:57 -0700)]
BaseTools: Add BaseTools plugins to support CI

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

Add the following plugins that are required to support
EDK II Continuous Integration (CI) builds.  These plugins
are added to BaseTools because that support EDK II BaseTools
features.

* BuildToolsReportGenerator
* LinuxGcc5ToolChain
* WindowsResourceCompiler
* WindowsVsToolChain

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Add YAML files with path env and tool extdeps
Sean Brogan [Tue, 8 Oct 2019 01:37:13 +0000 (18:37 -0700)]
BaseTools: Add YAML files with path env and tool extdeps

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

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Add RC_PATH define for VS2017/2019
Sean Brogan [Tue, 8 Oct 2019 02:54:21 +0000 (19:54 -0700)]
BaseTools: Add RC_PATH define for VS2017/2019

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

Add use of RC_PATH define that provides the path to the resource
compiler that is typically provided in a Windows SDK.  The path
changes with different Windows SDK releases.  This define is set
to the WINSDK_PATH_FOR_RC_EXE environment variable.  This
environment variable must be set to the path to the currently
installed resource compiler (rc.exe).

Update set_vsprefix_envs.bat to set WINSDK_PATH_FOR_RC_EXE
if a Windows SDK is detected.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agopip-requirements.txt: Add python pip requirements file
Sean Brogan [Wed, 25 Sep 2019 04:34:26 +0000 (21:34 -0700)]
pip-requirements.txt: Add python pip requirements file

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

Add pip requirements file that is used to install the
python pip modules build from the edk2-pytool-library and
edk2-pytool-extensions repositories.

These python modules provide the extensions required to
perform EDK II Continuous Integration(CI) builds.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years ago.gitignore: Ignore python compiled files, extdeps, and vscode
Sean Brogan [Wed, 25 Sep 2019 05:34:18 +0000 (22:34 -0700)]
.gitignore: Ignore python compiled files, extdeps, and vscode

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

Update .gitignore to ignore .pyc files and __pycache__
directories.  Python based plugins can be added to any
package or platform, so these files and directories may
be present outside of BaseTools.

Ignore _extdep directories that are generated by the
pytool external dependency feature.

Ignore .vscode directories generated by the VS Code
editor.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMaintainers.txt: Add continuous integration(CI) directories
Michael D Kinney [Fri, 25 Oct 2019 18:44:54 +0000 (11:44 -0700)]
Maintainers.txt: Add continuous integration(CI) directories

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

Add maintainers and reviewers for the directories associated
with continuous integration steps.
* .azurepipelines
* .mergify
* .pytool

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoReadme.md: remove positional references from submodule description
Leif Lindholm [Tue, 29 Oct 2019 01:54:36 +0000 (09:54 +0800)]
Readme.md: remove positional references from submodule description

Remove references to the number of submodules in the tree, as well as
reword the referring to specific submodules as "former" and "previous".
This means we won't need to keep updating the surrounding text if we
add/remove submodules.

Cc: Andrew Fish <afish@apple.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdeModulePkg/Pci: Add DeviceSecurity support.
Jiewen Yao [Sun, 29 Sep 2019 08:37:14 +0000 (16:37 +0800)]
MdeModulePkg/Pci: Add DeviceSecurity support.

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

Whenever a PCI device is discovered, PCI bus calls the
EDKII_DEVICE_SECURITY_PROTOCOL to authenticate it.
If the function returns success, the PCI bus allocates
the resource and installs the PCI_IO for the device.
If the function returns fail, the PCI bus skips the device.

It is similar to EFI_SECURITY_ARCH_PROTOCOL, which
is used to verify an EFI image.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Yun Lou <yun.lou@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoMdeModulePkg/dec: Add EdkiiDeviceSecurityProtocolGuid.
Jiewen Yao [Sun, 20 Oct 2019 09:07:06 +0000 (17:07 +0800)]
MdeModulePkg/dec: Add EdkiiDeviceSecurityProtocolGuid.

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

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Yun Lou <yun.lou@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed by: Ray Ni <ray.ni@intel.com>

4 years agoMdeModulePkg/Include: Add DeviceSecurity.h
Jiewen Yao [Sun, 20 Oct 2019 09:06:51 +0000 (17:06 +0800)]
MdeModulePkg/Include: Add DeviceSecurity.h

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

EDKII_DEVICE_SECURITY_PROTOCOL is used for device
measurement and/or authentication.
It is similar to EFI_SECURITY_ARCH_PROTOCOL.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Yun Lou <yun.lou@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed by: Ray Ni <ray.ni@intel.com>

4 years agoMdePkg/Include: Add DMTF SPDM definition.
Jiewen Yao [Sun, 29 Sep 2019 08:22:38 +0000 (16:22 +0800)]
MdePkg/Include: Add DMTF SPDM definition.

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

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yun Lou <yun.lou@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed by: Liming Gao <liming.gao@intel.com>
Reviewed by: Ray Ni <ray.ni@intel.com>

4 years agoMdeModulePkg/Core/Dxe: free page 0 after disabling NULL pointer detection
Jian J Wang [Wed, 6 Nov 2019 21:13:33 +0000 (21:13 +0000)]
MdeModulePkg/Core/Dxe: free page 0 after disabling NULL pointer detection

To solve access issue reported by BZ1885, page 0 will be allocated to
avoid misuses if NULL pointer detection is enabled. It should be better
to be freed after EndOfDxe if BIT7 of PcdNullPointerDetectionPropertyMask
is set, because NULL pointer detection is no longer available after
EndOfDxe and there will be no access conflict.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1885
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoMdeModulePkg/DxeIplPeim: reserve page 0 for NULL pointer detection
Jian J Wang [Wed, 6 Nov 2019 21:13:32 +0000 (21:13 +0000)]
MdeModulePkg/DxeIplPeim: reserve page 0 for NULL pointer detection

When a boot loader examines the memory map, it can see that location 0
is available memory. If it chooses to use that memory, and
PcdNullPointerDetectionPropertyMask is enabled, use of memory in page 0
will cause an exception. This does occur when running the memtest86
program.

Leaving page 0 available is for legacy support purpose. Since we have
deprecated the support of legacy, the solution is just reserving it so
that it cannot be allocated for other uses.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1885
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoBaseTools/GenFw AARCH64: disregard ADRP instructions that are patched already
Ard Biesheuvel [Fri, 8 Nov 2019 07:58:15 +0000 (08:58 +0100)]
BaseTools/GenFw AARCH64: disregard ADRP instructions that are patched already

In order to permit the use of compilers that only implement the small
code model [which involves the use of ADRP instructions that require
4 KB segment alignment] for generating PE/COFF binaries with a small
footprint, we patch ADRP instructions into ADR instructions while doing
the ELF to PE/COFF conversion.

As it turns out, the linker may be doing the same, but for different
reasons: there is a silicon erratum #843419 for ARM Cortex-A53 which
affects ADRP instructions appearing at a certain offset in memory, and
one of the mitigations for this erratum is to patch them into ADR
instructions at link time if the symbol reference is within -/+ 1 MB.
However, the LD linker fails to update the static relocation tables, and
so we end up with an ADR instruction in the fully linked binary, but
with a relocation entry in the RELA section identifying it as an ADRP
instruction.

Since the linker has already updated the symbol reference, there is no
handling needed in GenFw for such instructions, and we can simply treat
it as an ordinary ADR. However, since it is guaranteed to be accompanied
by an add or load instruction with a LO12 relocation referencing the same
symbol, the section offset check we apply to ADR instructions is going to
take place anyway, so we can just disregard the ADR instruction entirely.

Reported-by: Eugene Cohen <eugene@hp.com>
Suggested-by: Eugene Cohen <eugene@hp.com>
Tested-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoShellPkg/CommandLib: Use first found UC for unsupported PlatformLang
Marvin H?user [Tue, 5 Nov 2019 13:50:44 +0000 (21:50 +0800)]
ShellPkg/CommandLib: Use first found UC for unsupported PlatformLang

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

On some firmwares PlatformLang is set to the local language (e.g. ru-RU),
however there is no Unicode Collation protocol instance that supports it.
As for missing PlatformLang, fall back to the first found instance.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
4 years agoBaseTools: Add support for parseing map files generated by CLANG9 in GenFv
Zhiguang Liu [Fri, 1 Nov 2019 02:35:59 +0000 (10:35 +0800)]
BaseTools: Add support for parseing map files generated by CLANG9 in GenFv

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

Add support for parseing map files generated by CLANG9 in GenFv

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
4 years agoBaseTools: Add map file parsing support for CLANG9
Zhiguang Liu [Tue, 29 Oct 2019 05:07:44 +0000 (13:07 +0800)]
BaseTools: Add map file parsing support for CLANG9

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
4 years agoEmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibility
Ashish Singhal [Mon, 4 Nov 2019 17:49:31 +0000 (10:49 -0700)]
EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibility

Add a PCD to govern whether to use DT or ACPI in case the
variable governing this is not found or is not valid.

Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoSecurityPkg: Fix TPM2 ACPI measurement.
Derek Lin [Wed, 6 Nov 2019 09:00:47 +0000 (09:00 +0000)]
SecurityPkg: Fix TPM2 ACPI measurement.

We have discussed in this thread.
https://edk2.groups.io/g/devel/topic/32205028

Before the change, TPM FW upgrade will impact TPM2 ACPI PCR value because
TPM2 ACPI HID include FW version.

This change make the measurement before TPM2 HID fixup. So, after TPM FW
upgrade, the ACPI PCR record remains the same.

Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoSecurityPkg/OpalPassword: Remove dependency on EFI_BLOCK_IO_PROTOCOL
Chu, Maggie [Mon, 4 Nov 2019 04:04:28 +0000 (12:04 +0800)]
SecurityPkg/OpalPassword: Remove dependency on EFI_BLOCK_IO_PROTOCOL

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

RAID drivers abstract their physical drives that make up
the array into a single unit, and do not supply individual
EFI_BLOCK_IO_PROTOCOL instances for each physical drive in the array.
This breaks support for the Security Storage Command Protocol,
which currently requires an EFI_BLOCK_IO_PROTOCOL to be associated
with the same device the protocol is installed on and provide
all the same parameters.

This patch remove dependency on EFI_BLOCK_IO_PROTOCOL and
allows access to Opal drive members of a RAID array.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
4 years agoMaintainers.txt: Adding new NetworkPkg reviewer.
Rabeda, Maciej [Tue, 5 Nov 2019 17:07:12 +0000 (01:07 +0800)]
Maintainers.txt: Adding new NetworkPkg reviewer.

Add Maciej Rabeda as reviewer of NetworkPkg.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
4 years agoMdeModulePkg: Enable variable runtime cache by default
Michael Kubacki [Mon, 14 Oct 2019 23:15:08 +0000 (16:15 -0700)]
MdeModulePkg: Enable variable runtime cache by default

This change enables the variable runtime cache by default by setting
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache in
MdeModulePkg.dec to TRUE.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoOvmfPkg: Disable variable runtime cache
Michael Kubacki [Mon, 14 Oct 2019 17:14:24 +0000 (10:14 -0700)]
OvmfPkg: Disable variable runtime cache

Sets gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache
to FALSE in OvmfPkgIa32.dsc, OvmfPkgIa32X64.dsc, and OvmfPkgX64.dsc
so that when SMM_REQUIRE is TRUE, the SMM variable driver will not
use the runtime variable cache.

This is done for OvmfPkg because it currently depends upon a SMM
variable GetVariable ()implementation as a simple method to exercise
the SMM driver stack. This allows the following commands to be used
for variables such as Boot####, BootOrder, and BootNext to test SMM
timing and stability differences on the BSP (e.g. CPU#0) vs an
AP (e.g. CPU#1).
 # taskset -c 0 efibootmgr
 # taskset -c 1 efibootmgr

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdeModulePkg/Variable: Add RT GetNextVariableName() cache support
Michael Kubacki [Tue, 24 Sep 2019 01:49:37 +0000 (18:49 -0700)]
MdeModulePkg/Variable: Add RT GetNextVariableName() cache support

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

This change implements the Runtime Service GetNextVariableName()
using the runtime cache in VariableSmmRuntimeDxe. Runtime Service
calls to GetNextVariableName() will no longer trigger a SW SMI
when gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache
is set to TRUE (default value).

Overall system performance and stability will be improved by
eliminating an SMI for these calls as they typically result in a
relatively large number of invocations to retrieve all variable
names in all variable stores present.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/Variable: Add RT GetVariable() cache support
Michael Kubacki [Mon, 23 Sep 2019 23:48:09 +0000 (16:48 -0700)]
MdeModulePkg/Variable: Add RT GetVariable() cache support

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

This change reduces SMIs for GetVariable () by maintaining a
UEFI variable cache in Runtime DXE in addition to the pre-
existing cache in SMRAM. When the Runtime Service GetVariable()
is invoked, a Runtime DXE cache is used instead of triggering an
SMI to VariableSmm. This can improve overall system performance
by servicing variable read requests without rendezvousing all
cores into SMM.

The runtime cache  can be disabled with by setting the FeaturePCD
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache
to FALSE. If the PCD is set to FALSE, the runtime cache will not be
used and an SMI will be triggered for Runtime Service
GetVariable () and GetNextVariableName () invocations.

The following are important points regarding the behavior of the
variable drivers when the variable runtime cache is enabled.

1. All of the non-volatile storage contents are loaded into the
   cache upon driver load. This one time load operation from storage
   is preferred as opposed to building the cache on demand. An on-
   demand cache would require a fallback SMI to load data into the
   cache as variables are requested.

2. SetVariable () requests will continue to always trigger an SMI.
   This occurs regardless of whether the variable is volatile or
   non-volatile.

3. Both volatile and non-volatile variables are cached in a runtime
   buffer. As is the case in the current EDK II variable driver, they
   continue to be cached in separate buffers.

4. The cache in Runtime DXE and SMM are intended to be exact copies
   of one another. All SMM variable accesses only return data from the
   SMM cache. The runtime caches are only updated after the variable I/O
   operation is successful in SMM. The runtime caches are only updated
   from SMM.

5. Synchronization mechanisms are in place to ensure the runtime cache
   content integrity with the SMM cache. These may result in updates to
   runtime cache that are the same in content but different in offset and
   size from updates to the SMM cache.

When using SMM variables with runtime cache enabled, two caches will now
be present.
1. "Runtime Cache" - Maintained in VariableSmmRuntimeDxe. Used to service
   Runtime Services GetVariable () and GetNextVariableName () callers.
2. "SMM Cache" - Maintained in VariableSmm to service SMM GetVariable ()
   and GetNextVariableName () callers.
   a. This cache is retained so SMM modules do not operate on data outside
      SMRAM.

Because a race condition can occur if an SMI occurs during the execution
of runtime code reading from the runtime cache, a runtime cache read lock
is introduced that explicitly moves pending updates from SMM to the runtime
cache if an SMM update occurs while the runtime cache is locked. Note that
it is not expected a Runtime services call will interrupt SMM processing
since all CPU cores rendezvous in SMM.

It is possible to view UEFI variable read and write statistics by setting
the gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics FeaturePcd
to TRUE and using the VariableInfo UEFI application in MdeModulePkg to dump
variable statistics to the console. By doing so, a user can view the number
of GetVariable () hits from the Runtime DXE variable driver (Runtime Cache
hits) and the SMM variable driver (SMM Cache hits). SMM Cache hits for
GetVariable () will occur when SMM modules invoke GetVariable ().

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg VariableInfo: Always consider RT DXE and SMM stats
Michael Kubacki [Wed, 25 Sep 2019 21:58:45 +0000 (14:58 -0700)]
MdeModulePkg VariableInfo: Always consider RT DXE and SMM stats

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

The current VariableInfo application only checks for variable
statistics from SMM if the variable information entries are
not present in the UEFI System Configuration table as published
by the DXE UEFI variable driver (VariableRuntimeDxe).

This change first checks for variable information entries in the
UEFI System Configuration but always checks for entries in SMM
as well. If the SMM variable driver is not present, an instance of
EFI_SMM_VARIABLE_PROTOCOL will not be found and the search for
SMM variable statistics will be aborted (an SW SMI to get variable
statistics will not be triggered).

In the case variable statistics are provided by both a Runtime DXE
driver (e.g. VariableSmmRuntimeDxe) and a SMM driver (VariableSmm),
this change will clearly identify statistics from each respective
driver.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/Variable: Add a file for NV variable functions
Michael Kubacki [Fri, 27 Sep 2019 22:34:14 +0000 (15:34 -0700)]
MdeModulePkg/Variable: Add a file for NV variable functions

This change adds a dedicated file for variable operations specific
to non-volatile variables. This decreases the overall length of the
relatively large Variable.c file.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/Variable: Parameterize auth status in VariableParsing
Michael Kubacki [Fri, 27 Sep 2019 22:18:42 +0000 (15:18 -0700)]
MdeModulePkg/Variable: Parameterize auth status in VariableParsing

The file VariableParsing.c provides generic functionality related
to parsing variable related structures and information. In order to
calculate offsets for certain operations, the functions must know if
authenticated variables are enabled as this increases the size of
variable headers.

This change removes linking against a global variable in an external file
in favor of passing the authenticated variable status as a parameter to
the variable parsing functions.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/Variable: Parameterize VARIABLE_INFO_ENTRY buffer
Michael Kubacki [Fri, 27 Sep 2019 22:08:09 +0000 (15:08 -0700)]
MdeModulePkg/Variable: Parameterize VARIABLE_INFO_ENTRY buffer

UpdateVariableInfo () currently accepts parameters regarding updates
to be made to a global variable of type VARIABLE_INFO_ENTRY. This
change passes the structure by pointer to UpdateVariableInfo ()
so structures other than the fixed global variable can be updated.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>