summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* ArmVirtPkg/PrePi: Allocate separate stack for Dxe phaseSami Mujawar2023-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch "f07a9df9af60 ArmVirtPkg: Enable stack guard" enabled stack overflow detection for ArmVirtPkg. Following this patch, running UEFI shell command 'dmpstore' resulted in a crash indicating a stack overflow. Invoking 'dmpstore' results in recursive calls to CascadeProcessVariables () which apparently consumes the available stack space and overflows. Normally, SEC and PEI run off the initial stack, and the DxeIpl PEIM is in charge of launching the DxeCore with a full-sized stack and remapping it non-executable as well. PrePi platforms take some shortcuts and the DXE and BDS run off the initial stack which is relatively small. It is therefore desirable to allocate 128 KiB worth of boot services data memory as the stack for the Dxe phase. The PrePiMain () in ArmVirtPkg/PrePi/PrePi.c invokes the LoadDxeCoreFromFv () to load the Dxe core and transfers control. The second parameter to LoadDxeCoreFromFv () is the stack size, which is currently set to 0. LoadDxeCoreFromFv () is implemented in PrePiLib and if the stack size is 0, it continues to use the initial stack. However, if a stack size is specified in the call to LoadDxeCoreFromFv (), memory is allocated for a new stack and the stack is switched to use the newly allocated stack for the Dxe phase. Therefore, specify 128 KiB as the stack size in the call to LoadDxeCoreFromFv () so that a separate stack is allocated and used for the Dxe phase. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmPkg/CpuDxe AARCH64: Report Memory Protection Attributes To GCDOliver Smith-Denny2023-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4463 When the AARCH64 CpuDxe attempts to SyncCacheConfig() with the GCD, it collects the page attributes as: EntryAttribute = Entry & TT_ATTR_INDX_MASK However, TT_ATTR_INDX_MASK only masks the cacheability attributes and drops the memory protections attributes. Importantly, it also drops the TT_AF (access flag) which is now wired up in EDK2 to represent EFI_MEMORY_RP, so by default all SystemMem pages will report as EFI_MEMORY_RP to the GCD. The GCD currently drops that silently, because the Capabilities field in the GCD does not support EFI_MEMORY_RP by default. However, some ranges may support EFI_MEMORY_RP and incorrectly mark those ranges as read protected. In conjunction with another change on the mailing list (see: https://edk2.groups.io/g/devel/topic/98505340), this causes an access flag fault incorrectly. See the linked BZ below for full details. This patch exposes all memory protections attributes to the GCD layer so it can correctly set pages as EFI_MEMORY[RP|XP|RO] when it initially syncs. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Taylor Beebe <t@taylorbeebe.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
* OvmfPkg/MicrovmX64: enable 1G pagesGerd Hoffmann2023-05-291-0/+3
| | | | | | | Reduces the memory footprint and speeds up booting. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/OvmfPkgIa32X64: enable 1G pagesGerd Hoffmann2023-05-291-0/+3
| | | | | | | Reduces the memory footprint and speeds up booting. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/PlatformInitLib: check PcdUse1GPageTableGerd Hoffmann2023-05-292-0/+6
| | | | | | | | | | | | If PcdUse1GPageTable is not enabled restrict the physical address space used to 1TB, to limit the amount of memory needed for identity mapping page tables. The same already happens in case the processor has no support for gigabyte pages. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/PciHotPlugInitDxe: Do not reserve IO ports by default.Gerd Hoffmann2023-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Flip the default for IO address space reservations for PCI(e) bridges and root ports with hotplug support from TRUE to FALSE. PCI(e) bridges will still get IO address space assigned in case: (a) Downstream devices actually need IO address space, or (b) Explicit configuration, using "qemu -device pcie-root-port,io-reserve=<size>". In case IO address space is exhausted edk2 will stop assigning resources to PCI(e) bridges. This is not limited to IO resources, the affected bridges will not get any memory resources assigned either. This patch solves this issue by not handing out the scarce IO address space, which is not needed in most cases anyway. Result is a more consistent PCI configuration in virtual machine configurations with many PCie root ports. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/Bhyve/PlatformPei: drop S3Verification()Gerd Hoffmann2023-05-291-29/+0
| | | | | | | Drop S3Verification () which is dead code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* OvmfPkg/PlatformPei: drop S3Verification()Gerd Hoffmann2023-05-291-31/+0
| | | | | | | | | | | | | Not needed any more, SMM + 64-bit PEI + S3 suspend works now. Fixed by commits: - 8bd2028f9ac3 ("MdeModulePkg: Supporting S3 in 64bit PEI") - 6acf72901a2e ("UefiCpuPkg: Supporting S3 in 64bit PEI") See also https://bugzilla.tianocore.org/show_bug.cgi?id=4195 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* OvmfPkg/VirtIoSerialDxe: Update for VS2015x86 compatibilityMichael D Kinney2023-05-291-5/+5
| | | | | | | | | | | | Move initialization of local variable structure from declaration to statements to fix VS2015x86 build break. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb+tianocore@kernel.org>
* MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrectGiri Mudusuru2023-05-291-1/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4394 Fix DumpCapabilityReg() debug log to print 64 bit capability instead of 32 bit pointer 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: Andrew Fish <afish@apple.com> Signed-off-by: Giri Mudusuru <girim@apple.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* RedfishPkg/RedfishPlatformConfigDxe: Fix string assert issueNickle Wang2023-05-294-27/+169
| | | | | | | | | | | | | | When calling SetValue() with string type input, there is assertion of providing zero string ID to HII string function. Fix this issue by creating string ID for input string buffer. Fix Unicode and Ascii code convert issue together. Add text op-code support Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com>
* PcAtChipsetPkg: RTC Runtime unable to get correct IO port by PCDGua Guo2023-05-292-19/+31
| | | | | | | | | | | | RTC runtime is unable to get dynamic PCD value after booting to OS using runtime services. Resolution: Cache the dynamic PCD value in RTC driver entry point Cc: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* BaseTools: toolsetup.bat always execute PYTHON_HOMEGua Guo2023-05-291-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Ideally behavior is like below order that can support one local build machine, clone multiple Edk2, some of edk2 repo use old tag and some of edk2 repo use new tag, they can both support on one machine. 1. if defined PYTHON_COMMAND only - use PYTHON_COMMAND = user assigned 2. if not defined PYTHON_COMMAND, auto detect py -3 - use PYTHON_COMMAND = py -3 3. if defined PYTHON_COMMAND and PYTHON_HOME, use PYTHON_COMMAND - use PYTHON_COMMAND = user assigned 4. if defined PYTHON_HOME only, - use PYTHON_COMMAND = %PYTHON_HOME%/python.exe SCRIPT_ERROR should return for paraent batch file to consume for error handle. 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: Rebecca Cran <rebecca@bsdio.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>