31120 Commits

Author SHA1 Message Date
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
Marvin Häuser
8ab268389f BaseUefiImageLib: Fix segment logging 2023-05-09 18:24:30 +03:00
Marvin Häuser
6d772a4b8e MdePkg/BasePeCoffLib2: Fix uninitialized RtContext for RelocateImage() 2023-05-09 18:24:30 +03:00
Marvin Häuser
3a16df0e2d MdePkg/BasePeCoffLib2: Fix RuntimeRelocate sanity-check 2023-05-09 18:24:30 +03:00
Marvin Häuser
c790116e13 ImageTool: Relocate using the IR 2023-05-09 18:24:30 +03:00
Marvin Häuser
4fccfa0359 ImageTool: Always store the full image segment data, including padding 2023-05-09 18:24:30 +03:00
Marvin Häuser
108c0769ad ImageTool: Don't shrink segment DataSize during validation 2023-05-09 18:24:30 +03:00
Marvin Häuser
efc88fb685 MdePkg/PeCoffLib2: Expose ARM Thumb MOVW/MOVT relocation helpers 2023-05-09 18:24:30 +03:00
Marvin Häuser
98179a20bf BaseTools: Simplify ELF-to-PE build 2023-05-09 18:24:30 +03:00
Marvin Häuser
141a48425c ImageTool: Unify 32-bit and 64-bit tool variants 2023-05-09 18:24:30 +03:00
Marvin Häuser
270a038c4d ImageTool: Don't output errors for ElfScan() RETURN_UNSUPPORTED 2023-05-09 18:24:30 +03:00
Marvin Häuser
35049dd27c ImageTool: Remove ImageInfo global state 2023-05-09 18:24:30 +03:00
Marvin Häuser
49d174dd95 ImageTool: Remove global state from ELF scanning 2023-05-09 18:24:30 +03:00
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