]> xenbits.xensource.com Git - ovmf.git/log
ovmf.git
23 months agoMdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV master edk2-stable202305
Wendy Liao [Wed, 3 May 2023 03:04:12 +0000 (11:04 +0800)]
MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV

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

The main dispatch loop in PeiDispatcher() goes through each FV and
calls DiscoverPeimsAndOrderWithApriori() to search Apriori file to
reorder all PEIMs then do the PEIM dispatched.

DiscoverPeimsAndOrderWithApriori() calculates Apriori file count for
every FV once and set Private->AprioriCount, but Private->AprioriCount
doesn't be set to 0 before dispatch loop walking through the next FV.

It causes the peim which sort on less than Private->AprioriCount and
depex is not satisfied would be dispatched when dispatch loop go through
to a scaned FV, even the peim is not set in APRIORI file.

Cc: Leon Chen <leon.chen@insyde.com>
Cc: Tim Lewis <tim.lewis@insyde.com>
Reported-by: Esther Lee <esther.lee@insyde.com>
Signed-off-by: Wendy Liao <wendy.liao@insyde.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoArmPkg/ArmMmuLib AARCH64: Add missing ISB after page table update
Ard Biesheuvel [Fri, 19 May 2023 21:44:12 +0000 (23:44 +0200)]
ArmPkg/ArmMmuLib AARCH64: Add missing ISB after page table update

The helper that updates live page table entries writes a zero entry,
invalidates the covered address range from the TLBs, and finally writes
the actual entry. This ensures that no TLB conflicts can occur.

Writing the final entry needs to complete before any translations can be
performed, as otherwise, the zero entry, which describes an invalid
translation, may be observed by the page table walker, resulting in a
translation fault. For this reason, the final write is followed by a DSB
barrier instruction.

However, this barrier will not stall the pipeline, and instruction
fetches may still hit this invalid translation, as has been observed and
reported by Oliver. To ensure that the new translation is fully active
before returning from this helper, we have to insert an ISB barrier as
well.

Reported-by: Oliver Steffen <osteffen@redhat.com>
Tested-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
23 months agopip-requirements.txt: Update edk2 pip modules
Michael Kubacki [Tue, 16 May 2023 16:50:28 +0000 (12:50 -0400)]
pip-requirements.txt: Update edk2 pip modules

- edk2-pytool-library: 0.14.0 to 0.14.1
- edk2-pytool-extensions: 0.21.8 to 0.23.2
- edk2-basetools: 0.1.43 to 0.1.48

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoOvmfPkg: RiscVVirt: Add missing SerialPortInitialize to Sec
Andrei Warkentin [Wed, 1 Mar 2023 16:48:17 +0000 (10:48 -0600)]
OvmfPkg: RiscVVirt: Add missing SerialPortInitialize to Sec

If the SerialPortLib had any initialization needed, this
would be skipped in the RiscVVirt Sec. Follow the example
seen elsewhere (ArmVirtPkg PrePi).

Seen with BaseSerialPortLibRiscVSbiLibRam not using DBCN in Sec,
yet using DBCN elsewhere.

Cc: Daniel Schaefer <git@danielschaefer.me>
Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoMdePkg: add SBI-based SerialPortLib for RISC-V
Andrei Warkentin [Tue, 28 Feb 2023 23:32:03 +0000 (17:32 -0600)]
MdePkg: add SBI-based SerialPortLib for RISC-V

These are implementations of SerialPortLib using SBI console services.
- BaseSerialPortLibRiscVSbiLib is appropriate for SEC/PEI (XIP)
  environments
- BaseSerialPortLibRiscVSbiLibRam is appropriate for PrePI/DXE
  environments

Tested with:
- Qemu RiscVVirt (non-DBCN case, backed by UART)
- TinyEMU + RiscVVirt (non-DBCN case, HTIF)
- TinyEMU + RiscVVirt (DBCN case, HTIF)

Cc: Daniel Schaefer <git@danielschaefer.me>
Cc: Sunil V L <sunilvl@ventanamicro.com>
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: Andrei Warkentin <andrei.warkentin@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoMdePkg: BaseRiscVSbiLib: make more useful to consumers
Andrei Warkentin [Tue, 28 Feb 2023 23:30:19 +0000 (17:30 -0600)]
MdePkg: BaseRiscVSbiLib: make more useful to consumers

Add a few more definitions and make SbiCall and TranslateError
usable (not static) by library users.

Cc: Daniel Schaefer <git@danielschaefer.me>
Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoUefiPayloadPkg: Fix boot shell issue for universal UEFI payload
Guo Dong [Wed, 10 May 2023 03:53:55 +0000 (20:53 -0700)]
UefiPayloadPkg: Fix boot shell issue for universal UEFI payload

After moving BDS driver to a new FV for universal UEFI payload,
the shell boot option path is not correct since it used the BDS
FV instead of DXE FV in its device path.
This patch would find the correct FV by reading shell file.
It also removed PcdShellFile by using gUefiShellFileGuid.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Mike Maslenkin <mike.maslenkin@gmail.com>
23 months agoMaintainers.txt: Update reviewers and maintainers for FdtLib.
Gua Guo [Fri, 12 May 2023 02:07:36 +0000 (10:07 +0800)]
Maintainers.txt: Update reviewers and maintainers for FdtLib.

Update reviewers and maintainers for FdtLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Benny Lin <benny.lin@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: Guo Gua <gua.guo@intel.com>
Reviewed-by: Benny Lin <benny.lin@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
23 months agoBaseTools/tools_def: Disable overzealous unused variable warning on Clang
Ard Biesheuvel [Wed, 10 May 2023 14:44:09 +0000 (16:44 +0200)]
BaseTools/tools_def: Disable overzealous unused variable warning on Clang

The warnings Clang emits when enabling -Wunneeded-internal-declaration
(which is part of -Wall) are generating false positives for variables
whose size gets taken but are not referenced beyond yet.

This may happen legitimately in debug code, so let's disable this
warning for Clang, rather than tiptoe around it in the code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
23 months agoBaseTools/tools_def: Drop ref to undefined CLANGDWARF_ARM_PREFIX
Ard Biesheuvel [Thu, 11 May 2023 06:55:20 +0000 (08:55 +0200)]
BaseTools/tools_def: Drop ref to undefined CLANGDWARF_ARM_PREFIX

When using CLANGDWARF to build for the ARM architecture, objcopy is
references via the wrong environment variable, resulting in the wrong
llvm-objcopy to be used (if one exists), or the build to fail (if
CLANGDWARF_BIN points to the only available instance)

So use CLANGDWARF_BIN instead, which was what was intended.

Fixes: ecbc394365f50f3c ("BaseTools: Set CLANGDWARF RC path ...")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
23 months agoShellPkg/UefiShellDebug1CommandsLib: Replace hardcoded SMBIOS strings.
Giri Mudusuru [Sat, 6 May 2023 10:28:24 +0000 (18:28 +0800)]
ShellPkg/UefiShellDebug1CommandsLib: Replace hardcoded SMBIOS strings.

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

Replace hardcoded SMBIOS Anchor string and size with defines.

Fix buffer overflow as described below.

Smbios64BitPrintEPSInfo () is coded like:
UINT8  Anchor[5];

MemToString (Anchor, SmbiosTable->AnchorString, 5);

But the definition of MemToString()
  Copy Length of Src buffer to Dest buffer,
  add a NULL termination to Dest buffer.

So Anchor needs to be +1 the size of the SMBIOS Anchor string `_SM3_`.

Changes from v1 to v2:
 - Replace doxygen style inline comments

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Andrew Fish <afish@apple.com>
Signed-off-by: Giri Mudusuru <girim@apple.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg/IndustryStandard: Add SMBIOS anchor string & length defines.
Giri Mudusuru [Fri, 5 May 2023 00:17:09 +0000 (08:17 +0800)]
MdePkg/IndustryStandard: Add SMBIOS anchor string & length defines.

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

Add SMBIOS spec defined anchor strings & length defines.

 - '_SM_' chapter 5.2.1 SMBIOS 2.1 (32-bit) Entry Point
 - '_SM3_' chapter 5.2.2 SMBIOS 3.0 (64-bit) Entry Point

Changes from v1 to v2:
 - Replace non-ASCII characters

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Andrew Fish <afish@apple.com>
Signed-off-by: Giri Mudusuru <girim@apple.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg/IndustryStandard: Add IPMI Interface Capabilities definitions
Tinh Nguyen [Sun, 7 May 2023 09:29:13 +0000 (17:29 +0800)]
MdePkg/IndustryStandard: Add IPMI Interface Capabilities definitions

This adds more definitions for the IPMI Get System Interface
Capabilities command.

Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.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: Abner Chang <abner.chang@amd.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg: Add new PCDs for IPMI SSIF
Tinh Nguyen [Sun, 7 May 2023 09:29:12 +0000 (17:29 +0800)]
MdePkg: Add new PCDs for IPMI SSIF

BZ#: 4434 - Add IPMI SSIF definitions.

This change adds new PCDs for IPMI SSIF.

Specification reference:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.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: Abner Chang <abner.chang@amd.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg/IndustryStandard: Add definitions for IPMI SSIF
Tinh Nguyen [Sun, 7 May 2023 09:29:11 +0000 (17:29 +0800)]
MdePkg/IndustryStandard: Add definitions for IPMI SSIF

BZ#: 4434 - Add IPMI SSIF definitions.

Specification reference:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.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: Abner Chang <abner.chang@amd.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMaintainers.txt: Update reviewers and maintainers for TraceHubDebugLib.
Gua Guo [Wed, 10 May 2023 09:13:22 +0000 (17:13 +0800)]
Maintainers.txt: Update reviewers and maintainers for TraceHubDebugLib.

Update reviewers and maintainers for TraceHubDebugSysTlib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Signed-off-by: Guo Gua <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: K N Karthik <karthik.k.n@intel.com>
Reviewed-by: Chan Laura <laura.chan@intel.com>
23 months agoMdeModulePkg: Add TraceHubDebugSysTLib library
Gua Guo [Wed, 10 May 2023 02:15:35 +0000 (10:15 +0800)]
MdeModulePkg: Add TraceHubDebugSysTLib library

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

This Library provides API to dump Trace Hub message.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Guo Gua <gua.guo@intel.com>
Cc: Chan Laura <laura.chan@intel.com>
Cc: Prakashan Krishnadas Veliyathuparambil <krishnadas.veliyathuparambil.prakashan@intel.com>
Cc: K N Karthik <karthik.k.n@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Guo Gua <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: K N Karthik <karthik.k.n@intel.com>
Reviewed-by: Chan Laura <laura.chan@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg: Add NULL library of TraceHubDebugSysTLib
Gua Guo [Wed, 10 May 2023 02:12:18 +0000 (10:12 +0800)]
MdePkg: Add NULL library of TraceHubDebugSysTLib

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

This Library is NULL library of TraceHubDebugSysTLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Guo Gua <gua.guo@intel.com>
Cc: Chan Laura <laura.chan@intel.com>
Cc: Prakashan Krishnadas Veliyathuparambil <krishnadas.veliyathuparambil.prakashan@intel.com>
Cc: K N Karthik <karthik.k.n@intel.com>
Signed-off-by: Guo Gua <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: K N Karthik <karthik.k.n@intel.com>
Reviewed-by: Chan Laura <laura.chan@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg: Add MipiSysTLib library
Gua Guo [Wed, 10 May 2023 20:42:57 +0000 (04:42 +0800)]
MdePkg: Add MipiSysTLib library

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

This Library provides functions consuming MIPI SYS-T submodule.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Guo Gua <gua.guo@intel.com>
Cc: Chan Laura <laura.chan@intel.com>
Cc: Prakashan Krishnadas Veliyathuparambil <krishnadas.veliyathuparambil.prakashan@intel.com>
Cc: K N Karthik <karthik.k.n@intel.com>
Signed-off-by: Guo Gua <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: K N Karthik <karthik.k.n@intel.com>
Reviewed-by: Chan Laura <laura.chan@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdePkg: Add mipisyst submodule
Gua Guo [Wed, 10 May 2023 20:54:05 +0000 (04:54 +0800)]
MdePkg: Add mipisyst submodule

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

This Library provides functions consuming MIPI SYS-T submodule.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Guo Gua <gua.guo@intel.com>
Cc: Chan Laura <laura.chan@intel.com>
Cc: Prakashan Krishnadas Veliyathuparambil <krishnadas.veliyathuparambil.prakashan@intel.com>
Cc: K N Karthik <karthik.k.n@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Guo Gua <gua.guo@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoBaseTools/Plugin: Too many execute files cause "cmd too long" failure
Gua Guo [Mon, 8 May 2023 10:45:55 +0000 (18:45 +0800)]
BaseTools/Plugin: Too many execute files cause "cmd too long" failure

Windows command prompt have 8191 characters limitation,
enhance it to make command too long can be resloved.

Provide an example, if have too many cov files, it causes to run single
command over the 8191 characters limitation.
> OpenCppCoverage
>  --export_type binary:coverage.cov
>  --working_dir={workspace}Build
>  --input_coverage=AAA.cov
>  ...
>  --input_coverage=NNN.cov

The solution is passing many coverage files in single command line to
breaking it up into many command lines with one coverage file per
command line in order to prevent single line is over to 8191 characters.

- Command Line 1
> OpenCppCoverage
>  --export_type binary:coverage.cov
>  --working_dir={workspace}Build
>  --input_coverage=AAA.cov
>  --input_coverage=coverage.cov
...

- Command Line N
> OpenCppCoverage
>  --export_type. binary:coverage.cov
>  --working_dir={workspace}Build
>  --input_coverage=NNN.cov
>  --input_coverage=coverage.cov

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoSecurityPkg: Add missing break in Tpm2TestParms
Rebecca Cran [Tue, 9 May 2023 16:44:59 +0000 (00:44 +0800)]
SecurityPkg: Add missing break in Tpm2TestParms

Add missing break in Tpm2TestParms.

Reported in https://github.com/tianocore/edk2/issues/4073

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
23 months agoBaseTools: Update Tests/TestTools.py to allow it to work on Windows
Rebecca Cran [Sat, 6 May 2023 11:01:49 +0000 (05:01 -0600)]
BaseTools: Update Tests/TestTools.py to allow it to work on Windows

On Windows, executables have a '.exe' suffix which needs to be added for
them to be found in a path.

Also, files need to be explicitly opened as binary.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
23 months agoBaseTools: only print the environment once in toolsetup.bat
Rebecca Cran [Mon, 24 Apr 2023 17:20:42 +0000 (11:20 -0600)]
BaseTools: only print the environment once in toolsetup.bat

Avoid printing %PATH% twice: move the printing of the environment down
to print_python_info.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
23 months agoBaseTools: Update toolsetup.bat to not use BASETOOLS_PYTHON_SOURCE
Rebecca Cran [Mon, 24 Apr 2023 17:15:46 +0000 (11:15 -0600)]
BaseTools: Update toolsetup.bat to not use BASETOOLS_PYTHON_SOURCE

The BASETOOLS_PYTHON_SOURCE environment variable is only used temporarily to
set PYTHONPATH. Since it doesn't help improve clarity, remove it.

While here, make sure we set PYTHONPATH when we're using Pip BaseTools
so that build etc. can be found.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
23 months agoBaseTools: Revert Set the CLANGDWARF OBJCOPY path in tools_def.template
Rebecca Cran [Wed, 10 May 2023 12:17:52 +0000 (06:17 -0600)]
BaseTools: Revert Set the CLANGDWARF OBJCOPY path in tools_def.template

This reverts commit 11f62f4cc09f16d265da1a737dabfd8ed65f8c00.

While GCC uses objcopy for the OBJCOPY command, it's not needed for the
CLANGDWARF toolchain and can be left as echo.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Ard BIesheuvel <ardb@kernel.org>
23 months agoOvmfPkg: drop PlatformBootManagerLibGrub
Gerd Hoffmann [Fri, 5 May 2023 05:17:27 +0000 (07:17 +0200)]
OvmfPkg: drop PlatformBootManagerLibGrub

Not used any more, remove.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
23 months agoOvmfPkg/AmdSev: stop using PlatformBootManagerLibGrub
Gerd Hoffmann [Fri, 5 May 2023 05:17:26 +0000 (07:17 +0200)]
OvmfPkg/AmdSev: stop using PlatformBootManagerLibGrub

Use PlatformBootManagerLib with PcdBootRestrictToFirmware
set to TRUE instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
23 months agoOvmfPkg/NvVarsFileLib: disable in case PcdBootRestrictToFirmware is set
Gerd Hoffmann [Fri, 5 May 2023 05:17:25 +0000 (07:17 +0200)]
OvmfPkg/NvVarsFileLib: disable in case PcdBootRestrictToFirmware is set

In case PcdBootRestrictToFirmware is set, disable loading EFI variables
from NvVars file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
23 months agoOvmfPkg/PlatformBootManagerLib: add PcdBootRestrictToFirmware
Gerd Hoffmann [Fri, 5 May 2023 05:17:24 +0000 (07:17 +0200)]
OvmfPkg/PlatformBootManagerLib: add PcdBootRestrictToFirmware

Add new PCD PcdBootRestrictToFirmware.  When set to TRUE restrict
boot options to EFI applications embedded into the firmware image.

Behavior should be identical to the PlatformBootManagerLibGrub
library variant.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
23 months agoRemove bashisms from edksetup.sh and BaseTools/BuildEnv
Rebecca Cran [Mon, 24 Apr 2023 20:59:14 +0000 (14:59 -0600)]
Remove bashisms from edksetup.sh and BaseTools/BuildEnv

Remove bashisms from edksetup.sh and BaseTools/BuildEnv. This allows any
POSIX shell to use those scripts, removing the dependency on bash.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoBaseTools: Remove the CLANGCC build rule for Hii-Binary-Package.UEFI_HII
Rebecca Cran [Tue, 9 May 2023 22:36:04 +0000 (16:36 -0600)]
BaseTools: Remove the CLANGCC build rule for Hii-Binary-Package.UEFI_HII

The build rule for Hii-Binary-Package.UEFI_HII should be the same as for
GCC, using $(RC) to embed the HII resource into the binary. Since the
build rule defaults to GCC, just remove CLANGGCC from the section.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoBaseTools: Set CLANGDWARF RC path to llvm-objcopy in tools_def.template
Rebecca Cran [Tue, 9 May 2023 22:33:00 +0000 (16:33 -0600)]
BaseTools: Set CLANGDWARF RC path to llvm-objcopy in tools_def.template

The llvm-rc tool is for Windows PE resources. Since the CLANGDWARF
toolchain creates ELF binaries, update the RC path to be llvm-objcopy.
This follows the GCC toolchain which uses objcopy for the RC path.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoBaseTools: Set the CLANGDWARF OBJCOPY path in tools_def.template
Rebecca Cran [Tue, 9 May 2023 22:31:53 +0000 (16:31 -0600)]
BaseTools: Set the CLANGDWARF OBJCOPY path in tools_def.template

Set the OBJCOPY path for the CLANGDWARF toolchain to 'llvm-objcopy' to
override the default of 'echo'.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoBaseTools: Remove BUILDRULEFAMILY from CLANGDWARF in tools_def.template
Rebecca Cran [Tue, 9 May 2023 22:30:28 +0000 (16:30 -0600)]
BaseTools: Remove BUILDRULEFAMILY from CLANGDWARF in tools_def.template

There's only a single rule in build_rule.template for CLANGGCC, and it's
incorrect. We should instead just use the rules for GCC, so remove the
BUILDRULEFAMILY line for the CLANGDWARF toolchain definition.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoCryptoPkg: Delete CLANG35 and CLANG38 build flags; add CLANGDWARF flags
Rebecca Cran [Fri, 5 May 2023 13:32:19 +0000 (07:32 -0600)]
CryptoPkg: Delete CLANG35 and CLANG38 build flags; add CLANGDWARF flags

Since CLANG35 and CLANG38 toolchains have been deleted from
tools_def.template, delete the build flags for them from CryptoPkg.

Since CLANGDWARF has replaced CLANG38, add build flags for it to the
CryptoPkg .inf files.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
23 months agoMdePkg: Add more HobLib/PeiServicesLib gmock support
Gua Guo [Mon, 8 May 2023 23:58:14 +0000 (07:58 +0800)]
MdePkg: Add more HobLib/PeiServicesLib gmock support

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

Add Google Mock Library for HobLib
Add Google Mock Library for PeiServicesLib

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Chris Johnson <chris.n.johnson@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoMdeModulePkg: Add more PciHostBridgeLib gmock support
Gua Guo [Fri, 5 May 2023 01:16:56 +0000 (09:16 +0800)]
MdeModulePkg: Add more PciHostBridgeLib gmock support

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

Add Google Mock Library for PciHostBridgeLib

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chris Johnson <chris.n.johnson@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
23 months agoOvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL
Michael Brown [Tue, 9 May 2023 12:09:33 +0000 (12:09 +0000)]
OvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL

At TPL_HIGH_LEVEL, CPU interrupts are disabled (as per the UEFI
specification) and so we should never encounter a situation in which
an interrupt occurs at TPL_HIGH_LEVEL.  The specification also
restricts usage of TPL_HIGH_LEVEL to the firmware itself.

However, nothing actually prevents a UEFI application from calling
gBS->RaiseTPL(TPL_HIGH_LEVEL) and then violating the invariant by
enabling interrupts via the STI or equivalent instruction.  Some
versions of the Microsoft Windows bootloader are known to do this.

NestedInterruptTplLib maintains the invariant that interrupts are
disabled at TPL_HIGH_LEVEL (even when performing the dark art of
deliberately manipulating the stack so that IRET will return with
interrupts still disabled), but does not itself rely on external code
maintaining this invariant.

Relax the assertion that the interrupted TPL is below TPL_HIGH_LEVEL
to an error message, to allow UEFI applications such as these versions
of the Microsoft Windows bootloader to continue to function.

Debugged-by: Gerd Hoffmann <kraxel@redhat.com>
Debugged-by: Laszlo Ersek <lersek@redhat.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2189136
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
23 months agoOvmfPkg: Clarify invariants for NestedInterruptTplLib
Michael Brown [Tue, 9 May 2023 12:09:30 +0000 (12:09 +0000)]
OvmfPkg: Clarify invariants for NestedInterruptTplLib

NestedInterruptTplLib relies on CPU interrupts being disabled to
guarantee exclusive (and hence atomic) access to the shared state in
IsrState.  Nothing in the calling interrupt handler should have
re-enabled interrupts before calling NestedInterruptRestoreTPL(), and
the loop in NestedInterruptRestoreTPL() itself maintains the invariant
that interrupts are disabled at the start of each iteration.

Add assertions to clarify this invariant, and expand the comments
around the calls to RestoreTPL() and DisableInterrupts() to clarify
the expectations around enabling and disabling interrupts.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
23 months agoBaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver
Rebecca Cran [Mon, 24 Apr 2023 17:10:54 +0000 (11:10 -0600)]
BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver

Update toolsetup.bat and Tests/PythonTest.py to check if we're running a
version of Python that's compatible with BaseTools and the Pip
BaseTools.

BaseTools uses syntax from Python 3.6 or newer, so set that as the minimum
version EDK2 requires.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoedksetup.bat: if toolsetup.bat fails, just exit
Rebecca Cran [Mon, 24 Apr 2023 17:06:52 +0000 (11:06 -0600)]
edksetup.bat: if toolsetup.bat fails, just exit

If toolsetup.bat fails (i.e. exits with a non-zero %ERRORLEVEL%), don't
try and carry on but just quit.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoBaseTools: use threading.current_thread in NmakeSubdirs.py
Rebecca Cran [Mon, 24 Apr 2023 16:44:24 +0000 (10:44 -0600)]
BaseTools: use threading.current_thread in NmakeSubdirs.py

threading.currentThread is a deprecated alias for
threading.current_thread, and causes a warning to be displayed when it's
called. Update NmakeSubdirs.py to use the latter method instead.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoBaseTools: Remove Python2/Python3 detection from toolset.bat
Rebecca Cran [Mon, 24 Apr 2023 13:18:59 +0000 (07:18 -0600)]
BaseTools: Remove Python2/Python3 detection from toolset.bat

Since Python3 is now required, we can remove the checks for PYTHON3_ENABLE
and PYTHON3 and simplify the code in toolsetup.bat. Also, remove the
leftover from when we supported freezing Python code.

While here, fix a couple of typos and improve error messages.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoRedfishPkg: Fix compile issue on Linux
Vu Nguyen [Thu, 20 May 2021 03:38:24 +0000 (10:38 +0700)]
RedfishPkg: Fix compile issue on Linux

It requires a fixed size array to store the content of device path PCD.
Add the array size to solve this issue.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <Abner.Chang@amd.com>
23 months agoRedfishPkg: Add missing newline character
Nhi Pham [Thu, 6 Apr 2023 01:22:44 +0000 (08:22 +0700)]
RedfishPkg: Add missing newline character

This adds a missing newline character to make the error log
readable in case the module is failed.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
23 months agoRedfishPkg: Create RestEx child on selected interface
Vu Nguyen [Mon, 28 Jun 2021 10:26:55 +0000 (17:26 +0700)]
RedfishPkg: Create RestEx child on selected interface

When a MAC address matching interface is found, a RestEx child will be
created to provide the Redfish communication on that interface.
Currently, It will try to locate all RestEx binding services and choose
the first satisfied instance without taking care about current selected
interface. This might raise an issue on the system with multiple network
devices that the RestEx child was installed on wrong interface.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <Abner.Chang@amd.com>
23 months agoRedfishPkg: Fix condition checking of error status
Vu Nguyen [Wed, 30 Jun 2021 01:41:21 +0000 (08:41 +0700)]
RedfishPkg: Fix condition checking of error status

This change fixes condition checking of error status, the condition
should be compared with TRUE status to be identical with an error message.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
23 months agoRedfishPkg: Correct variable type to prevent memory corruption
Vu Nguyen [Thu, 13 Apr 2023 09:24:49 +0000 (16:24 +0700)]
RedfishPkg: Correct variable type to prevent memory corruption

Id will be casted by CoreOpenProtocol, declare this variable with a
wrong type might result in the corruption of other local variables.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
23 months agoSecuritypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy
Linus Liu [Mon, 8 May 2023 04:20:51 +0000 (12:20 +0800)]
Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Maggie Chu <maggie.chu@intel.com>
Cc: Kumar Rahul <rahul.r.kumar@intel.com>
Signed-off-by: Linus Liu <linus.liu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
23 months agoAdd volatile keyword to NvmExpressPei's Passthru CQ
Oliver Smith-Denny [Thu, 27 Apr 2023 17:36:22 +0000 (01:36 +0800)]
Add volatile keyword to NvmExpressPei's Passthru CQ

This applies the volatile keyword and appropriate casts
to the NvmExpressPei's Passthru CQ.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
23 months agoAdd the volatile keyword to NvmExpressDxe's Passthru CQ
Oliver Smith-Denny [Thu, 27 Apr 2023 17:36:21 +0000 (01:36 +0800)]
Add the volatile keyword to NvmExpressDxe's Passthru CQ

This updates the relevant functions that expect a non-volatile
structure to be passed to them to take casts of the CQ
now that it is volatile.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoBaseTools/Conf: Add quotes to ADDDEBUGFLAG in tools_def.txt
Michael D Kinney [Sat, 6 May 2023 02:45:07 +0000 (19:45 -0700)]
BaseTools/Conf: Add quotes to ADDDEBUGFLAG in tools_def.txt

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

Update tools_def.txt to add quotes around the file target in
OBJCOPY_ADDDEBUGFLAGS for compatibility with GCC like tool
chains used on Windows.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2 years agoBaseTools/Conf: Align CLANGDWARF and CLANGPDB warning overrides
Michael D Kinney [Fri, 5 May 2023 23:36:44 +0000 (16:36 -0700)]
BaseTools/Conf: Align CLANGDWARF and CLANGPDB warning overrides

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

Fix build error related to use of DEBUG_CODE_BEGIN() and
DEBUG_CODE_END(). CLANGPDB requires extra warning disables
for use of DebugLib.h macros.  This change aligns the warning
disables between CLANGDWARF and CLANGPDB.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/CapsuleApp: Add EFIAPI to CompareFileNameInAlphabet()
Michael D Kinney [Fri, 5 May 2023 16:51:11 +0000 (09:51 -0700)]
MdeModulePkg/CapsuleApp: Add EFIAPI to CompareFileNameInAlphabet()

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

CompareFileNameInAlphabet() is passed as a function pointer
parameter and typecast to type SORT_COMPARE that is declared
with EFIAPI.  Add EFIAPI to CompareFileNameInAlphabet() to match
SORT_COMPARE type.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoOvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf
Gerd Hoffmann [Fri, 5 May 2023 11:06:24 +0000 (19:06 +0800)]
OvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf
Gerd Hoffmann [Fri, 5 May 2023 11:06:23 +0000 (19:06 +0800)]
OvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoBaseSynchronizationLib: Fix LoongArch64 synchronization functions
Dongyan Qian [Thu, 27 Apr 2023 12:57:12 +0000 (20:57 +0800)]
BaseSynchronizationLib: Fix LoongArch64 synchronization functions

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

There is a return value bug:
The sc.w/sc.d instruction will destroy the reg_t0,
use reg_t1 to avoid context reg_t0 being corrupted.
Adjust Check that ptr align is UINT16.
Optimize function SyncIncrement and SyncDecrement.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Reviewed-by: Chao Li <lichao@loongson.cn>
2 years agoBaseTools/Conf/tools_def.template: Bump VERSION to 3.00
Rebecca Cran [Sun, 16 Apr 2023 15:01:43 +0000 (09:01 -0600)]
BaseTools/Conf/tools_def.template: Bump VERSION to 3.00

Bump VERSION to 3.00 and explain the changes made to the toolchains.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Delete CLANG38 from tools_def.template
Rebecca Cran [Mon, 1 May 2023 13:36:16 +0000 (07:36 -0600)]
BaseTools: Delete CLANG38 from tools_def.template

Clang 3.8 is a very old release and is no longer relevant. Delete the
CLANG38 toolchain from tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove CLANG35 toolchain from tools_def.template
Rebecca Cran [Mon, 1 May 2023 13:29:57 +0000 (07:29 -0600)]
BaseTools: Remove CLANG35 toolchain from tools_def.template

Clang 3.5 is a very old release and is no longer relevant. Remove the
CLANG35 toolchain from tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and AARCH64
Rebecca Cran [Mon, 1 May 2023 13:50:37 +0000 (07:50 -0600)]
BaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and AARCH64

As with the IA32 and X64 CLANGDWARF toolchain definitions, use ld.lld
for ARM and AARCH64.

Add -Wl,--no-pie,--no-relax to the command line to fix linking when
using lld.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Add ARM and AARCH64 CLANGDWARF support in tools_def.template
Rebecca Cran [Mon, 1 May 2023 13:44:50 +0000 (07:44 -0600)]
BaseTools: Add ARM and AARCH64 CLANGDWARF support in tools_def.template

Add ARM and AARCH64 support to CLANGDWARF in tools_def.template, copying
the CLANG38 definitions.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools/Conf/tools_def.template: Add section for deprecated toolchains
Rebecca Cran [Sun, 16 Apr 2023 12:55:25 +0000 (06:55 -0600)]
BaseTools/Conf/tools_def.template: Add section for deprecated toolchains

In order to make it clear for anyone reading tools_def.template, add
a section for deprecated tool chains and move GCC48, GCC49 and GCC5
into it.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoAdd GCC and GCCNOLTO toolchains to tools_def.txt and update packages
Rebecca Cran [Wed, 12 Apr 2023 18:35:11 +0000 (12:35 -0600)]
Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages

Add a 'GCC' toolchain that's a copy of the existing GCC5 definition.
Add a 'GCCNOLTO' toolchain that's a copy of the existing GCC49
toolchain.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Update VS toolchain descriptions in tools_def.txt.template
Rebecca Cran [Sun, 2 Apr 2023 15:36:16 +0000 (09:36 -0600)]
BaseTools: Update VS toolchain descriptions in tools_def.txt.template

Update the Visual Studio toolchain descriptions in
tools_def.txt.template:

- The WinDDK is no longer needed.
- Update 3 is required for VS 2015.
- VS 2005 has been removed.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove EBC (EFI Byte Code) compiler definitions
Rebecca Cran [Tue, 21 Mar 2023 22:49:24 +0000 (16:49 -0600)]
BaseTools: Remove EBC (EFI Byte Code) compiler definitions

The edk2-stable202302 release was the last to support building
EFI Byte Code drivers. Since the Intel EFI Byte Code Compiler is no
longer available, a decision has been made to remove support for EBC
from edk2.

Remove the definitions for Intel's EBC compiler from
Conf/tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs
Rebecca Cran [Tue, 21 Mar 2023 22:47:51 +0000 (16:47 -0600)]
BaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs

Remove the unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS definitions
from Conf/tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoedksetup.bat: Remove VS2008-VS2013 remnants
Rebecca Cran [Tue, 21 Mar 2023 22:45:58 +0000 (16:45 -0600)]
edksetup.bat: Remove VS2008-VS2013 remnants

Since Visual Studio versions older than VS2015 are no longer supported,
remove mention of them from edksetup.bat.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdePkg: Remove VS2008-VS2013 remnants
Rebecca Cran [Tue, 21 Mar 2023 22:45:35 +0000 (16:45 -0600)]
MdePkg: Remove VS2008-VS2013 remnants

Since Visual Studio versions older than VS2015 are no longer supported,
remove mention of them from MdePkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove VS2008-VS2013 remnants
Rebecca Cran [Tue, 21 Mar 2023 22:45:23 +0000 (16:45 -0600)]
BaseTools: Remove VS2008-VS2013 remnants

Remove remnants of Visual Studio 2008-2013 support from
Conf/tools_def.txt and various batch scripts.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions
Rebecca Cran [Tue, 21 Mar 2023 22:29:43 +0000 (16:29 -0600)]
BaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions

With recent changes, Visual Studio versions older than VS2015 are
unable to build EDK2 code.

To avoid confusion, remove VS2008, 2010, 2012 and 2013 toolchain
definitions from Conf/tools_def.template, leaving only versions that can
be used to successfully build firmware.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdePkg/BasePeCoffLib: Deal with broken debug directories
Ard Biesheuvel [Thu, 4 May 2023 14:40:18 +0000 (16:40 +0200)]
MdePkg/BasePeCoffLib: Deal with broken debug directories

Older versions of GenFw put the wrong value in the debug directory size
field in the PE/COFF header: instead of putting the combined size of all
the entries, it puts the size of the only entry it creates, but adds the
size of the NB10 payload that the entry points to. This confuses the
loader now that we started using additional debug directory entries to
describe DLL characteristics.

GenFw was fixed in commit 60e85a39fe49071, but the binaries that were
generated with it still need to be supported.

So let's detect this condition, and check whether the size of the debug
directory is consistent with the NB10 payload: if we should expect
additional directory entries where we observe the NB10 payload, the size
field is clearly wrong, and we can break from the loop.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4425
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Tested-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years ago.pytool: Support FDT library.
Benny Lin [Thu, 4 May 2023 23:48:12 +0000 (16:48 -0700)]
.pytool: Support FDT library.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392
Add FDT support in EDK2 by submodule 3rd party libfdt
(https://github.com/devicetree-org/pylibfdt/tree/main/libfdt)

Add RequiredSubmodule object for CI setting.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Benny Lin <benny.lin@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdePkg: Support FDT library.
Benny Lin [Thu, 4 May 2023 23:48:11 +0000 (16:48 -0700)]
MdePkg: Support FDT library.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392
Add FDT support in EDK2 by submodule 3rd party libfdt
(https://github.com/devicetree-org/pylibfdt/tree/main/libfdt)
and refer to LibcLib implementation by Pedro.

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: Benny Lin <benny.lin@intel.com>
Acked-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoTianocore: Support FDT library.
Benny Lin [Thu, 4 May 2023 23:48:10 +0000 (16:48 -0700)]
Tianocore: Support FDT library.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392
Add FDT support in EDK2 by submodule 3rd party libfdt
(https://github.com/devicetree-org/pylibfdt/tree/main/libfdt)

Add submodule libfdt and update ReadMe for the license.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Benny Lin <benny.lin@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMaintainers.txt: Update for IntelFsp2Pkg and IntelFsp2WrapperPkg.
Chasel Chiu [Mon, 24 Apr 2023 18:07:50 +0000 (11:07 -0700)]
Maintainers.txt: Update for IntelFsp2Pkg and IntelFsp2WrapperPkg.

Add more maintainers and reviewers for these 2 packages.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Ray Han Lim Ng <ray.han.lim.ng@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Reviewed-by: Ng Ray Han Lim <ray.han.lim.ng@intel.com>
Reviewed-by: Chen Gang C <gang.c.chen@intel.com>
Reviewed-by: Kuo Ted <ted.kuo@intel.com>
Reviewed-by: Mohapatra Susovan <susovan.mohapatra@intel.com>
Reviewed-by: S Ashraf Ali <ashraf.ali.s@intel.com>
2 years agoOvmfPkg/PlatformBootManagerLib: setup virtio serial console
Gerd Hoffmann [Thu, 4 May 2023 13:12:01 +0000 (15:12 +0200)]
OvmfPkg/PlatformBootManagerLib: setup virtio serial console

In case a virtio-serial device is present in the system register the
first serial port as console.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg/VirtioSerialDxe: wire up in OvmfPkg*
Gerd Hoffmann [Thu, 4 May 2023 13:12:00 +0000 (15:12 +0200)]
OvmfPkg/VirtioSerialDxe: wire up in OvmfPkg*

Add the driver to the ovmf builds.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg/VirtioSerialDxe: add driver
Gerd Hoffmann [Thu, 4 May 2023 13:11:59 +0000 (15:11 +0200)]
OvmfPkg/VirtioSerialDxe: add driver

Add a driver for the virtio serial device.

The virtio serial device also known as virtio console device because
initially it had only support for a single tty, intended to be used as
console.  Support for multiple streams and named data ports has been
added later on.

The driver supports tty ports only, they are registered as SerialIo
UART in the system.

Named ports are detected and logged, but not exposed as devices.  They
are usually used by guest agents to communicate with the host.  It's not
clear whenever it makes sense for the firmware to run such agents and if
so which efi protocol could be to expose the ports.  So leaving that for
another day.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg: add IndustryStandard/VirtioSerial.h
Gerd Hoffmann [Thu, 4 May 2023 13:11:58 +0000 (15:11 +0200)]
OvmfPkg: add IndustryStandard/VirtioSerial.h

Add header files with structs and defines for the virtio serial device.

The virtio serial device also known as virtio console device because
initially it had only support for a single tty, intended to be used as
console.  Support for multiple streams and named data ports has been
added later on.

https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.html#x1-2900003

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg: replace SECURE_BOOT_FEATURE_ENABLED with PcdSecureBootSupported
Gerd Hoffmann [Fri, 21 Apr 2023 06:55:44 +0000 (08:55 +0200)]
OvmfPkg: replace SECURE_BOOT_FEATURE_ENABLED with PcdSecureBootSupported

Drop the '-D SECURE_BOOT_FEATURE_ENABLED' compile time option,
use a new FeaturePcd instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoArmVirtPkg: allow setting Firmware Version from build command line
Oliver Steffen [Fri, 14 Apr 2023 08:33:23 +0000 (10:33 +0200)]
ArmVirtPkg: allow setting Firmware Version from build command line

ArmVirtXen.dsc initializes
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString with with the
value of the variable "FIRMWARE_VER".

Move that functionality to ArmVirt.dsc.inc to make it available to all
ArmVirt packages, and make it conditional: only set the PCD string if
FIRMWARE_VER is actually defined.

This allows specifying the firmware version string on the build command
line with -D FIRMARE_VER=...

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoOvmfPkg: allow setting Firmware Version from build command line
Oliver Steffen [Fri, 14 Apr 2023 08:33:22 +0000 (10:33 +0200)]
OvmfPkg: allow setting Firmware Version from build command line

Initialize gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString with
with the value of the variable "FIRMWARE_VER", if is is defined. Applies
to all flavors of OvmfPkg.

This behavior is already implemented in ArmVirtXen.dsc. It allows
specifying the firmware version string on the build command line with
-D FIRMARE_VER=...

Introduce a common include file to be used in the .dsc files for the
different OVMF flavors, and add the changes there.  (ArmVirtPkg already
has such a file).

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2 years agoArmPkg/PlatformBootManagerLib: Add path to boot UEFI Shell over UiApp
Pierre Gondois [Tue, 25 Apr 2023 11:27:16 +0000 (13:27 +0200)]
ArmPkg/PlatformBootManagerLib: Add path to boot UEFI Shell over UiApp

The UEFI Shell is a non-active boot option, at the opposite of UiApp.
If no valid boot option is found, UiApp is selected. UiApp requires a
human interaction. When installing a new EDKII image in CIs or when
scripting is required, this is problematic.

If no valid boot option is discovered, add a path to directly go to
the UEFI Shell where the startup.nsh script is automatically executed.
The UEFI Shell is launched after connecting possible devices, but
before the reset that is meant to automatically make them visible.

The new PcdUefiShellDefaultBootEnable must be set to TRUE to enable
this behaviour. The Pcd is set to false by default.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Patrik Berglund <patrik.berglund@arm.com>
2 years agoSecurityPkg: add TIS sanity check (tpm12)
Gerd Hoffmann [Wed, 26 Apr 2023 16:24:05 +0000 (00:24 +0800)]
SecurityPkg: add TIS sanity check (tpm12)

The code blindly assumes a TIS interface is present in case both CRB and
FIFO checks fail.  Check the InterfaceType for TIS instead and only
return PtpInterfaceTis in case it matches, PtpInterfaceMax otherwise.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg: add TIS sanity check (tpm2)
Gerd Hoffmann [Wed, 26 Apr 2023 16:24:04 +0000 (00:24 +0800)]
SecurityPkg: add TIS sanity check (tpm2)

The code blindly assumes a TIS interface is present in case both CRB and
FIFO checks fail.  Check the InterfaceType for TIS instead and only
return Tpm2PtpInterfaceTis in case it matches, Tpm2PtpInterfaceMax
otherwise.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoUefiPayloadPkg: Fix issues when MULTIPLE_DEBUG_PORT_SUPPORT is true
PaytonX Hsieh [Wed, 26 Apr 2023 12:36:56 +0000 (20:36 +0800)]
UefiPayloadPkg: Fix issues when MULTIPLE_DEBUG_PORT_SUPPORT is true

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

1. Since UART speed is slower than CPU, BIOS need to check the write
   buffer is empty, to avoid overwrite the buffer content.
2. LPSS UART might disable MMIO space for Windows debug usage during
   ExitBootServices event. BIOS need to avoid access the MMIO space
   after ExitBootServices.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: PaytonX Hsieh <paytonx.hsieh@intel.com>
2 years agoRedfishPkg: Add Redfish Platform Config Protocol to RedfishPkg
Nickle Wang [Mon, 10 Apr 2023 13:25:39 +0000 (21:25 +0800)]
RedfishPkg: Add Redfish Platform Config Protocol to RedfishPkg

Add RedfishPlatformConfigDxe driver and corresponding library to
RedfishPkg.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: Helper library of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
Nickle Wang [Mon, 10 Apr 2023 13:18:42 +0000 (21:18 +0800)]
RedfishPkg: Helper library of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL

This is the helper library for using
EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: Implementation of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
Nickle Wang [Mon, 10 Apr 2023 13:14:41 +0000 (21:14 +0800)]
RedfishPkg: Implementation of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL

This is the Implementation of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL,
which is the EDKII Redfish Platform Config driver instance that accesses
EDK2 HII configuration format and storage.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: introduce HII utility helper library
Nickle Wang [Mon, 10 Apr 2023 13:12:03 +0000 (21:12 +0800)]
RedfishPkg: introduce HII utility helper library

HiiUtilityLib is a helper library that provides the
functions to manipulate HII options.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: introduce EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
Nickle Wang [Mon, 10 Apr 2023 13:09:14 +0000 (21:09 +0800)]
RedfishPkg: introduce EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL

EDKII Redfish Platform Config Protocol defines the protocol
interfaces that abstracts the platform configuration format
and storage from EDK2 Redfish Feature driver. This protocol
provides the interfaces to get and set platform configuration
with the format and configuration storage agnostic to the
Redfish feature driver.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoMdeModulePkg/RegularExpressionDxe: Fix Arm build error
Nickle Wang [Fri, 21 Apr 2023 06:48:30 +0000 (14:48 +0800)]
MdeModulePkg/RegularExpressionDxe: Fix Arm build error

Arm CI build error:
- ArmPkg/Library/CompilerIntrinsicsLib/memset.c:39:1: warning: type of
‘memset’ does not match original declaration [-Wlto-type-mismatch]
MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c:123:1:
note: type ‘char’ should match type ‘int’
- multiple definition of `memcpy'; OnigurumaUefiPort.obj (symbol from
plugin):(.text+0x0): first defined here

Fix:
- Update memset() implementation to match memset() definition in
ArmPkg/Library/CompilerIntrinsicsLib.
- memcpy() is supported by ArmPkg/Library/CompilerIntrinsicsLib. Exclude
it in OnigurumaUefiPort.c.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoSecurityPkg/DxeImageVerificationLib: Add AUTH_SIG_NOT_FOUND Action
Nhi Pham [Wed, 12 Apr 2023 09:21:49 +0000 (17:21 +0800)]
SecurityPkg/DxeImageVerificationLib: Add AUTH_SIG_NOT_FOUND Action

Add the AUTH_SIG_NOT_FOUND Action to the Image Execution Info Table
when the Image is signed but signature is not allowed by DB and the
hash of image is not found in DB/DBX.

This is documented in the UEFI spec 2.10, table 32.5.

This issue is found by the SIE SCT with the error message as follows:
SecureBoot - TestImage1.bin in Image Execution Info Table with
SIG_NOT_FOUND. --FAILURE
B3A670AA-0FBA-48CA-9D01-0EE9700965A9
SctPkg/TestCase/UEFI/EFI/RuntimeServices/SecureBoot/BlackBoxTest/
ImageLoadingBBTest.c:1079:Status Success

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoUefiPayloadPkg: Clang dependency removal
BruceX Wang [Wed, 26 Apr 2023 06:32:01 +0000 (14:32 +0800)]
UefiPayloadPkg: Clang dependency removal

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

Use Python to replace llvm-objcopy in UniversalPayloadBuild.py.
1. AddSection32() and AddSection64(): Make a section named
<section> with the contents of <file>.
2. RemoveSection32() and RemoveSection64(): Remove <section>.
3. ReplaceFv (): remove the section before add the section
if the file exists.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: BruceX Wang <brucex.wang@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2 years ago.azurepipelines: Switch linux image default to Fedora-37
Gua Guo [Thu, 27 Apr 2023 05:07:02 +0000 (13:07 +0800)]
.azurepipelines: Switch linux image default to Fedora-37

Switch default linux build image from Fedora-35 to Fedora-37

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Chris Fernald <chfernal@microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
2 years ago.azurepipelines: Choose container that have installed lcov
Gua Guo [Sun, 23 Apr 2023 01:17:51 +0000 (09:17 +0800)]
.azurepipelines: Choose container that have installed lcov

Azure should install code coverage tool (lcov), it didn't
exist on Fedora and Ubuntu by default.

Update docker setting, pick below solution between 47addc9 and 3b3eb8f
3b3eb8f Fixes and improvements to dev containers (#69)
54e5bd1 Enable GTK on Fedora QEMU (#63)
f1c7a20 Fedora: install code coverage tools for GCC (#62)
2ce82af Ubuntu-22: Add initial Ubuntu-22 image (#61)
14d2aba Add Fedora 37 image with gcc12 (#60)
5b8a008 Add dotnet runtime to fedora build (#57)
f5c874a Fix platform build file name for EDK2 change (#58)
48540ad Ubuntu-20: Fix dev image entrypoint (#55)
98e849d Fedora-35: Add Powershell to build image (#52)

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Chris Fernald <chfernal@microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
Reviewed-by: Chris Fernald <chfernal@microsoft.com>
2 years agoBaseTools/Plugin: Report error if code coverage failure
Gua Guo [Sun, 23 Apr 2023 01:14:22 +0000 (09:14 +0800)]
BaseTools/Plugin: Report error if code coverage failure

If code coverage exist failure, CI/CD need to catch it

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
2 years agoOvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP
Roth, Michael via groups.io [Tue, 25 Apr 2023 20:32:58 +0000 (04:32 +0800)]
OvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP

Currently OVMF tries to rely on the base size advertised via the CPUID
table entries corresponding to leaf 0xD, sub-leafs 0x0/0x1. This will
generally work for KVM guests, but might not for other SEV-SNP
hypervisor implementations. Make the handling more robust by simply
using the base area size documented by the APM.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>