New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 789276 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature

Blocking:
issue 783998



Sign in to add a comment

vboot: Expand NvStorage to 64 bytes

Project Member Reported by rspangler@chromium.org, Nov 28 2017

Issue description

Currently, vboot non-volatile storage uses a 16-byte record.  This was as much CMOS as we could get back in 2009 on the first Chromebook.

We're now out of space in that record, so we need to increase the size.  Might as well go up to 64 bytes, to give us some room for future features as well.

Firmware will support either 16-byte (current/old) or 64-byte (new ToT) records.  No need to dynamically determine record size.

Crossystem, mosys, and anyone else directly mucking with the records from the OS will need to support both old and new record sizes.  Firmware will provide a flag to the OS to indicate if 64-byte records should be used (default=no, for backwards-compatibility).
 
Blocking: 783998
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/f6780a36ff19b36abcdb5ace903c4ae2272fb574

commit f6780a36ff19b36abcdb5ace903c4ae2272fb574
Author: Randall Spangler <rspangler@chromium.org>
Date: Fri Dec 01 22:54:40 2017

firmware: header tweaks for depthcharge

Depthcharge currently includes vboot_nvstorage.h directly, instead of
including only the API header files directly.  Add 2nvstorage.h to the
list of headers which can be requested impolitely.

Also fix the definition of ARRAY_SIZE to match exactly what
depthcharge and coreboot provide, so that the compiler does not get
sad when it's included from both libpayload.h and 2common.h.

BUG=chromium:789276
BRANCH=none
TEST=make runtests; emerge-reef depthcharge coreboot

Change-Id: Idc0390eaf813c3079df1676781e8bf5bc9b46450
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/802176
Reviewed-by: Shelley Chen <shchen@chromium.org>

[modify] https://crrev.com/f6780a36ff19b36abcdb5ace903c4ae2272fb574/firmware/include/vb2_api.h
[modify] https://crrev.com/f6780a36ff19b36abcdb5ace903c4ae2272fb574/firmware/2lib/include/2common.h

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/74f442d830e6be3e91bcd9d57532d9877d65a464

commit 74f442d830e6be3e91bcd9d57532d9877d65a464
Author: Randall Spangler <rspangler@chromium.org>
Date: Tue Dec 05 01:33:56 2017

vboot: Use 2nvstorage API instead of vboot_nvstorage

We are removing the old vboot_nvstorage API from vboot_reference.
Depthcharge should really not have been including any header files
other than vboot_api.h and vb2_api.h, but for historical reasons it
uses the vboot nvstorage API directly.

Port that code to use the vboot2 (2nvstorage) API.

Don't include the 2nvstorage.h header file directly.  Instead, define
NEED_VB20_INTERNALS so that vb2_api.h supplies it.  This makes it
easier to refactor vboot, and highlights the places that are peeking
at vboot internals so they're easier to fix later.

BUG=chromium:789276
BRANCH=none
TEST=emerge-reef depthcharge
     Build and boot reef firmware.
CQ-DEPEND=CL:802176

Change-Id: Ief51dc7a0a33c403c16e4f75976441a7746a23a6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/802241
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>

[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/board/smaug/fastboot.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/fastboot/fastboot.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/vboot/stages.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/vboot/vbnv.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/fastboot/capabilities.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/vboot/callbacks/display.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/boot/bcb.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/vboot/fastboot.c
[modify] https://crrev.com/74f442d830e6be3e91bcd9d57532d9877d65a464/src/netboot/netboot.c

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 7 2017

Labels: merge-merged-chromeos-2016.05
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/a3d4a78a7c7080b80afdf6432a9bc652dc386a82

commit a3d4a78a7c7080b80afdf6432a9bc652dc386a82
Author: Randall Spangler <rspangler@chromium.org>
Date: Thu Dec 07 16:04:38 2017

UPSTREAM: security/vboot: Remove unused include of vboot_nvstorage.h

This include is not needed, and the header file is going away in
vboot_reference.  So, remove it.

BUG=chromium:789276
BRANCH=none
TEST=emerge-reef coreboot

Change-Id: I35e7fc7e5e90c755c72d696d36c4490fc1e246b7
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 8fdbd114ec528ac414b49393f6e856cee4056d87
Original-Change-Id: Ie0b37ae3d2f979f79060a15ca3f7157f49c89785
Original-Signed-off-by: Randall Spangler <rspangler@chromium.org>
Original-Signed-off-by: Randall Spangler <randall@spanglers.com>
Original-Reviewed-on: https://review.coreboot.org/22733
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://chromium-review.googlesource.com/813954
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>

[modify] https://crrev.com/a3d4a78a7c7080b80afdf6432a9bc652dc386a82/src/security/vboot/vbnv_flash.c

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 8 2017

Labels: merge-merged-firmware-fizz-10139.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/1a094a9ad168d80ad1f4a69d321d758b1e7386cc

commit 1a094a9ad168d80ad1f4a69d321d758b1e7386cc
Author: Randall Spangler <rspangler@chromium.org>
Date: Fri Dec 08 23:12:48 2017

vboot: Use 2nvstorage API instead of vboot_nvstorage

We are removing the old vboot_nvstorage API from vboot_reference.
Depthcharge should really not have been including any header files
other than vboot_api.h and vb2_api.h, but for historical reasons it
uses the vboot nvstorage API directly.

Port that code to use the vboot2 (2nvstorage) API.

Don't include the 2nvstorage.h header file directly.  Instead, define
NEED_VB20_INTERNALS so that vb2_api.h supplies it.  This makes it
easier to refactor vboot, and highlights the places that are peeking
at vboot internals so they're easier to fix later.

BUG=chromium:789276
BRANCH=none
TEST=emerge-reef depthcharge
     Build and boot reef firmware.
CQ-DEPEND=CL:802176

Change-Id: Ief51dc7a0a33c403c16e4f75976441a7746a23a6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/802241
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>
(cherry picked from commit 74f442d830e6be3e91bcd9d57532d9877d65a464)
Reviewed-on: https://chromium-review.googlesource.com/817919
Commit-Queue: Shelley Chen <shchen@chromium.org>
Tested-by: Shelley Chen <shchen@chromium.org>

[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/board/smaug/fastboot.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/fastboot/fastboot.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/vboot/stages.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/vboot/vbnv.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/fastboot/capabilities.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/vboot/callbacks/display.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/boot/bcb.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/vboot/fastboot.c
[modify] https://crrev.com/1a094a9ad168d80ad1f4a69d321d758b1e7386cc/src/netboot/netboot.c

Project Member

Comment 6 by bugdroid1@chromium.org, Dec 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/fa82985a2a7bb58894f26eac9bca774e8064e297

commit fa82985a2a7bb58894f26eac9bca774e8064e297
Author: Randall Spangler <rspangler@chromium.org>
Date: Fri Dec 08 23:19:25 2017

firmware: header tweaks for depthcharge

Depthcharge currently includes vboot_nvstorage.h directly, instead of
including only the API header files directly.  Add 2nvstorage.h to the
list of headers which can be requested impolitely.

Also fix the definition of ARRAY_SIZE to match exactly what
depthcharge and coreboot provide, so that the compiler does not get
sad when it's included from both libpayload.h and 2common.h.

BUG=chromium:789276
BRANCH=none
TEST=make runtests; emerge-reef depthcharge coreboot

Change-Id: Idc0390eaf813c3079df1676781e8bf5bc9b46450
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/802176
Reviewed-by: Shelley Chen <shchen@chromium.org>
(cherry picked from commit f6780a36ff19b36abcdb5ace903c4ae2272fb574)
Reviewed-on: https://chromium-review.googlesource.com/817711
Commit-Queue: Shelley Chen <shchen@chromium.org>
Tested-by: Shelley Chen <shchen@chromium.org>

[modify] https://crrev.com/fa82985a2a7bb58894f26eac9bca774e8064e297/firmware/include/vb2_api.h
[modify] https://crrev.com/fa82985a2a7bb58894f26eac9bca774e8064e297/firmware/2lib/include/2common.h

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/cbea37158457f6b9242ed70ff6e7a546ef1414bf

commit cbea37158457f6b9242ed70ff6e7a546ef1414bf
Author: Randall Spangler <rspangler@chromium.org>
Date: Sat Dec 09 00:22:54 2017

UPSTREAM: security/vboot: Remove unused include of vboot_nvstorage.h

This include is not needed, and the header file is going away in
vboot_reference.  So, remove it.

BUG=chromium:789276
BRANCH=none
TEST=emerge-reef coreboot

Change-Id: I35e7fc7e5e90c755c72d696d36c4490fc1e246b7
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 8fdbd114ec528ac414b49393f6e856cee4056d87
Original-Change-Id: Ie0b37ae3d2f979f79060a15ca3f7157f49c89785
Original-Signed-off-by: Randall Spangler <rspangler@chromium.org>
Original-Signed-off-by: Randall Spangler <randall@spanglers.com>
Original-Reviewed-on: https://review.coreboot.org/22733
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://chromium-review.googlesource.com/813954
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/818437
Commit-Queue: Shelley Chen <shchen@chromium.org>
Tested-by: Shelley Chen <shchen@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>

[modify] https://crrev.com/cbea37158457f6b9242ed70ff6e7a546ef1414bf/src/security/vboot/vbnv_flash.c

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/dff5852c2f41c240842b49549b212c36287d5e26

commit dff5852c2f41c240842b49549b212c36287d5e26
Author: Randall Spangler <rspangler@chromium.org>
Date: Mon Dec 11 23:16:25 2017

vboot: Use 2nvstorage instead of vboot_nvstorage

Remove the old vboot1 vboot_nvstorage library (VbNv*() functions) and
use the vboot2 library (vb2_nv_*()) instead.  This is needed in
preparation for moving to 64-byte records; no sense in implementing
that change twice...

Should be (better be) no change in system behavior.

BUG=chromium:789276
BRANCH=none
TEST=make runtests
     compare output of crossystem before/after change (should be identical)

Change-Id: I10f9975b0824263064b9a74a3c6daadcecc085d3
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/794732

[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/host/lib/crossystem.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_audio_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/verify_kernel.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/utility/load_kernel_test.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/linktest/main.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/Makefile
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_api_kernel_tests.c
[delete] https://crrev.com/626340420e2ebc42f8f24b0b2c3d56cc73dc6e60/firmware/lib/vboot_nvstorage.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_display_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/host/lib/include/crossystem_arch.h
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/include/load_kernel_fw.h
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_api_kernel5_tests.c
[delete] https://crrev.com/626340420e2ebc42f8f24b0b2c3d56cc73dc6e60/tests/vboot_nvstorage_test.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/vboot_ui.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_api_kernel4_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_region_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/host/include/crossystem_vbnv.h
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/host/arch/mips/lib/crossystem_arch.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/host/arch/x86/lib/crossystem_arch.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/vboot_api_kernel.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/2lib/include/2recovery_reasons.h
[delete] https://crrev.com/626340420e2ebc42f8f24b0b2c3d56cc73dc6e60/firmware/include/vboot_nvstorage.h
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/2lib/include/2nvstorage.h
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_api_devmode_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/ec_sync_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/host/arch/arm/lib/crossystem_arch.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/2lib/2nvstorage.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_api_kernel6_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/Android.mk
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/include/vboot_display.h
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/tests/vboot_kernel_tests.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/vboot_kernel.c
[modify] https://crrev.com/dff5852c2f41c240842b49549b212c36287d5e26/firmware/lib/vboot_display.c

Project Member

Comment 9 by bugdroid1@chromium.org, Jan 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf

commit 008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf
Author: Randall Spangler <rspangler@chromium.org>
Date: Thu Jan 11 08:12:53 2018

vboot: Use 2nvstorage instead of vboot_nvstorage

Remove the old vboot1 vboot_nvstorage library (VbNv*() functions) and
use the vboot2 library (vb2_nv_*()) instead.  This is needed in
preparation for moving to 64-byte records; no sense in implementing
that change twice...

Should be (better be) no change in system behavior.

BUG=chromium:789276
BRANCH=none
TEST=make runtests
     compare output of crossystem before/after change (should be identical)

Change-Id: I10f9975b0824263064b9a74a3c6daadcecc085d3
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/794732
(cherry picked from commit dff5852c2f41c240842b49549b212c36287d5e26)
Reviewed-on: https://chromium-review.googlesource.com/861319
Reviewed-by: Shelley Chen <shchen@chromium.org>
Commit-Queue: Shelley Chen <shchen@chromium.org>
Tested-by: Shelley Chen <shchen@chromium.org>

[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/host/lib/crossystem.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_audio_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/verify_kernel.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/utility/load_kernel_test.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/linktest/main.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/Makefile
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_api_kernel_tests.c
[delete] https://crrev.com/3cb2e75d5401bc5b98bee604fbe1280ec49a4e20/firmware/lib/vboot_nvstorage.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_display_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/host/lib/include/crossystem_arch.h
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/include/load_kernel_fw.h
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_api_kernel5_tests.c
[delete] https://crrev.com/3cb2e75d5401bc5b98bee604fbe1280ec49a4e20/tests/vboot_nvstorage_test.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/vboot_ui.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_api_kernel4_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_region_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/host/include/crossystem_vbnv.h
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/host/arch/mips/lib/crossystem_arch.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/host/arch/x86/lib/crossystem_arch.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/vboot_api_kernel.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/2lib/include/2recovery_reasons.h
[delete] https://crrev.com/3cb2e75d5401bc5b98bee604fbe1280ec49a4e20/firmware/include/vboot_nvstorage.h
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/2lib/include/2nvstorage.h
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_api_devmode_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/ec_sync_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/host/arch/arm/lib/crossystem_arch.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/2lib/2nvstorage.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_api_kernel6_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/Android.mk
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/include/vboot_display.h
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/tests/vboot_kernel_tests.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/vboot_kernel.c
[modify] https://crrev.com/008b1db9e576a38e409fdd3fc7f7f4b513f2bcaf/firmware/lib/vboot_display.c

Project Member

Comment 10 by bugdroid1@chromium.org, Mar 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/4ff95009177da30bb517d702b161be372578a1b7

commit 4ff95009177da30bb517d702b161be372578a1b7
Author: Randall Spangler <rspangler@chromium.org>
Date: Fri Mar 02 03:13:12 2018

fastboot: set NV storage directly instead of VbLockDevice()

All VbLockDevice() does is the equivalent of
vbnv_write(VB2_NV_DISABLE_DEV_REQUEST, 1);

So, do that, rather than requiring another API.  Fastboot already uses
vbnv_write() in other places.

This will allow removing the VbLockDevice() API entirely, rather than
needing to rewrite it to support larger NV storage records.

BUG=chromium:789276
BRANCH=none
TEST=none (no firmware in ToT uses fastboot)

Change-Id: I915a7384d9a736574ca2e44649064fb61b8ce638
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944183
Reviewed-by: Furquan Shaikh <furquan@chromium.org>

[modify] https://crrev.com/4ff95009177da30bb517d702b161be372578a1b7/src/fastboot/fastboot.c

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/68ca41067083ee78f5e6b96ba0e2ce9a76cecd3b

commit 68ca41067083ee78f5e6b96ba0e2ce9a76cecd3b
Author: Randall Spangler <rspangler@chromium.org>
Date: Fri Mar 02 03:13:13 2018

firmware: Remove VbLockDevice()

VbLockDevice() would be inconvenient to port to 64-byte NV storage
records because it doesn't take VbSharedData flags or a vb2_context.
So, just have depthcharge call vbnv_write() directly (as it does in
other places in fastboot.c) and get rid of this API.

BUG=chromium:789276
BRANCH=none
TEST=make runtests
CQ-DEPEND=CL:944183

Change-Id: I2aeaecf7f929cd1a1ebd1f6850d0dd96c6fabb49
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944243
Reviewed-by: Furquan Shaikh <furquan@chromium.org>

[modify] https://crrev.com/68ca41067083ee78f5e6b96ba0e2ce9a76cecd3b/firmware/lib/vboot_api_kernel.c
[modify] https://crrev.com/68ca41067083ee78f5e6b96ba0e2ce9a76cecd3b/tests/vboot_api_kernel6_tests.c
[modify] https://crrev.com/68ca41067083ee78f5e6b96ba0e2ce9a76cecd3b/firmware/include/vboot_api.h

Project Member

Comment 12 by bugdroid1@chromium.org, Mar 2 2018

Labels: merge-merged-firmware-poppy-10431.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/7ed54a351e4588819f6e50e2b1290ea6ec7ab5a3

commit 7ed54a351e4588819f6e50e2b1290ea6ec7ab5a3
Author: Randall Spangler <rspangler@chromium.org>
Date: Fri Mar 02 23:56:48 2018

fastboot: set NV storage directly instead of VbLockDevice()

All VbLockDevice() does is the equivalent of
vbnv_write(VB2_NV_DISABLE_DEV_REQUEST, 1);

So, do that, rather than requiring another API.  Fastboot already uses
vbnv_write() in other places.

This will allow removing the VbLockDevice() API entirely, rather than
needing to rewrite it to support larger NV storage records.

BUG=chromium:789276
BRANCH=none
TEST=none (no firmware in ToT uses fastboot)

Change-Id: I915a7384d9a736574ca2e44649064fb61b8ce638
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944183
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/947335
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Trybot-Ready: Furquan Shaikh <furquan@chromium.org>

[modify] https://crrev.com/7ed54a351e4588819f6e50e2b1290ea6ec7ab5a3/src/fastboot/fastboot.c

Project Member

Comment 13 by bugdroid1@chromium.org, Mar 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/8bf997ddfe96c7826dd9607ccf7b5a63a3dfe1ae

commit 8bf997ddfe96c7826dd9607ccf7b5a63a3dfe1ae
Author: Randall Spangler <rspangler@chromium.org>
Date: Sat Mar 03 00:11:04 2018

firmware: Remove VbLockDevice()

VbLockDevice() would be inconvenient to port to 64-byte NV storage
records because it doesn't take VbSharedData flags or a vb2_context.
So, just have depthcharge call vbnv_write() directly (as it does in
other places in fastboot.c) and get rid of this API.

BUG=chromium:789276
BRANCH=none
TEST=make runtests
CQ-DEPEND=CL:944183

Change-Id: I2aeaecf7f929cd1a1ebd1f6850d0dd96c6fabb49
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944243
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
(cherry picked from commit 68ca41067083ee78f5e6b96ba0e2ce9a76cecd3b)
Reviewed-on: https://chromium-review.googlesource.com/947392
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Trybot-Ready: Furquan Shaikh <furquan@chromium.org>

[modify] https://crrev.com/8bf997ddfe96c7826dd9607ccf7b5a63a3dfe1ae/firmware/lib/vboot_api_kernel.c
[modify] https://crrev.com/8bf997ddfe96c7826dd9607ccf7b5a63a3dfe1ae/tests/vboot_api_kernel6_tests.c
[modify] https://crrev.com/8bf997ddfe96c7826dd9607ccf7b5a63a3dfe1ae/firmware/include/vboot_api.h

Project Member

Comment 14 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0

commit a80a79f9f5ca0250eb31330d9dfdacf3a250efb0
Author: Randall Spangler <rspangler@chromium.org>
Date: Thu Mar 08 00:55:15 2018

2lib: Add support for 64-byte nvstorage record

The calling firmware can set ctx->flags VB2_CONTEXT_NVDATA_V2 to tell
vboot that nvdata is a 64-byte record instead of a 16-byte record, or
equivalently, set the VBSD_NVDATA_V2 flag if calling the old vboot1
API.

If calling firmware does not (which is the current coreboot and
depthcharge default), then the 16-byte record is used, and V2 fields
return explicit default values.

Added the fw_max_rollforward V2 field, which defaults to 0xfffffffe on
V1.  This will be used by a subsequent CL.

Added unit tests to verify all that.

Added crossystem support, though it will only work with the current
16-byte records until firmware sets the VBSD flag and mosys supports
larger records.

(Note that because coreboot/depthcharge do not yet set the new context
flag, this CL should not change ToT firmware behavior.)

See go/vboot-nvstorage for design doc.

BUG=chromium:789276
BRANCH=none
TEST=make runtests

Change-Id: I43072ef153dfa016c051f560892af1fbb3508e3a
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/942031

[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/2lib/include/2nvstorage_fields.h
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/include/vboot_struct.h
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/2lib/include/2api.h
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/tests/vb2_nvstorage_tests.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/tests/vboot_api_kernel4_tests.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/2lib/2nvstorage.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/2lib/include/2nvstorage.h
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/tests/vboot_api_kernel5_tests.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/host/arch/x86/lib/crossystem_arch.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/lib/vboot_api_kernel.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/host/lib/crossystem.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/host/arch/arm/lib/crossystem_arch.c
[modify] https://crrev.com/a80a79f9f5ca0250eb31330d9dfdacf3a250efb0/firmware/lib/vboot_display.c

Project Member

Comment 15 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/0bdb8713be40abfe963d9ef625dbb67961068840

commit 0bdb8713be40abfe963d9ef625dbb67961068840
Author: Randall Spangler <rspangler@chromium.org>
Date: Thu Mar 08 19:33:26 2018

crossystem: Fix null pointer dereference on VMs

Check the result of VbSharedDataRead() before dereferencing it.

BUG=chromium:789276, chromium:819695 
BRANCH=none
TEST=make runtests

Change-Id: I1b1cc90bdc2fca61a9aad6b02e8b7e1f6a919797
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/954712
Commit-Ready: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0bdb8713be40abfe963d9ef625dbb67961068840/host/lib/crossystem.c

Sign in to add a comment