diff options
author | Julius Werner <jwerner@chromium.org> | 2017-03-17 16:54:48 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2017-03-28 22:17:35 +0200 |
commit | 73d042bd90bc8877f9bfd8b846578fe3e12444c3 (patch) | |
tree | 313a7814c4c9ca76e42b5239d07037e7ea537f42 /src/vboot/Kconfig | |
parent | 5fc7c2896ae0d628903144041ff13349c79f2619 (diff) |
vboot: Disallow separate verstage after romstage, try to clarify logic
No board has ever tried to combine CONFIG_SEPARATE_VERSTAGE with
CONFIG_VBOOT_STARTS_IN_ROMSTAGE. There are probably many reasons why
this wouldn't work (e.g. x86 CAR migration logic currently always
assumes verstage code to run pre-migration). It would also not really
make sense: the reason we use separate verstages is to decrease
bootblock size (mitigating the boot speed cost of slow boot ROM SPI
drivers) and to allow the SRAM-saving RETURN_FROM_VERSTAGE trick,
neither of which would apply to the after-romstage case. It is better to
just forbid that case explicitly and give programmers more guarantees
about what the verstage is (e.g. now the assumption that it runs pre-RAM
is always valid).
Since Kconfig dependencies aren't always guaranteed in the face of
'select' statements, also add some explicit compile-time assertions to
the vboot code. We can simplify some of the loader logic which now no
longer needs to provide for the forbidden case. In addition, also try to
make some of the loader logic more readable by writing it in a more
functional style that allows us to put more assertions about which cases
should be unreachable in there, which will hopefully make it more robust
and fail-fast with future changes (e.g. addition of new stages).
Change-Id: Iaf60040af4eff711d9b80ee0e5950ce05958b3aa
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/18983
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/vboot/Kconfig')
-rw-r--r-- | src/vboot/Kconfig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vboot/Kconfig b/src/vboot/Kconfig index 0c72d4775e..a92a2fa5e1 100644 --- a/src/vboot/Kconfig +++ b/src/vboot/Kconfig @@ -83,7 +83,13 @@ config VBOOT_DISABLE_DEV_ON_RECOVERY config SEPARATE_VERSTAGE bool "Vboot verification is built into a separate stage" default n - depends on VBOOT + depends on VBOOT && VBOOT_STARTS_IN_BOOTBLOCK + help + If this option is set, vboot verification runs in a standalone stage + that is loaded from the bootblock and exits into romstage. If it is + not set, the verification code is linked directly into the bootblock + or the romstage and runs as part of that stage (cf. related options + VBOOT_STARTS_IN_BOOTBLOCK/_ROMSTAGE and RETURN_FROM_VERSTAGE). config RETURN_FROM_VERSTAGE bool "The separate verification stage returns to its caller" |