Commit 4d64eb7f authored by Grzegorz Jaszczyk's avatar Grzegorz Jaszczyk
Browse files

BACKPORT: FROMLIST: x86/of: add support for reserved memory defined by DT



The DT reserved-memory nodes can be present in DT as described in
Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml.
Similar to other architecture, which supports DT, there is a need to
create reserved memory regions for such nodes.

Additionally, the x86 architecture builds its memory map based on E820
description passed by bootloader and not on DT. Since x86 already has
some DT support and allows booting with both ACPI and DT at the same
time, let's register an arch specific hook which will validate if a
reserved-memory region passed by DT is valid (covered by E820 reserved
region entry).

Without this check, the reserved memory from DT could be successfully
registered, even though such a region could conflict with e820
description e.g. it could be described as E820_RAM and could be already
used at early x86 boot stage for memblock initialization (which happens
before DT parsing).

Co-developed-by: default avatarBartłomiej Grzesik <bgrzesik@google.com>
Signed-off-by: default avatarBartłomiej Grzesik <bgrzesik@google.com>
Signed-off-by: default avatarGrzegorz Jaszczyk <jaszczyk@google.com>

Backport-notes: calling hook registration and reserved memory scan was
moved after unflatten_and_copy_device_tree() due to missing
"of: reserved_mem: Restructure how the reserved memory regions are
processed" in android15-6.6-desktop. Refer to
https://android-review.git.corp.google.com/c/kernel/common/+/3553665/comment/b507e763_1c6edfbe/
for more info.

Bug: 399581144
Link: https://lore.kernel.org/all/20250418124718.1009563-3-jaszczyk@chromium.org/


Change-Id: If420f290f6331c4dfa840a05cf3ad51969137d2b
Signed-off-by: default avatarGrzegorz Jaszczyk <jaszczyk@google.com>
parent d9d07953
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment