31425 Commits

Author SHA1 Message Date
Mikhail Krichanov
a3d73d44ee 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-07-07 09:46:08 +03:00
Savva Mitrofanov
edf7f64f14 Build: Upgrade OpenCorePkg
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:46:08 +03:00
Mikhail Krichanov
42c5cd67d2 OvmfPkg, BaseTools: Fixed Amaranth compilation for gcc-12.3.0. 2023-07-07 09:46:08 +03:00
Mikhail Krichanov
6190e6380f BaseTools: Introduce new HII section design 2023-07-07 09:46:08 +03:00
Marvin Häuser
b74b98d4c3 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2023-07-07 09:46:08 +03:00
Marvin Häuser
1957edbf01 BaseTools/GenFv: Remove .text and .data from FV map 2023-07-07 09:46:08 +03:00
Marvin Häuser
212716a1c4 Remove hacks related to former lack of XCODE5 .hii support 2023-07-07 09:46:08 +03:00
Mikhail Krichanov
86283f1f8b Added .md file summarizing current states of packages. 2023-07-07 09:46:08 +03:00
Marvin Häuser
e80ae38879 BaseTools/build_rule: Drop deprecated ASM16 definition 2023-07-07 09:44:53 +03:00
Mikhail Krichanov
49eba86f69 Drop support for the TE format 2023-07-07 09:44:53 +03:00
Marvin Häuser
b6eac1a574 ArmPkg/ArmMmuLib: ASSERT ArmReplaceLiveTranslationEntry alignment 2023-07-07 09:44:53 +03:00
Marvin Häuser
9c43408450 MdeModulePkg/ExtendedFirmwarePerformance: Fix FPDT struct alignment 2023-07-07 09:44:53 +03:00
Marvin Häuser
b3150e51ab UefiPayloadPkg/UefiPayloadEntry: Return image destination size as UINT32 2023-07-07 09:44:53 +03:00
Savva Mitrofanov
cd4dd49a12 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-07-07 09:44:53 +03:00
Mikhail Krichanov
789888e652 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-07-07 09:44:53 +03:00
Mikhail Krichanov
2c38c37510 UefiImageLib: Ensure consistently passing the full buffer size 2023-07-07 09:44:53 +03:00
Mikhail Krichanov
96ec1c3f4b BaseTools/CommonLib: Consume MemoryAllocationLib 2023-07-07 09:44:53 +03:00
Marvin Häuser
bff9ccd041 EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2023-07-07 09:44:52 +03:00
Marvin Häuser
43fff71ccd EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2023-07-07 09:44:52 +03:00
Marvin Häuser
4b17f3031c MdePkg/UefiImageLib: Require callers to allocate aligned memory 2023-07-07 09:44:52 +03:00
Mikhail Krichanov
000ec64cbb MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-07-07 09:41:57 +03:00
Marvin Häuser
d8d1594eab EmulatorPkg/Host: Consume MemoryAllocationLib 2023-07-07 09:40:00 +03:00
Mikhail Krichanov
7887a8a2e7 MdePkg: Introduce CommonMemoryAllocationLib 2023-07-07 09:39:09 +03:00
Marvin Häuser
574dc7aa64 MdeModulePkg: Manage MemoryProfileLib separately 2023-07-07 09:38:00 +03:00
Marvin Häuser
8cd1fcbfe4 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-07-07 09:38:00 +03:00
Marvin Häuser
c2a1aba688 EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2023-07-07 09:38:00 +03:00
Marvin Häuser
9449729dba MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2023-07-07 09:38:00 +03:00
Marvin Häuser
adf1673ece BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-07-07 09:38:00 +03:00
Marvin Häuser
64a6723cdc EmulatorPkg: Fix some image loader related issues 2023-07-07 09:38:00 +03:00
Marvin Häuser
b44e3da5ea EmulatorPkg: Fix Thunk PPI/Protocol library types 2023-07-07 09:38:00 +03:00
Marvin Häuser
405799494f EmulatorPkg/Host: Remove orphaned SecImageRead() 2023-07-07 09:38:00 +03:00
Marvin Häuser
ee9d30f774 BaseTools/GenFv: Remove duplicated alignment macros 2023-07-07 09:38:00 +03:00
Marvin Häuser
d7eb301e17 MdeModulePkg/PiSmmCore: Fix fixed address loading 2023-07-07 09:38:00 +03:00
Marvin Häuser
3a5ff7daee EmulatorPkg/Host: Fix XCODE5 build 2023-07-07 09:38:00 +03:00
Marvin Häuser
7a3d964d6b 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-07-07 09:38:00 +03:00
Marvin Häuser
6dcbb98d37 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-07-07 09:37:59 +03:00
Marvin Häuser
d82181f8c6 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-07-07 09:37:59 +03:00
Marvin Häuser
2fbf070521 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-07-07 09:37:59 +03:00
Marvin Häuser
635c09d6cb 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-07-07 09:37:59 +03:00
Mikhail Krichanov
671ee277b0 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-07-07 09:37:59 +03:00
Savva Mitrofanov
2849e25902 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-07-07 09:37:59 +03:00
Savva Mitrofanov
5b772e12ce 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-07-07 09:37:59 +03:00
Mike Beaton
cb770afa2b 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-07-07 09:37:59 +03:00
Mikhail Krichanov
496bb5c965 CI: Constructed separate workflows for common, arm, x86 packages and CodeQL.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Mikhail Krichanov
09057a1a5b 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-07-07 09:37:59 +03:00
Mikhail Krichanov
6ca8a30461 Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2023-07-07 09:37:59 +03:00
Mikhail Krichanov
ded02fa331 BaseTools: Removed GCC48/49 toolchains, refactored tools_def.template. 2023-07-07 09:37:59 +03:00
Savva Mitrofanov
f49ebbe84e UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
4b95233c0d 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-07-07 09:37:59 +03:00
Savva Mitrofanov
8efe81d86c MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00