coreboot-kgpe-d16/src/arch/riscv
Julius Werner fffee873c8 Makefile: Add build-time overlap check for programs loaded after coreboot
On non-x86 platforms, coreboot uses the memlayout.ld mechanism to
statically allocate the different memory regions it needs and guarantees
at build time that there are no dangerous overlaps between them. At the
end of its (ramstage) execution, however, it usually loads a payload
(and possibly other platform-specific components) that is not integrated
into the coreboot build system and therefore cannot provide the same
overlap guarantees through memlayout.ld. This creates a dangerous memory
hazard where a new component could be loaded over memory areas that are
still in use by the code-loading ramstage and lead to arbitrary memory
corruption bugs.

This patch fills this gap in our build-time correctness guarantees by
adding the necessary checks as a new intermediate Makefile target on
route to assembling the final image. It will parse the memory footprint
information of the payload (and other platform-specific post-ramstage
components) from CBFS and compare it to a list of memory areas known to
be still in use during late ramstage, generating a build failure in case
of a possible hazard.

BUG=chrome-os-partner:48008
TEST=Built Oak while moving critical regions in the way of BL31 or the
payload, observing the desired build-time errors. Built Nyan, Jerry and
Falco without issues for good measure.

Change-Id: I3ebd2c1caa4df959421265e26f9cab2c54909b68
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/13949
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-03-09 17:07:14 +01:00
..
include arches: lib: add main_decl.h for main() declaration 2016-02-11 23:29:08 +01:00
Kconfig console: Simplify bootblock console Kconfig selection logic 2016-01-21 05:37:27 +01:00
Makefile.inc Makefile: Add build-time overlap check for programs loaded after coreboot 2016-03-09 17:07:14 +01:00
boot.c die() when attempting to use bounce buffer on non-i386. 2016-02-22 18:38:48 +01:00
bootblock.S tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
bootblock_simple.c arm/arm64: Generalize bootblock C entry point 2015-11-11 05:08:07 +01:00
id.ld arch/riscv: Add missing license headers 2016-01-18 02:14:03 +01:00
misc.c arch/riscv: Add missing license headers 2016-01-18 02:14:03 +01:00
prologue.inc tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
rom_media.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
stages.c arch: remove stage_exit() 2016-02-11 23:12:06 +01:00
tables.c lib/coreboot_table: add function to allow arch code to add records 2016-02-19 19:21:15 +01:00
trap_handler.c RISC-V: Add more debug info to debug printks 2016-02-19 05:42:52 +01:00
trap_util.S tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
virtual_memory.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00