OvmfPkg: Update LINUX_LOADER to allow unaligned user images

Required in some distros, e.g. SliTaz. In that example bootx64.efi is the
kernel plus an extra loader which fetches its params from a text file.
That image has section alignment 0x20, whereas the default (0x7)
PcdImageProtectionPolicy enforces section alignment of EFI_PAGE_SIZE=0x1000
for all images.

In OpenDuet and OpenCore native loader the Pcd is already set to 0x03,
to not enforce this for user images (to allow legacy Apple images) - so
this distro I believe would already load via Duet; but this change is
required for it to load in AUDK OVMF.
This commit is contained in:
Mike Beaton 2024-03-13 17:02:59 +00:00
parent 11bfa6a102
commit 13f99fa7cb
4 changed files with 4 additions and 0 deletions

View File

@ -485,6 +485,7 @@
# Allow execution of EfiReservedMemoryType, EfiConventionalMemory, EfiBootServicesData and EfiLoaderData memory regions.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xFFFFFFFFFFFFFF40
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003
!else
# Allow execution of EfiConventionalMemory and EfiBootServicesData memory regions.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xFFFFFFFFFFFFFF45

View File

@ -592,6 +592,7 @@
# Allow execution of EfiReservedMemoryType, EfiConventionalMemory, EfiBootServicesData and EfiLoaderData memory regions.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xFFFFFFFFFFFFFF40
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003
!elseif $(WINDOWS_10_IA32) == TRUE
# Allow execution of EfiReservedMemoryType, EfiConventionalMemory, EfiBootServicesData and EfiRuntimeServicesData memory regions.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xFFFFFFFFFFFFFF04

View File

@ -607,6 +607,7 @@
# Allow execution of EfiReservedMemoryType, EfiConventionalMemory, EfiBootServicesData and EfiLoaderData memory regions.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xFFFFFFFFFFFFFF40
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003
!endif
################################################################################

View File

@ -623,6 +623,7 @@
# Allow execution of EfiReservedMemoryType, EfiConventionalMemory, EfiBootServicesData and EfiLoaderData memory regions.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xFFFFFFFFFFFFFF40
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003
!endif
################################################################################