Commit Graph

32639 Commits

Author SHA1 Message Date
Mikhail Krichanov 7886691a93 Revert "MdeModulePkg: Enable forward edge CFI in mem attributes table"
This reverts commit e4ef609319.
2024-07-22 13:47:18 +03:00
Mikhail Krichanov 769c333a61 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>
2024-07-22 13:47:18 +03:00
Mikhail Krichanov ecfa20d841 OvmfPkg, BaseTools: Fixed Amaranth compilation for gcc-12.3.0. 2024-07-22 13:47:18 +03:00
Mikhail Krichanov 047d1b2f88 BaseTools: Introduce new HII section design 2024-07-22 13:47:18 +03:00
Mikhail Krichanov c57cc69793 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2024-07-22 13:47:18 +03:00
Marvin Häuser f69039282f BaseTools/GenFv: Remove .text and .data from FV map 2024-07-22 13:47:18 +03:00
Marvin Häuser f0891b587f Remove hacks related to former lack of XCODE5 .hii support 2024-07-22 13:47:18 +03:00
Mikhail Krichanov e04963f91d Added .md file summarizing current states of packages. 2024-07-22 13:47:18 +03:00
Marvin Häuser 4f05d0cc12 BaseTools/build_rule: Drop deprecated ASM16 definition 2024-07-22 13:47:18 +03:00
Mikhail Krichanov 2ae98acd86 Drop support for the TE format 2024-07-22 13:47:18 +03:00
Marvin Häuser 584d13a2eb ArmPkg/ArmMmuLib: ASSERT ArmReplaceLiveTranslationEntry alignment 2024-07-22 13:47:18 +03:00
Marvin Häuser 3aee8784da MdeModulePkg/ExtendedFirmwarePerformance: Fix FPDT struct alignment 2024-07-22 13:47:18 +03:00
Marvin Häuser e63fef0eea UefiPayloadPkg/UefiPayloadEntry: Return image destination size as UINT32 2024-07-22 13:47:18 +03:00
Savva Mitrofanov a86d9d688e 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>
2024-07-22 13:47:18 +03:00
Mikhail Krichanov a0180c022a 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>
2024-07-22 13:47:18 +03:00
Mikhail Krichanov 76e055e723 BaseTools/CommonLib: Consume MemoryAllocationLib 2024-07-22 13:47:18 +03:00
Marvin Häuser ba21218d12 EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2024-07-22 13:47:18 +03:00
Marvin Häuser f0ac2e86e3 EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2024-07-22 13:47:18 +03:00
Mikhail Krichanov 091bca8bc8 MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2024-07-22 13:47:18 +03:00
Marvin Häuser e23139949b EmulatorPkg/Host: Consume MemoryAllocationLib 2024-07-22 13:47:18 +03:00
Mikhail Krichanov 6cf6d8247a MdePkg: Introduce CommonMemoryAllocationLib 2024-07-22 13:47:18 +03:00
Marvin Häuser 55f9f59ebc MdeModulePkg: Manage MemoryProfileLib separately 2024-07-22 13:47:18 +03:00
Marvin Häuser 9d65ea7b79 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2024-07-22 13:47:18 +03:00
Marvin Häuser 623c955985 EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2024-07-22 13:47:18 +03:00
Marvin Häuser 85ae25837b MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2024-07-22 13:47:18 +03:00
Marvin Häuser 8632c62d0d BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2024-07-22 13:47:18 +03:00
Marvin Häuser 086e621cc2 EmulatorPkg: Fix some image loader related issues 2024-07-22 13:47:18 +03:00
Marvin Häuser 367845eaf9 EmulatorPkg: Fix Thunk PPI/Protocol library types 2024-07-22 13:47:18 +03:00
Marvin Häuser 293504a3e5 EmulatorPkg/Host: Remove orphaned SecImageRead() 2024-07-22 13:47:18 +03:00
Marvin Häuser 9482b7ddc9 BaseTools/GenFv: Remove duplicated alignment macros 2024-07-22 13:47:17 +03:00
Marvin Häuser a2a1d641f1 EmulatorPkg/Host: Fix XCODE5 build 2024-07-22 13:47:17 +03:00
Marvin Häuser 2df90a3027 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>
2024-07-22 13:47:17 +03:00
Marvin Häuser 9163cd4925 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>
2024-07-22 13:47:17 +03:00
Marvin Häuser 1a49c0297c 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>
2024-07-22 13:47:17 +03:00
Marvin Häuser fcbf3d2b62 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>
2024-07-22 13:47:17 +03:00
Marvin Häuser 572bcb051d 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>
2024-07-22 13:47:17 +03:00
Mikhail Krichanov ba02e8cc6c 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>
2024-07-22 13:47:17 +03:00
Savva Mitrofanov 30afd72eaf 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>
2024-07-22 13:47:17 +03:00
Savva Mitrofanov 9252fc0e1a 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>
2024-07-22 13:47:17 +03:00
Mike Beaton e19d725d4c 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`.
2024-07-22 13:47:17 +03:00
Mikhail Krichanov ae79fe0dc3 CI: Constructed separate workflows for common, arm, x86 packages and CodeQL.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2024-07-22 13:47:17 +03:00
Mikhail Krichanov a986e4f61e 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>
2024-07-22 13:47:17 +03:00
Mikhail Krichanov a98a96336f Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2024-07-22 13:47:17 +03:00
Mikhail Krichanov ba869df56a BaseTools: Removed GCC48/49 toolchains, refactored tools_def.template. 2024-07-22 13:47:17 +03:00
Savva Mitrofanov f8cc20e790 UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2024-07-22 13:47:17 +03:00
Savva Mitrofanov 3246819f4c 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>
2024-07-22 13:47:17 +03:00
Savva Mitrofanov a5fe2c29a3 MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2024-07-22 13:47:17 +03:00
Savva Mitrofanov 370c5f3399 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>
2024-07-22 13:47:17 +03:00
Savva Mitrofanov 656cd26abc 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>
2024-07-22 13:47:17 +03:00
Mikhail Krichanov 12ba277a2d 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>
2024-07-22 13:47:17 +03:00