Skip to content

Allow !no-map GPU reserved ranges and map them#432

Merged
marcan merged 2 commits intomainfrom
lina/reserved-ranges
Jan 24, 2025
Merged

Allow !no-map GPU reserved ranges and map them#432
marcan merged 2 commits intomainfrom
lina/reserved-ranges

Conversation

@hoshinolina
Copy link
Contributor

This should make the behavior with and without u-boot (mostly) consistent. I think u-boot also adds mem ranges for no-map reserved ranges (then the kernel doesn't map them as requested), but that shouldn't make much of a difference.

This is set in the device trees anyway, but a future kernel release may
rely on this being *not* set.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Copy link
Member

@jannau jannau left a comment

Choose a reason for hiding this comment

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

Have you tested if u-boot still works with this?

src/kboot.c Outdated
{
const char *name = fdt_get_name(dt, node, NULL);
const char *status = fdt_getprop(dt, node, "status", NULL);
if (status && !strcmp(status, "disabled"))
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised libfdt misses a function for this

This is the same thing U-Boot does for the EFI mem map, and means these
ranges get a `struct page` in the kernel.

Signed-off-by: Asahi Lina <lina@asahilina.net>
@hoshinolina
Copy link
Contributor Author

hoshinolina commented Jan 24, 2025

Have you tested if u-boot still works with this?

It seems to work fine. I think u-boot just merges everything together into its own memory map. The DT still contains a subset of memory ranges (main + the map ones this adds), and u-boot still reports all reserved-memory ranges (including no-map) in the EFI mem map to the kernel.

@marcan marcan merged commit d2956e4 into main Jan 24, 2025
3 checks passed
@svenpeter42 svenpeter42 deleted the lina/reserved-ranges branch August 10, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants