31134 Commits

Author SHA1 Message Date
Mikhail Krichanov
2009ea50f3 Build: Switched ocbuild to audk-stable-202302 branch. 2023-07-07 10:30:05 +03:00
Savva Mitrofanov
eb0955c10d
CI: Remove Dependabot configuration 2023-07-05 16:10:46 +06:00
Pedro Falcato
583b54f824
Ext4Pkg: Skip zero-sized extents
Zero-sized extents should not be cached nor considered valid, as they
have no meaning. As such, reject them outright when caching extents.
This makes it so callers do not need to check for ee_len = 0 before
using the result, which, if not done, can result in possible infinite
loops.

Cc: Marvin Häuser <mhaeuser@posteo.de>
Fixes: d9ceedca6c8f ("Ext4Pkg: Add Ext4Dxe driver.")
Reported-by: Savva Mitrofanov <savvamtr@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
2023-07-03 13:54:43 +06:00
Savva Mitrofanov
20a4d1a54e
Ext4Pkg: Fix GdtCsum calculation for block group descriptor
Doesn't take into account the empty checksum field and passes the correct initial value of 0xFFFF into the CRC16-ANSI function

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-29 12:51:58 +03:00
Savva Mitrofanov
a166c3d82f
MdePkg/BaseLib: Correct CRC-16-ANSI implementation
The ANSI implementation assumes that initial value should be 0xFFFF and
the result shouldn't be inverted

Fixes: 92288f4 ("MdePkg/BaseLib: Add CRC16-ANSI and CRC32c implementations")
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-28 20:33:14 +03:00
Mikhail Krichanov
6ca1d30f60 ArmPkg: Replaced Drivers/CpuDxe with Library/CpuArchLib. 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
dc770393a3 IntelTdx: Removed superfluous TdxSharedBitMask field in EFI_HOB_PLATFORM_INFO 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
8bce5dd9f0 OvmfPkg/IntelTdx: Replaced CpuDxe with CpuArchLib. 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
8a70dcfaec MdeModulePkg/Core/Dxe: Turned on memory protection right after CPU Arch protocol initialization. 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
14b38f155e MdeModulePkg/Core/Dxe: Fixed boot of OvmfPkgIa32X64.dsc failing due to common mExceptionHandlerData for DxeCore and CpuArchLib. 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
cec94399d6 MdeModulePkg/Core/Dxe: Called ProtectUefiImage() for DxeCore.efi right after initialization of CPU Architectural protocol. 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
2f0024e283 MdeModulePkg/Core/Dxe: Initialized CPU Architectural Protocol immediately after initializing GCD Services.
Initialized Multi-processor support after calling 
ProcessLibraryConstructorList() because of its dependency on TimerLib.
2023-06-14 11:09:38 +03:00
Mikhail Krichanov
0369b4600c UefiCpuPkg, OvmfPkg: Eliminated dependency of CpuArchLib from DynamicPcds: PcdPteMemoryEncryptionAddressOrMask, PcdTdxSharedBitMask. This information is now obtained from EFI_HOB_PLATFORM_INFO directly. 2023-06-14 11:09:38 +03:00
Mikhail Krichanov
28743ca0ee UefiCpuPkg, OvmfPkg: Eliminated dependencies of PeiMpInitLib, DxeMpInitLib
from DynamicPcds: PcdCpuMaxLogicalProcessorNumber, 
PcdCpuBootLogicalProcessorNumber, PcdGhcbBase, 
PcdConfidentialComputingGuestAttr.
This information is now obtained from EFI_HOB_PLATFORM_INFO directly.
2023-06-14 11:09:38 +03:00
Mikhail Krichanov
c810b25601 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-06-14 11:09:38 +03:00
Mikhail Krichanov
91f8b375ca MdeModulePkg/Dxe/Core: Expose services tables early
The current image DxeCore re-uses the generic UEFI implementations of
DxeServicesTableLib, UefiBootServicesTableLib, and
UefiRuntimeServicesTableLib. As such, the respective pointers are not
available till the library constructors have been called.

Use the DxeCore library instances for the services tables for them to
be available earlier. This for example allows the usage of DXE memory
protection services by externally linked modules before reaching
library construction stage.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-06-14 11:09:38 +03:00
Mikhail Krichanov
25204d87a7 MdeModulePkg: Introduce DxeCore services library instances
The current image DxeCore re-uses the generic UEFI implementations of
DxeServicesTableLib, UefiBootServicesTableLib, and
UefiRuntimeServicesTableLib. As it is the owner of those pointers
however, it can expose them without further indirection.

Import library instances of the services table libraries specifically
for DxeCore to expose its internal pointers dirtectly.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-06-14 11:09:38 +03:00
Mikhail Krichanov
e67903fa65 IntelFsp2WrapperPkg: Fixed compilation. 2023-06-05 20:08:35 +03:00
Mikhail Krichanov
653d1195f1 IntelTdx: Fixed compilation and boot after switching to SecurePE loader. 2023-06-05 19:13:46 +03:00
Savva Mitrofanov
d9bb10ae3b
Build: Upgrade OpenCorePkg
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-22 15:01:50 +03:00
Mikhail Krichanov
16c414c1e8 OvmfPkg, BaseTools: Fixed Amaranth compilation for gcc-12.3.0. 2023-05-17 16:57:00 +03:00
Savva Mitrofanov
d56c3a5610
Ext4Pkg: Correct MSVC compilation
MaxExtentsPerNode should be same type as eh_max uint16, because maximum
count of extent header entries is 65535

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-12 19:46:53 +03:00
Pedro Falcato
5e87e3bcd7
Ext4Pkg: Advertise CSUM_SEED as supported
We had added support for CSUM_SEED but accidentally forgot to advertise
it in gSupportedIncompatFeat. This made it (erroneously) impossible to
mount CSUM_SEED filesystems.

Detected by attempting to mount a relatively new mkfs.ext4'd filesystem.

Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2023-05-12 15:38:11 +03:00
Pedro Falcato
174fc2fbb9
Ext4Pkg: Improve extent node validation on the number of entries
Improve the extent tree node validation by validating the number of
entries the node advertises against the theoretical max (derived from
the size of on-disk structs and the block size (or i_data, if inline
extents).

Previously, we did not validate the number of entries. This could be
exploited for out-of-bounds reads and crashes.

Cc: Marvin Häuser <mhaeuser@posteo.de>
Fixes: d9ceedca6c8f ("Ext4Pkg: Add Ext4Dxe driver.")
Reported-by: Savva Mitrofanov <savvamtr@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2023-05-12 15:38:03 +03:00
Pedro Falcato
10ad1cf2c6
Ext4Pkg: Move unicode collation initialization to Start()
There have been reports[1] of failures to boot due to unicode collation
protocols not being available at Ext4Dxe load time. Therefore, attempt
to initialize unicode collation at Start() time, like done previously in
FatPkg/EnhancedFatDxe. By doing so, we move collation initialization
to BDS, where the module responsible for protocol installation should
have already been loaded and ran.

[1]: https://edk2.groups.io/g/devel/message/100312

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Marvin Häuser <mhaeuser@posteo.de>
Fixes: d9ceedca6c8f ("Ext4Pkg: Add Ext4Dxe driver.")
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2023-05-12 15:37:48 +03:00
PMheart
c546b66aa4 Build: Use latest Windows image (#33) 2023-05-10 10:16:26 +03:00
Marvin Häuser
0c7d4d57cb MdePkg/BasePeCoffLib2: Fix invalid ASSERT for when RelocDirSize == 0 2023-05-10 10:16:05 +03:00
Gerd Hoffmann
4d8020f9e7 OvmfPkg/NestedInterruptTplLib: replace ASSERT() with a warning logged
OVMF can't guarantee that the ASSERT() doesn't happen.  Misbehaving
EFI applications can trigger this.  So log a warning instead and try
to continue.

Reproducer: Fetch windows 11 22H2 iso image, boot it in qemu with OVMF.

Traced to BootServices->Stall() being called with IPL=TPL_HIGH_LEVEL
and Interrupts /enabled/ while windows is booting.

Cc: Michael Brown <mcb30@ipxe.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2023-05-09 18:24:31 +03:00
Mikhail Krichanov
9f0721d0ea CI: Added WINDOWS_10_IA32 option to fix 32-bit Windows' boot tests. 2023-05-09 18:24:31 +03:00
Mikhail Krichanov
8f851e5093 CI: Upgraded qemu. 2023-05-09 18:24:31 +03:00
vit9696
dee2fa02b8 Build: Upgrade OpenCorePkg 2023-05-09 18:24:31 +03:00
Marvin Häuser
58021b2e7b ImageTool: Replace QuickSort with qsort 2023-05-09 18:24:31 +03:00
Marvin Häuser
cf1422b7eb BaseTools/GenFds: Fix reloc-stripped file name typo 2023-05-09 18:24:31 +03:00
Marvin Häuser
5d71d5f204 ImageTool: Remove old HII functionality 2023-05-09 18:24:31 +03:00
Marvin Häuser
820d54669f BaseTools: Introduce new HII section design 2023-05-09 18:24:31 +03:00
Marvin Häuser
3cbb3f3c55 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2023-05-09 18:24:31 +03:00
Marvin Häuser
c80ad49870 BaseTools/GenFv: Remove .text and .data from FV map 2023-05-09 18:24:30 +03:00
Marvin Häuser
2ab0dbf987 BaseTools: Remove GenFw 2023-05-09 18:24:30 +03:00
Marvin Häuser
8d2d635a7a BaseTools/Python: Replace GenFw with ImageTool 2023-05-09 18:24:30 +03:00
Marvin Häuser
6567f22721 ImageTool: Update command syntax to suit BaseTools/GenMake 2023-05-09 18:24:30 +03:00
Marvin Häuser
eb498a2fc3 ImageTool: Support FixedAddress 2023-05-09 18:24:30 +03:00
Marvin Häuser
5ed47e7c71 ImageTool: Utilize UefiImageLib 2023-05-09 18:24:30 +03:00
Marvin Häuser
dcdb8d3425 MdePkg/UefiImageLib: Add API for the image format ID 2023-05-09 18:24:30 +03:00
Marvin Häuser
b9a2fa8473 ImageTool: Support stripping relocs 2023-05-09 18:24:30 +03:00
Marvin Häuser
5bbcef04ab MdePkg/BaseUefiImageLib: Factor out ExecutionSupport 2023-05-09 18:24:30 +03:00
Marvin Häuser
41a8eaf22b ImageTool: Separate image generation from file I/O logic 2023-05-09 18:24:30 +03:00
Marvin Häuser
3f044a39b8 ImageTool: Make IR canonical and compare input/output IRs 2023-05-09 18:24:30 +03:00
Marvin Häuser
a68aaab3c1 ImageTool: Make ELF SymbolsPath optional 2023-05-09 18:24:30 +03:00
Marvin Häuser
5548b0a92e Remove hacks related to former lack of XCODE5 .hii support 2023-05-09 18:24:30 +03:00
Marvin Häuser
857d3804c7 ImageTool: Append .hii during PE generation 2023-05-09 18:24:30 +03:00