30791 Commits

Author SHA1 Message Date
Mikhail Krichanov
c9b10ce0c1 MdePkg: Redefined DEBUG_RAISE() to facilitate fuzzing. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
2bb2e22db8 BaseTools: Reduced minimal alignment to 32 bytes. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
6117177c2e BaseTools: Added MDEPKG_REDUCE_FW_SIZE and MDEPKG_MERGE_RODATA_INTO_TEXT build options. 2023-03-16 12:20:13 +03:00
Savva Mitrofanov
fe193d6384 .github/workflows: Uploads OvmfPkg artifacts and test them using QEMU
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-03-13 20:48:55 +06:00
Mikhail Krichanov
fc981b0891 UefiPayloadPkg: Increased FD_SIZE to fix VS2019 NOOPT build. 2023-03-13 20:48:55 +06:00
Mikhail Krichanov
7836cea3bd BaseTools: Fixed VS2019 build by removing EFI_IMAGE_SCN_MEM_DISCARDABLE flag from .xdata and .pdata sections and as a result correcting DataRVA inside .hii. 2023-03-13 20:48:55 +06:00
Savva Mitrofanov
9c0a615470
Corrects ocbuild branch in docker-compose.yml 2023-03-09 21:21:18 +06:00
Savva Mitrofanov
3f8cfa4d44
OvmfPkg: Corrects default values in OvmfPkgIa32X64.dsc
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-03-09 17:12:10 +06:00
Marvin Häuser
9f35d83d71 BaseTools/tools_def: Introduce MTOC_PREFIX environment variable
Most compiler toolchains and tools have support for PREFIX environment
variables to specify their location, but Apple mtoc does not. While
it used to be in a stable install location, it has recently been
deprecated and ocmtoc is maintained as a fork. Homebrew has accepted
ocmtoc into its repository, including its ARM version. As Homebrew on
ARM does not install its packages into /usr/local, XCODE5 currently
does not work on Apple silicon with ocmtoc installed via Homebrew.

Introduce the MTOC_PREFIX environment variable to customize the
installation location of Apple mtoc or ocmtoc.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-06 20:16:39 +01:00
Savva Mitrofanov
85989f6bf7
Build: Updated OpenCore submodule to current master branch
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-28 18:53:13 +06:00
Savva Mitrofanov
7052c3badf
FatPkg: Corrects FatDelete exit logic if PcdFatReadOnlyMode is set
The FatDelete routine closes the file even it write protected

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-28 18:37:36 +06:00
Savva Mitrofanov
18722f129f FatPkg: Don't try to open file for write/create for RO mode
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-23 00:47:34 +03:00
Savva Mitrofanov
acfb8ae13a FatPkg: Early-exit from writing functions when enforced RO mode
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-23 00:47:34 +03:00
Savva Mitrofanov
5b09f83e0c 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-02-23 00:47:34 +03:00
Savva Mitrofanov
c8a9df31b3
Build: Updated OpenCore submodule to current master branch. 2023-02-22 17:55:25 +06:00
Savva Mitrofanov
b78e1e0e5a
BaseTools: Fix MSVC build due to missing Crc32 symbols
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-22 17:39:14 +06:00
Savva Mitrofanov
b96cbb7cfa
.github/workflows: Update build workflow
Doesn't rebuild basetools on every package

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-20 15:58:44 +06:00
Savva Mitrofanov
ff3d00d4d4
Ext4Pkg: Fixes double-free in Ext4ReadSymlink
The SymlinkTmp was deallocated unconditionally, so we shouldn't free it
again on EFI_ERROR

Cc: Marvin Häuser <mhaeuser@posteo.de>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Fixes: e81432fbacb7 ("Ext4Pkg: Add symbolic links support")
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-17 00:11:13 +06:00
Savva Mitrofanov
d24fd429be
Ext4Pkg: Code correctness and security improvements
Applies latest upstream changes, which performs minor changes into
previous patchset

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-16 21:20:02 +06:00
Savva Mitrofanov
63360b588f
.github/workflows: Adds build workflow
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-15 20:21:34 +06:00
Savva Mitrofanov
2e8901738b
UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-15 20:21:28 +06:00
Savva Mitrofanov
7c7ec2efd8
MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-15 20:21:27 +06:00
Savva Mitrofanov
54539b807e
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-02-15 20:21:11 +06:00
vit9696
1a98b00817 Revert "OvmfPkg/OvmfPkgX64: Increase DXEFV size"
This reverts commit fd547e49ea4ec151623257699b7d6fba9ebd1ac9.

Changes in this commit result in JOS failing to start due to 1500000h
becoming occupied.
2023-02-13 23:42:13 +03:00
Savva Mitrofanov
9fd29bbc8d
OvmfPkg/OvmfPkgX64: Removes DEBUG_ON_SERIAL_PORT define
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-12 23:18:11 +06:00
Savva Mitrofanov
9646f2c4bc
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-02-12 23:18:05 +06:00
Savva Mitrofanov
858d91c7c6
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-02-12 23:18:00 +06:00
Savva Mitrofanov
dd971fc1e5
OvmfPkg/OvmfPkgIa32X64: Increase PEIFV size
The NOOPT build target produces greater overall size of PEI modules than available inside firmware volume, which leads to GenFv invalid size
error

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-12 23:17:56 +06:00
Savva Mitrofanov
fd547e49ea
OvmfPkg/OvmfPkgX64: Increase DXEFV size
The NOOPT build target produces greater overall size of DXE modules than
available inside firmware volume, which leads to GenFv invalid size
error

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-12 23:17:47 +06:00
Savva Mitrofanov
bdf03f766c
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-02-12 21:07:06 +06:00
Marvin Häuser
418524ac00 BaseTools: Rename __RELOC_FIX to __RO_RELOCS 2023-02-12 14:51:26 +01:00
Marvin Häuser
f5b2118058 BaseTools: Add -require_read_only_relocs to MTOC_FLAGS 2023-02-12 14:51:26 +01:00
Marvin Häuser
742a1e3326 BaseTools: Support read-only data for ASLC 2023-02-12 14:51:26 +01:00
Marvin Häuser
1eff93c8e2 BaseTools: ASLC files may not contain relocs 2023-02-12 14:51:26 +01:00
Marvin Häuser
bb53e3652b BaseTools: Fix __RELOC_FIX generation to always use a populated section 2023-02-12 14:51:26 +01:00
vit9696
0dfb926bb5 MdeModulePkg/Core: Fix DxeCore entry not being added to DebugTable
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
2023-02-12 11:23:14 +03:00
Vitaly Cheptsov
d230c91de9 MdePkg/BasePeCoffLib2: Remove DEBUG_RAISE on invalid DebugDir size
EfiBoot images contain a sum of EFI_IMAGE_DEBUG_DIRECTORY_ENTRY and
EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY sizes in DebugDir size.
Since our XCODE5 toolchain generates NB10 debug entries and we do not
have access to Apple DEBUG symbols, just ignore this debug information.

Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
2023-02-12 09:57:12 +03:00
Mikhail Krichanov
76d8185b5c ImageTool: Fixed "Blue Screen" problem for CLANGDWARF. 2023-02-10 14:00:28 +03:00
Savva Mitrofanov
9e4ebf488e BaseTools/tools_def: Add read_only_relocs arg to X64 target on XCODE5
For now "-read_only_relocs suppress" is safe, as relocations can now
target __TEXT without triggering the issue with Mach-O relocation
offsets

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-10 14:00:28 +03:00
Mikhail Krichanov
0212a1af87 ImageTool: Refactored relocs calculation. 2023-02-10 14:00:28 +03:00
Mikhail Krichanov
4a7bcc4251 ImageTool: Fixed GOTPCREL relocations for GCC5. 2023-02-10 14:00:28 +03:00
Mikhail Krichanov
8e421ef0e3 BaseTools: Fixed sh_addralign field in ELF files, removed useless checks in ImageTool. 2023-02-10 14:00:28 +03:00
Mikhail Krichanov
8e6e4d1be4 ImageTool: Removed recalculation of virtual addresses, asssuming they are the same both in ELF and PE files. 2023-02-10 14:00:28 +03:00
Mikhail Krichanov
ec2ea092ed BaseTools: Moved .rodata into a separate section, enforced appropriate .rodata names for different toolchains. 2023-02-10 14:00:28 +03:00
Mikhail Krichanov
464cf15edb BaseTools: United GCC and CLANG linker scripts, set default 4K alignment for all toolchains. 2023-02-10 14:00:28 +03:00
Mikhail Krichanov
46de80ddd2 OvmfPkg: Removed useless DEFINE. 2023-02-10 14:00:28 +03:00
Savva Mitrofanov
d8e2a00f61
UefiPayloadPkg: Increase FD_SIZE for NOOPT target
Fixes recent NOOPT builds using MSVC toolchain

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>4
2023-02-08 18:28:08 +06:00
Savva Mitrofanov
087ef41f7e
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-02-08 18:27:40 +06:00
Savva Mitrofanov
ff658eb1a2
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>
2023-02-06 16:20:09 +06:00
Savva Mitrofanov
be5e5b1f99
BaseTools: 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>
2023-02-06 16:20:08 +06:00