30867 Commits

Author SHA1 Message Date
Mikhail Krichanov
d477fd49b1 MdeModulePkg/DxeCore: Use correct type for alignment mask
The page allocator code in CoreFindFreePagesI() uses a mask derived from
    its UINTN Alignment argument to align the descriptor end address of a
    MEMORY_MAP entry to the requested alignment, in order to check whether
    the descriptor covers enough sufficiently aligned area to satisfy the
    request.

    However, on 32-bit architectures, 'Alignment' is a 32-bit type, whereas
    DescEnd is a 64-bit type, and so the resulting operation performed on
    the end address comes down to masking with 0xfffff000 instead of the
    intended 0xffffffff_fffff000. Given the -1 at the end of the expression,
    the resulting address is 0xffffffff_fffffffff for any descriptor that
    ends on a 4G aligned boundary, and this is certainly not what was
    intended.

    So cast Alignment to UINT64 to ensure that the mask has the right size.

    Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
    Reported-by: Nathan Chancellor <nathan@kernel.org>
    Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-04-09 17:33:52 +02:00
Savva Mitrofanov
5a084dafde
.github/workflow: Split build workflow into multiple and add ARM targets
Adds new workflow for building and testing ARM targets. Also, it splits
previous build workflow into multiple parts: common packages,
x86 firmwares, ARM firmwares. In addition, it adds Windows PE tests.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-05 14:48:09 +06:00
Savva Mitrofanov
b4167ccdd4
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-04-05 14:48:08 +06:00
Savva Mitrofanov
6c9cb4f420
EmbeddedPkg/PrePiMemoryAllocationLib: Correct missing function argument
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-05 12:56:49 +06:00
Savva Mitrofanov
b877d75f50
EmbeddedPkg/PrePiLib: Correct function prototype
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-02 21:33:58 +06:00
vit9696
950de0d6fe MdePkg: Fix uninitialised access in SafeString 2023-04-02 15:50:10 +03:00
Marvin Häuser
b137c5414d MdePkg/BasePeCoffLib2: Read debug directory from the image memory 2023-04-02 00:04:47 +02:00
Marvin Häuser
94af9da84b MdePkg/BasePeCoffLib2: Distinguish between unsupported and corrupted 2023-04-02 00:04:47 +02:00
Marvin Häuser
35731d9829 UefiImageLib: Ensure consistently passing the full buffer size 2023-04-02 00:04:47 +02:00
Marvin Häuser
e15d23ca81 MdeModulePkg/RegularExpressionDxe: Fix XCODE5 build 2023-04-02 00:04:46 +02:00
Marvin Häuser
23e0a765a5 BaseTools/tools_def: Declare -Wno-unknown-warning-option for XCODE5 2023-04-02 00:04:46 +02:00
Marvin Häuser
b1851ef38d BaseTools/ImageTool: Fix PeScan error handling 2023-04-02 00:04:46 +02:00
Marvin Häuser
d5eecc2e2d BaseTools/ImageTool: Use AllocateAlignedCodePages() for images 2023-04-02 00:04:28 +02:00
Marvin Häuser
240e920841 BaseTools/ImageTool: Consume CommonMemoryAllocationLib 2023-04-01 23:59:10 +02:00
Marvin Häuser
f3fedad22d BaseTools/CommonLib: Guarantee 8-byte alignment for AllocatePool() 2023-04-01 19:17:12 +02:00
Marvin Häuser
c382e9c571 BaseTools/CommonLib: Consume MemoryAllocationLib 2023-03-30 17:15:19 +02:00
Marvin Häuser
7506a40c12 EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2023-03-30 17:15:19 +02:00
Marvin Häuser
db85482684 EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2023-03-30 17:15:19 +02:00
Marvin Häuser
eea8ba4030 MdePkg/UefiImageLib: Require callers to allocate aligned memory 2023-03-30 17:15:14 +02:00
Marvin Häuser
227871ad94 MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-03-30 16:18:09 +02:00
Marvin Häuser
31979d701f EmulatorPkg/Host: Consume MemoryAllocationLib 2023-03-30 16:18:09 +02:00
Marvin Häuser
b5b858f990 MdePkg: Introduce CommonMemoryAllocationLib 2023-03-30 16:18:09 +02:00
Marvin Häuser
cc4427d20c MdeModulePkg: Manage MemoryProfileLib separately 2023-03-30 16:18:09 +02:00
Marvin Häuser
0d53d302de MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-03-30 16:18:09 +02:00
Marvin Häuser
2a12deda9b EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2023-03-30 00:18:29 +02:00
Marvin Häuser
dff189ca49 MdeModulePkg/DxeCore: Remove orphaned CoreReadImageFile() 2023-03-30 00:18:28 +02:00
Marvin Häuser
059e6ecef9 MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2023-03-30 00:18:28 +02:00
Marvin Häuser
b74a1336a5 MdePkg/BasePeCoffLib2: Move ExtraAction to UefiImageLib 2023-03-30 00:18:28 +02:00
Marvin Häuser
0cd5908c7f BaseTools/ImageTool: Rename PreferredAddress to BaseAddress 2023-03-30 00:18:28 +02:00
Marvin Häuser
6ececb9b0c BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-03-29 21:37:14 +02:00
Marvin Häuser
2428dcb8c9 MdeModulePkg/DxeCore: Fix RelocationData type 2023-03-29 21:37:14 +02:00
Marvin Häuser
4e4c413daa UefiCpuPkg/CpuExceptionHandlerLib: Fix ImageContext type 2023-03-29 21:36:28 +02:00
Marvin Häuser
0725fe2554 MdePkg/BaseOverflowLib: Add missing Base.h includes 2023-03-29 21:36:28 +02:00
Marvin Häuser
46a55a1dc4 MdePkg/BasePeCoffLib2: Fix call to RelocateExtraAction 2023-03-29 19:57:39 +02:00
Marvin Häuser
f5fe05bccc EmulatorPkg: Fix some image loader related issues 2023-03-29 19:57:33 +02:00
Marvin Häuser
dc58fd4c5f EmulatorPkg: Fix Thunk PPI/Protocol library types 2023-03-28 23:52:27 +02:00
Marvin Häuser
7c28bde9dc EmulatorPkg/Host: Remove orphaned SecImageRead() 2023-03-28 23:52:27 +02:00
Marvin Häuser
c7a6facd38 ArmPlatformPkg/PrePi: Add missing UefiImageLib include 2023-03-28 23:52:27 +02:00
Marvin Häuser
d5e49c5c2d BaseTools/GenFv: Remove duplicated alignment macros 2023-03-28 23:52:27 +02:00
Marvin Häuser
eeba662f20 MdePkg/UefiImageLib: Convert to CRLF 2023-03-28 23:52:27 +02:00
Marvin Häuser
ea97361c29 ImageTool: Fix SymbolsPathLen inconsistencies 2023-03-28 23:52:27 +02:00
Marvin Häuser
fbb0bac451 MdeModulePkg/PiSmmCore: Fix fixed address loading 2023-03-28 15:55:57 +02:00
Marvin Häuser
47a3d5dc0c CI: Drop submodule update in favour of actions/checkout 2023-03-28 01:12:12 +02:00
Marvin Häuser
f9750fd19b .gitmodules: Track main OpenCorePkg branch 2023-03-28 00:38:11 +02:00
Marvin Häuser
db6d6cd55f devcontainer: Initial import 2023-03-28 00:36:41 +02:00
Marvin Häuser
2329159b11 Docker: Extend OpenCorePkg docker-compose 2023-03-28 00:36:34 +02:00
Marvin Häuser
1e71ff04c4 EmulatorPkg/Host: Fix XCODE5 build 2023-03-28 00:29:29 +02:00
Marvin Häuser
e30809d363 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-03-22 16:13:25 +01:00
Marvin Häuser
e958f25835 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-03-17 15:16:23 +03:00
Marvin Häuser
d24e8eb64a 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-03-17 15:16:23 +03:00