Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32843
Change subject: vboot: save whether developer mode is enabled ......................................................................
vboot: save whether developer mode is enabled
Save whether or not vboot has selected developer mode as a flag in vboot_working_data. Other coreboot code may access this flag without needing to consult vboot_handoff (which is in the process of being deprecated).
BUG=b:124141368, b:124192753 TEST=make clean && make test-abuild BRANCH=none
Change-Id: Ieb6ac4937c943aea78ddc762595a05387d2b8114 Signed-off-by: Joel Kitching kitching@google.com --- M src/security/vboot/bootmode.c M src/security/vboot/misc.h M src/security/vboot/vboot_common.c M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c 5 files changed, 9 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/32843/1
diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index e6e53b6..68749f0 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -164,10 +164,8 @@
int vboot_developer_mode_enabled(void) { - if (cbmem_possibly_online() && vboot_handoff_check_developer_flag()) - return 1; - - return 0; + return cbmem_possibly_online() && + vboot_get_working_data()->flags & VBOOT_WD_FLAG_DEVELOPER_MODE; }
#if CONFIG(VBOOT_NO_BOARD_SUPPORT) diff --git a/src/security/vboot/misc.h b/src/security/vboot/misc.h index 23159c8..acb6dbb 100644 --- a/src/security/vboot/misc.h +++ b/src/security/vboot/misc.h @@ -47,6 +47,8 @@ */ /* vboot requests display initialization from coreboot. */ #define VBOOT_WD_FLAG_DISPLAY_INIT (1 << 0) +/* vboot has selected developer mode. */ +#define VBOOT_WD_FLAG_DEVELOPER_MODE (1 << 1)
/* * Source: security/vboot/common.c diff --git a/src/security/vboot/vboot_common.c b/src/security/vboot/vboot_common.c index 14f154c..ff8e6c8 100644 --- a/src/security/vboot/vboot_common.c +++ b/src/security/vboot/vboot_common.c @@ -88,11 +88,6 @@ return !!(vbho->out_flags & flag); }
-int vboot_handoff_check_developer_flag(void) -{ - return vboot_get_handoff_flag(VB_INIT_OUT_ENABLE_DEVELOPER); -} - int vboot_handoff_check_recovery_flag(void) { return vboot_get_handoff_flag(VB_INIT_OUT_ENABLE_RECOVERY); diff --git a/src/security/vboot/vboot_common.h b/src/security/vboot/vboot_common.h index 9a02303..a785a8b 100644 --- a/src/security/vboot/vboot_common.h +++ b/src/security/vboot/vboot_common.h @@ -62,7 +62,6 @@ * Returns value read for other fields */ int vboot_handoff_check_recovery_flag(void); -int vboot_handoff_check_developer_flag(void); int vboot_handoff_get_recovery_reason(void);
/* ============================ VBOOT REBOOT ============================== */ diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index df34490..00347c3 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -364,10 +364,13 @@ vboot_reboot(); }
- /* Is vboot declaring that display is available? If so, we should mark - it down, so that the mainboard/SoC knows to initialize display. */ + /* Jot down some information from vboot which may be required later on + in coreboot boot flow. */ if (ctx.flags & VB2_CONTEXT_DISPLAY_INIT) + /* Mainboard/SoC should initialize display. */ vboot_get_working_data()->flags |= VBOOT_WD_FLAG_DISPLAY_INIT; + if (ctx.flags & VB2_CONTEXT_DEVELOPER_MODE) + vboot_get_working_data()->flags |= VBOOT_WD_FLAG_DEVELOPER_MODE;
/* Determine which firmware slot to boot (based on NVRAM) */ printk(BIOS_INFO, "Phase 2\n");
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32843 )
Change subject: vboot: save whether developer mode is enabled ......................................................................
Patch Set 1: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32843 )
Change subject: vboot: save whether developer mode is enabled ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32843 )
Change subject: vboot: save whether developer mode is enabled ......................................................................
vboot: save whether developer mode is enabled
Save whether or not vboot has selected developer mode as a flag in vboot_working_data. Other coreboot code may access this flag without needing to consult vboot_handoff (which is in the process of being deprecated).
BUG=b:124141368, b:124192753 TEST=make clean && make test-abuild BRANCH=none
Change-Id: Ieb6ac4937c943aea78ddc762595a05387d2b8114 Signed-off-by: Joel Kitching kitching@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32843 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com Reviewed-by: Julius Werner jwerner@chromium.org --- M src/security/vboot/bootmode.c M src/security/vboot/misc.h M src/security/vboot/vboot_common.c M src/security/vboot/vboot_common.h M src/security/vboot/vboot_logic.c 5 files changed, 9 insertions(+), 12 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Julius Werner: Looks good to me, approved
diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index e6e53b6..68749f0 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -164,10 +164,8 @@
int vboot_developer_mode_enabled(void) { - if (cbmem_possibly_online() && vboot_handoff_check_developer_flag()) - return 1; - - return 0; + return cbmem_possibly_online() && + vboot_get_working_data()->flags & VBOOT_WD_FLAG_DEVELOPER_MODE; }
#if CONFIG(VBOOT_NO_BOARD_SUPPORT) diff --git a/src/security/vboot/misc.h b/src/security/vboot/misc.h index 23159c8..acb6dbb 100644 --- a/src/security/vboot/misc.h +++ b/src/security/vboot/misc.h @@ -47,6 +47,8 @@ */ /* vboot requests display initialization from coreboot. */ #define VBOOT_WD_FLAG_DISPLAY_INIT (1 << 0) +/* vboot has selected developer mode. */ +#define VBOOT_WD_FLAG_DEVELOPER_MODE (1 << 1)
/* * Source: security/vboot/common.c diff --git a/src/security/vboot/vboot_common.c b/src/security/vboot/vboot_common.c index 14f154c..ff8e6c8 100644 --- a/src/security/vboot/vboot_common.c +++ b/src/security/vboot/vboot_common.c @@ -88,11 +88,6 @@ return !!(vbho->out_flags & flag); }
-int vboot_handoff_check_developer_flag(void) -{ - return vboot_get_handoff_flag(VB_INIT_OUT_ENABLE_DEVELOPER); -} - int vboot_handoff_check_recovery_flag(void) { return vboot_get_handoff_flag(VB_INIT_OUT_ENABLE_RECOVERY); diff --git a/src/security/vboot/vboot_common.h b/src/security/vboot/vboot_common.h index 9a02303..a785a8b 100644 --- a/src/security/vboot/vboot_common.h +++ b/src/security/vboot/vboot_common.h @@ -62,7 +62,6 @@ * Returns value read for other fields */ int vboot_handoff_check_recovery_flag(void); -int vboot_handoff_check_developer_flag(void); int vboot_handoff_get_recovery_reason(void);
/* ============================ VBOOT REBOOT ============================== */ diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index df34490..00347c3 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -364,10 +364,13 @@ vboot_reboot(); }
- /* Is vboot declaring that display is available? If so, we should mark - it down, so that the mainboard/SoC knows to initialize display. */ + /* Jot down some information from vboot which may be required later on + in coreboot boot flow. */ if (ctx.flags & VB2_CONTEXT_DISPLAY_INIT) + /* Mainboard/SoC should initialize display. */ vboot_get_working_data()->flags |= VBOOT_WD_FLAG_DISPLAY_INIT; + if (ctx.flags & VB2_CONTEXT_DEVELOPER_MODE) + vboot_get_working_data()->flags |= VBOOT_WD_FLAG_DEVELOPER_MODE;
/* Determine which firmware slot to boot (based on NVRAM) */ printk(BIOS_INFO, "Phase 2\n");