summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools/SetupGit.py: Fix invalid choice 'edk2-test'Nhi Pham2024-10-091-1/+1
| | | | | | This fixes missing 'edk2-test' in the choices of the repo name option. Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
* BaseTools/CodeQl: Give preference to Plugin settingsAbdul Lateef Attar2024-10-091-5/+6
| | | | | | | | | | | | | | | For the CodeQl `AuditOnly` flag, prioritize Plugin settings over global settings. This patch adjusts the logic for the global `AuditOnly` setting, placing it before the Plugin setting code. This ensures that Plugin settings take precedence over global settings. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Joey Vagedes <joey.vagedes@gmail.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
* FmpDevicePkg/FmpDependencyLib: Fix potential overflow in loopMichael Kubacki2024-10-091-1/+1
| | | | | | | | | FmpVersionsCount is a UINTN while the loop index variable compared against it is a UINT8. This can lead to an overflow of the loop index for FmpVersionsCount values larger than UINT8_MAX. This change makes Index a UINTN to match in width. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
* UefiPayloadPkg : Roll back the sequence of gEfiEndOfPeiSignalPpiGuid.Linus Liu2024-10-081-1/+42
| | | | | | | | Adjust the sequence of gEfiEndOfPeiSignalPpiGuid notify function when FDT is disabled , or some of notify functions won't work cause the debug message print twice. Signed-off-by: Linus Liu <linus.liu@intel.com>
* UnitTestFrameworkPkg: UnitTestLib: Support Failure Strings of 512 CharsOliver Smith-Denny2024-10-084-19/+12
| | | | | | | | | | | | | | | Currently, there is a mismatch of allowed string sizes in UnitTestLib. The UT_LOG_* macros allow a string size of 512, but failure messages are constrained to 120 characters and some other string lengths are similarly constrained. 120 characters is too few for some longer error messages, particularly the ones that print out the path to the failing line. This can result in the actual error not getting printed in the log. This patch updates all UnitTestLib allowed string lengths to be 512 characters. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* MdePkg: DebugLib: Check Signature in CR in Release BuildsOliver Smith-Denny2024-10-081-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CR macro is used to access an enclosing structure from a pointer within the structure. In DEBUG builds (i.e. when MDEPKG_NDEBUG is not set and debug asserts are enabled), this macro does signature validation checking to ensure that the structure that has been found is the correct structure, based on a signature passed in by the caller. However, if MDEPKG_NDEBUG is set or debug asserts are disabled, no signature validation is performed, meaning that CR may return an invalid structure that the caller believes is valid and has had signature validation on, causing undefined behavior (memory corruption). We should where at all possible have defined behavior, particularly in RELEASE builds, which are what typical platforms will ship to consumers. This patch updates CR to do the signature validation in all scenarios to provide defined behavior from the macro. In the event of a signature failure, CR will either 1) assert if !MDEPKG_NDEBUG and debug asserts are enabled (existing behavior) or 2) return NULL to indicate to the caller that signature validation failed. There exist consumers today who already, erroneously, rely on this behavior. Another macro, BASE_CR, exists for callers who do not wish to perform signature validation. Any code that wishes to avoid the signature validation should move to this macro. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* EmulatorPkg: Add Signature to Graphics StructureOliver Smith-Denny2024-10-082-0/+5
| | | | | | | | | | | | | When updating MdePkg's CR macro to enforce signature checking in all usages, it was discovered that EmulatorPkg was initializing a structure without setting the signature for it, causing an error to be returned when CR now checked the signature. This commit updates the graphics stack in EmulatorPkg to set the signature of the data structure and check the return value of the wrapper for the CR macro. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* DynamicTablesPkg: AmlLib: Fix CodeQL IssueOliver Smith-Denny2024-10-071-1/+1
| | | | | | | | Without the addition of this cast, the compiler promotes 1 to a UINT32, which leads CodeQL to complain that different size types are being compared. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* Maintainers.txt: Add myself as UefiPayloadPkg maintainerBenjamin Doron2024-10-041-0/+1
| | | | | | | Per discussion in an email thread, I'm adding myself as a maintainer of the UefiPayloadPkg. Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
* DynamicTablesPkg: Correct _PSD package formatJeff Brasen2024-10-041-13/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The _PSD structure should have nested packages. The current implementation generates Name (_PSD, Package() { NumEntries // Integer Revision // Integer (BYTE) Domain // Integer (DWORD) CoordType // Integer (DWORD) NumProcessors // Integer (DWORD) }) when this should be Name (_PSD, Package() { Package() { NumEntries // Integer Revision // Integer (BYTE) Domain // Integer (DWORD) CoordType // Integer (DWORD) NumProcessors // Integer (DWORD) } }) REF: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html#psd-p-state-dependency Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
* ShellPkg: Fix Optional Data rewriting with bcfgTormod Volden2024-10-041-5/+9
| | | | | | | | | | | | | When modifying the Optional Data of a boot option with bcfg boot -opt the result was corrupted data, for instance a concatenation of old data, heap contents, and new data. This was due to a erronous calculation of the original optional data length. In addition to fixing the calculation, add explaining comments and introduce a helper variable, to not abuse other variables and confuse readers (including the author). Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
* ShellPkg: ShellLevel2StripQuotes: Strip consecutive quotesTormod Volden2024-10-041-1/+3
| | | | | | | | | When a quotation mark was found, the remaining line would be shifted in-place to get rid of it. However, the "walker" index would still be increased and therefore the first character of the shifted part would be skipped. This means a second quotation mark would not be deleted. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
* ShellPkg/AcpiView: RASF ParserCarsten Haitzler2024-10-044-0/+86
| | | | | | Add a new parser for the RASF Table as specified in ACPI6.5 Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
* ShellPkg/AcpiView: RAS2 Parser - Remove unused defineCarsten Haitzler2024-10-041-3/+0
| | | | | | Remove unused define from RAS2 parser Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
* OvmfPkg: RiscV64: build BaseRiscVFpuLibHeinrich Schuchardt2024-10-041-0/+1
| | | | | | | | | Enable building the BaseRiscVFpuLib library for OvmfPkg to * Enable the FPU and set it to state 'dirty'. * Clear the fcsr CSR. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* UefiCpuPkg: RiscV64: initialize FPUHeinrich Schuchardt2024-10-048-0/+80
| | | | | | | | | | | | The OpenSSL library uses floating point registers. The is no guarantee that a prior firmware stage has enabled the FPU. Provide a library BaseRiscVFpuLib to * Enable the FPU and set it to state 'dirty'. * Clear the fcsr CSR. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* MdePkg/BaseLib: RISC-V: Add FPU CSR constantsHeinrich Schuchardt2024-10-041-0/+4
| | | | | | | * Define CSR fcsr * Define bitmasks for vs and fs bit fields in the mstatus register Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* MdePkg: MdeLibs.dsc.inc: Introduce CUSTOM_STACK_CHECK_LIB MacroOliver Smith-Denny2024-10-042-8/+83
| | | | | | | | | | | | | In order to support a platform overriding StackCheckLibNull provided by MdeLibs.dsc.inc, the CUSTOM_STACK_CHECK_LIB macro is introduced. If this macro is defined, MdeLibs.dsc.inc will not link StackCheckLibNull and it is expected that the platform will link the version(s) of StackCheckLib that it requires. The StackCheckLib README is also updated in this patch to document the new macro and provide additional information. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* MdeModulePkg/UefiBootManagerLib: Build proper SD/MMC boot descriptionsMario Bălănică2024-10-032-2/+239
| | | | | | | | | | | | This generates boot descriptions for SD/MMC devices in the form of: - "UEFI SanDisk SC128 2A2B1E4F SD Device" - "UEFI Samsung BJTD4R 7AB3A8DE eMMC User Data" The manufacturer ID tables are a best-effort, collected from various places and personal testing. They're not complete and may be inaccurate for rebranded cards. Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
* DynamicTablesPkg: Adds SPMI table generatorAbdul Lateef Attar2024-10-038-0/+488
| | | | | | | | | | | | | | Adds ACPI SPMI table generator library. Updates acpi standard table enum with spmi. Updates arch common namespace object and parser. Updates the Readme. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
* MdePkg/IndustryStandard: Adds SPMI macrosAbdul Lateef Attar2024-10-031-0/+15
| | | | | | | | | | | | Adds macro which defines SPMI table revision and interface type as per the specification. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
* StandaloneMmPkg: CodeQL Fixes.Michael Kubacki2024-10-032-2/+5
| | | | | | | | | | | Makes changes to comply with alerts raised by CodeQL. Most of the issues here fall into the following two categories: 1. Potential use of uninitialized pointer 2. Inconsistent integer width used in loop comparison Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* MdePkg: Improving readability of CVE patch for PeCoffLoaderRelocateImageDoug Flick2024-10-021-1/+1
| | | | | | | | | | This change adds parantheses to the if condition detecting overflow in the PeCoffLoaderRelocateImage function to improve readability. Follow on change for: REF!: https://github.com/tianocore/edk2/pull/6249 Signed-off-by: Doug Flick <dougflick@microsoft.com>
* ArmVirtPkg/ArmVirtQemu: avoid unnecessary use of $(ARCH) conditionalLeif Lindholm2024-10-021-4/+2
| | | | | | | | ARCH as set by "build" command is not really useful for conditionals, so move AArch64-specific Pcd to [PcdsFixedAtBuild.AARCH64]. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* Maintainers.txt: add Leif Lindholm as additional BaseFdtLib maintainerLeif Lindholm2024-10-021-0/+1
| | | | | | | Since I have just added a bunch of changes and additions to this library, add myself as an additional maintainer. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* Maintainers.txt: add all files in BaseFdtLib to componentLeif Lindholm2024-10-021-1/+1
| | | | | | | | | There are many source files in MdePkg/Library/BaseFdtLib, but only one of them was highlighted as maintained by the library maintainers. This feels like an oversight, so change this to be BaseFdtLib/*, applying to all files in directory. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: add various additional functions to BaseFdtLibLeif Lindholm2024-10-022-0/+272
| | | | | | | | | | | | - FdtOffsetPointer - FdtParentOffset - FdtNodeOffsetByPhandle - FdtStringListContains - FdtGetAliasNameLen - FdtPathOffsetNameLen - FdtPathOffset Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: export additional Property functions from BaseFdtLibLeif Lindholm2024-10-022-0/+137
| | | | | | | | - FdtSetPropU64 - FdtAppendProp - FdtDelProp Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: export FdtAddressCells/FdtSizeCells from BaseFdtLibLeif Lindholm2024-10-022-0/+66
| | | | Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: export FdtOpenInto/FdtPack from BaseFdtLibLeif Lindholm2024-10-022-0/+68
| | | | Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: export some additional macros from BaseFdtLibLeif Lindholm2024-10-021-0/+16
| | | | | | | | - FDT_TAGSIZE and FDT_MAX_NCELLS - FdtGetHeader/FdtTotalSize - FdtForEachSubnode Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: align BaseFdtLib function prototypesLeif Lindholm2024-10-021-4/+5
| | | | | | | | | | | FdtLib.h uses CONST FDT_PROPERTY * return values for some wrapper functions, but the implementation in FdtLib.c used to original CONST struct fdt_property * instead of the exported typedef. Import LibFdt.h in the implementation file and make the implementation consistent with the declaration. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: add FdtStrerror wrapper to BaseFdtLibLeif Lindholm2024-10-022-0/+128
| | | | | | | Add a wrapper for fdt_strerror () and add the currently supported error code defines from submodule. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg: consistently use "Property" in BaseFdtLibLeif Lindholm2024-10-026-62/+62
| | | | | | | | | | | There is currently a mix on functions named as Prop or Property. The latter is in majority, and the better fit for tianocore coding style, so rename FdtNodeOffsetByPropValue () and FdtSetProp () for consistency. To avoid breaking bisect, change existing users in UefiPayloadPkg. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* MdePkg,UefiPayloadPkg: improve BaseFdtLib memreserve helper styleLeif Lindholm2024-10-023-21/+21
| | | | | | | | | | | | | | | | | | FdtNumRsv and FdtGetMemRsv were added for the benefit of UefiPayloadPkg, but their naming matches neither upstream libfdt nor tianocore coding style rules. And there was scope for improvement of the doxygen descriptions as well. These functions currently have only one in-tree user, UefiPayloadPkg FdtParserLib. So rename them more conformant FdtGetNumberOfReserveMapEntries and FdtGetReserveMapEntry and update the description comment blocks, at the same time as updating the existing user. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* .github/GitHub.py: Update bot in redundant comment checkMichael Kubacki2024-10-011-1/+1
| | | | | | | | | | | | The project moved from using the `github-actions[bot]` bot account to the `tianocore-assign-reviewers[bot]` account. A check is in place to prevent the "`WARNING: Cannot add some reviewers`" from appearing more than once if nothing has changed in the content it would post. This change updates the bot account to the current one so the check can work again. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
* MdePkg: Fix overflow issue in BasePeCoffLibDoug Flick2024-09-301-1/+1
| | | | | | | | | | The RelocDir->Size is a UINT32 value, and RelocDir->VirtualAddress is also a UINT32 value. The current code does not check for overflow when adding RelocDir->Size to RelocDir->VirtualAddress. This patch adds a check to ensure that the addition does not overflow. Signed-off-by: Doug Flick <dougflick@microsoft.com> Authored-by: sriraamx gobichettipalayam <sri..@intel.com>
* .gitignore: Ignore Python venv filesMike Beaton2024-09-301-0/+1
| | | | | | | | | | | Since presumably quite a few people will use stuart to build EDK 2, and since the recommended approach in that case is to use a python venv, it is much more convenient if these files are ignored by default in EDK 2, rather than requiring a manual update to .git/info/exclude each time the repo is cloned, as effectively suggested in the current How to Build With Stuart instructions on the tianocore wiki. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* IntelFsp2Pkg : Refactor BaseFspCommonLib to reduce binary sizeAshraf Ali2024-09-303-30/+43
| | | | | | | | | | | | Moved FspApiReturnStatusReset API to a separate file to eliminate unnecessary inclusion of FspApiReturnStatusReset APIs in driver binary. When the compiler linking the Object files it may not remove all the unused from NASM OBJs. This change is to reorganize the C files to minimize the impact of the NASM behavior resulting is code size reduction. Signed-off-by: Ashraf Ali <ashraf.ali.s@intel.com>
* BaseTools: LinuxGcc5ToolChain: Run for GCC ToolchainOliver Smith-Denny2024-09-303-55/+66
| | | | | | | | | | | | | | | | | | The GCC5 TOOL_CHAIN_TAG is being deprecated in favor of GCC. LinuxGcc5ToolChain.py needs to be updated to find the correct ARM/AARCH64/RISCV/LOONGARCH64 compilers for the GCC TOOL_CHAIN_TAG, as well, otherwise it defaults to the system GCC, which is typically X64 based. In order to keep this backward and forward compatible, the plugin now checks for the substring "GCC" in the TOOL_CHAIN_TAG and will set either the "GCC5" or "GCC" env variables used by tools_def.template to find the GCC compiler for the requested architecture. This plugin is also renamed to drop the old GCC5. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
* .pytool/UncrustifyCheck: Show errors in outputMichael Kubacki2024-09-281-10/+13
| | | | | | | | | | | | | | | | | | | | | Shows code formatting errors directly in build output. Previously only the filenames were in build output and the user had to look at the test result file either locally or in CI to find details. It is still recommended that users configure their local environment to run Uncrustify so it can automatically fix problems as opposed to manually correcting code based on the output shown in the terminal. In any case, it is easier to see what is expected now. Uncrustify reference material: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Code-Formatting https://github.com/tianocore/edk2/tree/master/.pytool/Plugin/UncrustifyCheck#readme Some logging levels are also updated to refocus log output by current message importance and relevance. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
* RedfishPkg/Include: add common RedfishPkg header file.Nickle Wang2024-09-275-11/+22
| | | | | | | | IS_EMPTY_STRING macro is defined in multiple drivers in RedfishPkg. So, I create RedfishCommon.h to keep common macros that we can use in RedfishPkg. Signed-off-by: Nickle Wang <nicklew@nvidia.com>
* NetworkPkg/Dhcp6Dxe: Fix extraneous parenthesessecurity-advisory/cve-2024-38796/advisoryMike Beaton2024-09-271-1/+1
| | | | | | | | | | Without this change we get: error: equality comparison with extraneous parentheses when building with -D NETWORK_IP6_ENABLE on XCODE5. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* CryptoPkg: Fix unused variable in CryptX509.cMike Beaton2024-09-271-2/+1
| | | | | | | | | | | Without this change we get: error: variable 'Index' set but not used when building on XCODE5. Co-authored-by: Savva Mitrofanov <savvamtr@gmail.com> Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* CryptoPkg/OpensslLib: Fix build on XCODE5Mike Beaton2024-09-275-10/+10
| | | | | | | | | | | | | | | | | | REF: https://edk2.groups.io/g/devel/message/88179 Without this change, we get: fatal error: 'Availability.h' file not found when building on XCODE5. The workaround uses a define present in openssl/include/crypto/rand.h which modifies openssl behaviour on Apple only, causing the library to default to a non-system specific source of entropy in syscall_random() in rand_unix.c. Co-authored-by: Savva Mitrofanov <savvamtr@gmail.com> Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* MdeModulePkg/VariablePolicyLib: Fix extraneous parenthesesMike Beaton2024-09-271-1/+1
| | | | | | | | | | Without this change we get: error: equality comparison with extraneous parentheses when building on XCODE5. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* MdePkg: Fix DEBUG_CODE and PERF_CODE macros for XCODE5Mike Beaton2024-09-272-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without these changes, we get the error: error: variable '__DebugCodeLocal' set but not used from the DebugLib.h DEBUG_CODE_BEGIN()/END() macros on XCODE5. Similarly, in NOOPT builds only, we get: error: variable '__PerformanceCodeLocal' set but not used from the PerformanceLib.h PERF_CODE_BEGIN()/END() macros on XCODE5. It is important to note that the previous code involving a local variable was intended to ensure correct behaviour of ; following the macros, in particular that ; should be required: - https://github.com/tianocore/edk2/pull/6226#issuecomment-2364087866 - https://github.com/tianocore/edk2/pull/6226#issuecomment-2364619759 This converted version repeats the standard do { ... } while (FALSE) idiom (which is already used in the END macro) to achieve the same affect. The modified versions work on all toolchains. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* BaseTools: Fix redefinition of UINT8_MAX in Decompress.c on XCODE5Mike Beaton2024-09-271-0/+2
| | | | | | | | | | | This is part of a sequence of commits to restore build on the XCODE5 toolchain. The definition is required on other toolchains, but on XCODE5 results in a macro redefined error (from the existing value 255) from /usr/include/stdint.h. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
* ArmPkg: drop FdtLib resolution from .dscLeif Lindholm2024-09-271-2/+0
| | | | | | | | ArmPkg.dsc sets up an FdtLib resolution that is not actually used by any of the components in it. Since the declared one is going away, drop the line. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* EmbeddedPkg: add missing BaseLib/BaseMemoryLib declarationsLeif Lindholm2024-09-274-0/+4
| | | | | | | | Add missing includes of BaseMemoryLib.h and declaration of BaseLib/BaseMemoryLib dependencies hidden by use of EmbeddedPkg FdtLib, which is being deleted. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>