Skip to content

boot/stub: allocate pages for combined initrds below 4GiB only on x86#35149

Merged
yuwata merged 3 commits intosystemd:mainfrom
andre4ik3:main
Nov 14, 2024
Merged

boot/stub: allocate pages for combined initrds below 4GiB only on x86#35149
yuwata merged 3 commits intosystemd:mainfrom
andre4ik3:main

Conversation

@andre4ik3
Copy link
Contributor

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

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: systemd#35026
@github-actions github-actions bot added sd-boot/sd-stub/bootctl please-review PR is ready for (re-)review by a maintainer labels Nov 13, 2024
Copy link
Member

@bluca bluca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for a start, for the next release we can see if we can drop the legacy protocol entirely

@bluca bluca changed the title boot: allocate cleanup pages below 4GiB only on x86 boot: allocate pages for combined initrds below 4GiB only on x86 Nov 13, 2024
@bluca bluca changed the title boot: allocate pages for combined initrds below 4GiB only on x86 boot/stub: allocate pages for combined initrds below 4GiB only on x86 Nov 13, 2024
@poettering
Copy link
Member

Can you please add a wrapper xmalloc_initrd() or so?

@andre4ik3
Copy link
Contributor Author

andre4ik3 commented Nov 13, 2024

Is it ok to put it in initrd.h or should I put it elsewhere?

@bluca bluca added this to the v257 milestone Nov 13, 2024
@bluca bluca added the rc-blocker 🚧 PRs and Issues tagged this way are blocking the upcoming rc release! label Nov 13, 2024
@yuwata yuwata removed the please-review PR is ready for (re-)review by a maintainer label Nov 14, 2024
@yuwata yuwata added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Nov 14, 2024
@yuwata yuwata merged commit 6e207b3 into systemd:main Nov 14, 2024
@github-actions github-actions bot removed good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed squash-on-merge labels Nov 14, 2024
@bluca bluca removed the rc-blocker 🚧 PRs and Issues tagged this way are blocking the upcoming rc release! label Nov 14, 2024
goenkam pushed a commit to goenkam/systemd that referenced this pull request Jan 8, 2025
…systemd#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: systemd#35026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

systemd-boot 256.7 fails to boot on machines with no physical memory below 4GiB boundary

5 participants