diff options
author | dnojiri <dnojiri@chromium.org> | 2020-03-30 17:21:58 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-01 22:48:15 +0000 |
commit | 42cd1f57fb89b49028fe3bc93018a1cdb86a5e84 (patch) | |
tree | a0f641397edbac376f66801f8b9ad24306f4fede /firmware | |
parent | 7790911ced6b1f690cf47930d308388b8618031f (diff) | |
download | vboot-42cd1f57fb89b49028fe3bc93018a1cdb86a5e84.tar.gz |
ec_sync: Ignore NO_BOOT when GBB says DISABLE_EC_SOFTWARE_SYNC
Currently, there is a final guard in VbSelectAndLoadKernel to
enforce NO_BOOT unconditionally.
This makes a board with VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
unable to boot if Hmir != Heff because Hmir will never be synced.
If a system doesn't boot, set_gbb_flags.sh can't be used to enable
software sync.
This patch skips the final guard if
VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC is set.
Signed-off-by: dnojiri <dnojiri@chromium.org>
BUG=chromium:1045217
BRANCH=none
TEST=make runtests
Change-Id: I0c7f8c90cb0a6bb54ce30ef42e4d62554decb872
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2129107
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 6111eee0..ff13a256 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -176,6 +176,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, VbSelectAndLoadKernelParams *kparams) { struct vb2_shared_data *sd = vb2_get_sd(ctx); + vb2_gbb_flags_t gbb_flags = vb2api_gbb_get_flags(ctx); /* Init nvstorage space. TODO(kitching): Remove once we add assertions to vb2_nv_get and vb2_nv_set. */ @@ -185,7 +186,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, VB2_TRY(vb2api_kernel_phase1(ctx)); - VB2_DEBUG("GBB flags are %#x\n", vb2_get_gbb(ctx)->flags); + VB2_DEBUG("GBB flags are %#x\n", gbb_flags); /* * Do EC and Aux FW software sync unless we're in recovery mode. This @@ -262,10 +263,14 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, VB2_TRY(vb2_normal_boot(ctx)); } - if (ctx->flags & VB2_CONTEXT_NO_BOOT) { - /* Stop all cases returning SUCCESS against NO_BOOT flag. */ - VB2_DEBUG("Blocking boot in NO_BOOT mode.\n"); - vb2api_fail(ctx, VB2_RECOVERY_RW_INVALID_OS, 0); + /* + * Stop all cases returning SUCCESS against NO_BOOT flag except when + * GBB flag disables software sync. + */ + if (!(gbb_flags & VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC) + && (ctx->flags & VB2_CONTEXT_NO_BOOT)) { + VB2_DEBUG("Blocking escape from NO_BOOT mode.\n"); + vb2api_fail(ctx, VB2_RECOVERY_ESCAPE_NO_BOOT, 0); return VB2_ERROR_ESCAPE_NO_BOOT; } |