31072 Commits

Author SHA1 Message Date
Mikhail Krichanov
d6b9b3c21b Added .md file summarizing current states of packages. 2023-05-09 18:24:30 +03:00
Mikhail Krichanov
fb8bf205c3 Fixed compilation of all packages tracked by CI after rebasing upon edk2-stable202302. 2023-05-09 18:24:30 +03:00
Marvin Häuser
8f3ea92eda BaseTools/build_rule: Drop deprecated ASM16 definition 2023-05-09 18:24:30 +03:00
Mikhail Krichanov
c7edf90a16 Drop support for the TE format 2023-05-09 18:24:29 +03:00
Marvin Häuser
8d93295a77 ArmPkg/ArmMmuLib: ASSERT ArmReplaceLiveTranslationEntry alignment 2023-05-09 18:24:29 +03:00
Marvin Häuser
5e15fce5d3 MdeModulePkg/ExtendedFirmwarePerformance: Fix FPDT struct alignment 2023-05-09 18:24:29 +03:00
Marvin Häuser
319a83ad2b UefiPayloadPkg/UefiPayloadEntry: Return image destination size as UINT32 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
e04de5db08 ArmPkg/ArmMmuLib: Fix ArmReplaceLiveTranslationEntry() alignment
As the ASM_FUNC() macro performs a section switch, the preceding
.balign directive applies the alignment constraint to the current
location in the previous section. As the linker may not merge the
sections in-order, ArmReplaceLiveTranslationEntry() may be left
unaligned.

Replace the explicit invocation of .balign with the ASM_FUNC_ALIGN()
macro, which guarantees the alignment constraint is applied correctly.
To make sure related issues are reliably caught in the future, align the
end of the function before checking the total occupied size. This
ensures crossing a 0x200 boundary will cause a compilation error.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-05-09 18:24:29 +03:00
Mikhail Krichanov
c16951f06e ArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN()
With the current ASM_FUNC() macro, there is no good way to declare an
alignment constraint for a function. As ASM_FUNC() switches sections,
declaring the constraint before the macro invocation applies it to the
current location in the previous section. Declaring the constraint after
the macro invocation lets the function label point to the location prior
to alignment. Depending on toolchain behaviour, this may cause the label
to point to alignment padding preceding the actual function definition.

To address these issues, introduce the ASM_FUNC_ALIGN() macro, which
declares the alignment constraint right before the function label.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-05-09 18:24:29 +03:00
Mikhail Krichanov
bef3e16d5d MdePkg/ProcessorBind AARCH64: Add asm macro to emit GNU BTI note
Implement a CPP macro that can be called from .S files to emit the .note
section carrying the annotation that informs the linker that the object
file is compatible with BTI control flow integrity checks.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
2023-05-09 18:24:29 +03:00
Savva Mitrofanov
f3d158c6a0 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-05-09 18:24:29 +03:00
vit9696
b063a20c61 MdePkg: Fix uninitialised access in SafeString 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
c2aa73cf3d UefiImageLib: Ensure consistently passing the full buffer size 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
002702671a BaseTools/CommonLib: Consume MemoryAllocationLib 2023-05-09 18:24:29 +03:00
Marvin Häuser
2dcbc0591a EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2023-05-09 18:24:29 +03:00
Marvin Häuser
5ac7f80191 EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2023-05-09 18:24:29 +03:00
Marvin Häuser
9ef906f695 MdePkg/UefiImageLib: Require callers to allocate aligned memory 2023-05-09 18:24:29 +03:00
Marvin Häuser
91f0ea84f1 MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-05-09 18:24:29 +03:00
Marvin Häuser
581e3aa89a EmulatorPkg/Host: Consume MemoryAllocationLib 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
4c8f3ef802 MdePkg: Introduce CommonMemoryAllocationLib 2023-05-09 18:24:29 +03:00
Marvin Häuser
91775aef7f MdeModulePkg: Manage MemoryProfileLib separately 2023-05-09 18:24:29 +03:00
Marvin Häuser
dcce25f5f6 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-05-09 18:24:29 +03:00
Marvin Häuser
1efda6d0c8 EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2023-05-09 18:24:29 +03:00
Marvin Häuser
365039693c MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2023-05-09 18:24:29 +03:00
Marvin Häuser
124e8a5ec2 BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-05-09 18:24:29 +03:00
Marvin Häuser
a521baefbd EmulatorPkg: Fix some image loader related issues 2023-05-09 18:24:29 +03:00
Marvin Häuser
d1ba5a8064 EmulatorPkg: Fix Thunk PPI/Protocol library types 2023-05-09 18:24:29 +03:00
Marvin Häuser
ca3235b347 EmulatorPkg/Host: Remove orphaned SecImageRead() 2023-05-09 18:24:29 +03:00
Marvin Häuser
ad21bf30bc BaseTools/GenFv: Remove duplicated alignment macros 2023-05-09 18:24:29 +03:00
Marvin Häuser
414fd1789b MdeModulePkg/PiSmmCore: Fix fixed address loading 2023-05-09 18:24:29 +03:00
Marvin Häuser
03b44331ec EmulatorPkg/Host: Fix XCODE5 build 2023-05-09 18:24:29 +03:00
Marvin Häuser
d67c631c7c UefiCpuPkg/CpuExceptionHandlerLib: Fix wrong use of relative addressing
HookAfterStubHeader is copied before execution. Thus, relative
addressing cannot safely be used for anything outside the copy range.
Fix the reference of HookAfterStubHeaderEnd to be absolute.

This change alone violates an undocumented requirement that
HookAfterStubHeader and AsmIdtVector are structurally equivalent (their
respective sizes in particular). Resolve this by treating them (and in
particular their sizes) independently.
2023-05-09 18:24:28 +03:00
Marvin Häuser
52aff92912 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-05-09 18:24:28 +03:00
Marvin Häuser
e21683c782 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-05-09 18:24:28 +03:00
Marvin Häuser
1aae1df13e 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-05-09 18:24:28 +03:00
Marvin Häuser
1ae00e9036 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-05-09 18:24:28 +03:00
Marvin Häuser
cfee123a4e 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-05-09 18:24:28 +03:00
Mikhail Krichanov
360279542d 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-05-09 18:24:28 +03:00
Savva Mitrofanov
0d533c0293 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-05-09 18:24:28 +03:00
Savva Mitrofanov
73ff8aa3c9 UefiCpuPkg: Removes Xcode5SecPeiCpuExceptionHandlerLib
We don't need this XCODE5-specific lib anymore due to recent rodata
changes

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
7c6f401593 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-05-09 18:24:28 +03:00
Savva Mitrofanov
20e7a9319f 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-05-09 18:24:28 +03:00
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