boot/stub: allocate pages for combined initrds below 4GiB only on x86 (#35149)
authorandre4ik3 <little.ice3735@fastmail.com>
Thu, 14 Nov 2024 04:20:09 +0000 (08:20 +0400)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 04:20:09 +0000 (13:20 +0900)
commit6e207b370e91e681efb08c497a6c8ad78e3c8d83
tree210f6c19295de0ce1930db1f3026617be916613f
parent1507899383e39df0c66fbb1047a92d6e379efcc4
boot/stub: allocate pages for combined initrds below 4GiB only on x86 (#35149)

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
src/boot/boot.c
src/boot/stub.c
src/boot/util.h