summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-02Maintainers.txt: add Leif Lindholm as additional BaseFdtLib maintainerLeif Lindholm1-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>
2024-10-02Maintainers.txt: add all files in BaseFdtLib to componentLeif Lindholm1-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>
2024-10-02MdePkg: add various additional functions to BaseFdtLibLeif Lindholm2-0/+272
- FdtOffsetPointer - FdtParentOffset - FdtNodeOffsetByPhandle - FdtStringListContains - FdtGetAliasNameLen - FdtPathOffsetNameLen - FdtPathOffset Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02MdePkg: export additional Property functions from BaseFdtLibLeif Lindholm2-0/+137
- FdtSetPropU64 - FdtAppendProp - FdtDelProp Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02MdePkg: export FdtAddressCells/FdtSizeCells from BaseFdtLibLeif Lindholm2-0/+66
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02MdePkg: export FdtOpenInto/FdtPack from BaseFdtLibLeif Lindholm2-0/+68
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02MdePkg: export some additional macros from BaseFdtLibLeif Lindholm1-0/+16
- FDT_TAGSIZE and FDT_MAX_NCELLS - FdtGetHeader/FdtTotalSize - FdtForEachSubnode Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02MdePkg: align BaseFdtLib function prototypesLeif Lindholm1-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>
2024-10-02MdePkg: add FdtStrerror wrapper to BaseFdtLibLeif Lindholm2-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>
2024-10-02MdePkg: consistently use "Property" in BaseFdtLibLeif Lindholm6-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>
2024-10-02MdePkg,UefiPayloadPkg: improve BaseFdtLib memreserve helper styleLeif Lindholm3-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>
2024-10-01.github/GitHub.py: Update bot in redundant comment checkMichael Kubacki1-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>
2024-09-30MdePkg: Fix overflow issue in BasePeCoffLibDoug Flick1-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>
2024-09-30.gitignore: Ignore Python venv filesMike Beaton1-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>
2024-09-30IntelFsp2Pkg : Refactor BaseFspCommonLib to reduce binary sizeAshraf Ali3-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>
2024-09-30BaseTools: LinuxGcc5ToolChain: Run for GCC ToolchainOliver Smith-Denny3-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>
2024-09-28.pytool/UncrustifyCheck: Show errors in outputMichael Kubacki1-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>
2024-09-27RedfishPkg/Include: add common RedfishPkg header file.Nickle Wang5-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>
2024-09-27NetworkPkg/Dhcp6Dxe: Fix extraneous parenthesessecurity-advisory/cve-2024-38796/advisoryMike Beaton1-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>
2024-09-27CryptoPkg: Fix unused variable in CryptX509.cMike Beaton1-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>
2024-09-27CryptoPkg/OpensslLib: Fix build on XCODE5Mike Beaton5-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>
2024-09-27MdeModulePkg/VariablePolicyLib: Fix extraneous parenthesesMike Beaton1-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>
2024-09-27MdePkg: Fix DEBUG_CODE and PERF_CODE macros for XCODE5Mike Beaton2-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>
2024-09-27BaseTools: Fix redefinition of UINT8_MAX in Decompress.c on XCODE5Mike Beaton1-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>
2024-09-27ArmPkg: drop FdtLib resolution from .dscLeif Lindholm1-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>
2024-09-27EmbeddedPkg: add missing BaseLib/BaseMemoryLib declarationsLeif Lindholm4-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>
2024-09-27ArmVirtPkg: add QemuVirtMemInfoLib missing dependency/includesLeif Lindholm2-0/+2
QemuVirtMemInfoLib makes use of BaseLib but never declared the dependency or included the header. The code still built by luck and by including the EmbeddedPkg FdtLib. Which is going away, so add the missing stanzas in preparation. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-09-27DynamicTablesPkg/FdtHwInfoParserLib: add missing resolutions/includesLeif Lindholm10-0/+13
FdtHwInfoParserLib does not explicitly call out its dependencies on BaseLib/BaseMemoryLib, which is currently hidden when EmbeddedPkg FdtLib pulls them in instead. But that is going away, so make the necessary explicit references and add missing include statements. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-09-27CryptoPkg: Update generated files based on openssl 3.0.15Li Yi7-127/+25
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4842 Signed-off-by: Li Yi <yi1.li@intel.com>
2024-09-27CryptoPkg: Update openssl submodule to 3.0.15Li Yi1-0/+0
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4842 CVE-2024-6119 affects TLS-client implementation of EDK2. Fix it by updating to 3.0.15. Signed-off-by: Li Yi <yi1.li@intel.com>
2024-09-26ArmVirtPkg: Correct PcdDxeNxMemoryProtectionPolicy commentHeinrich Schuchardt1-2/+4
Since commit 2997ae387397 ("ArmVirtPkg: make EFI_LOADER_DATA non-executable") the comment for PcdDxeNxMemoryProtectionPolicy is incorrect. * Remove the incorrect part of the description. * Describe overriding NX protection by passing a pcd parameter on the build command line. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-09-25openssl: add Library/OpensslLib/openssl to includes, drop e_os.h hackGerd Hoffmann6-5/+1
Adding $(OPENSSL_PATH)/e_os.h to the list of source files had the effect that $(OPENSSL_PATH)/ was added to the list of include directories. With the file being gone in openssl-3.2.x this doesn't work any more. Add the directory to the [Includes.Common.Private] section instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-25CrtLibSupport: add intptr_tGerd Hoffmann1-0/+1
Will be needed by openssl-3.4.x Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-25CrtLibSupport: add timezoneGerd Hoffmann4-1/+7
Will be needed by openssl-3.2.x Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-25CrtLibSupport: add mktime()Gerd Hoffmann3-0/+31
Will be needed by openssl-3.2.x Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-25CrtLibSupport: factor out EFI_TIME -> time_t calculation to new functionGerd Hoffmann1-19/+32
No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-25CrtLibSupport: fix gettimeofday()Gerd Hoffmann4-1/+41
Turn gettimeofday() into a proper function with return value. Will be needed by openssl-3.2.x Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-25CrtLibSupport: add sleep()Gerd Hoffmann4-0/+32
Will be needed by openssl-3.2.x Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-09-24ShellPkg: add missing linefeed in reset messageHeinrich Schuchardt1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4850 When running 'reset -s' no linefeed is printed. This results in the Linux command line prompt not being printed at the start of a new line: Shell> reset -s Reset with <null string> (0 bytes)user@workstation:/tmp$ Add the missing linefeed. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-09-23FatPkg: Improvements to Fat to Fix File CorruptionMike Turner4-16/+238
This patch improves dirty bit checking in FAT and coalesces multiple writes to adjacent blocks into a single write. For good read performance, the Fat code caches 64KB lines from the file system. Any update to the data will force 64KB writes. Writing the full 64KB causes collateral blocks (i.e. blocks belonging to other files) to be written. This is inefficient to write blocks that are not dirty, the FAT driver should only be writing blocks that have actually been updated through its cache. This also resolves an issue with existing bootloaders which have ways to update files outside of the FAT code and the collateral write can corrupt those files. One such file is the Windows BCD that gets updated outside of the FAT code and has been seen to be corrupted by the collateral writes, causing the OS to fail to boot. This fix keeps track of physical disk block (LBA) size and will only mark LBA size zones of the 64KB cache line that are written to. When the file is closed and the cached data is written, only the dirty LBAs are written, which avoids the collateral write and therefore the corruption. In addition, adjacent LBAs will be coalesced into one write for performance considerations. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-23FatPkg: Check BlockIo Device Has Supported BlockSizeOliver Smith-Denny1-0/+24
Per the FAT spec, FAT32 supports block sizes of 512B, 1KB, 2KB, or 4KB. This patch adds a check to the FAT driver initialization to ensure that the underlying BlockIo device supports one of those block sizes and fails initialization otherwise. The underlying BlockIo blocksize is used when we flush the FatDiskCache back to disk and if the block size is an unsupported size, we could cause file corruption. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-23UefiPayloadPkg: Enhance ReadMe.md for ELF and FITGua Guo1-23/+31
Enhance and introduce environment construction and build step for ELF and FIT format payload Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-09-23CryptoPkg/OpensslLib: Create SM3-only version of the libraryArd Biesheuvel3-0/+51
Create a special OpensslLib implementation that only exposes the SM3 routines that MbedTlsLib borrows from OpensslLib, to avoid having to pull in other parts of OpenSSL that are not needed (e.g., via the library constructor) Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-09-23CryptoPkg: Add unit testcase for SM3Ard Biesheuvel1-0/+11
SM3 needs to be tested so we can verify that alternative implementations (such as the one I will be contributing to BaseCryptLibMbedTls) as well as the reference implementation produce the expected value. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-09-23CryptoPkg/MbedTls CLANGDWARF: Replace outdated CLANG3x referencesArd Biesheuvel6-22/+6
The CLANG35 and CLANG38 toolchain specifiers have been phased out, and replaced with CLANGDWARF. Update the MbedTls library definitions accordingly. While at it, switch to the gnu99 C dialect, which is a better match with GCC in C99 mode, which includes GCC specific GNU extensions. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-09-23BaseTools: Fix multiple 'invalid escape sequence' warnings in testsMike Beaton18-72/+72
In Python 3.12 invalid escape sequences in strings moved from DeprecationWarning to SyntaxWarning (ref https://docs.python.org/3/whatsnew/changelog.html#python-3-12-0-final and search for gh-98401). In a future Python version this will become SyntaxError. Multiple instances of these SyntaxWarnings are currently printed when running the BaseTools tests using Python 3.12 (though without actually failing the affected tests). This commit updates all lines which were causing this type of warning. Typical examples which needed fixing are: - "BaseTools\Source\Python" representing a path: "\S" and "\P" are invalid escape sequences, therefore left unchanged, therefore the test works (with a warning in Python 3.12). r"BaseTools\Source\Python" represents the same string, but with escapes turned off completely thus no warning. - Where '\t\s' is used as a regex pattern, then chr(9) + '\\s' is sent to the regex parser (with a warning in Python 3.12) since '\s' is not a valid Python escape sequence. This works correctly, though arguably for the wrong reasons. r'\t\s' sends the same as '\\t\\s', as originally intended and with no warning. (Note that ' and " are not fundamentally different in Python.) Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-09-23UefiPayloadPkg: Add LOCKBOX_SUPPORT in UPL and set it as FALSE in defaultZhou Jianfeng1-0/+5
S3 performance table is saved to LockBox. Without LockBox, S3 performance data will lost. Add LOCKBOX_SUPPORT to optionally select LockBox libary instance, default value is FALSE. Signed-off-by: Zhou Jianfeng <jianfeng.zhou@intel.com>
2024-09-23UefiPayloadPkg: Align relocation item with specGua Guo2-2/+2
Currently, FIT Payload data relocation data has some minor error with Universal Payload Specification v0.9.1 section 2.4.3. Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-09-20BaseTools: Update RETURN_ERROR Macro in BaseTypes.hAbdul Lateef Attar1-1/+3
This patch is to sync RETURN_ERROR macro with the MdePkg/Include/Base.h Ref: 1a89d9887f MdePkg:Update Return Error Macro in Base.h Fixing RETURN_ERROR macro. It is causing problem in Coverity Static analysis tool as we are directly converting the UINT value to INTN. Changing value from UINT to INTN might cause problema Here we know that the values would not be in loss of data. To increase the code quality and increase the static tool analysis score we have to change it 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: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-09-20Set PcdSerialClockRate from SerialPortInfo in UefiPayloadEntryMatt DeVillier2-0/+9
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>