diff options
author | Julius Werner <jwerner@chromium.org> | 2018-05-08 17:09:57 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2018-05-10 01:24:40 +0000 |
commit | ae05d095b36ac835a6b1a221e6858065e5486888 (patch) | |
tree | ebf1fd3d64d53e76afb3d95b343773176776967d /src/include/bootmem.h | |
parent | 40e6d2ebbd982fdccf9ecdb7981b746ad0493445 (diff) | |
download | coreboot-ae05d095b36ac835a6b1a221e6858065e5486888.tar.xz |
bootmem: Keep OS memory map separate from the start
The patch series ending in 64049be (lib/bootmem: Add method to walk OS
POV memory tables) expanded the bootmem framework to also keep track of
memory regions that are only relevant while coreboot is still executing,
such as the ramstage code and data. Mixing this into the exsting bootmem
ranges has already caused an issue on CONFIG_RELOCATEABLE_RAMSTAGE
boards, because the ramstage code in CBMEM is marked as BM_RAMSTAGE
which ends up getting translated back to LB_RAM in the OS tables. This
was fixed in 1ecec5f (lib/bootmem: ensure ramstage memory isn't given to
OS) for this specific case, but unfortunately Arm boards can have a
similar problem where their stack space is sometimes located in an SRAM
region that should not be made available as RAM to the OS.
Since both the resources made available to the OS and the regions
reserved for coreboot can be different for each platform, we should find
a generic solution to this rather than trying to deal with each issue
individually. This patch solves the problem by keeping the OS point of
view and the coreboot-specific ranges separate from the start, rather
than cloning it out later. Ranges only relevant to the coreboot view
will never touch the OS-specific layout, to avoid the problem of losing
information about the original memory type of the underlying region that
needs to be restored for the OS view. This both supersedes the
RELOCATABLE_RAMSTAGE fix and resolves the problems on Arm boards.
Change-Id: I7bb018456b58ad9b0cfb0b8da8c26b791b487fbb
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/26182
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/bootmem.h')
-rw-r--r-- | src/include/bootmem.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/bootmem.h b/src/include/bootmem.h index 7503306167..0a960c992a 100644 --- a/src/include/bootmem.h +++ b/src/include/bootmem.h @@ -38,6 +38,8 @@ enum bootmem_type { BM_MEM_UNUSABLE, /* Unusable address space */ BM_MEM_VENDOR_RSVD, /* Vendor Reserved */ BM_MEM_TABLE, /* Ram configuration tables are kept in */ + /* Tags below this point are ignored for the OS table. */ + BM_MEM_OS_CUTOFF = BM_MEM_TABLE, BM_MEM_RAMSTAGE, BM_MEM_PAYLOAD, BM_MEM_LAST, /* Last entry in this list */ |