]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
4 years agoSecurityPkg/OpalPassword: Add warning message for Secure Erase
Chu, Maggie [Tue, 7 May 2019 06:19:35 +0000 (14:19 +0800)]
SecurityPkg/OpalPassword: Add warning message for Secure Erase

https://bugzilla.tianocore.org/show_bug.cgi?id=1753
Add pop-up warning messages before secure erase action.
In order to notify user the secure erase action will take a longer time.
This change also fix some pop-up windows are unable to show up
complete message due to some strings are too long.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoBaseTools: support arm64 as a platform name in addition to aarch64
Rebecca Cran [Thu, 11 Apr 2019 03:16:53 +0000 (21:16 -0600)]
BaseTools: support arm64 as a platform name in addition to aarch64

Some systems such as FreeBSD identify the platform as 'arm64'
and not 'aarch64' as Linux does.

Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: fix up DKIM damage in the "From:" address]

4 years agoVlv2TbltDevicePkg: Remove NetworkPkg/IpSecDxe module
Michael D Kinney [Wed, 1 May 2019 19:14:25 +0000 (12:14 -0700)]
Vlv2TbltDevicePkg: Remove NetworkPkg/IpSecDxe module

The following commit removed the NetworkPkg/IpSecDxe
module.

https://github.com/tianocore/edk2/commit/d55d9d0664366efe731db461e14c6fc380fca776

Update the MinnowMax platform DSC/FDF files to remove all
references to the NetworkPkg/IpSecDxe module.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
4 years agoOvmfPkg/EnrollDefaultKeys: suppress incorrect compiler warning
Laszlo Ersek [Tue, 30 Apr 2019 21:33:39 +0000 (23:33 +0200)]
OvmfPkg/EnrollDefaultKeys: suppress incorrect compiler warning

When building OvmfPkg/EnrollDefaultKeys for IA32 with gcc-4.8 for the
DEBUG target (and possibly under other build configurations too), the
compiler incorrectly reports,

> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c: In function
> 'ShellAppMain':
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c:631:10: error:
> 'SizeOfPkKek1' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>    Status = EnrollListOfCerts (
>           ^
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c:703:12: error: 'PkKek1'
> may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    FreePool (PkKek1);
>             ^
> cc1: all warnings being treated as errors

Suppress this warning, in the style suggested under
<https://bugzilla.tianocore.org/show_bug.cgi?id=607>.

Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: be9470b3c91fc50436c15a76c85cdde940355b9f
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoBaseTools:Fixed an issue where the order of GuidS changed in guid.xref
Fan, ZhijuX [Fri, 26 Apr 2019 02:29:58 +0000 (10:29 +0800)]
BaseTools:Fixed an issue where the order of GuidS changed in guid.xref

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

Add content to dsc
[PcdsPatchableInModule.common]
  gEfiMdeModulePkgTokenSpaceGuid.test1|FALSE

The order of file Guid.xref will change after increment build.
The root cause is set() is used in Get all the PCDS
the order of the data may change if set() is used

This patch is going to fix that issue.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Add GCC flags to Basetool build.
Feng, Bob C [Tue, 30 Apr 2019 11:07:01 +0000 (19:07 +0800)]
BaseTools: Add GCC flags to Basetool build.

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

Some compiler flags restrict the compiler from making
arbitrary decisions while handling undefined C/C++ behaviors.
Therefore they can be used to fix some issues caused by undefined behavior.

For example, for GCC, the following flags are available:
-fno-delete-null-pointer-checks tells
the compiler NOT to assume that null pointer deference does not exist.
-fwrapv tells the compiler that signed overflow always wraps.

This patch is going to add these 2 build options to
BaseTool GCC build option.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoBaseTools: split long line into multiple short lines.
Bob Feng [Tue, 30 Apr 2019 11:06:29 +0000 (19:06 +0800)]
BaseTools: split long line into multiple short lines.

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

To be easy to review in future, split the long line into
multiple shorter lines.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoQuarkPlatformPkg/PlatformInit: Resolve ResetSystemLib name collision
Michael D Kinney [Wed, 24 Apr 2019 21:15:32 +0000 (14:15 -0700)]
QuarkPlatformPkg/PlatformInit: Resolve ResetSystemLib name collision

Change function name from ResetSystem() to PlatformResetSystem()
to resolve name collision with ResetSystemLib.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
4 years agoQuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close
Michael D Kinney [Wed, 24 Apr 2019 21:07:19 +0000 (14:07 -0700)]
QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close

The following commit removed the unconditional UC setting
just prior to closing the SMRAM region.  This is a correct
change for most platforms.

https://github.com/tianocore/edk2/commit/bfc87aa78e77ed15b09d1b4499c5eab63e8842bb

The Quark platforms still require this UC setting, so move
the UC setting into the Quark specific SMM Access Protocol
when the Close() service is called.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
4 years agoQuarkPlatformPkg: Use uniprocessor MpInitLibUp
Michael D Kinney [Tue, 30 Apr 2019 19:05:17 +0000 (12:05 -0700)]
QuarkPlatformPkg: Use uniprocessor MpInitLibUp

Update Quark DSC files to use MpInitLibUp instead
of DxeMpInitLib and PeiMpInitLib.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
4 years agoUefiCpuPkg/CpuMpPei: Add missing CpuLib class
Michael D Kinney [Tue, 30 Apr 2019 19:03:36 +0000 (12:03 -0700)]
UefiCpuPkg/CpuMpPei: Add missing CpuLib class

The CpuMpPei module uses a services from the CpuLib class,
but the CpuLib class is missing from the INF file.  This
update is required to use the new MpInitLibUp instance that
does not use the CpuLib class.

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>
4 years agoUefiCpuPkg/MpInitLibUp: Add uniprocessor MpInitLib
Michael D Kinney [Tue, 30 Apr 2019 19:00:53 +0000 (12:00 -0700)]
UefiCpuPkg/MpInitLibUp: Add uniprocessor MpInitLib

Add a new instance of the MpInitLib that is designed for
uniprocessor platforms that require the use of modules
that depend on the MP_SERVICES_PROTOCOL for dispatch
or to retrieve information about the boot processor.

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>
4 years agoQuarkPlatformPkg: Set PcdSpeculationBarrierType to CPUID
Michael D Kinney [Mon, 29 Apr 2019 23:22:09 +0000 (16:22 -0700)]
QuarkPlatformPkg: Set PcdSpeculationBarrierType to CPUID

Set PcdSpeculationBarrierType to use CPUID instead of the
default LFENCE in the BaseLib function SpeculationBarrier().
LFENCE requires SSE2, and Quark platforms do not support
SSE2.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
4 years agoMdePkg/BaseLib: Use PcdSpeculationBarrierType
Michael D Kinney [Wed, 24 Apr 2019 21:06:32 +0000 (14:06 -0700)]
MdePkg/BaseLib: Use PcdSpeculationBarrierType

Use PcdSpeculationBarrierType in the x86 implementation
of SpeculationBarrier() to select between AsmLfence(),
AsmCpuid(), and no operation.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
4 years agoMdePkg: Add PcdSpeculationBarrierType
Michael D Kinney [Mon, 29 Apr 2019 23:17:20 +0000 (16:17 -0700)]
MdePkg: Add PcdSpeculationBarrierType

Add gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType that
uses the PCD type FixedAtBuild.  This performs a build time
selection for the type of speculation barrier to use in the
BaseLib function SpeculationBarrier().  The recommended
speculation barrier for x86 is LFENCE and this is the default
value for this PCD.  x86 CPUs that do not support LFENCE must
select one of the other supported values which includes CPUID
and nothing.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
4 years agoOvmfPkg/XenSupport: turn off address decoding before BAR sizing
Igor Druzhinin [Thu, 25 Apr 2019 20:23:58 +0000 (21:23 +0100)]
OvmfPkg/XenSupport: turn off address decoding before BAR sizing

On Xen, hvmloader firmware leaves address decoding enabled for
enumerated PCI device before jumping into OVMF. OVMF seems to
expect it to be disabled and tries to size PCI BARs in several places
without disabling it which causes BAR64, for example, being
incorrectly placed by QEMU.

Fix it by disabling PCI address decoding explicitly before the
first attempt to size BARs on Xen.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
4 years agoOvmfPkg/XenSupport: use a correct PCI host bridge aperture for BAR64
Igor Druzhinin [Thu, 25 Apr 2019 20:23:57 +0000 (21:23 +0100)]
OvmfPkg/XenSupport: use a correct PCI host bridge aperture for BAR64

In case BAR64 is placed below 4G choose the correct aperture.
This fixes a failed assertion down the code path.

Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
4 years agoOvmfPkg/XenSupport: remove usage of prefetchable PCI host bridge aperture
Igor Druzhinin [Thu, 25 Apr 2019 20:23:56 +0000 (21:23 +0100)]
OvmfPkg/XenSupport: remove usage of prefetchable PCI host bridge aperture

This aperture doesn't exist in QEMU-XEN and hvmloader places BARs
in arbitrary order disregarding prefetchable bit. This makes
prefetchable and non-prefetchable BARs to follow each other that's
quite likely with PCI passthrough devices. In that case, the existing
code, that tries to work out aperture boundaries by reading hvmloader
BAR placement, will report a bogus prefetchable aperture which overlaps
with the regular one. It will eventually trigger an assertion in
DXE PCI initialization code.

Do the same thing as OVMF on QEMU-KVM and pass a non-existing aperture
there. It's not necessary to pass additional allocation flags as we set
ResourceAssigned flag on the root bridge which means they will be ignored.

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
4 years agoOvmfPkg/EnrollDefaultKeys: remove Red Hat's hard-coded PK/KEK1
Laszlo Ersek [Thu, 25 Apr 2019 21:26:10 +0000 (23:26 +0200)]
OvmfPkg/EnrollDefaultKeys: remove Red Hat's hard-coded PK/KEK1

The certificate

  "Red Hat Secure Boot (PK/KEK key 1)/emailAddress=secalert@redhat.com"
  SHA1: fd:fc:7f:3c:7e:f3:e0:57:76:ad:d7:98:78:21:6c:9b:e0:e1:95:97

is no longer referenced; remove it.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: enroll PK/KEK1 from the Type 11 SMBIOS table
Laszlo Ersek [Thu, 25 Apr 2019 21:15:14 +0000 (23:15 +0200)]
OvmfPkg/EnrollDefaultKeys: enroll PK/KEK1 from the Type 11 SMBIOS table

Disconnect the certificate that is enrolled as both Platform Key and first
Key Exchange Key from Red Hat: expect the hypervisor to specify it, as
part of SMBIOS.

Example usage with QEMU:

* Generate self-signed X509 certificate:

  openssl req \
    -x509 \
    -newkey rsa:2048 \
    -outform PEM \
    -keyout PkKek1.private.key \
    -out PkKek1.pem

  (where "PEM" simply means "DER + base64 + header + footer").

* Strip the header, footer, and newline characters; prepend the
  application prefix:

  sed \
    -e 's/^-----BEGIN CERTIFICATE-----$/4e32566d-8e9e-4f52-81d3-5bb9715f9727:/' \
    -e '/^-----END CERTIFICATE-----$/d' \
    PkKek1.pem \
  | tr -d '\n' \
  > PkKek1.oemstr

* Pass the certificate to EnrollDefaultKeys with the following QEMU
  option:

  -smbios type=11,value="$(< PkKek1.oemstr)"

  (Note: for the above option to work correctly, a QEMU version is needed
  that includes commit 950c4e6c94b1 ("opts: don't silently truncate long
  option values", 2018-05-09). The first upstream release with that commit
  was v3.0.0.

  Once <https://bugs.launchpad.net/qemu/+bug/1826200> is fixed, QEMU will
  learn to read the file directly; passing the blob on the command will be
  necessary no more.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg: introduce OVMF_PK_KEK1_APP_PREFIX_GUID
Laszlo Ersek [Thu, 25 Apr 2019 22:17:17 +0000 (00:17 +0200)]
OvmfPkg: introduce OVMF_PK_KEK1_APP_PREFIX_GUID

For the EnrollDefaultKeys application, the hypervisor is expected to add a
string entry to the "OEM Strings" (Type 11) SMBIOS table, with the
following format:

4e32566d-8e9e-4f52-81d3-5bb9715f9727:<Base64 X509 cert for PK and first KEK>

The string representation of the GUID at the front is the "application
prefix", in terms of QEMU commit
<https://git.qemu.org/?p=qemu.git;a=commit;h=2d6dcbf93fb0>.

Introduce this GUID in the usual manner.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: document the steps of the entry point function
Laszlo Ersek [Thu, 25 Apr 2019 20:19:36 +0000 (22:19 +0200)]
OvmfPkg/EnrollDefaultKeys: document the steps of the entry point function

The entry point function of EnrollDefaultKeys finishes with a sanity
check, verifying the values of the Secure Boot-related "control"
variables. Add a diagram to explain why we expect the values we do.

While at it, write comments on the rest of the entry point function.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: describe functions with leading comment blocks
Laszlo Ersek [Thu, 25 Apr 2019 15:03:15 +0000 (17:03 +0200)]
OvmfPkg/EnrollDefaultKeys: describe functions with leading comment blocks

The GetExact(), GetSettings(), PrintSettings(), and ShellAppMain()
functions lack leading comment blocks. Supply those.

While at it, make sure that every such comment block is preceded by two
blank lines.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: extract MICROSOFT_VENDOR_GUID
Laszlo Ersek [Thu, 25 Apr 2019 19:49:38 +0000 (21:49 +0200)]
OvmfPkg/EnrollDefaultKeys: extract MICROSOFT_VENDOR_GUID

The GUID

  77FA9ABD-0359-4D32-BD60-28F4E78F784B

is specified in MSDN, at
<https://msdn.microsoft.com/en-us/ie/dn932805(v=vs.94)>, therefore it
deserves an entry in the package DEC file, and a header file under
"Include/Guid".

(Arguably, this GUID declaration / definition could even live under
SecurityPkg, but the edk2 tradition has been to hoist GUIDs,
protocols/PPIs, and lib classes from OvmfPkg to a core package only when
dependent C code is added to the core package.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: split out certificate and signature constants
Laszlo Ersek [Thu, 25 Apr 2019 14:03:05 +0000 (16:03 +0200)]
OvmfPkg/EnrollDefaultKeys: split out certificate and signature constants

A large portion of "EnrollDefaultKeys.c" is hex-encoded X509 certificates,
GUIDs, and signatures. These objects are constants, unlikely to see
changes anytime soon. Move them out of the way, to "AuthData.c", so we can
more easily work on functions in "EnrollDefaultKeys.c".

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: extract typedefs to a header file
Laszlo Ersek [Thu, 25 Apr 2019 13:27:57 +0000 (15:27 +0200)]
OvmfPkg/EnrollDefaultKeys: extract typedefs to a header file

"EnrollDefaultKeys.c" defines three structure types: SINGLE_HEADER,
REPEATING_HEADER, and SETTINGS. The definitions are scattered over the C
file, and lack high-level summary comments.

Extract the structures to "EnrollDefaultKeys.h", and add the missing
comments.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: remove unneeded EFIAPI call. conv. specifiers
Laszlo Ersek [Thu, 25 Apr 2019 13:02:55 +0000 (15:02 +0200)]
OvmfPkg/EnrollDefaultKeys: remove unneeded EFIAPI call. conv. specifiers

The GetExact(), GetSettings(), PrintSettings() functions are only called
from within "EnrollDefaultKeys.c", and none of them take variable
arguments. Drop their EFIAPI calling convention specifiers.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: clean up acronym capitalization in identifiers
Laszlo Ersek [Thu, 25 Apr 2019 12:36:43 +0000 (14:36 +0200)]
OvmfPkg/EnrollDefaultKeys: clean up acronym capitalization in identifiers

According to the edk2 coding standards, "[w]hen all letters in an acronym
are capitalized, it makes the prior and subsequent words visually
difficult to distinguish".

Fix the spellings of three acronyms, accordingly:
- "KEK" (Key Exchange Key) should be written as "Kek", in "mMicrosoftKEK",
- "CA" (Certificate Authority) should be written as "Ca", in
  "mMicrosoftUefiCA",
- "PCA" (Production Certificate Authority) should be written as "Pca", in
  "mMicrosoftPCA".

Generate the changes with:

  sed --regexp-extended --in-place \
    --expression='s,\<mMicrosoftKEK\>,mMicrosoftKek,g' \
    --expression='s,\<mMicrosoftUefiCA\>,mMicrosoftUefiCa,g' \
    --expression='s,\<mMicrosoftPCA\>,mMicrosoftPca,g' \
    OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: clean up global variable name prefixes
Laszlo Ersek [Thu, 25 Apr 2019 12:15:10 +0000 (14:15 +0200)]
OvmfPkg/EnrollDefaultKeys: clean up global variable name prefixes

In edk2, we should start the names of module-global variables with "m".
Rename the "RedHatPkKek1", "MicrosoftKEK", "MicrosoftPCA",
"MicrosoftUefiCA" variables accordingly, with the following command:

  sed --regexp-extended --in-place \
    --expression='s,\<(RedHatPkKek1|Microsoft(KEK|PCA|UefiCA))\>,m\1,g' \
    OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: clean up minor whitespace wart
Laszlo Ersek [Thu, 25 Apr 2019 11:57:36 +0000 (13:57 +0200)]
OvmfPkg/EnrollDefaultKeys: clean up minor whitespace wart

In edk2, we should spell "#pragma pack(...)" with a space character in
front of the opening parenthesis. Fix up locations that suggest otherwise.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoArmVirtPkg: build EnrollDefaultKeys.efi
Laszlo Ersek [Thu, 25 Apr 2019 11:44:07 +0000 (13:44 +0200)]
ArmVirtPkg: build EnrollDefaultKeys.efi

Having removed VALID_ARCHITECTURES from
"OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf", it now makes sense to
reflect the related platform DSC bits from OvmfPkg to ArmVirtPkg.

Build "EnrollDefaultKeys.efi" as part of ArmVirtQemu and ArmVirtQemuKernel
(which are the ArmVirtPkg platforms that include SecureBootConfigDxe too).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: refresh INF file
Laszlo Ersek [Thu, 25 Apr 2019 11:38:17 +0000 (13:38 +0200)]
OvmfPkg/EnrollDefaultKeys: refresh INF file

Bump INF_VERSION to the latest edk2 INF specification.

Regenerate FILE_GUID to distinguish this application from downstream-only
versions.

Remove the VALID_ARCHITECTURES comment as there is nothing ISA or platform
specific in the application.

Ensure all sections apart from [Defines] are alphabetically sorted.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg/EnrollDefaultKeys: update @file comment blocks
Laszlo Ersek [Thu, 25 Apr 2019 11:33:44 +0000 (13:33 +0200)]
OvmfPkg/EnrollDefaultKeys: update @file comment blocks

Refresh the sentence that states the purpose of the application.

Extend the copyright notice to the year 2019.

Replace the 2-clause BSD License banner with the BSD-2-Clause-Patent SPDX
ID.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoOvmfPkg: introduce EnrollDefaultKeys application
Laszlo Ersek [Thu, 25 Apr 2019 11:15:13 +0000 (13:15 +0200)]
OvmfPkg: introduce EnrollDefaultKeys application

Add the OvmfPkg/EnrollDefaultKeys shell application source as it is at the
"edk2-20190308git89910a39dcfd-2.el8" tag in RHEL8's downstream "edk2"
package.

Further patches in this series will replace Red Hat-specific bits in the
application, with a conduit to pass in parameters directly from the host
side, on both QEMU and Xen.

(Note: at the moment, Xen doesn't support Secure Boot, due to lacking a
standards-conformant variable driver stack. However, that could change
soon
<https://fosdem.org/2019/schedule/event/vai_implementing_uefi_variable_services_in_qemu/>,
and then this facility will become useful on Xen too.)

The use case for this application (including why it is only being added to
the DSC files) is explained in detail in
<https://bugzilla.tianocore.org/show_bug.cgi?id=1747#c0>.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
4 years agoQuarkPlatformPkg/AcpiTables: Resolve iASL warnings
Michael D Kinney [Thu, 25 Apr 2019 18:43:47 +0000 (11:43 -0700)]
QuarkPlatformPkg/AcpiTables: Resolve iASL warnings

Resolve a few warnings from the latest iASL compilers.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
4 years agoedk2: Update ReadMe.md and Maintainer.txt for edk2-libc repo
Michael D Kinney [Sat, 20 Apr 2019 00:24:00 +0000 (17:24 -0700)]
edk2: Update ReadMe.md and Maintainer.txt for edk2-libc repo

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

The following packages have been moved to the new edk2-libc
repository.  Remove references to these packages from
Readme.md and Maintainers.txt.

* AppPkg
* StdLib
* StdLibPrivateInternalFiles

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoedk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
Michael D Kinney [Sat, 20 Apr 2019 00:22:39 +0000 (17:22 -0700)]
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles

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

Remove the following packages and move them to the new
edk2-libc repository

* AppPkg
* StdLib
* StdLibPrivateInternalFiles

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
4 years agoEmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
Marcin Wojtas [Sat, 27 Apr 2019 09:16:32 +0000 (11:16 +0200)]
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS

Latest change allowed to add dependency on NvVarStoreFormattedLib
for the DXE_DRIVER modules. Although effectively it is hooked
using the 'NULL' class, extend the LIBRARY_CLASS with according
type for consistency sake.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoCryptoPkg/BaseCryptLib: Remove the blank line in the comments
Zhichao Gao [Sun, 28 Apr 2019 10:25:34 +0000 (10:25 +0000)]
CryptoPkg/BaseCryptLib: Remove the blank line in the comments

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

For accroding with the doxygen special documention blocks
in section 2.3.5, removing the blank line in the file comments
of the file header for PeiCryptLib.inf

Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Jian Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg: BaseSerialPortLib16550: Add Mmio32 support
Tien Hock, Loh [Fri, 26 Apr 2019 06:26:44 +0000 (14:26 +0800)]
MdeModulePkg: BaseSerialPortLib16550: Add Mmio32 support

Some buses doesn't allow 8 bit MMIO read/write, this adds support for
32 bits read/write

Signed-off-by: "Tien Hock, Loh" <tien.hock.loh@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoNetworkPkg: Add missing string token in NetworkPkg.uni
Xue, ShengfengX [Mon, 29 Apr 2019 05:56:09 +0000 (13:56 +0800)]
NetworkPkg: Add missing string token in NetworkPkg.uni

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

UNI file that is associated by INF or DEC file need
define the prompt and help information in NetworkPkg.uni

Signed-off-by: Xue ShengfengX <shengfengx.xue@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
4 years agoNetworkPkg: Remove IpSec driver and application
Wang, Fan [Tue, 23 Apr 2019 03:16:50 +0000 (11:16 +0800)]
NetworkPkg: Remove IpSec driver and application

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

The IpSec driver in NetworkPkg is not really used by platforms
but has security risks. So it is scheduled to be removed from
edk2, also include IpSecConfig application.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
4 years agoMdeModulePkg/StatusCodeHandlerRuntimeDxe: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:34:28 +0000 (11:34 +0800)]
MdeModulePkg/StatusCodeHandlerRuntimeDxe: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoIntelFrameworkModulePkg: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:32:38 +0000 (11:32 +0800)]
IntelFrameworkModulePkg: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoIntelFsp2WrapperPkg/FspWrapperNotifyDxe: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:30:45 +0000 (11:30 +0800)]
IntelFsp2WrapperPkg/FspWrapperNotifyDxe: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/FirmwarePerformanceDxe: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:30:11 +0000 (11:30 +0800)]
MdeModulePkg/FirmwarePerformanceDxe: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoIntelFrameworkModulePkg: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:28:43 +0000 (11:28 +0800)]
IntelFrameworkModulePkg: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/UefiDebugLibStdErr: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:26:55 +0000 (11:26 +0800)]
MdePkg/UefiDebugLibStdErr: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/UefiDebugLibDebugPortProtocol: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:26:00 +0000 (11:26 +0800)]
MdePkg/UefiDebugLibDebugPortProtocol: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/UefiDebugLibConOut: make global variable static
Zhichao Gao [Wed, 24 Apr 2019 03:20:38 +0000 (11:20 +0800)]
MdePkg/UefiDebugLibConOut: make global variable static

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

Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg: Removed IPF related code
Shenglei Zhang [Wed, 27 Mar 2019 02:24:08 +0000 (10:24 +0800)]
MdePkg: Removed IPF related code

A previous commit(3cb0a311cb7e747d7be5c5076d0fff76ad256d2b) didn't
clean all IPF contents. So this change removes the rest contents.
https://bugzilla.tianocore.org/show_bug.cgi?id=1560

v2: Withdraw the removal of Mps.h. It is written in Mps.h that
    MPS only was included to support Itanium-based platform power on.
    But we found MPS is not so relevant to Itanium architecture.

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoShellPkg/UefiHandleParsingLib: Remove some unused Guids
Shenglei Zhang [Thu, 28 Mar 2019 07:28:06 +0000 (15:28 +0800)]
ShellPkg/UefiHandleParsingLib: Remove some unused Guids

ExtendedSalBootService.h, ExtendedSalServiceClasses.h and
McaInitPmi.h will be deleted. So remove the Guids defined
in these Protocols. And also remove strings in uni file.
https://bugzilla.tianocore.org/show_bug.cgi?id=1560

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoShellPkg/UefiShellDebug1CommandsLib
Shenglei Zhang [Thu, 28 Mar 2019 02:52:26 +0000 (10:52 +0800)]
ShellPkg/UefiShellDebug1CommandsLib

With Itanium architecture unsupported, gEfiSalSystemTableGuid
and gEfiMpsTableGuid will be no longer used.
https://bugzilla.tianocore.org/show_bug.cgi?id=1560

v2:Withdraw the removal of #include <Guid/Mps.h> and
   gEfiMpsTableGuid.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoOvmfPkg/PlatformBootManagerLib: Remove dependency on Mps.h
Shenglei Zhang [Thu, 28 Mar 2019 07:08:22 +0000 (15:08 +0800)]
OvmfPkg/PlatformBootManagerLib: Remove dependency on Mps.h

Mps.h is included in BdsPlatform.h but not actually used.
So remove it.

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype
Bret Barkelew [Fri, 22 Feb 2019 05:51:43 +0000 (13:51 +0800)]
MdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype

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

Implement the new API ResetSystemWithSubtype. Depend on Uefi Spec
2.8 chapter 8.5.1, the ResetData is valid while the ResetStatus
is EFI_SUCCESS regardless of the ResetType. Also change the function
ResetPlatofrmSpecificGuid to directly call ResetSystemWithSubtype
to reduce the duplicated code.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype
Bret Barkelew [Fri, 22 Feb 2019 05:36:24 +0000 (13:36 +0800)]
MdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype

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

Add a new API ResetSystemWithSubtype's prototype declaration in
header file. Also add the required data type header file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoArmVirtPkg/ArmVirtPsciResetSystemLib: Add a new API ResetSystem
Zhichao Gao [Thu, 11 Apr 2019 01:29:47 +0000 (09:29 +0800)]
ArmVirtPkg/ArmVirtPsciResetSystemLib: Add a new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoArmPkg/ArmSmcPsciResetSystemLib: Add a new API ResetSystem
Zhichao Gao [Thu, 11 Apr 2019 01:28:13 +0000 (09:28 +0800)]
ArmPkg/ArmSmcPsciResetSystemLib: Add a new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoVlv2TbltdevicePkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:17:11 +0000 (16:17 +0800)]
Vlv2TbltdevicePkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
4 years agoQuarkSocPkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:15:25 +0000 (16:15 +0800)]
QuarkSocPkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
4 years agoPcAtChipsetPkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:14:15 +0000 (16:14 +0800)]
PcAtChipsetPkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoOvmfPkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:11:59 +0000 (16:11 +0800)]
OvmfPkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoNt32Pkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:11:16 +0000 (16:11 +0800)]
Nt32Pkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoCorebootPayloadPkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:09:10 +0000 (16:09 +0800)]
CorebootPayloadPkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoBeagleBoardPkg/ResetSystemLib: Add new API ResetSystem
Zhichao Gao [Mon, 8 Apr 2019 08:07:35 +0000 (16:07 +0800)]
BeagleBoardPkg/ResetSystemLib: Add new API ResetSystem

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

Add a new API ResetSystem to this ResetSystemLib instance.
It only adds the basic functions from ResetSystemRuntimeDxe.
Lacking of this interface may cause link error, if some drivers
use this new API and link to this library instance.
Notes:
This library API only provide a basic function of reset. Full
function should use the instance in the MdeModulePkg and make
sure the depex driver is dispatched.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoMdeModulePkg/NvmExpressHci.c: Change comments
Zhichao Gao [Wed, 27 Feb 2019 06:38:16 +0000 (14:38 +0800)]
MdeModulePkg/NvmExpressHci.c: Change comments

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not. So change the comments of NvmeShutdownAllControllers.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/PeiMain: Change comments of PeiResetSystem2
Zhichao Gao [Wed, 27 Feb 2019 06:32:08 +0000 (14:32 +0800)]
MdeModulePkg/PeiMain: Change comments of PeiResetSystem2

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/ResetSystemPei: Change comments of ResetSystem2
Zhichao Gao [Wed, 27 Feb 2019 06:26:49 +0000 (14:26 +0800)]
MdeModulePkg/ResetSystemPei: Change comments of ResetSystem2

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/ResetSystemRuntimeDxe: Change comments
Zhichao Gao [Wed, 27 Feb 2019 06:24:37 +0000 (14:24 +0800)]
MdeModulePkg/ResetSystemRuntimeDxe: Change comments

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not. So change the comments of RuntimeServiceResetSystem.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/PeiResetSystemlib.c: Change comments of ResetSystem
Zhichao Gao [Wed, 27 Feb 2019 06:22:48 +0000 (14:22 +0800)]
MdeModulePkg/PeiResetSystemlib.c: Change comments of ResetSystem

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/RuntimeResetSystemLib.c: Change comments
Zhichao Gao [Wed, 27 Feb 2019 06:35:50 +0000 (14:35 +0800)]
MdeModulePkg/RuntimeResetSystemLib.c: Change comments

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not. So change the comments of ResetSystem.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/BaseResetSystemLibNull.c: Change comments of ResetSystem
Zhichao Gao [Wed, 27 Feb 2019 06:20:39 +0000 (14:20 +0800)]
MdeModulePkg/BaseResetSystemLibNull.c: Change comments of ResetSystem

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/DxeResetSystemLib.c: Change comments of ResetSystem
Zhichao Gao [Wed, 27 Feb 2019 06:16:14 +0000 (14:16 +0800)]
MdeModulePkg/DxeResetSystemLib.c: Change comments of ResetSystem

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/ResetSystemLib.h: Change comments of ResetSystem
Zhichao Gao [Wed, 27 Feb 2019 06:14:43 +0000 (14:14 +0800)]
MdeModulePkg/ResetSystemLib.h: Change comments of ResetSystem

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoSecurityPkg/Tcg2Dxe: Change comments of ShutdownTpmOnReset
Zhichao Gao [Wed, 27 Feb 2019 05:58:57 +0000 (13:58 +0800)]
SecurityPkg/Tcg2Dxe: Change comments of ShutdownTpmOnReset

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoMdePkg/PeiServicesLib.c: Change comments of PeiServicesResetSystem2
Zhichao Gao [Wed, 27 Feb 2019 05:57:16 +0000 (13:57 +0800)]
MdePkg/PeiServicesLib.c: Change comments of PeiServicesResetSystem2

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/PeiServicesLib.h: Change comments of PeiServicesResetSystem2
Zhichao Gao [Wed, 27 Feb 2019 05:43:03 +0000 (13:43 +0800)]
MdePkg/PeiServicesLib.h: Change comments of PeiServicesResetSystem2

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/PiPeiCis.h: Change comments of EFI_PEI_RESET2_SYSTEM
Zhichao Gao [Wed, 27 Feb 2019 05:42:07 +0000 (13:42 +0800)]
MdePkg/PiPeiCis.h: Change comments of EFI_PEI_RESET2_SYSTEM

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/UefiSpec.h: Change comments of EFI_RESET_SYSTEM
Zhichao Gao [Wed, 27 Feb 2019 05:16:43 +0000 (13:16 +0800)]
MdePkg/UefiSpec.h: Change comments of EFI_RESET_SYSTEM

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

Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools/tools_def.template: Remove tools chain with ASL tool
Shenglei Zhang [Fri, 29 Mar 2019 08:46:41 +0000 (16:46 +0800)]
BaseTools/tools_def.template: Remove tools chain with ASL tool

Microsoft ASL is not verified now.
So remove tool chain with ASL tool. They are: VS2008xASL,
VS2008x86xASL, VS2010xASL, VS2010x86xASL, VS2012xASL, VS2012x86xASL,
VS2013xASL, VS2013x86xASL, VS2015xASL, VS2015x86xASL and CYGGCCxASL.
https://bugzilla.tianocore.org/show_bug.cgi?id=1667

v2:Remove definitions of WIN_ASL_BIN, MS_ASL_OUTFLAGS and MS_ASL_FLAGS.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/HiiDB: Minimize memory allocation times after ReadyToBoot
Dandan Bi [Thu, 25 Apr 2019 01:00:26 +0000 (09:00 +0800)]
MdeModulePkg/HiiDB: Minimize memory allocation times after ReadyToBoot

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

Currently RTData are allocated at/after ReadyToBoot to store the
contents in HiiDatabase and the HII configurations for OS runtime
utilization.
Some platforms may meet S4 resume issue since the allocation after
ReadyToBoot cause memory map change.
Now this patch is to do some overallocation to minimize the number
of memory allocations after ReadyToBoot and also add warning
message when do allocation after ReadyToBoot.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/FileExplorer: Set Handle to NULL after uninstall protocol
Dandan Bi [Tue, 23 Apr 2019 06:23:15 +0000 (14:23 +0800)]
MdeModulePkg/FileExplorer: Set Handle to NULL after uninstall protocol

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

Currently Emulator meets ASSERT when enter setup->Continue->enter setup.
When re-enter setup, the FeDriverHandle in FileExplorerLib Constructor
is not NULL which cause InstallMultipleProtocolInterfaces failure,
then ASSERT. So here set FeDriverHandle to NULL after uninstalling
protocols on it in the Destructor function to avoid this issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/BMMUiLib: Set Handle to NULL after uninstall protocol
Dandan Bi [Tue, 23 Apr 2019 06:19:44 +0000 (14:19 +0800)]
MdeModulePkg/BMMUiLib: Set Handle to NULL after uninstall protocol

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

Currently Emulator meets ASSERT when enter setup->Continue->enter setup.
When re-enter setup, the BmmDriverHandle in BMMUiLib Constructor
is not NULL which cause InstallMultipleProtocolInterfaces failure,
then ASSERT. So here set BmmDriverHandle to NULL after uninstalling
protocols on it in Destructor function to avoid this issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoBaseTools: Support customized compiling command
Bob Feng [Tue, 23 Apr 2019 03:21:22 +0000 (11:21 +0800)]
BaseTools: Support customized compiling command

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1737
User may add other commands before CC command from build_rule.txt
for specific purpose. It worked fine before commit 05217d210e.

This patch is going to fix the bug in commit 05217d210e to
support customized CC command.

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>
4 years agoMdeModulePkg/DxeCore: Please static checker for false report
Hao Wu [Mon, 22 Apr 2019 05:42:18 +0000 (13:42 +0800)]
MdeModulePkg/DxeCore: Please static checker for false report

After commit 57df17fe26, some static check reports suspicious NULL pointer
deference at line:

  Entry->MachineType = Entry->Emulator->MachineType;
                       ^^^^^^^^^^^^^^^

within function PeCoffEmuProtocolNotify().

However, 'Entry->Emulator' is guaranteed to have a non-NULL value when
previous call to the CoreHandleProtocol() returns EFI_SUCCESS.

This commit will re-write the return status check for CoreHandleProtocol()
to add explicit NULL pointer check for protocol instance pointer.

Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
4 years agoEmbeddedPkg: Allow DXE_DRIVER to depend on NvVarStoreFormattedLib
Marcin Wojtas [Thu, 25 Apr 2019 09:18:00 +0000 (11:18 +0200)]
EmbeddedPkg: Allow DXE_DRIVER to depend on NvVarStoreFormattedLib

Some modules (such as FaultTolerantWriteDxe) use the FlashNvStorage
PCDs (PcdFlashNvStorageFtw*). In case the flash contents are not
mapped in memory, the module loading order of the FVB driver
may become important.

To handle above, this patch allows to hook the dependency of
desired DXE_DRIVER type module in the .DSC file via
NvVarStoreFormattedLib NULL resolution.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoOvmfPkg/Sec: fix out-of-bounds reads
Laszlo Ersek [Fri, 12 Apr 2019 13:55:28 +0000 (15:55 +0200)]
OvmfPkg/Sec: fix out-of-bounds reads

RH covscan justifiedly reports that accessing "EFI_FFS_FILE_HEADER.Size"
and "EFI_COMMON_SECTION_HEADER.Size", which both are of type UINT8[3],
through (UINT32*), is undefined behavior:

> Error: OVERRUN (CWE-119):
> edk2-89910a39dcfd/OvmfPkg/Sec/SecMain.c:283: overrun-local: Overrunning
> array of 3 bytes at byte offset 3 by dereferencing pointer
> "(UINT32 *)File->Size".
> #  281|
> #  282|       File = (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress;
> #  283|->     Size = *(UINT32*) File->Size & 0xffffff;
> #  284|       if (Size < (sizeof (*File) + sizeof (EFI_COMMON_SECTION_HEADER))) {
> #  285|         return EFI_VOLUME_CORRUPTED;
>
> Error: OVERRUN (CWE-119):
> edk2-89910a39dcfd/OvmfPkg/Sec/SecMain.c:614: overrun-local: Overrunning
> array of 3 bytes at byte offset 3 by dereferencing pointer
> "(UINT32 *)File->Size".
> #  612|
> #  613|       File = (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress;
> #  614|->     Size = *(UINT32*) File->Size & 0xffffff;
> #  615|       if (Size < sizeof (*File)) {
> #  616|         return EFI_NOT_FOUND;
>
> Error: OVERRUN (CWE-119):
> edk2-89910a39dcfd/OvmfPkg/Sec/SecMain.c:639: overrun-local: Overrunning
> array of 3 bytes at byte offset 3 by dereferencing pointer
> "(UINT32 *)Section->Size".
> #  637|         Section = (EFI_COMMON_SECTION_HEADER*)(UINTN) CurrentAddress;
> #  638|
> #  639|->       Size = *(UINT32*) Section->Size & 0xffffff;
> #  640|         if (Size < sizeof (*Section)) {
> #  641|           return EFI_NOT_FOUND;

Fix these by invoking the FFS_FILE_SIZE() and SECTION_SIZE() macros, which
by now have been fixed too.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
Issue: scan-1008.txt
Issue: scan-1009.txt
Issue: scan-1010.txt
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoMdePkg/PiFirmwareFile: fix undefined behavior in FFS_FILE_SIZE
Laszlo Ersek [Fri, 12 Apr 2019 13:43:21 +0000 (15:43 +0200)]
MdePkg/PiFirmwareFile: fix undefined behavior in FFS_FILE_SIZE

Accessing "EFI_FFS_FILE_HEADER.Size", which is of type UINT8[3], through a
(UINT32*), is undefined behavior. Fix it by accessing the array elements
individually.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoBaseTools/PiFirmwareFile: fix undefined behavior in SECTION_SIZE
Laszlo Ersek [Fri, 12 Apr 2019 13:10:09 +0000 (15:10 +0200)]
BaseTools/PiFirmwareFile: fix undefined behavior in SECTION_SIZE

Sync SECTION_SIZE() from MdePkg to BaseTools, from an earlier patch in
this series.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoMdePkg/PiFirmwareFile: fix undefined behavior in SECTION_SIZE
Laszlo Ersek [Fri, 12 Apr 2019 12:03:23 +0000 (14:03 +0200)]
MdePkg/PiFirmwareFile: fix undefined behavior in SECTION_SIZE

RH covscan justifiedly reports that accessing
"EFI_COMMON_SECTION_HEADER.Size", which is of type UINT8[3], through a
(UINT32*), is undefined behavior:

> Error: OVERRUN (CWE-119):
> edk2-89910a39dcfd/OvmfPkg/Sec/SecMain.c:178: overrun-local: Overrunning
> array of 3 bytes at byte offset 3 by dereferencing pointer
> "(UINT32 *)((EFI_COMMON_SECTION_HEADER *)(UINTN)Section)->Size".
> #  176|       Section = (EFI_COMMON_SECTION_HEADER*)(UINTN) CurrentAddress;
> #  177|
> #  178|->     Size = SECTION_SIZE (Section);
> #  179|       if (Size < sizeof (*Section)) {
> #  180|         return EFI_VOLUME_CORRUPTED;

Fix this by accessing the array elements individually.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
Issue: scan-1007.txt
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoMdePkg/PiFirmwareFile: express IS_SECTION2 in terms of SECTION_SIZE
Laszlo Ersek [Fri, 12 Apr 2019 11:56:51 +0000 (13:56 +0200)]
MdePkg/PiFirmwareFile: express IS_SECTION2 in terms of SECTION_SIZE

The IS_SECTION2() function-like macro duplicates the SECTION_SIZE()
calculation, just to compare the computed size against 0xFFFFFF. Invoke
SECTION_SIZE() instead; only preserve the comparison.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoCryptoPkg: add issetugid declaration to fix openssl build on FreeBSD
rebecca via Groups.Io [Sat, 20 Apr 2019 06:38:29 +0000 (06:38 +0000)]
CryptoPkg: add issetugid declaration to fix openssl build on FreeBSD

When building OpenSSL, the OpenBSD/FreeBSD/DFBSD code in crypto/uid.c
calls issetugid(). Add the declaration of this function to
CrtLibSupport.h to avoid the need to patch the openssl code on these
platforms.

Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Jian Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/AhciPei: Add PEI BlockIO support
Hao Wu [Mon, 11 Mar 2019 01:52:57 +0000 (09:52 +0800)]
MdeModulePkg/AhciPei: Add PEI BlockIO support

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

This commit will add the PEI BlockIO (2) PPIs support for AHCI mode ATA
devices.

More specifically, the driver will consume the ATA AHCI host controller
PPI for ATA controllers working under AHCI code within the system. And
then produces the below additional PPIs for each controller:

EFI PEI Recovery Block IO PPI
EFI PEI Recovery Block IO2 PPI

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoMdeModulePkg/AhciPei: Limit max transfer blocknum for 48-bit address
Hao Wu [Mon, 18 Mar 2019 08:33:44 +0000 (16:33 +0800)]
MdeModulePkg/AhciPei: Limit max transfer blocknum for 48-bit address

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

Due to the limited resource on the VTd DMA buffer size in the PEI phase,
the driver will limit the maximum transfer block number for 48-bit
addressing.

According to PCDs:
gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize|0x00400000
gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3|0x00200000

The default buffer size allocated for IOMMU mapping is:
* 4M bytes for non-S3 cases;
* 2M bytes for S3

For ATA devices in 48-bit address mode, the maximum block number is
currently set to 0xFFFF. For a device with block size equal to 512 bytes,
the maximum buffer allowed for mapping within AhciPei driver will be close
to 32M bytes. Thus, this commit will limit the 48-bit mode maximum block
number to 0x800, which means 1M-byte maximum buffer for mapping when the
block size of a device is 512 bytes. By doing so, potential failure on
calls to the IOMMU 'Map' service can be avoided.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoBaseTools: Remove ICC tool chain in tools_def.template
Shenglei Zhang [Mon, 1 Apr 2019 02:42:38 +0000 (10:42 +0800)]
BaseTools: Remove ICC tool chain in tools_def.template

There is no Intel compiler test. Suggest to remove ICC tool chain from
tools_def.template.
https://bugzilla.tianocore.org/show_bug.cgi?id=1666

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
(cherry picked from commit 323b5b06c593ba6e438847dec7d4acec7f9df970)

4 years agoMdePkg/BaseLib: Remove support of INTEL tool chain
Shenglei Zhang [Thu, 4 Apr 2019 08:53:43 +0000 (16:53 +0800)]
MdePkg/BaseLib: Remove support of INTEL tool chain

As Intel tool chain will be removed, support of INTEL tool chain
should be removed first.
https://bugzilla.tianocore.org/show_bug.cgi?id=1666

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
(cherry picked from commit dd611bfeaac249cebb6c12ffdcbbf510f8ed1980)

4 years agoMdePkg/BaseIoLibIntrinsic: Remove IoLibIcc.c
Shenglei Zhang [Mon, 1 Apr 2019 06:46:53 +0000 (14:46 +0800)]
MdePkg/BaseIoLibIntrinsic: Remove IoLibIcc.c

As ICC tool chain will be removed, IoLibIcc.c should
also be removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1666

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
(cherry picked from commit 9b5be294b93f7ff7fe1bcafdc3c57016f58ee4e8)

4 years agoShellBinPkg: Remove ShellBinPkg
Dandan Bi [Wed, 17 Apr 2019 05:41:55 +0000 (13:41 +0800)]
ShellBinPkg: Remove ShellBinPkg

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

Remove ShellBinPkg from edk2.
If developers work on current edk2 master and still want to use Shell
binary after this removal, they can get it from source code in the Assets
part of edk2-stable201903 tag release page.
And from next release (edk2-stable201905 tag), we will publish all Shell
binaries to the according Assets part directly.
link: https://github.com/tianocore/edk2/releases
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
(cherry picked from commit 62d8b6004616a6d9b06afa83974be30eb951c679)

4 years agoMdeModulePkg/HiiDatabaseDxe: Release lock on all error return path
Dandan Bi [Mon, 22 Apr 2019 01:33:59 +0000 (09:33 +0800)]
MdeModulePkg/HiiDatabaseDxe: Release lock on all error return path

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

Commit ffe5f7a6b4e9
"MdeModulePkg/HiiDatabase: Fix potential integer overflow "
added some new error paths, but it missed releasing the
mHiiDatabaseLock lock on those paths.
This patch releases mHiiDatabaseLock on those paths.

Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
(cherry picked from commit 927c516f9557f2f36319fe5d2508af29e3375fb8)

4 years agoMdeModulePkg/DxeCapsuleLibFmp: clone ESRT for runtime access
Ard Biesheuvel [Sat, 20 Apr 2019 10:34:54 +0000 (12:34 +0200)]
MdeModulePkg/DxeCapsuleLibFmp: clone ESRT for runtime access

The DxeCapsuleLibFmp code accesses the ESRT table to decide whether
a certain capsule is an FMP capsule. Since the UEFI spec mandates
that the ESRT resides in EfiBootServicesData memory, this results
in problems at OS runtime, since the firmware implementation itself
cannot access memory that has not been virtually remapped.

So let's take a private copy of the ESRT at ReadyToBoot, and store
it in EfiRuntimeServicesData memory. The ESRT's size is order 10s
of bytes so the memory footprint is going to be negligigble.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>