lib/bootmem: ensure ramstage memory isn't given to OS
When RELOCATABLE_RAMSTAGE is employed ramstage lives within the cbmem area. Don't mark it as OS usable under that circumstance. Change-Id: Ie15775806632bd943b8217c433bc13708904c696 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/26117 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
c48b70f744
commit
1ecec5f979
|
@ -97,9 +97,15 @@ static void bootmem_init(void)
|
||||||
/* Add memory used by CBMEM. */
|
/* Add memory used by CBMEM. */
|
||||||
cbmem_add_bootmem();
|
cbmem_add_bootmem();
|
||||||
|
|
||||||
/* Add memory used by coreboot. */
|
/* Add memory used by coreboot -- only if RELOCATABLE_RAMSTAGE is not
|
||||||
bootmem_add_range((uintptr_t)_stack, _stack_size, BM_MEM_RAMSTAGE);
|
* used. When RELOCATABLE_RAMSTAGE is employed ramstage lives in cbmem
|
||||||
bootmem_add_range((uintptr_t)_program, _program_size, BM_MEM_RAMSTAGE);
|
* so cbmem_add_bootmem() takes care of that memory region. */
|
||||||
|
if (!IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)) {
|
||||||
|
bootmem_add_range((uintptr_t)_stack, _stack_size,
|
||||||
|
BM_MEM_RAMSTAGE);
|
||||||
|
bootmem_add_range((uintptr_t)_program, _program_size,
|
||||||
|
BM_MEM_RAMSTAGE);
|
||||||
|
}
|
||||||
|
|
||||||
bootmem_arch_add_ranges();
|
bootmem_arch_add_ranges();
|
||||||
bootmem_platform_add_ranges();
|
bootmem_platform_add_ranges();
|
||||||
|
|
Loading…
Reference in New Issue