summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* pip: update edk2-pytool-extensions requirement from ~=0.21.8 to ~=0.23.3dependabot/pip/edk2-pytool-extensions-approx-eq-0.23.3dependabot[bot]2023-05-251-1/+1
| | | | | | | | | | | | | Updates the requirements on [edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions) to permit the latest version. - [Release notes](https://github.com/tianocore/edk2-pytool-extensions/releases) - [Commits](https://github.com/tianocore/edk2-pytool-extensions/compare/v0.21.8...v0.23.3) --- updated-dependencies: - dependency-name: edk2-pytool-extensions dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FVedk2-stable202305Wendy Liao2023-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* ArmPkg/ArmMmuLib AARCH64: Add missing ISB after page table updateArd Biesheuvel2023-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* pip-requirements.txt: Update edk2 pip modulesMichael Kubacki2023-05-221-3/+3
| | | | | | | | | | | | | | - 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>
* OvmfPkg: RiscVVirt: Add missing SerialPortInitialize to SecAndrei Warkentin2023-05-173-1/+5
| | | | | | | | | | | | | | 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>
* MdePkg: add SBI-based SerialPortLib for RISC-VAndrei Warkentin2023-05-178-0/+767
| | | | | | | | | | | | | | | | | | | | | | 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>
* MdePkg: BaseRiscVSbiLib: make more useful to consumersAndrei Warkentin2023-05-172-6/+39
| | | | | | | | | | | 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>
* UefiPayloadPkg: Fix boot shell issue for universal UEFI payloadGuo Dong2023-05-153-12/+78
| | | | | | | | | | | | | | | | | 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>
* Maintainers.txt: Update reviewers and maintainers for FdtLib.Gua Guo2023-05-151-0/+8
| | | | | | | | | | | | | | | | | 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>
* BaseTools/tools_def: Disable overzealous unused variable warning on ClangArd Biesheuvel2023-05-121-1/+1
| | | | | | | | | | | | | 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>
* BaseTools/tools_def: Drop ref to undefined CLANGDWARF_ARM_PREFIXArd Biesheuvel2023-05-121-1/+1
| | | | | | | | | | | | | | 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>
* ShellPkg/UefiShellDebug1CommandsLib: Replace hardcoded SMBIOS strings.Giri Mudusuru2023-05-122-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* MdePkg/IndustryStandard: Add SMBIOS anchor string & length defines.Giri Mudusuru2023-05-121-2/+20
| | | | | | | | | | | | | | | | | | | 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>
* MdePkg/IndustryStandard: Add IPMI Interface Capabilities definitionsTinh Nguyen2023-05-121-0/+46
| | | | | | | | | | | | | 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>
* MdePkg: Add new PCDs for IPMI SSIFTinh Nguyen2023-05-121-0/+27
| | | | | | | | | | | | | | | | | 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>
* MdePkg/IndustryStandard: Add definitions for IPMI SSIFTinh Nguyen2023-05-121-0/+98
| | | | | | | | | | | | | | | 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>
* Maintainers.txt: Update reviewers and maintainers for TraceHubDebugLib.Gua Guo2023-05-111-0/+18
| | | | | | | | | | | | 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>
* MdeModulePkg: Add TraceHubDebugSysTLib libraryGua Guo2023-05-1115-0/+1457
| | | | | | | | | | | | | | | | | | | 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>
* MdePkg: Add NULL library of TraceHubDebugSysTLibGua Guo2023-05-114-0/+187
| | | | | | | | | | | | | | | | | | | 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>
* MdePkg: Add MipiSysTLib libraryGua Guo2023-05-1111-3/+1508
| | | | | | | | | | | | | | | | | | | 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>
* MdePkg: Add mipisyst submoduleGua Guo2023-05-114-0/+6
| | | | | | | | | | | | | | | | | | | | | | | 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>
* BaseTools/Plugin: Too many execute files cause "cmd too long" failureGua Guo2023-05-111-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* SecurityPkg: Add missing break in Tpm2TestParmsRebecca Cran2023-05-111-0/+1
| | | | | | | | | 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>
* BaseTools: Update Tests/TestTools.py to allow it to work on WindowsRebecca Cran2023-05-111-1/+3
| | | | | | | | | 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>
* BaseTools: only print the environment once in toolsetup.batRebecca Cran2023-05-111-19/+16
| | | | | | | Avoid printing %PATH% twice: move the printing of the environment down to print_python_info. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
* BaseTools: Update toolsetup.bat to not use BASETOOLS_PYTHON_SOURCERebecca Cran2023-05-111-3/+2
| | | | | | | | | | 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>
* BaseTools: Revert Set the CLANGDWARF OBJCOPY path in tools_def.templateRebecca Cran2023-05-111-4/+0
| | | | | | | | | | 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>
* OvmfPkg: drop PlatformBootManagerLibGrubGerd Hoffmann2023-05-105-2129/+0
| | | | | | | | 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>
* OvmfPkg/AmdSev: stop using PlatformBootManagerLibGrubGerd Hoffmann2023-05-101-2/+8
| | | | | | | | | 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>
* OvmfPkg/NvVarsFileLib: disable in case PcdBootRestrictToFirmware is setGerd Hoffmann2023-05-102-1/+4
| | | | | | | | 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>
* OvmfPkg/PlatformBootManagerLib: add PcdBootRestrictToFirmwareGerd Hoffmann2023-05-103-4/+71
| | | | | | | | | | | | 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>
* Remove bashisms from edksetup.sh and BaseTools/BuildEnvRebecca Cran2023-05-102-93/+26
| | | | | | | | 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>
* BaseTools: Remove the CLANGCC build rule for Hii-Binary-Package.UEFI_HIIRebecca Cran2023-05-101-1/+1
| | | | | | | | | | 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>
* BaseTools: Set CLANGDWARF RC path to llvm-objcopy in tools_def.templateRebecca Cran2023-05-101-4/+4
| | | | | | | | | | 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>
* BaseTools: Set the CLANGDWARF OBJCOPY path in tools_def.templateRebecca Cran2023-05-101-0/+4
| | | | | | | | | 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>
* BaseTools: Remove BUILDRULEFAMILY from CLANGDWARF in tools_def.templateRebecca Cran2023-05-101-1/+1
| | | | | | | | | | 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>
* CryptoPkg: Delete CLANG35 and CLANG38 build flags; add CLANGDWARF flagsRebecca Cran2023-05-1011-22/+11
| | | | | | | | | | | 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>
* MdePkg: Add more HobLib/PeiServicesLib gmock supportGua Guo2023-05-107-0/+472
| | | | | | | | | | | | | | 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>
* MdeModulePkg: Add more PciHostBridgeLib gmock supportGua Guo2023-05-105-0/+95
| | | | | | | | | | | | | 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>
* OvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVELMichael Brown2023-05-091-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* OvmfPkg: Clarify invariants for NestedInterruptTplLibMichael Brown2023-05-091-2/+8
| | | | | | | | | | | | | | | | 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>
* BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check verRebecca Cran2023-05-082-29/+54
| | | | | | | | | | | | 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>
* edksetup.bat: if toolsetup.bat fails, just exitRebecca Cran2023-05-081-0/+1
| | | | | | | | 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>
* BaseTools: use threading.current_thread in NmakeSubdirs.pyRebecca Cran2023-05-081-1/+1
| | | | | | | | | 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>
* BaseTools: Remove Python2/Python3 detection from toolset.batRebecca Cran2023-05-081-48/+16
| | | | | | | | | | | 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>
* RedfishPkg: Fix compile issue on LinuxVu Nguyen2023-05-081-1/+4
| | | | | | | | | | | 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>
* RedfishPkg: Add missing newline characterNhi Pham2023-05-081-1/+2
| | | | | | | | | | | 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>
* RedfishPkg: Create RestEx child on selected interfaceVu Nguyen2023-05-083-100/+73
| | | | | | | | | | | | | | | 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>
* RedfishPkg: Fix condition checking of error statusVu Nguyen2023-05-081-1/+2
| | | | | | | | | | | 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>
* RedfishPkg: Correct variable type to prevent memory corruptionVu Nguyen2023-05-081-1/+2
| | | | | | | | | | | 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>