]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
2 years agoUefiPayloadPkg: Fix the build failure for non-universal payload
Guo Dong [Tue, 19 Oct 2021 06:05:09 +0000 (23:05 -0700)]
UefiPayloadPkg: Fix the build failure for non-universal payload

Applied an old patch which caused non-universal payload build failed
since that code was added after the old patch.
This patch fixed the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
2 years agoUefiPayloadPkg: Fix ECC reported issues
Guo Dong [Fri, 15 Oct 2021 19:10:11 +0000 (12:10 -0700)]
UefiPayloadPkg: Fix ECC reported issues

V2: Fix more header files on #ifdef variable

ECC reported some issues on UefiPayloadPkg, this patch fixed
most of them except several files including ElfLib\Elf32.h,
coreboot.h, CbParseLib.c, etc.
It also removed unused functions in ResetSystemLib and Hob.c.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
2 years agoUefiPayloadPkg: Replace MEMROY_ENTRY by MEMORY_ENTRY
Guo Dong [Tue, 19 Oct 2021 03:34:38 +0000 (20:34 -0700)]
UefiPayloadPkg: Replace MEMROY_ENTRY by MEMORY_ENTRY

Fixes simple typo, no behavioral change.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Moritz Fischer <moritzf@google.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2 years agoOvmfPkg/AmdSev: update the fdf to use new workarea PCD
Brijesh Singh [Thu, 14 Oct 2021 18:17:11 +0000 (02:17 +0800)]
OvmfPkg/AmdSev: update the fdf to use new workarea PCD

The commit 80e67af9afca added support for the generic work area concept
used mainly by the encrypted VMs but missed update the AmdSev package.

Fixes: 80e67af9afca ("OvmfPkg: introduce a common work area")
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reported-by: Dov Murik <dovmurik@linux.ibm.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dov Murik <dovmurik@linux.ibm.com>
Tested-by: Dov Murik <dovmurik@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfpkg: update Ia32 build to use new work area
Brijesh Singh [Thu, 14 Oct 2021 18:17:10 +0000 (02:17 +0800)]
Ovmfpkg: update Ia32 build to use new work area

The commit 80e67af9afca added support for the generic work area concept
used mainly by the encrypted VMs. In the past, the work area was
preliminary used by the SEV-ES VMs. The SEV-ES support is available for
the X64 builds only. But now, that work area header contains fields that
nonencrypted VMs and SEV VMs can use. They can be built for IA32. So,
moving the work area defines outside of X64.

Fixes: 80e67af9afca ("OvmfPkg: introduce a common work area")
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoStandaloneMmPkg: Support CLANGPDB builds
Marvin Häuser [Thu, 14 Oct 2021 19:05:48 +0000 (19:05 +0000)]
StandaloneMmPkg: Support CLANGPDB builds

Currently, the flag "-fpie" is passed for all builds with a GCC
family toolchain, including CLANGPDB. CLANGPDB however does not
support this flag as it generates PE/COFF files directly.

As the flag is mostly required for ARM-specific self-relocation, drop
it for other architectures and document the limitation to enable e.g.
X64 CLANGPDB builds of StandaloneMmCore.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Acked-by: Shi Steven <steven.shi@intel.com>
2 years agoUefiPayloadPkg: Fix the build issue for coreboot
Guo Dong [Fri, 15 Oct 2021 00:18:43 +0000 (17:18 -0700)]
UefiPayloadPkg: Fix the build issue for coreboot

V2: Fix GCC build issue.
There is typo in previous change caused coreboot build failure.
This patch fixed the build issue.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoArmPkg/Smbios: Fix max cache size 2 wrong issue
Ming Huang [Thu, 14 Oct 2021 07:23:14 +0000 (15:23 +0800)]
ArmPkg/Smbios: Fix max cache size 2 wrong issue

As SMBIOS spec, bit-31 of maximum cache size 2 should be 1
for 64K granularity.

Signed-off-by: Ming Huang <huangming@linux.alibaba.com>
Reviewed-by: Rebecca Cran <rebecca@nuviainc.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
2 years agoUefiPayloadPkg: Use SECURITY_STUB_ENABLE to control the SecurityStubDxe
Liu, Zhiguang [Wed, 13 Oct 2021 09:08:22 +0000 (17:08 +0800)]
UefiPayloadPkg: Use SECURITY_STUB_ENABLE to control the SecurityStubDxe

The SecurityStubDxe driver may be provided by platform payload.
In UefiPayloadPkg\UefiPayloadPkg.fdf file, SecurityStubDxe should only
be included if SECURITY_STUB_ENABLE is TRUE

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2 years agoBaseTools: add edk2-test repo to SetupGit.py
Heinrich Schuchardt [Mon, 9 Nov 2020 23:16:08 +0000 (07:16 +0800)]
BaseTools: add edk2-test repo to SetupGit.py

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

The SctPkg is managed in repository
https://github.com/tianocore/edk2-test.

Make SetupGit.py usable for this repository.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
Abner Chang [Mon, 11 Oct 2021 13:39:13 +0000 (21:39 +0800)]
ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt

Relocate VirtioFdtDxe to OvmfPkg/Fdt, this driver is leverage by
both ARM and RISC-V archs.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch.
Abner Chang [Mon, 11 Oct 2021 13:38:30 +0000 (21:38 +0800)]
OvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt
Abner Chang [Mon, 11 Oct 2021 13:36:28 +0000 (21:36 +0800)]
ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt

Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt, this library is
leverage by both ARM and RISC-V archs. Also use
PcdPciMmio32Translation and PcdPciMmio64Translation
PCDs provided by MdePkg instead of ArmPkg.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoMdePkg: Add PcdPciMmio32(64)Translation PCDs
Abner Chang [Mon, 11 Oct 2021 13:35:49 +0000 (21:35 +0800)]
MdePkg: Add PcdPciMmio32(64)Translation PCDs

PcdPciMmio32Translation and PcdPciMmio64Translation PCDs are added
to MdePkg as the common PCDs for ARM and RSIC-V archs.

The one under ArmPkg is removed in the next patch.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg/QemuFwCfgLibMmio: Add RISC-V arch support
Abner Chang [Mon, 11 Oct 2021 13:35:06 +0000 (21:35 +0800)]
OvmfPkg/QemuFwCfgLibMmio: Add RISC-V arch support

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
Abner Chang [Mon, 11 Oct 2021 13:33:59 +0000 (21:33 +0800)]
ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg

Relocate QemuFwCfgLib to OvmfPkg/Library/QemuFwCfgLib and rename
it to QemuFwCfgLibMmio, this library is leverage by both ARM and
RISC-V archs.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/HighMemDxe: Add RISC-V in the supported arch.
Abner Chang [Mon, 11 Oct 2021 13:30:17 +0000 (21:30 +0800)]
OvmfPkg/HighMemDxe: Add RISC-V in the supported arch.

Add RISC-V VM in the file header.
Add RISC-V to the supported arch.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
Abner Chang [Mon, 11 Oct 2021 13:27:33 +0000 (21:27 +0800)]
ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg

Relocate HighMemDxe to OvmfPkg/Fdt, this library is leverage by
both ARM and RISC-V archs.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
Abner Chang [Mon, 11 Oct 2021 13:27:00 +0000 (21:27 +0800)]
ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg

Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is
leverage by both ARM and RISC-V archs.

Add OvmfPkg/Fdt maintainers in Maintainers.txt

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmPkg: Use PcdPciIoTranslation PCD from MdePkg
Abner Chang [Mon, 11 Oct 2021 13:26:23 +0000 (21:26 +0800)]
ArmPkg: Use PcdPciIoTranslation PCD from MdePkg

PcdPciIoTranslation PCD is relocated to MdePkg and leveraged by
both ARM and RISC-V arch. This patch removes the one from ArmPkg
and address the corresponding changes required for other modules
under ArmVirtPkg.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoMdePkg: Add PcdPciIoTranslation PCD
Abner Chang [Mon, 11 Oct 2021 13:25:49 +0000 (21:25 +0800)]
MdePkg: Add PcdPciIoTranslation PCD

This PCD is moved from ArmPkg that is used to set the base address
of PCI MMIO window that provides I/O access. We relocate this PCD
because this PCD is common to ARM and RSIC-V arch.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
Abner Chang [Mon, 11 Oct 2021 13:24:08 +0000 (21:24 +0800)]
ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg

This is one of the series patches to restructure the location of modules under
ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to
parse FDT nodes.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoMdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleList
Hua Ma [Mon, 11 Oct 2021 03:43:12 +0000 (11:43 +0800)]
MdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleList

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

This patch fixes the following issue:

The global variable gHandleList is a linked list.
This list is locked when a entry is added or removed from the list,
but there is no lock when iterating this list in function
CoreValidateHandle().
It can lead to "Handle.c (76): CR has Bad Signature" assertion if the
iterated entry in the list is just removed by other task during iterating.

Currently some caller functions of CoreValidateHandle() have
CoreAcquireProtocolLock(), but some caller functions of
CoreValidateHandle() do not CoreAcquireProtocolLock().
Add CoreAcquireProtocolLock() always when CoreValidateHandle() is called,
Also, A lock check is added in the CoreValidateHandle().

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoMdeModulePkg/Sd: Corrections for Extra.uni files
Konstantin Aladyshev [Mon, 11 Oct 2021 17:00:41 +0000 (01:00 +0800)]
MdeModulePkg/Sd: Corrections for Extra.uni files

Add correct content to the 'SdDxeExtra.uni' file.
Include 'EmmcDxeExtra.uni' and 'SdDxeExtra.uni' files to their
appropriate INF files.

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoUefiPayloadPkg: Add PCI root bridge info hob support for SBL
Ma, Maurice [Thu, 30 Sep 2021 16:59:07 +0000 (09:59 -0700)]
UefiPayloadPkg: Add PCI root bridge info hob support for SBL

Current UefiPayloadPkg can suport PCI root bridge info HOB
provided by bootloader. For UniversalPayload, bootloader can
directly provide this HOB for payload consumption. However,
for legacy UEFI payload, it is required to migrate the HOB
information from bootloader HOB space to UEFI payload HOB
space. This patch added the missing part for the bootloader
ParseLib in order to support both legacy and universal UEFI
payload.

This patch was tested on Slim Bootloader with latest UEFI
payload, and it worked as expected.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2 years agoBaseTools: Change RealPath to AbsPath
Chen, Christine [Tue, 12 Oct 2021 04:07:38 +0000 (12:07 +0800)]
BaseTools: Change RealPath to AbsPath

Currently the realpath is used when parse modules, which shows the
path with a drive letter in build log. In Windows 'subst' comand is
used to associates a path with a drive letter, when use the mapped
drive letter for build, with realpath function the build log will
have different disk letter info which will cause confusion. In this
situation, if use adspath function to show the path info, it will keep
same letter with the mapped drive letter, which avoids confusion.
This patch modifies the realpath to abspath.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@Intel.com>
2 years agoMdePkg/BaseLib: Add QuickSort function on BaseLib
IanX Kuo [Tue, 12 Oct 2021 00:05:31 +0000 (08:05 +0800)]
MdePkg/BaseLib: Add QuickSort function on BaseLib

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

Add QuickSort function into BaseLib

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
2 years agoCryptoPkg/BaseCryptLib: Eliminate extra buffer copy in Pkcs7Verify()
Bob Morgan [Fri, 10 Sep 2021 21:34:14 +0000 (05:34 +0800)]
CryptoPkg/BaseCryptLib: Eliminate extra buffer copy in Pkcs7Verify()

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

Create a read-only openSSL BIO wrapper for the existing input
buffer passed to Pkcs7Verify() instead of copying the buffer
into an empty writable BIO which causes memory allocations
within openSSL.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Bob Morgan <bobm@nvidia.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoShellPkg: Support ProcessorUpgradeSocketLGA4677 from SMBIOS 3.5.0
Star Zeng [Tue, 28 Sep 2021 02:27:28 +0000 (10:27 +0800)]
ShellPkg: Support ProcessorUpgradeSocketLGA4677 from SMBIOS 3.5.0

The patch adds entry into QueryTable.c for ProcessorUpgradeSocketLGA4677
from SMBIOS 3.5.0.
It also adds entries into QueryTable.c for ProcessorUpgradeSocketLGA4189
and ProcessorUpgradeSocketLGA1200 from SMBIOS 3.4.0.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdePkg: Add ProcessorUpgradeSocketLGA4677 from SMBIOS 3.5.0
Zeng, Star [Tue, 28 Sep 2021 02:36:16 +0000 (10:36 +0800)]
MdePkg: Add ProcessorUpgradeSocketLGA4677 from SMBIOS 3.5.0

This patch adds ProcessorUpgradeSocketLGA4677 definition into Smbios.h
from SMBIOS 3.5.0.
It also adds ProcessorUpgradeSocketLGA4189 and ProcessorUpgradeSocketLGA1200
definitions into from SMBIOS 3.4.0.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoUefiPayloadPkg: Add a macro to select the SecurityStubDxe driver.
Liu, Zhiguang [Mon, 27 Sep 2021 01:59:59 +0000 (09:59 +0800)]
UefiPayloadPkg: Add a macro to select the SecurityStubDxe driver.

The SecurityStubDxe driver may be provided by platform payload.

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2 years agoDynamicTablesPkg: SSDT CPU topology and LPI state generator
Pierre Gondois [Fri, 8 Oct 2021 14:46:32 +0000 (15:46 +0100)]
DynamicTablesPkg: SSDT CPU topology and LPI state generator

In the GIC interrupt model, logical processors are required to
have a Processor Device object in the DSDT and must convey each
processor's GIC information to the OS using the GICC structure.
Additionally, _LPI objects may be needed as they provide a method
to describe Low Power Idle states that defines the local power
states for each node in a hierarchical processor topology.

Therefore, add support to generate the CPU topology and the LPI
state information in an SSDT table.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add CM_ARM_LPI_INFO object
Pierre Gondois [Fri, 8 Oct 2021 14:46:31 +0000 (15:46 +0100)]
DynamicTablesPkg: Add CM_ARM_LPI_INFO object

Introduce the CM_ARM_LPI_INFO CmObj in the ArmNameSpaceObjects.
This allows to describe LPI state information, as described in
ACPI 6.4, s8.4.4.3 "_LPI (Low Power Idle States)".

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation to add an _LPI state
Pierre Gondois [Fri, 8 Oct 2021 14:46:30 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation to add an _LPI state

Add AmlAddLpiState() to generates AML code to add an _LPI state
to an _LPI object created using AmlCreateLpiNode().

AmlAddLpiState increments the count of LPI states in the LPI
node by one, and adds the following package:
  Package() {
    MinResidency,
    WorstCaseWakeLatency,
    Flags,
    ArchFlags,
    ResCntFreq,
    EnableParentState,
    (GenericRegisterDescriptor != NULL) ?           // Entry method. If a
      ResourceTemplate(GenericRegisterDescriptor) : // Register is given,
      Integer,                                      // use it. Use the
                                                    // Integer otherwise
    ResourceTemplate() {                            // NULL Residency
      Register (SystemMemory, 0, 0, 0, 0)           // Counter
    },
    ResourceTemplate() {                            // NULL Usage Counter
      Register (SystemMemory, 0, 0, 0, 0)
    },
    ""                                              // NULL State Name
  },

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation for a _LPI object
Pierre Gondois [Fri, 8 Oct 2021 14:46:29 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation for a _LPI object

_LPI object provides a method to describe Low Power Idle
states that define the local power states for each node
in a hierarchical processor topology.

Therefore, add AmlCreateLpiNode() to generate code for a
_LPI object.

AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is
equivalent of the following ASL code:
  Name (_LPI, Package (
0,  // Revision
1,  // LevelId
0   // Count
))

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation for a Method returning a NS
Pierre Gondois [Fri, 8 Oct 2021 14:46:28 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation for a Method returning a NS

Add AmlCodeGenMethodRetNameString() to generate AML code to create
a Method returning a NameString (NS).

AmlCodeGenMethodRetNameString (
  "MET0", "_CRS", 1, TRUE, 3, ParentNode, NewObjectNode
  );
is equivalent of the following ASL code:
Method(MET0, 1, Serialized, 3) {
  Return (_CRS)
}

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation to Return a NameString
Pierre Gondois [Fri, 8 Oct 2021 14:46:27 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation to Return a NameString

Add AmlCodeGenReturnNameString() to generate AML code for a
Return object node, returning the object as a NameString.

AmlCodeGenReturn ("NAM1", ParentNode, NewObjectNode) is
equivalent of the following ASL code:
  Return(NAM1)

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation for a Method
Pierre Gondois [Fri, 8 Oct 2021 14:46:26 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation for a Method

Add AmlCodeGenMethod() to generate code for a control method.

AmlCodeGenMethod ("MET0", 1, TRUE, 3, ParentNode, NewObjectNode)
is equivalent of the following ASL code:
    Method(MET0, 1, Serialized, 3) {}

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation for a ResourceTemplate
Pierre Gondois [Fri, 8 Oct 2021 14:46:25 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation for a ResourceTemplate

ASL provides a ResourceTemplate macro that creates a Buffer in which
resource descriptor macros can be listed. The ResourceTemplate macro
automatically generates an End descriptor and calculates the checksum
for the resource template.

Therefore, add AmlCodeGenResourceTemplate() to generate AML code for
the ResourceTemplate() macro. This function generates a Buffer node
with an EndTag resource data descriptor, which is similar to the ASL
ResourceTemplate() macro.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Helper function to compute package length
Pierre Gondois [Fri, 8 Oct 2021 14:46:24 +0000 (15:46 +0100)]
DynamicTablesPkg: Helper function to compute package length

Some AML object have a PkgLen which indicates the size of the
AML object. The package length can be encoded in 1 to 4 bytes.
The bytes used to encode the PkgLen is itself counted in the
PkgLen value. So, if an AML object's size increments/decrements,
the number of bytes used to encode the PkgLen value can itself
increment/decrement.

Therefore, a helper function AmlComputePkgLength() is introduced
to simply computation of the PkgLen.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML code generation for a Package
Pierre Gondois [Fri, 8 Oct 2021 14:46:23 +0000 (15:46 +0100)]
DynamicTablesPkg: AML code generation for a Package

Add AmlCodeGenPackage() to generate AML code for declaring
a Package() object. This function generates an empty package
node. New elements can then be added to the package's variable
argument list.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML Code generation for Resource data EndTag
Pierre Gondois [Fri, 8 Oct 2021 14:46:22 +0000 (15:46 +0100)]
DynamicTablesPkg: AML Code generation for Resource data EndTag

Add a helper function AmlCodeGenEndTag() to generate AML Resource Data
EndTag. The EndTag resource data is automatically generated by the ASL
compiler at the end of a list of resource data elements. Therefore, an
equivalent function is not present in ASL.

However, AmlCodeGenEndTag() is useful when generating AML code for the
ResourceTemplate() macro.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: AML Code generation for Register()
Pierre Gondois [Fri, 8 Oct 2021 14:46:21 +0000 (15:46 +0100)]
DynamicTablesPkg: AML Code generation for Register()

Add AmlCodeGenRegister() to generate AML code for the
Generic Register Resource Descriptor. This function is
equivalent to the ASL macro Register().

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Make AmlNodeGetIntegerValue public
Pierre Gondois [Fri, 8 Oct 2021 14:46:20 +0000 (15:46 +0100)]
DynamicTablesPkg: Make AmlNodeGetIntegerValue public

Remove the STATIC qualifier for the AmlUtility function
AmlNodeGetIntegerValue() and add the definition to the
header file so that it can be used by other AmlLib
sub-modules.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Update error handling for node creation
Pierre Gondois [Fri, 8 Oct 2021 14:46:19 +0000 (15:46 +0100)]
DynamicTablesPkg: Update error handling for node creation

The node creation functions:
- AmlCreateRootNode()
- AmlCreateObjectNode()
- AmlCreateDataNode()
are now resetting the input pointer where the created node is stored.
Thus, it is not necessary to set some local variables to NULL or
check a node value before trying to delete it.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Clear pointer in node creation fcts
Pierre Gondois [Fri, 8 Oct 2021 14:46:18 +0000 (15:46 +0100)]
DynamicTablesPkg: Clear pointer in node creation fcts

The following functions:
- AmlCreateRootNode()
- AmlCreateObjectNode()
- AmlCreateDataNode()
create a node and return it by populating a pointer. This pointer
should only be considered/used if the function returns successfully.
Otherwise, the value stored in this pointer should be ignored.

For their error handling, some other functions assume that this
pointer is reset to NULL if an error occurs during a node creation.
To make this assumption correct, explicitly clear this input pointer.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Set EndTag's Checksum if RdList is modified
Pierre Gondois [Fri, 8 Oct 2021 14:46:17 +0000 (15:46 +0100)]
DynamicTablesPkg: Set EndTag's Checksum if RdList is modified

ACPI 6.4, s6.4.2.9 "End Tag":
"This checksum is generated such that adding it to the sum of all the data
bytes will produce a zero sum."
"If the checksum field is zero, the resource data is treated as if the
checksum operation succeeded. Configuration proceeds normally."

To avoid re-computing checksums, if a new resource data elements is
added/removed/modified in a list of resource data elements, the AmlLib
resets the checksum to 0.

This patch also refactors the AmlAppendRdNode() function by getting the
last Resource Data node directly instead of iterating over all the
elements of the list of Resource Data node.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add AmlSetRdListCheckSum()
Pierre Gondois [Fri, 8 Oct 2021 14:46:16 +0000 (15:46 +0100)]
DynamicTablesPkg: Add AmlSetRdListCheckSum()

Lists of Resource Data elements end with an EndTag (most of the time).
This function finds the EndTag (if present) in a list of Resource Data
elements and sets the checksum.

ACPI 6.4, s6.4.2.9 "End Tag":
"This checksum is generated such that adding it to the sum of all the data
bytes will produce a zero sum."
"If the checksum field is zero, the resource data is treated as if the
checksum operation succeeded. Configuration proceeds normally."

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add AmlRdSetEndTagChecksum()
Pierre Gondois [Fri, 8 Oct 2021 14:46:15 +0000 (15:46 +0100)]
DynamicTablesPkg: Add AmlRdSetEndTagChecksum()

Add AmlRdSetEndTagChecksum(), setting the CheckSum value contained in a
Resource Data element.

ACPI 6.4, s6.4.2.9 "End Tag":
"This checksum is generated such that adding it to the sum of all the
data bytes will produce a zero sum."
"If the checksum field is zero, the resource data is treated as if the
checksum operation succeeded. Configuration proceeds normally."

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add AddSsdtAcpiHeader()
Pierre Gondois [Fri, 8 Oct 2021 14:46:14 +0000 (15:46 +0100)]
DynamicTablesPkg: Add AddSsdtAcpiHeader()

To fetch the Oem information from the ConfigurationManagerProtocol
and the AcpiTableInfo, and populate the SSDT ACPI header when
creating a RootNode via the AmlLib, create AddSsdtAcpiHeader().

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add missing parameter check
Pierre Gondois [Fri, 8 Oct 2021 14:46:13 +0000 (15:46 +0100)]
DynamicTablesPkg: Add missing parameter check

Add missing check of 'AcpiTableInfo' in AddAcpiHeader().

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Remove unnecessary includes
Pierre Gondois [Fri, 8 Oct 2021 14:46:12 +0000 (15:46 +0100)]
DynamicTablesPkg: Remove unnecessary includes

Some includes are not necessary. Remove them.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoShellPkg: Update Acpiview HMAT parser to ACPI spec version 6.4
Chris Jones [Wed, 14 Jul 2021 11:45:12 +0000 (12:45 +0100)]
ShellPkg: Update Acpiview HMAT parser to ACPI spec version 6.4

Add parser support for the new "MinTransferSize" field of the System
Locality, Latency and Bandwidth structure, introduced by the ACPI
specification version 6.4.

Also update the HMAT parser to use the newer ACPI version 6.4
definitions.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhcihao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdeModulePkg/Core/Dxe: Add lock protection in CoreLocateHandleBuffer()
Hua Ma [Wed, 29 Sep 2021 05:08:14 +0000 (13:08 +0800)]
MdeModulePkg/Core/Dxe: Add lock protection in CoreLocateHandleBuffer()

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

Currently, CoreLocateHandleBuffer() follows three steps:
1) get the size of protocol database firstly
2) allocate the buffer based on the size
3) get the protocol database into the buffer
There is no lock protection for the whole three steps. If a new protocol
added in step 2) by other task, e.g. (event timer handle USB device
hotplug). The size of protocol database may be increased and cannot fit
into the previous buffer in step 3). The protocol database cannot be
returned successfully, EFI_BUFFER_TOO_SMALL error will be returned.

This patch adds the lock to protect the whole three steps.
It can make sure the correct protocol database be returned.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Dandan Bi dandan.bi@intel.com
Reviewed-by: Liming Gao gaoliming@byosoft.com.cn
2 years agoShellPkg: Add Type 5 PCC Subspace Structure parser
Chris Jones [Fri, 13 Aug 2021 17:02:45 +0000 (18:02 +0100)]
ShellPkg: Add Type 5 PCC Subspace Structure parser

Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563)

Update the Acpiview PCCT parser with the HW Registers based
Communications Subspace Structure (Type 5) as defined in Section 14.1.7
of the ACPI 6.4 specification.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
2 years agoShellPkg: Update Acpiview PCCT parser to ACPI 6.4
Chris Jones [Fri, 13 Aug 2021 17:02:44 +0000 (18:02 +0100)]
ShellPkg: Update Acpiview PCCT parser to ACPI 6.4

Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563)

Update the Acpiview PCCT parser to use Acpi64.h.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
2 years agoShellPkg: Update Acpiview GTDT parser to ACPI 6.4
Chris Jones [Mon, 16 Aug 2021 14:52:18 +0000 (15:52 +0100)]
ShellPkg: Update Acpiview GTDT parser to ACPI 6.4

Bugzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565)

Update the Acpiview GTDT parser to use Acpi64.h and as such rename all
occurences of "SBSA Generic Watchdog" to "Arm Generic Watchdog".

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoDynamicTablesPkg: Rename SBSA generic watchdog
Chris Jones [Mon, 16 Aug 2021 14:52:17 +0000 (15:52 +0100)]
DynamicTablesPkg: Rename SBSA generic watchdog

Buzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565)

As part of the updates to ACPI 6.4 the "SBSA Generic Watchdog" was
renamed to the "Arm Generic Watchdog". This patch implements that
change by updating the GTDT generator to use Acpi64.h and renames
any occurence of "SBSA Generic Watchdog" to "Arm Generic Watchdog".

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoDynamicTablesPkg: Update FADT generator to ACPI 6.4
Chris Jones [Tue, 17 Aug 2021 13:50:58 +0000 (14:50 +0100)]
DynamicTablesPkg: Update FADT generator to ACPI 6.4

Bugzilla: 3568 (https://bugzilla.tianocore.org/show_bug.cgi?id=3568)

Update the FADT generator to use Acpi64.h. As the FADT revision tracks
the ACPI revision this updates the minor revision value generated.

Mantis ID for change: https://mantis.uefi.org/mantis/view.php?id=2105

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoOvmfPkg/Microvm: add Maintainers.txt entry
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:19 +0000 (11:01 +0200)]
OvmfPkg/Microvm: add Maintainers.txt entry

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoOvmfPkg/Microvm: wire up serial console, drop super-io
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:17 +0000 (11:01 +0200)]
OvmfPkg/Microvm: wire up serial console, drop super-io

Microvm has no LPC bridge, so drop the PciSioSerialDxe driver.
Use SerialDxe instead, with ioport hardcoded to 0x3f8 aka com1 aka ttyS0.

With this tianocore boots to uefi shell prompt on the serial console.
Direct kernel boot can be used too.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: use PciHostBridgeLibNull
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:16 +0000 (11:01 +0200)]
OvmfPkg/Microvm: use PciHostBridgeLibNull

Shortcut PCI support for now (proper PCIe
support will be wired up later).

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: BdsPlatform: PciAcpiInitialization tweak.
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:15 +0000 (11:01 +0200)]
OvmfPkg/Microvm: BdsPlatform: PciAcpiInitialization tweak.

Nothing to do here ;)

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/ResetSystemLib: add driver for microvm
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:14 +0000 (11:01 +0200)]
OvmfPkg/ResetSystemLib: add driver for microvm

Uses the generic event device to reset and poweroff.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: PlatformPei/Platform: add id.
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:13 +0000 (11:01 +0200)]
OvmfPkg/Microvm: PlatformPei/Platform: add id.

Add + set microvm id for PcdOvmfHostBridgePciDevId.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: PlatformPei/Platform memory map tweaks
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:12 +0000 (11:01 +0200)]
OvmfPkg/Microvm: PlatformPei/Platform memory map tweaks

Microvm needs ioapic hobs only.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: PlatformPei/MemDetect tweaks
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:11 +0000 (11:01 +0200)]
OvmfPkg/Microvm: PlatformPei/MemDetect tweaks

Skip host bridge setup on microvm.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: use XenTimerDxe (lapic timer)
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:10 +0000 (11:01 +0200)]
OvmfPkg/Microvm: use XenTimerDxe (lapic timer)

Microvm has no acpi timer, so go use XenTimerDxe
which uses the local apic instead.

Set PcdFSBClock to 1000 MHz, which is the lapic
timer frequency used by KVM.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: use MdePkg/Library/SecPeiDxeTimerLibCpu
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:09 +0000 (11:01 +0200)]
OvmfPkg/Microvm: use MdePkg/Library/SecPeiDxeTimerLibCpu

Microvm has no acpi timer, so use the generic lib instead.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: no emulated scsi
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:08 +0000 (11:01 +0200)]
OvmfPkg/Microvm: no emulated scsi

Microvm focus is virtio, so go drop support
for emulated scsi host adapters.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: no csm
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:07 +0000 (11:01 +0200)]
OvmfPkg/Microvm: no csm

Guests depending on BIOS will probably not work that well with microvm
due to legacy hardware being not available.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: no sev
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:06 +0000 (11:01 +0200)]
OvmfPkg/Microvm: no sev

Microvm has no SEV support.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: no tpm
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:05 +0000 (11:01 +0200)]
OvmfPkg/Microvm: no tpm

Microvm has no TPM support.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: no secure boot
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:04 +0000 (11:01 +0200)]
OvmfPkg/Microvm: no secure boot

Without SMM secure boot isn't actually secure, so drop it too.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: no smm
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:03 +0000 (11:01 +0200)]
OvmfPkg/Microvm: no smm

Microvm has no SMM support.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: rename output files, fix includes
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:02 +0000 (11:01 +0200)]
OvmfPkg/Microvm: rename output files, fix includes

Rename the firmware volume files (s/OVMF/MICROVM/).
Fix includes so they work with microvm config being in a subdirectory.
With this patch applied the build works.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/Microvm: copy OvmfPkgX64 files as-is
Gerd Hoffmann [Wed, 8 Sep 2021 09:01:01 +0000 (11:01 +0200)]
OvmfPkg/Microvm: copy OvmfPkgX64 files as-is

Create Microvm subdirectory.  Copy OvmfPkgX64 .dsc and .fdf files
unmodified as starting point for MicrovmX64.

Changes come as separate patches, to simplify patch review and rebases.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoArmVirtPkg: Disable the TPM2 platform hierarchy
Stefan Berger [Fri, 24 Sep 2021 11:42:21 +0000 (07:42 -0400)]
ArmVirtPkg: Disable the TPM2 platform hierarchy

Disable the TPM2 platform hierarchy by directly calling
ConfigureTpmPlatformHierarchy().

Per the TCG firmware specification "TCG PC Client Platform Firmware Profile
Specification" the TPM 2 platform hierarchy needs to be disabled or a
random password set and discarded before the firmware passes control to the
next stage bootloader or kernel.

Current specs are here:
https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClient_PFP_r1p05_v23_pub.pdf

Section 11 states:
"Platform Firmware MUST protect access to the Platform Hierarchy
and prevent access to the platform hierarchy by non-manufacturer-
controlled components."

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoArmVirtPkg: Reference new TPM classes in the build system for compilation
Stefan Berger [Fri, 24 Sep 2021 11:42:20 +0000 (07:42 -0400)]
ArmVirtPkg: Reference new TPM classes in the build system for compilation

We just added the same functionality to the OvmfPkg. However, on x86, we
could use the notification mechanism around
gEfiDxeSmmReadyToLockProtocolGuid to indirectly invoke
ConfigureTpmPlatformHierarchy(). Since ARM does not have an SMM mode, we
have to use direct invocation of this function at the same place in
PlatformBootManagerBeforeConsole() as it is called on x86.

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib
Stefan Berger [Fri, 24 Sep 2021 11:42:19 +0000 (07:42 -0400)]
ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib

Add a NULL implementation of the library class TpmPlatformHierarchyLib.

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MB
Rebecca Cran [Mon, 4 Oct 2021 16:22:33 +0000 (10:22 -0600)]
ArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MB

According to the SMBIOS specification, the ExtendedBiosSize field should
be zero when the BIOS size is less than 16MB:

"Size (n) where 64K * (n+1) is the size of the
physical device containing the BIOS, in
bytes.
FFh - size is 16MB or greater, see Extended
BIOS ROM Size for actual size."

Fix the code in MiscBiosVendorFunction.c to only populate the
ExtendedBiosSize field if the BIOS size is greater than 16MB.

Fix the code to correctly populate the ExtendedBiosSize field with the
unit bits set to MB if the size is between 16MB and 16GB.

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Nhi Pham <nhi@os.amperecomputing.com>
2 years agoIntelFsp2Pkg: Adopt FSP 2.3 specification.
Chasel Chiu [Fri, 1 Oct 2021 07:34:39 +0000 (15:34 +0800)]
IntelFsp2Pkg: Adopt FSP 2.3 specification.

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

Add ExtendedImageRevision in FSP_INFO_HEADER structure, also add
FSP_NON_VOLATILE_STORAGE_HOB2 header.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoDynamicTablesPkg: Rework AmlResourceDataCodegen.c/h
Pierre Gondois [Thu, 30 Sep 2021 07:48:21 +0000 (08:48 +0100)]
DynamicTablesPkg: Rework AmlResourceDataCodegen.c/h

Rework all the functions to to have a generic prototype:
 - First take take the resource data specific arguments.
   E.g.: for a Register(): the AddressSpace, BitWidth, ...
 - The penultimate parameter is a NameOpNode. The resource data
   created is appended to the ResourceTemplate() contained in the
   NameOpNode.
 - The last parameter is a pointer holding the created resource data.

A least one of the two last parameter must be provided. One of them can
be omitted. This generic interface allows to either:
 - Add the resource data to a NameOpNode. This is a common case for the
   Ssdt tables generator.
 - Get the created resource data and let the caller place it in an AML
   tree.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Deprecate Crs specific methods in AmlLib
Pierre Gondois [Thu, 30 Sep 2021 07:48:20 +0000 (08:48 +0100)]
DynamicTablesPkg: Deprecate Crs specific methods in AmlLib

Some functions in the AmlLib have 'Crs' in their name and can only
be applied to '_CRS' AML objects. To re-use them on AML objects that
have different names:
 - Rename them and remove the '_CRS' name check.
 - Create aliases having of the 'Crs' function prototypes. These
   aliases are available when DISABLE_NEW_DEPRECATED_INTERFACES
   is not defined. They will be deprecated in a near future.

The deprecated functions are:
- AmlNameOpCrsGetFirstRdNode()
- AmlNameOpCrsGetNextRdNode()
- AmlCodeGenCrsAddRdInterrupt()

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Update DynamicTablesPkg.ci.yaml
Pierre Gondois [Thu, 30 Sep 2021 07:48:19 +0000 (08:48 +0100)]
DynamicTablesPkg: Update DynamicTablesPkg.ci.yaml

To prepare edk2 upstream CI for incoming modifications:
1- Disable the Ecc check 9005:
   "Only Doxygen commands '@bug', '@todo', [...], '@{', '@}'
   are allowed to mark the code Unknown doxygen command [...]"
2- Disable the Ecc check 8003 for the following keyword:
   "DISABLE_NEW_DEPRECATED_INTERFACES"
   Indeed, this error has been corrected on the latest version of
   BaseTools, but is still triggered when using the older python
   packages containing the BaseTools.
3- Add word exceptions for the cspell tool.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Use %a formatter in AmlDbgPrint
Pierre Gondois [Thu, 30 Sep 2021 07:48:18 +0000 (08:48 +0100)]
DynamicTablesPkg: Use %a formatter in AmlDbgPrint

The correct formatter to print a CHAR8 char in edk2 is '%a'.
Replace the '%s' formatters by '%a'.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add Configuration Manager Object parser
Sami Mujawar [Thu, 30 Sep 2021 07:48:17 +0000 (08:48 +0100)]
DynamicTablesPkg: Add Configuration Manager Object parser

The Platform information repository in the Configuration Manager
may be dynamically populated, for e.g. by a Hardware Information
Parser like FdtHwInfoParser. In such cases it is useful to trace
the CM objects that were populated by the parser.

Therefore, introduce helper functions that can parse and trace
the Configuration Manager Objects.

Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add AmlGetEisaIdFromString() to AcpiHelperLib
Pierre Gondois [Thu, 30 Sep 2021 07:48:16 +0000 (08:48 +0100)]
DynamicTablesPkg: Add AmlGetEisaIdFromString() to AcpiHelperLib

Add a function converting a 7 characters string to its UINT32
EISAID. The algorithm used to create the EISAID is described
in the ACPI 6.4 specification, s19.3.4 "ASL Macros".

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Add HexFromAscii() to AcpiHelperLib
Pierre Gondois [Thu, 30 Sep 2021 07:48:15 +0000 (08:48 +0100)]
DynamicTablesPkg: Add HexFromAscii() to AcpiHelperLib

Add HexFromAscii(), converting an hexadecimal ascii char
to an integer.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Rename single char input parameter
Pierre Gondois [Thu, 30 Sep 2021 07:48:14 +0000 (08:48 +0100)]
DynamicTablesPkg: Rename single char input parameter

The Ecc tool forbids the usage of one char variable: Ecc error 8007:
"There should be no use of short (single character) variable names"

To follow this policy, rename this one letter parameter.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Update TableHelperLib.inf
Pierre Gondois [Thu, 30 Sep 2021 07:48:13 +0000 (08:48 +0100)]
DynamicTablesPkg: Update TableHelperLib.inf

Update the inf file version and BASE_NAME of the library.
Remove unused sections.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoDynamicTablesPkg: Extract AcpiHelperLib from TableHelperLib
Pierre Gondois [Thu, 30 Sep 2021 07:48:12 +0000 (08:48 +0100)]
DynamicTablesPkg: Extract AcpiHelperLib from TableHelperLib

The TableHelperLib contains helper functions. Some rely on
DynamicTablesPkg definitions (they use Configuration Manager objects).
Some others are more generic.

To allow using these generic functions without including
DynamicTablesPkg definitions, move them to a new AcpiHelperLib
library.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2 years agoUefiPayloadPkg: Remove asm code and sharing libraries
Guo Dong [Wed, 29 Sep 2021 03:34:40 +0000 (20:34 -0700)]
UefiPayloadPkg: Remove asm code and sharing libraries

Remove asm code used for payload entry.
Use patchable PCD instead a fixed PCD PcdPayloadStackTop to avoid
potential conflict.

Based on the removal, use same HobLib regardless UNIVERSAL_PAYLOAD.
Use same PlatformHookLib regardless UNIVERSAL_PAYLOAD. The original
PlatformHookLib was removed and UniversalPayloadPlatformHookLib was
rename to new PlatformHookLib.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoSecurityPkg: Fix SecureBootDefaultKeysDxe failed to start
Nhi Pham [Mon, 27 Sep 2021 07:46:27 +0000 (15:46 +0800)]
SecurityPkg: Fix SecureBootDefaultKeysDxe failed to start

The dbt and dbx keys are optional, the driver entry should return
EFI_SUCCESS to start if they are not found in the firmware flash. This
patch is to fix it and update the description of retval as well.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Grzegorz Bernacki <gjb@semihalf.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Grzegorz Bernacki <gjb@semihalf.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoMdeModulePkg: CI YAML: Added new GUID to ignore duplicate list
Kun Qin [Thu, 16 Sep 2021 00:14:20 +0000 (08:14 +0800)]
MdeModulePkg: CI YAML: Added new GUID to ignore duplicate list

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

SMM Communication PPI GUID from MdeModulePkg is defined the same as MM
Communication PPI GUID from MdePkg, according to PI Spec v1.5 and onward.

After introduction of MM Communication PPI definitions, an update in the
ignore duplicate list is needed to avoid breaking CI build.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdePkg: CI YAML: Added new GUID to ignore duplicate list
Kun Qin [Thu, 16 Sep 2021 00:14:19 +0000 (08:14 +0800)]
MdePkg: CI YAML: Added new GUID to ignore duplicate list

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

SMM Communication PPI GUID from MdeModulePkg is defined the same as MM
Communication PPI GUID from MdePkg, according to PI Spec v1.5 and onward.

After introduction of MM Communication PPI definitions, an update in the
ignore duplicate list is needed to avoid breaking CI build.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdePkg: MmCommunication: Added definition of MM Communication PPI
Kun Qin [Thu, 16 Sep 2021 00:14:18 +0000 (08:14 +0800)]
MdePkg: MmCommunication: Added definition of MM Communication PPI

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

MM Communication PPI was defined in PI Specification since v1.5. This
change added definition of such PPI and related GUIDs into MdePkg.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoOvmfPkg: Reference new Tcg2PlatformPei in the build system
Stefan Berger [Wed, 15 Sep 2021 01:25:06 +0000 (09:25 +0800)]
OvmfPkg: Reference new Tcg2PlatformPei in the build system

Compile the Tcg2PlatformPei related code now to support TPM 2 platform
hierachy disablement if the TPM state cannot be resumed upon S3 resume.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg: Reference new Tcg2PlatformDxe in the build system for compilation
Stefan Berger [Wed, 15 Sep 2021 01:25:05 +0000 (09:25 +0800)]
OvmfPkg: Reference new Tcg2PlatformDxe in the build system for compilation

Compile the Tcg2PlatformDxe related code now.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg: Handle TPM 2 physical presence opcodes much earlier
Stefan Berger [Wed, 15 Sep 2021 01:25:04 +0000 (09:25 +0800)]
OvmfPkg: Handle TPM 2 physical presence opcodes much earlier

Handle the TPM 2 physical presence interface (PPI) opcodes in
PlatformBootManagerBeforeConsole() before the TPM 2 platform hierarchy
is disabled. Since the handling of the PPI opcodes may require inter-
action with the user, initialize the keyboard before handling PPI codes.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>