]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
4 years agoMdePkg: Add ACPI 6.3 header file
Krzysztof Koch [Wed, 24 Apr 2019 09:50:22 +0000 (10:50 +0100)]
MdePkg: Add ACPI 6.3 header file

The patch includes the following ACPI 6.3 updates:
 1. Reserve CRAT and CDIT table names in ACPI 6.3 header.
    - ACPI 6.3 January 2019, Table 5-30
    - Mantis ID 1883 (https://mantis.uefi.org/mantis/view.php?id=1883)
 2. Add new processor structure flags in PPTT.
    - ACPI 6.3 January 2019, Section 5.2.29
    - Mantis ID 1870 (https://mantis.uefi.org/mantis/view.php?id=1870)
    - Mantis ID 1934 (https://mantis.uefi.org/mantis/view.php?id=1934)
 3. Add SPE support to MADT.
    - ACPI 6.3 January 2019, Table 5-60
    - Mantis ID 1934 (https://mantis.uefi.org/mantis/view.php?id=1934)
 4. Add 'Hot-plug Capable' flag to APIC.
    - ACPI 6.3 January 2019, Table 5-44, Table 5-47 & Table 5-58
    - Mantis ID 1948 (https://mantis.uefi.org/mantis/view.php?id=1948)
 5. Add CNTHV timer to GTDT.
    - ACPI 6.3 January 2019, Section 5.2.24
    - Mantis ID 1851 (https://mantis.uefi.org/mantis/view.php?id=1851)
 6. Add 'Trigger Order' to Platform Communication Channel Identification
    Structure.
    - ACPI 6.3 January 2019, Section 5.2.28
    - Mantis ID 1867 (https://mantis.uefi.org/mantis/view.php?id=1867)
 7. Add Generic Initiator Affinity Structure to SRAT.
    - ACPI 6.3 January 2019, Section 5.2.16.6
    - Mantis ID 1904 (https://mantis.uefi.org/mantis/view.php?id=1904)
 8. Add 'HMAT Enhancements'.
    - ACPI 6.3 January 2019, Section 5.2.27
    - Mantis ID 1914 (https://mantis.uefi.org/mantis/view.php?id=1914)
    - Mantis ID 1959 (https://mantis.uefi.org/mantis/view.php?id=1959)
 9. Fix generic address structure definition to include all address
    space ID keywords.
   - ACPI 6.3 January 2019, Table 5-25
   - Mantis ID 1965 (https://mantis.uefi.org/mantis/view.php?id=1965)
10. Make Acpi63.h the latest ACPI definition.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoOvmfPkg: Remove duplicated library classes in dxe drivers section in DSC
Zhang, Shenglei [Wed, 15 May 2019 07:24:19 +0000 (15:24 +0800)]
OvmfPkg: Remove duplicated library classes in dxe drivers section in DSC

NetLib,IpIoLib,UdpIoLib and DpcLib already exist in [LibraryClasses].
So the ones in [LibraryClasses.common.DXE_DRIVER] are duplicated,
which should be removed.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Message-Id: <20190515072419.23792-1-shenglei.zhang@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1293
[lersek@redhat.com: add TianoCore BZ reference]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoEmbeddedPkg/PrePiLib: Drop dependency on IntelFramework[Module]Pkg
Hao A Wu [Tue, 14 May 2019 03:02:19 +0000 (11:02 +0800)]
EmbeddedPkg/PrePiLib: Drop dependency on IntelFramework[Module]Pkg

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

This commit will remove the dependency on IntelFramework[Module]Pkg from
the PrePiLib.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoEmbeddedPkg DSC: Use ReportStatusCodeLib (DXE) in MdeModulePkg
Hao A Wu [Tue, 14 May 2019 03:00:16 +0000 (11:00 +0800)]
EmbeddedPkg DSC: Use ReportStatusCodeLib (DXE) in MdeModulePkg

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

This commit will update the package DSC file to consume the
ReportStatusCodeLib (DXE phase instance) in MdeModulePkg, instead of using
the one in IntelFrameworkModulePkg.

Please note that, the 2 ReportStatusCodeLib are almost identical. Thus,
there is no functional impact for this commit.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoSecurityPkg/AuthSeriableLib: Always delete variable in certdb
Zhichao Gao [Mon, 13 May 2019 02:48:27 +0000 (10:48 +0800)]
SecurityPkg/AuthSeriableLib: Always delete variable in certdb

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

While cleaning the certdb, always delete the variable data in
the certdb regardless of its attribute.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoSecurityPkg: Remove double \r
Joe Richey [Fri, 10 May 2019 09:36:32 +0000 (17:36 +0800)]
SecurityPkg: Remove double \r

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Signed-off-by: Joe Richey <joerichey@google.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by : Chao Zhang <chao.b.zhang@intel.com>

4 years agoUefiCpuPkg PiSmmCpuDxeSmm: Only support IN/OUT IO save state read (CVE-2018-12182)
Star Zeng [Tue, 19 Dec 2017 01:59:50 +0000 (09:59 +0800)]
UefiCpuPkg PiSmmCpuDxeSmm: Only support IN/OUT IO save state read (CVE-2018-12182)

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1136
CVE: CVE-2018-12182

Customer met system hang-up during serial port loopback test in OS.
It is a corner case happened with one CPU core doing "out dx,al" and
another CPU core(s) doing "rep outs dx,byte ptr [rsi]".

Detailed code flow is as below.

1. Serial port loopback test in OS.
One CPU core: "out dx,al" -> Writing B2h, SMI will happen.
Another CPU core(s): "rep outs dx,byte ptr [rsi]".

2. SMI happens to enter SMM.
"out dx" (SMM_IO_TYPE_OUT_DX) is saved as I/O instruction type in
SMRAM save state for CPU doing "out dx,al".
"rep outs dx" (SMM_IO_TYPE_REP_OUTS) is saved as I/O instruction
type and rsi is save as I/O Memory Address in SMRAM save state for
CPU doing "rep outs dx, byte ptr [rsi]".

NOTE: I/O Memory Address (rsi) is a virtual address mapped by
OS/Virtual Machine.

3. Some SMM code calls EFI_SMM_CPU_PROTOCOL.ReadSaveState() with
EFI_SMM_SAVE_STATE_REGISTER_IO and parse data returned.

For example:
https://github.com/tianocore/edk2/blob/master/QuarkSocPkg/
QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNC/QNCSmmSw.c#L76

4. SmmReadSaveState() is executed to read save state for
EFI_SMM_SAVE_STATE_REGISTER_IO.

- The SmmReadSaveState() function in
  "UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c" calls the
  SmmCpuFeaturesReadSaveStateRegister() function, from the platform's
  SmmCpuFeaturesLib instance.

- If that platform-specific function returns EFI_UNSUPPORTED, then
  PiSmmCpuDxeSmm falls back to the common function
  ReadSaveStateRegister(), defined in file
  "UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c".

Current ReadSaveStateRegister() in
UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c is trying to copy data
from I/O Memory Address for EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX,
PF will happen as SMM page table does not know and cover this
OS/Virtual Machine virtual address.

Same case is for SmmCpuFeaturesReadSaveStateRegister() in platform-
specific SmmCpuFeaturesLib instance if it has similar implementation
to read save state for EFI_SMM_SAVE_STATE_REGISTER_IO with
EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX.

Same case is for "ins", 'outs' and 'rep ins'.

So to fix the problem, this patch updates the code to only support
IN/OUT, but not INS/OUTS/REP INS/REP OUTS for SmmReadSaveState().

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoedk2: Update Maintainers.txt for packages moved to edk2-platforms
Michael D Kinney [Thu, 9 May 2019 20:34:06 +0000 (13:34 -0700)]
edk2: Update Maintainers.txt for packages moved to edk2-platforms

https://bugzilla.tianocore.org/show_bug.cgi?id=1467
https://bugzilla.tianocore.org/show_bug.cgi?id=1374
https://bugzilla.tianocore.org/show_bug.cgi?id=1793

Remove maintainers for ththe following packages that have been
imported to edk2-platforms/master
  * Omap35xxPkg
  * BeagleBoardPkg
  * QuarkSocPkg
  * QuarkPlatformPkg
  * Vlv2DeviceRefCodePkg
  * Vlv2TbltDevicePkg
  * OptionRomPkg

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
4 years agoedk2: Remove packages moved to edk2-platforms
Michael D Kinney [Fri, 10 May 2019 03:42:03 +0000 (20:42 -0700)]
edk2: Remove packages moved to edk2-platforms

https://bugzilla.tianocore.org/show_bug.cgi?id=1467
https://bugzilla.tianocore.org/show_bug.cgi?id=1374
https://bugzilla.tianocore.org/show_bug.cgi?id=1793

Remove the following packages that have been imported to
edk2-platforms/master
  * Omap35xxPkg
  * BeagleBoardPkg
  * QuarkSocPkg
  * QuarkPlatformPkg
  * Vlv2DeviceRefCodePkg
  * Vlv2TbltDevicePkg
  * OptionRomPkg

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
4 years agoArmPkg/CompilerIntrinsicsLib: Add uread, uwrite GCC assembly sources
Pete Batard [Mon, 13 May 2019 08:54:16 +0000 (09:54 +0100)]
ArmPkg/CompilerIntrinsicsLib: Add uread, uwrite GCC assembly sources

The new sources are a copy of the RVCT version.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoArmPkg/CompilerIntrinsicsLib: Add lasr ARM assembly source for GCC
Pete Batard [Mon, 13 May 2019 08:54:15 +0000 (09:54 +0100)]
ArmPkg/CompilerIntrinsicsLib: Add lasr ARM assembly source for GCC

The new source is a port of the RVCT version.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoArmPkg/CompilerIntrinsicsLib: Add memcmp, memmove intrinsics for MSFT
Pete Batard [Mon, 13 May 2019 08:54:14 +0000 (09:54 +0100)]
ArmPkg/CompilerIntrinsicsLib: Add memcmp, memmove intrinsics for MSFT

We could have reused memmove.asm for ARM, but we would still need to add
an implemention for ARM64, so we use the same source for both archs.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoArmPkg/CompilerIntrinsicsLib: Remove unused sources and clean up .inf
Pete Batard [Mon, 13 May 2019 08:54:13 +0000 (09:54 +0100)]
ArmPkg/CompilerIntrinsicsLib: Remove unused sources and clean up .inf

None of the .c/.h in Arm/ are used any more => remove them.
Also merge the CC flags for MSFT ARM and ARM64, since these are the
only archs we support for this package.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoBaseTools/VfrCompile: clean Framework Vfr support
Dandan Bi [Fri, 10 May 2019 05:22:15 +0000 (13:22 +0800)]
BaseTools/VfrCompile: clean Framework Vfr support

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

This commit is to do the cleanup which are missing in
previous commit 1b72fd5121b5b31918be0a9a0868a39070d4c8d4
BaseTools/VfrCompile: Remove framework VFR support

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoUefiCpuPkg: Remove double \r
Joe Richey [Fri, 10 May 2019 08:06:57 +0000 (16:06 +0800)]
UefiCpuPkg: Remove double \r

These files have \r\n line endings, but a few lines use \r\r\n which
is not a valid line ending. These lines were causing problems for git
and other tools.

Signed-off-by: Joe Richey <joerichey@google.com>
Review-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoCoreboot*Pkg: Retire CorebootPayloadPkg and CorebootModulePkg
Maurice Ma [Fri, 10 May 2019 17:39:08 +0000 (10:39 -0700)]
Coreboot*Pkg: Retire CorebootPayloadPkg and CorebootModulePkg

RFC: https://edk2.groups.io/g/devel/message/39126

Since UefiPayloadPkg in EDK2 supports Coreboot and Slim Bootloader,
and I don't receive any concerns for the RFC to remove CorebootModulePkg
and CorebootPayloadPkg from EDK2, here is the action patch to remove
CorebootPayloadPkg and CorebootModulePkg.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
4 years agoBaseTools: Check the fread function and avoid dead loop
Liu, Zhiguang [Fri, 10 May 2019 01:50:32 +0000 (09:50 +0800)]
BaseTools: Check the fread function and avoid dead loop

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

If the input file is not a valid file, it may cause dead loop,
because the return of fread function is not checked.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Bob 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:Enables FFS to support the GUID value format
Fan, ZhijuX [Thu, 9 May 2019 11:58:32 +0000 (19:58 +0800)]
BaseTools:Enables FFS to support the GUID value format

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

Per FDF spec, FFS Rule can specify the hard code FILE Guid value.
But,BaseTools reports the build failure.It should be fixed.

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: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Correct the value assignment for StructurePcd
Fan, ZhijuX [Thu, 9 May 2019 09:19:56 +0000 (17:19 +0800)]
BaseTools: Correct the value assignment for StructurePcd

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

This patch is to fix the code bug in StructurePcd overall
value assignment logic. If a Pcd Array size is fixed but the
size of actual value in Dsc or Dec is bigger than the Pcd
array size, the tool will report error about such setting and
stop build.

The patch is tested minplatform, Ovmf, structure pcd regression test
These tests are build pass. The patch also tested the following cases.
Our cases focused on PcdArraySize. 1.flexiable PcdArraySize.
 2.Fixed PcdArraySize, Pcd overall value exceeds the size of PcdArray.
 3.Fixed PcdArraySize, Pcd overall value Not exceeds the size of PcdArray.

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: BaseSerialPortLib16550: Add missing Pcd to UNI
Tien Hock, Loh [Thu, 9 May 2019 09:19:54 +0000 (17:19 +0800)]
MdeModulePkg: BaseSerialPortLib16550: Add missing Pcd to UNI

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

Some buses doesn't allow 8 bit MMIO read/write, this adds support for
32 bits read/write. This patch adds the UNI information on the new Pcd
introduced - PcdSerialRegisterAccessWidth

Signed-off-by: "Tien Hock, Loh" <tien.hock.loh@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: "Zhu, YongHong" <yonghong.zhu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoOvmfPkg/QemuVideoDxe: Remove dependency on OptionRomPkg
Michael D Kinney [Thu, 9 May 2019 17:38:07 +0000 (10:38 -0700)]
OvmfPkg/QemuVideoDxe: Remove dependency on OptionRomPkg

Update the QemuVideoDxe driver to not depend on the
OptionRomPkg to support moving OptionRomPkg to the
edk2-platforms repository.

The only dependency on the OptionRomPkg is the use of
PcdDriverSupportedEfiVersion to set the version value in the
EFI Driver Supported EFI Version Protocol.

Quoting the UEFI-2.8 spec, "This protocol is required for EFI
drivers that are *on* PCI and other plug in cards" (emphasis ours).
However, QemuVideoDxe is always part of the OVMF platform firmware,
and is never read by PciBusDxe from the PCI ROM BAR of QEMU's
emulated graphics cards.

Since this protocol does not apply to QEMU environment, remove
both the PCD and the installation of the EFI Driver Supported EFI
Version Protocol.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoVlv2TbltDevicePkg: Update Readme.md
Michael D Kinney [Wed, 8 May 2019 22:42:07 +0000 (15:42 -0700)]
Vlv2TbltDevicePkg: Update Readme.md

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
4 years agoVlv2TbltDevicePkg/Capsule: Add Linux/LVFS generation scripts
Michael D Kinney [Wed, 8 May 2019 22:16:31 +0000 (15:16 -0700)]
Vlv2TbltDevicePkg/Capsule: Add Linux/LVFS generation scripts

Add batch scripts to generate the LVFS compatible capsule
update driver.

Add DSC/FDF files to build capsules and invoke post build
shell scripts for Linux build environments.

Make versions consistent.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/Capsule: Remove path to openssl tools
Michael D Kinney [Wed, 8 May 2019 22:12:41 +0000 (15:12 -0700)]
Vlv2TbltDevicePkg/Capsule: Remove path to openssl tools

Remove path to openssl tools from batch scripts.  Instead,
the path to the openssl tools must be included in PATH for
a build to complete.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/Capsule: Do not clear UEFI varstore
Michael D Kinney [Wed, 8 May 2019 22:02:51 +0000 (15:02 -0700)]
Vlv2TbltDevicePkg/Capsule: Do not clear UEFI varstore

Preserve the UEFI Variable store when a capsule update is
performed.  UEFI Variables are used to store firmware version
information for the sample devices (Red, Green, Blue).

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg: Remove directory assumptions from build scripts
Michael D Kinney [Wed, 8 May 2019 22:23:13 +0000 (15:23 -0700)]
Vlv2TbltDevicePkg: Remove directory assumptions from build scripts

In preparation for moving Vlv2TbltDevicePkg to the
edk2-platforms repository, the batch scripts used to build
this platform are updated to not make any assumptions about
the directory location of Vlv2TbltDevicePkg.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/Stitch/Gcc: Update default setting binary
Michael D Kinney [Wed, 8 May 2019 21:39:26 +0000 (14:39 -0700)]
Vlv2TbltDevicePkg/Stitch/Gcc: Update default setting binary

Update the binary file that contains the default configuration
settings.  This file is generated using FCE.exe during a
Windows build and this binary file needs to be updated when
there are changes to the configuration setting layout or
configuration setting default values.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg: Always enable QuietBoot to produce BGRT
Michael D Kinney [Wed, 8 May 2019 22:04:06 +0000 (15:04 -0700)]
Vlv2TbltDevicePkg: Always enable QuietBoot to produce BGRT

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg: Add PchInitSmm module
Michael D Kinney [Wed, 8 May 2019 22:32:50 +0000 (15:32 -0700)]
Vlv2TbltDevicePkg: Add PchInitSmm module

Add the PcdInitSmm module that should not have been
removed.  This module performs actions at Exit Boot
Services to place devices in an OS compatible state.
Without this module, some versions of Linux can not
boot.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg: Use CpuDxe from UefiCpuPkg
Michael D Kinney [Wed, 8 May 2019 22:29:35 +0000 (15:29 -0700)]
Vlv2TbltDevicePkg: Use CpuDxe from UefiCpuPkg

Use the CpuDxe module from the UefiCpuPkg instead of the binary
MpCpu module.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg: Build full UEFI Shell from sources
Michael D Kinney [Wed, 8 May 2019 22:25:47 +0000 (15:25 -0700)]
Vlv2TbltDevicePkg: Build full UEFI Shell from sources

Update DSC files to build full UEFI Shell from sources.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg: Find UEFI Shell using gUefiShellFileGuid
Michael D Kinney [Wed, 8 May 2019 22:07:14 +0000 (15:07 -0700)]
Vlv2TbltDevicePkg: Find UEFI Shell using gUefiShellFileGuid

Remove use of PCD PcdShellFile from the IntelFrameworkModulePkg
and instead use gUefiShellFileGuid to find the UEFI Shell in
an FV.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/SmBiosMiscDxe: Fix GCC build issue
Michael D Kinney [Thu, 9 May 2019 03:01:02 +0000 (23:01 -0400)]
Vlv2TbltDevicePkg/SmBiosMiscDxe: Fix GCC build issue

Fix loop comparison for end of languages.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol
Michael D Kinney [Wed, 8 May 2019 22:19:35 +0000 (15:19 -0700)]
Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol

The NumberOfEnabledProcessors parameter to the MP Services
Protocol service GetNumberOfProcessors() is not optional and is
not allowed to be NULL.  Add the CpuEnabledCount local variable
and pass it into GetNumberOfProcessors().

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/AcpiPlatform: Add variable protocols to depex
Michael D Kinney [Wed, 8 May 2019 22:10:06 +0000 (15:10 -0700)]
Vlv2TbltDevicePkg/AcpiPlatform: Add variable protocols to depex

Add the arch protocols gEfiVariableArchProtocolGuid and
gEfiVariableWriteArchProtocolGuid to the dependency expression
for the AcpiPlatform module to guarantee that the variables
that AcpiPlatform depends upon are set before they are used by
this module.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN
Michael D Kinney [Wed, 8 May 2019 21:38:47 +0000 (14:38 -0700)]
Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN

Change the type of the local variable Size in the function
AcpiPlatformEntryPoint() from UINT32 to UINTN.  This local
variable is passed into the function ReadSection() that returns
a value of type UINTN.  Using type UINT32 can potentially
corrupt an adjacent local on the stack.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoVlv2TbltDevicePkg/PlatformFlashAccessLib: Add error return
Michael D Kinney [Wed, 8 May 2019 21:34:58 +0000 (14:34 -0700)]
Vlv2TbltDevicePkg/PlatformFlashAccessLib: Add error return

If the FLASH device cannot be erased or written, then the
flag FlashError is set to TRUE.

Add the missing logic to return an error if FlashError
is TRUE.  The missing logic was found from a GCC build that
noticed a local variable was declared and assigned, but was
not being used.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
4 years agoEmulatorPkg: Remove framework pkgs dependency from EmulatorPkg
Zhiguang Liu [Mon, 29 Apr 2019 01:45:25 +0000 (09:45 +0800)]
EmulatorPkg: Remove framework pkgs dependency from EmulatorPkg

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

Remove two inf files form EmulatorPkg.

About IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf,
this inf file is not included in the EmulaotrPkg.fdf,
which means the StatusCodePei.inf does't work at all,
so it is ok to remove it from EmulatorPkg.

About IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf,
in the inf file, we can see it consumes gEfiIdeControllerInitProtocolGuid.
there are only two inf files in the edk project that produce this Protocol,
as belows:
    PcAtChipsetPkg\Bus\Pci\IdeControllerDxe\IdeControllerDxe.inf
    MdeModulePkg\Bus\Pci\SataControllerDxe\SataControllerDxe.inf
However, neither of them is included in the EmulatorPkg.dsc.
It means the IdeBusDxe.inf can't work at all,
so it is ok to remove it from EmulatorPkg.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg: Save the modified order after rebooting
Zhiguang Liu [Mon, 6 May 2019 00:52:35 +0000 (08:52 +0800)]
EmulatorPkg: Save the modified order after rebooting

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

Use memory mapped FV device path
by adding FvNameGuid to EmulatorPkg.fdf file.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg: Make the shell be the first boot option
Zhiguang Liu [Mon, 6 May 2019 01:37:02 +0000 (09:37 +0800)]
EmulatorPkg: Make the shell be the first boot option

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

Make the shell be the first boot option by default,
So it can boot into UEFI Internal Shell directly

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg: Change the cpu frequency to a non-zero value
Zhiguang Liu [Mon, 29 Apr 2019 01:07:50 +0000 (09:07 +0800)]
EmulatorPkg: Change the cpu frequency to a non-zero value

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

The valuse of 1234 is a fake value for CPU frequency.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoMaintainers.txt: Update the name of 'Hao Wu' to 'Hao A Wu'
Hao A Wu [Wed, 8 May 2019 05:32:49 +0000 (13:32 +0800)]
Maintainers.txt: Update the name of 'Hao Wu' to 'Hao A Wu'

This commit will update the name of 'Hao Wu' to 'Hao A Wu' to match the
mail address.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoIntelSiliconPkg/IntelVTdDxe: Do global invalidation before boot
Zhichao Gao [Thu, 9 May 2019 03:11:55 +0000 (11:11 +0800)]
IntelSiliconPkg/IntelVTdDxe: Do global invalidation before boot

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

V2:
Abandon V1.
Do global invalidation of context-cache and IOTLB at
ExitBootServices.

V1:
Only doing IOTLB invalidation would cause a BSOD
'DRIVER_VERIFIER_DMA_VIOLATION' while changing the second
level page entry's attributes. So always do the global
invalidation of context-cache and IOTLB.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
4 years agoMdeModulePkg: Remove BootInRecoveryMode PPI
xuwei6 [Tue, 7 May 2019 09:11:11 +0000 (17:11 +0800)]
MdeModulePkg: Remove BootInRecoveryMode PPI

DEPEX from PEI storage stack.

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

BootInRecoveryMode Ppi dependency should be removed from PEI storage stack
drivers. Besides recovery, more features are using the storage stack.
Platform can apply Ppi dependency in Recovery FV which contains full
storage driver stack. Platform storage stack modules, such as host
controller init PEI module, should also remove this dependency.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoFatPkg/FatPei: Remove BootInRecoveryMode PPI DEPEX.
xuwei6 [Tue, 7 May 2019 09:10:07 +0000 (17:10 +0800)]
FatPkg/FatPei: Remove BootInRecoveryMode PPI DEPEX.

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

BootInRecoveryMode Ppi dependency should be removed from PEI storage stack
drivers. Besides recovery, more features are using the storage stack.
Platform can apply Ppi dependency in Recovery FV which contains full
storage driver stack. Platform storage stack modules, such as host
controller init PEI module, should also remove this dependency.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoRevert "BaseTools:code of test python module is moved to edksetup"
Fan, ZhijuX [Thu, 9 May 2019 06:50:05 +0000 (14:50 +0800)]
Revert "BaseTools:code of test python module is moved to edksetup"

This reverts commit df7c81b5b219c9aee776baa466dd64c9d318dd80.

In commint df7c81b5b219c9,used a function to test python module
But the Boolean value of the return value of this function is the
opposite of the Correct result, resulting in an unexpected result

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 agoVlv2TbltDevicePkg:Delete FrameworkDatabase from Vlv2TbltDevicePkg
Fan, ZhijuX [Mon, 6 May 2019 09:19:01 +0000 (17:19 +0800)]
Vlv2TbltDevicePkg:Delete FrameworkDatabase from Vlv2TbltDevicePkg

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

The FrameworkDatabase was already obsolete,
So, FrameworkDatabase can be removed from Vlv2TbltDevicePkg.

This patch is going to fix this issue.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
4 years agoBaseTools: Fix the issue that build report missing Module Size
Bob Feng [Wed, 8 May 2019 09:46:30 +0000 (17:46 +0800)]
BaseTools: Fix the issue that build report missing Module Size

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

commit b1e27d changed GENFW output folder from DEBUG to OUTPUT,
but that commit missed updating the buildreport.py for FwReportFileName.

This patch is going to fix this issue.

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 agoBaseTools:Delete FrameworkDatabase from BaseTools/Conf
Fan, ZhijuX [Mon, 6 May 2019 09:16:20 +0000 (17:16 +0800)]
BaseTools:Delete FrameworkDatabase from BaseTools/Conf

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

The FrameworkDatabase was already obsolete,
So, FrameworkDatabase can be removed from BaseTools/Conf.

This patch is going to fix this 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 agoSecurityPkg/OpalPassword: Fix "Enable Feature" Menu disappear issue
Eric Dong [Mon, 10 Dec 2018 06:58:43 +0000 (14:58 +0800)]
SecurityPkg/OpalPassword: Fix "Enable Feature" Menu disappear issue

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

After change behavior to send BlockSid command at EndOfDxe point,
check device ownership command will return un-authority error, it
finally caused opal driver can't show "Enable Feature" menu.

Update the code logic to send detect device ownership command
before send BlockSID command.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoSecurityPkg/OpalPassword: Change send BlockSID policy
Eric Dong [Mon, 10 Dec 2018 06:55:25 +0000 (14:55 +0800)]
SecurityPkg/OpalPassword: Change send BlockSID policy

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

Change Send BlockSID command time from ReadyToBoot to
EndOfDxe.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoSecurityPkg/SecurityPkg.dec: Change BlockSID default policy
Eric Dong [Fri, 16 Nov 2018 08:14:30 +0000 (16:14 +0800)]
SecurityPkg/SecurityPkg.dec: Change BlockSID default policy

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

Change BlockSID default policy, default enable BlockSid.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg: Remove PcdFrameworkCompatibilitySupport
Dandan Bi [Sun, 28 Apr 2019 13:44:39 +0000 (21:44 +0800)]
MdeModulePkg: Remove PcdFrameworkCompatibilitySupport

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

Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
4 years agoVlv2TbltDevicePkg: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:43:08 +0000 (21:43 +0800)]
Vlv2TbltDevicePkg: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
4 years agoUefiCpuPkg: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:42:33 +0000 (21:42 +0800)]
UefiCpuPkg: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoSignedCapsulePkg: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:41:24 +0000 (21:41 +0800)]
SignedCapsulePkg: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoQuarkPlatformPkg: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:40:13 +0000 (21:40 +0800)]
QuarkPlatformPkg: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

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: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/Setup: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:38:37 +0000 (21:38 +0800)]
MdeModulePkg/Setup: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

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: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/CdExpress: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:36:03 +0000 (21:36 +0800)]
MdeModulePkg/CdExpress: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Hao Wu <hao.a.wu@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>
4 years agoMdeModulePkg/Core: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 13:31:31 +0000 (21:31 +0800)]
MdeModulePkg/Core: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoIntelFrameworkModulePkg: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 08:31:56 +0000 (16:31 +0800)]
IntelFrameworkModulePkg: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoFatPkg/FatPei: Remove PcdFrameworkCompatibilitySupport usage
Dandan Bi [Sun, 28 Apr 2019 08:28:08 +0000 (16:28 +0800)]
FatPkg/FatPei: Remove PcdFrameworkCompatibilitySupport usage

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

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoBaseTools/VfrCompile: Remove framework VFR support
Dandan Bi [Tue, 16 Apr 2019 08:36:56 +0000 (16:36 +0800)]
BaseTools/VfrCompile: Remove framework VFR support

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

Currently there is no usage of framework VFR,
remove the support from VfrCompile.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoEmulatorPkg: Support a second GOP window
Zhiguang Liu [Mon, 29 Apr 2019 01:40:26 +0000 (09:40 +0800)]
EmulatorPkg: Support a second GOP window

Two GOP screens will be created if PcdEmuGop is set in
EmulatorPkg.dsc:
gEmulatorPkgTokenSpaceGuid.PcdEmuGop|L"GOP Window 1!GOP Window 2"

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1687
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoNetworkPkg: Add package level include DSC file
Liming Gao [Thu, 25 Apr 2019 12:37:35 +0000 (20:37 +0800)]
NetworkPkg: Add package level include DSC file

Platform DSC can include Network.dsc.inc to enable network features.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
4 years agoNetworkPkg: Add DSC/FDF include segment files to NetworkPkg.
Liming Gao [Thu, 25 Apr 2019 12:37:34 +0000 (20:37 +0800)]
NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

This patch provides a set of include segment files for platform owner to
easily enable/disable network stack support on their platform.

For DSC, there are:
- a "NetworkDefines.dsc.inc" for the [Defines] section(s),
- a "NetworkLibs.dsc.inc" for the [LibraryClasses*] section(s),
- a "NetworkPcds.dsc.inc" for the [Pcds*] section(s),
- a "NetworkComponents.dsc.inc" for the [Components*] section(s).
For FDF, there is:
- a "Network.fdf.inc" for the [Fv*] section(s).

These files can be added to the platform DSC/FDF file by using
  !include NetworkPkg/xxx
where "xxx" is the *.inc file name.

A platform DSC file can diverge from the defaults in
"NetworkDefines.dsc.inc" by setting the individual DEFINEs before
including "NetworkDefines.dsc.inc".
And, build command line ("-D FLAG=VALUE") can be used to enable or
disable related feature set, please check "NetworkDefines.dsc.inc"
for a detail description of each flag.

The default value of these flags are:
  DEFINE NETWORK_ENABLE                 = TRUE
  DEFINE NETWORK_SNP_ENABLE             = TRUE
  DEFINE NETWORK_IP4_ENABLE             = TRUE
  DEFINE NETWORK_IP6_ENABLE             = TRUE
  DEFINE NETWORK_TLS_ENABLE             = TRUE
  DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE
  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  DEFINE NETWORK_ISCSI_ENABLE           = TRUE
  DEFINE NETWORK_VLAN_ENABLE            = TRUE

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

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
4 years agoNetworkPkg DSC: Add the required ARM library to pass ARM build
Liming Gao [Mon, 29 Apr 2019 14:29:50 +0000 (22:29 +0800)]
NetworkPkg DSC: Add the required ARM library to pass ARM build

Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdeModulePkg/DumpDynPcd: Add application to dump dynamic PCD settings
Zhang, Shenglei [Tue, 7 May 2019 05:55:05 +0000 (13:55 +0800)]
MdeModulePkg/DumpDynPcd: Add application to dump dynamic PCD settings

This is a shell application to dump dynamic PCD settings.
Type DumpDynPcd -?/h/H to get help information.
Type DumpDynPcd -v/V to get version information.
Type DumpDynPcd [PcdName] to get Pcd information.
https://bugzilla.tianocore.org/show_bug.cgi?id=1541

v2:1.Add static for global variables.
   2.Change the parameter amount of InternalStrnCatGrow in DumpDynPcd.c.
   3.Add open brace according to EDK II C Coding Standards Specification.
   4.Remove the dependency on ShellPkg.dec in DumpDynPcd.inf.

v3:Add static for all global variables and internal functions.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoBaseTools:The code used to test python module is moved to edksetup
Fan, ZhijuX [Tue, 30 Apr 2019 02:16:01 +0000 (10:16 +0800)]
BaseTools:The code used to test python module is moved to edksetup

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

testing for presence of python modules should be done in edksetup
to reduce impact on subsequent build times.
This code currently exists in BaseTools/Tests/RunTest.py.

This patch is going to fix this 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:Remove unused BaseTools\Source\Python\UPT\Dll
Fan, ZhijuX [Tue, 30 Apr 2019 02:21:25 +0000 (10:21 +0800)]
BaseTools:Remove unused BaseTools\Source\Python\UPT\Dll

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

BaseTools runs from python source. It doesn't depend on
dll any more. So, DLL can be removed.

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:ECC report errors on account of analyze special characters
Fan, ZhijuX [Mon, 6 May 2019 02:35:07 +0000 (10:35 +0800)]
BaseTools:ECC report errors on account of analyze special characters

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

In case that a C function body contains the string of L'', L'\"',
L"\"", L''', L""", L"\"\"", L"\"^", L" \"", L"\" \"", ('L",\\\""')
ECC tool running under python3 interpreter will report error.
The antlr4 module misidentified this character

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:corrected error message for the DatumType error
Fan, ZhijuX [Tue, 7 May 2019 07:14:14 +0000 (15:14 +0800)]
BaseTools:corrected error message for the DatumType error

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

For structure Pcd, Its DatumType may be self-defined,
If the PCD DatumType format is incorrect,
this PCD DatumType error message is inappropriate.

This patch corrects the error message.

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 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>