Commit Graph

31973 Commits

Author SHA1 Message Date
Savva Mitrofanov df8beba585 MdePkg/BaseLib: Correct CRC-16-ANSI implementation
The ANSI implementation assumes that initial value should be 0xFFFF and
the result shouldn't be inverted

Fixes: 92288f4 ("MdePkg/BaseLib: Add CRC16-ANSI and CRC32c implementations")
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 14:01:23 +03:00
Mikhail Krichanov 03d41cad62 BaseTools/Conf: Added EDK2_GCC_NOLTO build option. 2023-12-20 14:00:19 +03:00
Mikhail Krichanov d36d7bfc5e Build: Replaced GCC5 toolchain with GCC. 2023-12-20 14:00:19 +03:00
Mikhail Krichanov 8a56cbfb5d Fixed compilation of all packages tracked by CI after rebasing upon edk2-stable202305. 2023-12-20 14:00:19 +03:00
Mikhail Krichanov 5df2773303 Revert "MdeModulePkg: Enable forward edge CFI in mem attributes table"
This reverts commit e4ef609319.
2023-12-20 14:00:19 +03:00
Mikhail Krichanov e26eb0f9c1 MdeModulePkg/Core/Dxe: Integrate CPU Architectural producer
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3223

In the current design, memory protection is not available till CpuDxe
is loaded. To resolve this, introduce CpuArchLib to move the
CPU Architectural initialization to DxeCore.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 14:00:19 +03:00
Mikhail Krichanov 1ecb175538 OvmfPkg, BaseTools: Fixed Amaranth compilation for gcc-12.3.0. 2023-12-20 14:00:19 +03:00
Mikhail Krichanov 35e7b2a75f BaseTools: Introduce new HII section design 2023-12-20 14:00:19 +03:00
Mikhail Krichanov ff216ecc28 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2023-12-20 14:00:19 +03:00
Marvin Häuser c3b3ef8b78 BaseTools/GenFv: Remove .text and .data from FV map 2023-12-20 14:00:19 +03:00
Marvin Häuser 6c84e6a282 Remove hacks related to former lack of XCODE5 .hii support 2023-12-20 14:00:19 +03:00
Mikhail Krichanov 41b9d0100d Added .md file summarizing current states of packages. 2023-12-20 14:00:19 +03:00
Marvin Häuser acbdbc0aad BaseTools/build_rule: Drop deprecated ASM16 definition 2023-12-20 14:00:19 +03:00
Mikhail Krichanov a828c6cedf Drop support for the TE format 2023-12-20 14:00:19 +03:00
Marvin Häuser c82eacb202 ArmPkg/ArmMmuLib: ASSERT ArmReplaceLiveTranslationEntry alignment 2023-12-20 14:00:19 +03:00
Marvin Häuser 079070c748 MdeModulePkg/ExtendedFirmwarePerformance: Fix FPDT struct alignment 2023-12-20 14:00:19 +03:00
Marvin Häuser 11f28961da UefiPayloadPkg/UefiPayloadEntry: Return image destination size as UINT32 2023-12-20 14:00:19 +03:00
Savva Mitrofanov 52bb666c34 ArmVirtPkg/ArmVirtQemu: Disable PcdPrePiProduceMemoryTypeInformationHob for ARM
The PcdPrePiProduceMemoryTypeInformationHob on ARM breaks Linux efistub
boot. The efistub for arm32 uncompresses Linux kernel into memory ranges
which occupied by DXE-phase drivers which leads to
'permission denied'-error during page write. So as a temporary solution
we use PcdPrePiProduceMemoryTypeInformationHob only for AARCH64

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 14:00:19 +03:00
Mikhail Krichanov 8dec042e02 UefiCpuPkg/CpuExceptionHandlerLib: Creates unified ExceptionHandlerAsm
This change removes Xcode5ExceptionHandlerAsm and merge it's
functionality into ExceptionHandlerAsm.
Also decreases number of vectors to 32 for:
- 64-bit PeiCpuExceptionHandlerLib
- 32-bit PeiCpuExceptionHandlerLib, SecPeiCpuExceptionHandlerLib

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 14:00:19 +03:00
Mikhail Krichanov c14c33e76a BaseTools/CommonLib: Consume MemoryAllocationLib 2023-12-20 13:59:27 +03:00
Marvin Häuser af9f4495e9 EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2023-12-20 13:59:27 +03:00
Marvin Häuser c225c0c4ed EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2023-12-20 13:59:27 +03:00
Mikhail Krichanov aba3723d24 MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-12-20 13:57:24 +03:00
Marvin Häuser 2753421adc EmulatorPkg/Host: Consume MemoryAllocationLib 2023-12-20 13:57:24 +03:00
Mikhail Krichanov 08a862caf7 MdePkg: Introduce CommonMemoryAllocationLib 2023-12-20 13:57:24 +03:00
Marvin Häuser 443dd80eb8 MdeModulePkg: Manage MemoryProfileLib separately 2023-12-20 13:57:24 +03:00
Marvin Häuser 750a6dec00 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-12-20 13:57:24 +03:00
Marvin Häuser 5a4fbc3aa4 EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2023-12-20 13:57:24 +03:00
Marvin Häuser 671e3756ed MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2023-12-20 13:57:24 +03:00
Marvin Häuser b9aa08eb24 BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-12-20 13:57:24 +03:00
Marvin Häuser 3f66dcc702 EmulatorPkg: Fix some image loader related issues 2023-12-20 13:57:24 +03:00
Marvin Häuser ec09218694 EmulatorPkg: Fix Thunk PPI/Protocol library types 2023-12-20 13:57:24 +03:00
Marvin Häuser 9045b1b283 EmulatorPkg/Host: Remove orphaned SecImageRead() 2023-12-20 13:57:24 +03:00
Marvin Häuser 091a444326 BaseTools/GenFv: Remove duplicated alignment macros 2023-12-20 13:57:24 +03:00
Marvin Häuser e521b58bf1 EmulatorPkg/Host: Fix XCODE5 build 2023-12-20 13:55:44 +03:00
Marvin Häuser acd73b7ca2 BaseTools/DevicePath: Consume MdePkg/UefiDevicePathLib
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:55:44 +03:00
Marvin Häuser 16aaa47e85 BaseTools/CommonLib: Consume MdePkg and MdeModulePkg
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:55:44 +03:00
Marvin Häuser b5300a918a UefiCpuPkg/MtrrLib: Add missing PcdLib.h include
MtrrLib does not include PcdLib.h despite explicitly using its
definitions. Add the include to fix compilation for modules that do not
utilize AutoGen.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:55:44 +03:00
Marvin Häuser 029d44255f MdePkg/Base.h: Add support for C++ alignof
In preparation of including Base.h in C++ BaseTools programs, support
the C++ 11 alignof operator. The C _Alignof operator is not universally
supported in C++ mode across compiler toolchains and thus the current
definition may lead to compilation errors with said programs.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:55:44 +03:00
Marvin Häuser 2531248905 MdePkg/Base.h: Only use C++ static_assert when supported
To support GoogleTest, 933b4c3 added support for C++ static_assert.
However, this is not a mandatory or universally supported C++ feature.
Guard its usage by the __cpp_static_assert support flag.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-12-20 13:55:44 +03:00
Mikhail Krichanov feea9b362d FatPkg: Adds support for read-only mode
Implements gEfiFatPkgTokenSpaceGuid token space and adds token which
disables write operations. By default driver still supports read-write
mode

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:55:44 +03:00
Savva Mitrofanov 0177e0ac42 UefiCpuPkg/CpuPageTableLib: Add intrinsic lib to fix MSVC build
For the bitfield access, MSVC apparently uses a right shift of the base type of the bitfield member. In our case, is is cased by IA32_PTE_4K and
IA32_PAGE_LEAF_ENTRY_BIG_PAGESIZE and other structures which uses uint64
bitfields and 32-bit x86 doesn't have a 64-bit integer shift (except using MMX or SSE2). With -Od (NOOPT) even for constant counts it puts
the data in EDX:EAX, the shift count in cl and calls __aullshr.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:55:44 +03:00
Savva Mitrofanov c2778bdbd5 CryptoPkg/IntrinsicLib: Corrects __ashrdi3 and adds __lshrdi3
The ashrdi3 function should do arithmetic shift instead of logic using
sar instruction. Also adds __lshrdi3 implementation to correct build
using LLVM

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-12-20 13:55:44 +03:00
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