31030 Commits

Author SHA1 Message Date
Mike Beaton
0f3b3460b4 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-05-09 18:24:28 +03:00
Mikhail Krichanov
9da98d0e8c CI: Constructed separate workflows for common, arm, x86 packages and CodeQL.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Mikhail Krichanov
a564d55862 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-05-09 18:24:28 +03:00
Mikhail Krichanov
c189dd0bd0 Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
9c3595f1bd BaseTools: Removed GCC48/49 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
05c47cd0d1 Conf: Remove unused IPHONE_TOOLS, SOURCERY_CYGWIN_TOOLS defs and EBC (EFI Byte Code) compiler definitions. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
1ed79bc4df BaseTools: Removed VS2008-VS2013 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
6ef394d429 Conf: Removed CLANG35/38 toolchains. 2023-05-09 18:24:28 +03:00
Savva Mitrofanov
d5c3d01897 UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
d529951a8e 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-05-09 18:24:28 +03:00
Savva Mitrofanov
def7e8e70a MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
32ed66677a MdePkg/Include: Corrects ALIGNOF macro in Base.h for MSVC
This change should correct compatibility with MSVC if the compiler flags undefines _MSC_VER, for example, like OpensslLib

Signed-off-by: Savva Mitrofanov
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
043b6eaf84 MdeModulePkg/DebugSupportDxe: Corrects MSVC build
Fixes 6c974ab21e212c1867c871f989f6f1df5786e99e by supressing type cast
warning for MSVC

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
01095d2f68 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-05-09 18:24:28 +03:00
Savva Mitrofanov
eb83f5d891 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-05-09 18:24:28 +03:00
Mikhail Krichanov
db34228ae5 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-05-09 18:24:28 +03:00
Mikhail Krichanov
c132468d39 MdePkg: Defined DEBUG_RAISE() to facilitate fuzzing. 2023-05-09 18:23:23 +03:00
Mikhail Krichanov
c3c2c17378 MdePkg: Added BaseOverflowLib library. 2023-05-09 18:21:10 +03:00
Mikhail Krichanov
1e0cdd036d BaseTools: Replaced GenFw with ImageTool and MicroTool. 2023-05-09 18:19:07 +03:00
Mikhail Krichanov
29ab261538 SecurePE: Replaced old PE loader with Secure one. 2023-05-09 18:18:43 +03:00
Savva Mitrofanov
526a5ef3e6 MdeModulePkg/CapsuleApp: Add missing EFIAPI modifier in CapsuleDump
Fixes calling conventions by defining CompareFileNameInAlphabet with
ms_abi

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
23f2919974 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-04-28 16:55:39 +03:00
Savva Mitrofanov
cc22ecbdb3 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-04-28 16:55:39 +03:00
Savva Mitrofanov
b87abe0acf NetworkPkg/WifiConnectionManagerDxe: Removes unused variable
Removes unused variable in WifiMgrRefreshNetworkList routine to correct
build

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
0d1a7f97c8 CryptoPkg/BaseCryptLib: Removes unused variable in CryptX509
Removes unused local variable in X509ConstructCertificateStackV

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Mikhail Krichanov
0e8763d81e MdeModulePkg/RegularExpressionDxe: Corrects onigurama build with LLVM 15
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
a3aca36ade MdeModulePkg/VarCheckHiiLib: Remove unused variable FfsIndex
Corrects compiler warning due to unused variable in VarCheckHiiGenFromFv

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Marvin Häuser
fb5e7be923 BaseTools/tools_def: Disable PIE generation for IA32 CLANGDWARF
Commit c25d390 disabled PIE generation for GCC49 and GCC5 as the GCC toolchains
at the time started enabling it by default. LLVM 15 has now done the same thing
for all Linux targets [1]. This causes the emission of a GOT with relocations
that GenFw does not currently support.

As such, disable PIC and PIE for the CLANGDWARF toolchain for IA32 targets, as
already done for GCC49 and GCC5, to support LLVM 15.

[1] ca68038d12

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
9dce42308f MdeModulePkg/SmbiosMeasurementDxe: Removes unused local variable
Removes unused local variable Size in GetSmbiosStringById

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
827e2a7de2 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-04-28 16:55:39 +03:00
Savva Mitrofanov
bc170642d6 .gitignore: Add compile_flags.txt
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Mikhail Krichanov
1a28f374fe Build: Fixed missing HII for X64, IA32 CLANGDWARF DEBUG, NOOPT. 2023-04-28 16:55:39 +03:00
Mikhail Krichanov
af606b5dab 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-04-28 16:55:39 +03:00
Savva Mitrofanov
20e98552d4 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-04-28 16:55:39 +03:00
Savva Mitrofanov
d0b4d95eff Revert "UefiCpuPkg: Enhance logic in InitializeMpExceptionStackSwitchHandlers"
This reverts commit 4b7bd4c591a81a290b31e9d1a94c4b8be787989e, because it
breaks IA32 targets, at least for XCODE5, CLANGPDB and CLANGDWARF
toolchains

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
98937be856 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-04-28 16:55:39 +03:00
Savva Mitrofanov
9a53125a35 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-04-28 16:55:39 +03:00
Vitaly Cheptsov
b88fb7469c 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-04-28 16:55:39 +03:00
Savva Mitrofanov
99b1eacd81 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-04-28 16:55:39 +03:00
Vitaly Cheptsov
29701b6bd9 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-04-28 16:55:39 +03:00
Mikhail Krichanov
4539a64818 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-04-28 16:55:39 +03:00
Goldfish64
0ddc355593 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-04-28 16:55:39 +03:00
Vitaly Cheptsov
77f168939c 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-04-28 16:55:39 +03:00
Mikhail Krichanov
0b691c8274 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-04-28 16:55:39 +03:00
Mikhail Krichanov
9760d73de3 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-04-28 16:55:39 +03:00
Mikhail Krichanov
2cdff1206e 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-04-28 16:55:39 +03:00
Mikhail Krichanov
05702eddbd Ext4Pkg: Various improvements based on Sydr fuzzing results.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
584fcbf4dd 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-04-28 16:55:39 +03:00
Sunil V L
f80f052277 OvmfPkg/RiscVVirt: Add Stack HOB
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4350

Currently, stack HOB is not created for the stack memory. This causes
stack memory to be treated as free memory and any memory allocation which
happens at this address causes random memory corruption. Fix this by
creating the stack HOB which marks the memory as BS data.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Andrei Warkentin <andrei.warkentin@intel.com>
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: Sunil V L <sunilvl@ventanamicro.com>
Reported-by: Andrei Warkentin <andrei.warkentin@intel.com>
Tested-by: Andrei Warkentin <andrei.warkentin@intel.com>
Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com>
2023-03-01 15:08:07 +00:00
MarsX Lin
1eeca0750a UefiPayloadPkg: remove the change that get platform specific logic
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4241

Since UefiPayloadPkg had supported multiple firmware volume,
remove the platform specific logic via protocol

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2023-02-23 07:47:12 +00:00