mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
boot: allocate cleanup pages below 4GiB only on x86
Outside of x86, some machines (e.g. Apple silicon, AMD Opteron A1100) have physical memory mapped above 4GiB, meaning this allocation will fail, causing the entire boot process to fail on these machines. This commit makes it so that the below-4GB address space allocation requirement is only set on x86 platforms, and not on other platforms (that don't have the specific Linux x86 boot protocol), thereby fixing boot on those that have no memory mapped below 4GiB in their address space. Tested on an Apple silicon M1 laptop and an AMD x86_64 desktop tower. Fixes: #35026 Manual backport of 6e207b370e91e681efb08c497a6c8ad78e3c8d83. (cherry picked from commit a9d9db7f4e4a75f6dbda5c31fbbf325eff9d63b4) (cherry picked from commit 8923d937684dba17a84dc3693e77adeb4a4f4ec8) (cherry picked from commit 6f0a01d3c01da0dae1eb744429b77b3d310a24ff)
This commit is contained in:
parent
bddd7a10ad
commit
9601ac90fe
@ -44,11 +44,20 @@ static EFI_STATUS combine_initrd(
|
||||
n += extra_initrd_sizes[i];
|
||||
}
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
_cleanup_pages_ Pages pages = xmalloc_pages(
|
||||
AllocateMaxAddress,
|
||||
EfiLoaderData,
|
||||
EFI_SIZE_TO_PAGES(n),
|
||||
UINT32_MAX /* Below 4G boundary. */);
|
||||
#else
|
||||
_cleanup_pages_ Pages pages = xmalloc_pages(
|
||||
AllocateAnyPages,
|
||||
EfiLoaderData,
|
||||
EFI_SIZE_TO_PAGES(n),
|
||||
0 /* Ignored. */);
|
||||
#endif
|
||||
|
||||
uint8_t *p = PHYSICAL_ADDRESS_TO_POINTER(pages.addr);
|
||||
if (initrd_base != 0) {
|
||||
size_t pad;
|
||||
|
Loading…
x
Reference in New Issue
Block a user