Commit Graph

31930 Commits

Author SHA1 Message Date
Mike Beaton 954d53ecff GenSec: Support TianoCompress
Allows .fdf files to define a compressed .ffs section which can be read
by legacy EFI firmware (such as found on Apple Mac).
Use `COMPRESS TIANO`.
2023-12-20 13:55:44 +03:00
Mikhail Krichanov 3e675bc5c3 CI: Constructed separate workflows for common, arm, x86 packages and CodeQL.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:53:23 +03:00
Mikhail Krichanov 37102da870 MdePkg: Add PCD to remove X perm from image sections with WX perms
This feature is useful for images created by old Apple mtoc utility.

Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
2023-12-20 13:51:20 +03:00
Mikhail Krichanov 4951110b8a Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2023-12-20 13:51:20 +03:00
Mikhail Krichanov 3d421ee595 BaseTools: Removed GCC48/49 toolchains, refactored tools_def.template. 2023-12-20 13:51:20 +03:00
Savva Mitrofanov ea6a196e5b UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:51:20 +03:00
Savva Mitrofanov ea685a797b UefiCpuPkg/UnitTest: Fixes CLANGDWARF build
Adds missing EFIAPI modifiers. Fixes calling conventions by defining as
ms_abi

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:51:20 +03:00
Savva Mitrofanov 238f50e158 MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:51:20 +03:00
Savva Mitrofanov 7c73271cc5 IntelFsp2WrapperPkg/FspWrapperMultiPhaseProcessLib: Fix CLANGPDB build
Silences "sometimes-uninitialized" warning by initializing the variable FspMultiPhaseApiOffset and corrects build using LLVM 15 toolchain

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:50:12 +03:00
Savva Mitrofanov 969c4c8d03 MdeModulePkg/BrotliCustomDecompressLib: Disable C4559 MSVC warning
Disables redefinition warning due to win 10 sdk to fix build using MSVC
toolchain

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:50:12 +03:00
Mikhail Krichanov ba44cd59a8 BaseTools, MdeModulePkg: Update brotli submodule
Update the brotli submodule to the latest commit (ed1995b6bda1)
so that the build isn't broken in GCC 12 compilers.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:50:12 +03:00
Mikhail Krichanov b29d2e0c4a MdePkg: Defined DEBUG_RAISE() to facilitate fuzzing. 2023-12-20 13:50:12 +03:00
Mikhail Krichanov fe0b6465de MdePkg: Added BaseOverflowLib library. 2023-12-20 13:50:12 +03:00
Mikhail Krichanov 3c8b43637e BaseTools: Replaced GenFw with ImageTool and MicroTool. 2023-12-20 13:50:12 +03:00
Mikhail Krichanov 06b3998f14 SecurePE: Replaced old PE loader with Secure one. 2023-12-20 13:48:26 +03:00
Mikhail Krichanov f503722857 MdeModulePkg/DebugSupportDxe: Adds callback function prototypes in caller
Adds EFI_EXCEPTION_CALLBACK and EFI_PERIODIC_CALLBACK casts to
RegisteredCallback call in InterruptDistributionHub to suppress
deprecated non-prototype LLVM 15 warning

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:37:39 +03:00
Savva Mitrofanov 3ff9a7d6e2 MdeModulePkg/CapsuleOnDiskLoadPei: Removes unused Index variable
Removes unused Index local variable in RetrieveRelocatedCapsule to
suppress compiler warning in LLVM 15

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 92a52393f2 NetworkPkg/WifiConnectionManagerDxe: Removes unused variable
Removes unused variable in WifiMgrRefreshNetworkList routine to correct
build

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 4143989061 CryptoPkg/BaseCryptLib: Removes unused variable in CryptX509
Removes unused local variable in X509ConstructCertificateStackV

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov bf29856aee MdeModulePkg/RegularExpressionDxe: Corrects onigurama build with LLVM 15
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov bc59f11687 MdeModulePkg/VarCheckHiiLib: Remove unused variable FfsIndex
Corrects compiler warning due to unused variable in VarCheckHiiGenFromFv

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 2146160aa0 MdeModulePkg/SmbiosMeasurementDxe: Removes unused local variable
Removes unused local variable Size in GetSmbiosStringById

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov fb0114a409 MdeModulePkg/BrotliCustomDecompressLib: Correct BrotliDecompress
We need to pass DestSize as pointer, because we assign this output var
to TotalOut value inside BrotliDecompress routine

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 7a40196dc8 .gitignore: Add compile_flags.txt
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov 9b88aa3128 Build: Fixed missing HII for X64, IA32 CLANGDWARF DEBUG, NOOPT. 2023-12-20 13:36:38 +03:00
Mikhail Krichanov e5ec2620cd MdePkg/X64/ProcessorBind.h: Fixes CLANGDWARF X64 compilation
Corrects typedef redefinition, in particular for openssl e_os2.h

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov fb2e96a8aa UefiCpuPkg/CpuExceptionHandlerLib: Increase mBuffer size
Add missing GDT alignment into mBuffer to prevent possible memory
corruption on ALIGN_POINTER operation on NewGdtTable
in ArchExceptionHandler

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov becf2d72f6 RedfishPkg/BaseUcs2Utf8Lib: Fix out of bounds shift in UTF8ToUCS2Char
Missing masks leads to shift out of bounds. Also there is no need to
construct CHAR16 using cast to CHAR8 buffer, better to use native endian
by assigning data directly into Ucs2Char variable

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 9486961073 MdePkg/BasePcdLibNull: Remove ASSERT from LibPcdGetSize, LibPcdGetExSize
GetSize routines should return zero size when checking Token existence

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
Reviewed-by: Vitaly Cheptsov <vit9696@protonmail.com>
2023-12-20 13:36:38 +03:00
Vitaly Cheptsov 4eea328c59 OvmfPkg/DxePciLibI440FxQ34: Add UefiBootServicesTableLib dependency
In case PlatformBootManagerLib does not have PciLib dependency,
we need to explicitly depend on UefiBootServicesTableLib.
Otherwise UefiBootServicesTableLib may not be constructed before
DxePciLibI440FxQ35, which uses a constructor-less PcdLib that directly
accesses gBS.

This can be viewed as a bug in the current implementation of BaseTools,
namely GetModuleLibInstances. This function drops all constructor-less
dependencies from the dependency resolution list to avoid dependency
cycles, which at the same time causes issues like above.

To properly fix the issue one should go over each library with
constructors and for each its dependency without constructors add all
the secondary dependencies that do have constructors. While doable,
it may cause considerable performance issues and is thus not done
in this patch.

Signed-off-by: Vitaly Cheptsov <cheptsov@ispras.ru>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 4b9e028390 UefiPayloadPkg/PchSmiDispatchSmm: Add missing EFIAPI modifiers
Added missing EFIAPI modifier to SmmSwDispatcher function which passed into gSmst->SmiHandlerRegister routine.

Signed-off-by: Savva Mitrofanov <sk.mitrofanov@ispras.ru>
Reviewed-by: Vitaly Cheptsov <cheptsov@ispras.ru>
2023-12-20 13:36:38 +03:00
Vitaly Cheptsov 397fb81ff5 BaseTools: Allow .text relocations in CLANGDWARF toolchain
UefiCpuPkg modules like ExceptionHandlerAsm.nasm require relocations
to .text or PIC as they use instructions like mov or bt against
external symbols:

1. mov     rax, ASM_PFX(CommonInterruptEntry)
2. mov     rax, HookAfterStubHeaderEnd
3. bt      [ASM_PFX(mErrorCodeFlag)], ecx
4. mov     [rcx + (@VectorNum - HookAfterStubHeaderBegin)], al

It is not easily possible to rewrite 3/4 cases without involving
more registers or more commands, and EDK II has never targeted
read-only .text at load time, only at runtime.

Change the defaults to let OVMF compile by CLANGDWARF as per:
https://lists.llvm.org/pipermail/llvm-dev/2017-March/111441.html

Signed-off-by: Vitaly Cheptsov <cheptsov@ispras.ru>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov 9a4877e5c0 BaseTools: Fix for NOOPT CLANG38 compilation with clang-13
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3715

We must treat not only R_X86_64_PLT32 as R_X86_64_PC32
(https://github.com/torvalds/linux/commit/
b21ebf2fb4cde1618915a97cc773e287ff49173e),
but also treat R_386_PLT32 relocation as R_386_PC32
(https://github.com/torvalds/linux/commit/
bb73d07148c405c293e576b40af37737faf23a6a).

Signed-off-by: Mikhail Krichanov <krichanov@ispras.ru>
2023-12-20 13:36:38 +03:00
Goldfish64 99de2ada96 OvmfPkg/SioBusDxe: Add PS/2 mouse support
SioBusDxe by default does not create a device for PS/2 mice, this patch adds that device.
2023-12-20 13:36:38 +03:00
Vitaly Cheptsov bb700fd56c ShellPkg: Add support for input with separately reported modifiers
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2510

Some firmwares:
- Report Shift modifier even when they report upper-case unicode letter.
- Report Ctrl modifier with "shifted" UniChar (i.e. X - 'A' + 1).

This change provides support for these firmwares preserving the compatibility
with the previous input handling.

Signed-off-by: Michael Belyaev <usrsse2@icloud.com>
Reviewed-by: Vitaly Cheptsov <vit9696@protonmail.com>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov 1f9e2321fe CryptoPkg/OpensslLib: Fix build for XCODE5 compiler on macOS
REF: https://edk2.groups.io/g/devel/message/88179

A build of CryptoPkg with XCODE5 on macOS is now trying to include
Availability.h, which isn't found. Seems the problem is in condition
logic inside openssl/include/crypto/rand.h

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov 82e796ffa4 MdePkg: DebugLib: Compilation fix for clang-13
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3704

build -a X64 -t CLANG38 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc
results in
UDK/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c:1284:31:
error: variable 'Status' set but not used
[-Werror,-Wunused-but-set-variable]

Signed-off-by: Mikhail Krichanov <krichanov@ispras.ru>

MdePkg/DebugLib(PerformanceLib): Fix "unused-but-set-variable" warning

The current definitions of DEBUG_CODE_BEGIN() and DEBUG_CODE_END() use 
the local
variable __DebugCodeLocal as an attempt to track parity. If 
DEBUG_CODE_END() is
used without a preceding DEBUG_CODE_BEGIN(), __DebugCodeLocal will not 
have been
declared and a compilation error will be issued. The mutations of the 
variable
are not used to track nesting or such. As the value of this variable is 
never
actually used, recent Clang versions issue a "unused-but-set-variable" 
warning
for it.

To solve this, re-define __DebugCodeLocal as a BOOLEAN that is always 
FALSE and
use it in a do-while loop condition as done explicitly in many places. 
Like the
previous solution, DEBUG_CODE_END() cannot be used without 
DEBUG_CODE_BEGIN(),
as __DebugCodeLocal will be not have been defined.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov 50031d1d24 OvmfPkg/PlatformInitLib: Corrects initializers to fix NOOPT build
Fixes OvmfPkg build using XCODE5, CLANGPDB and CLANGDWARF toolchains
for NOOPT target

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Mikhail Krichanov 8c29fe63c3 Ext4Pkg: Various improvements based on Sydr fuzzing results.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Savva Mitrofanov 76daa1e807 Ext4Pkg: Add EDK II Ext4 package
Adds a Pedro Falcato's UEFI EXT4 filesystem driver that implements the EFI_FILE_PROTOCOL and EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:36:38 +03:00
Igor Kulchytskyy 8736b8fdca RedfishPkg: RedfishDiscoverDxe: Optimize the Redfish Discover flow
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4602

Filter out the network interfaces which are not supported by
Redfish Host Interface.

Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Mike Maslenkin <mike.maslenkin@gmail.com>
Signed-off-by: Igor Kulchytskyy <igork@ami.com>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-22 13:31:54 +00:00
Igor Kulchytskyy f444c4bea5 RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4602

Supported function of the driver changed to wait for all network
interface to be installed.

Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Acked-by Mike Maslenkin <mike.maslenkin@gmail.com>
Signed-off-by: Igor Kulchytskyy <igork@ami.com>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-22 13:31:54 +00:00
Liming Gao 8dd52c949e Revert "RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed later"
This reverts commit 06b27ccb90.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-11-22 13:31:54 +00:00
Liming Gao 15538bc62e Revert "RedfishPkg: RedfishDiscoverDxe: Optimize the Redfish Discover flow"
This reverts commit 3db76e6476.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-11-22 13:31:54 +00:00
Ashish Singhal 23dbb8a07d DynamicTablesPkg: Fix ETE _UID Creation
Bugzilla: 4600 (https://bugzilla.tianocore.org/show_bug.cgi?id=4600)

Just like CPU _UID, ETE UID also needs to be unique so
use AcpiProcessorUid instead of CpuName

Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-11-21 14:13:54 +00:00
Igor Kulchytskyy 3db76e6476 RedfishPkg: RedfishDiscoverDxe: Optimize the Redfish Discover flow
Filter out the network interfaces which are not supported by
Redfish Host Interface.

Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Acked-by Mike Maslenkin <mike.maslenkin@gmail.com>
Signed-off-by: Igor Kulchytskyy <igork@ami.com>
2023-11-15 03:50:39 +00:00
Igor Kulchytskyy 06b27ccb90 RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx
Supported function of the driver changed to wait for all network
interface to be installed.

Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Acked-by Mike Maslenkin <mike.maslenkin@gmail.com>
Signed-off-by: Igor Kulchytskyy <igork@ami.com>
2023-11-15 03:50:39 +00:00
Jake Garver via groups.io c9cce5a005 MdeModulePkg/RegularExpressinoDxe: Fix clang error
Ignore old style declaration warnings in oniguruma/src/st.c.  This was
already ignored for MSFT, but newer versions of clang complain as well.

Signed-off-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Nhi Pham <nhi@os.amperecomputing.com>
Tested-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-11-13 05:21:09 +00:00
Michael D Kinney 33deaa3b84 BaseTools/Scripts/GetMaintainer: Sort output addresses
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593

Sort the list of output addresses alphabetically so this
script produces the same output even if the order of patches
in a patch series is modified such that that order of files
processed by this script changes.

Use set() logic instead of OrderedDict to accumulate the
list of unique addresses that are sorted alphabetically.

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>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-11 02:31:13 +00:00
Michael D Kinney 706811819d BaseTools/Scripts/GetMaintainer: Handle reviewer only case
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593

If a package only has reviewers and no maintainers, then also
return the <default> maintainers.

In order to detect this case, get_maintainers() is updated to
return maintainers, reviews, and lists separately instead of
a single merged list.  This also allows this module to be used
by other scripts that need to distinguish between maintainers,
reviewers, and lists.

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>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-11 02:31:13 +00:00