coreboot-kgpe-d16/src/lib
Aaron Durbin eeb77379e0 vboot/tpm2: enable nvmem commits on cr50 when writing firmware secdata
cr50 by default delays nvmem commits internally from the point of
reset to accumulate change state. However, the factory process can
put a board into dev mode through the recovery screen. This state
is stored in the TPM's nvmem space. When the factory process is
complete a disable_dev_request and battery_cutoff_request is performed.
This leads to disabling the dev mode in TPM, but the battery is
subsequently cut off so the nvmem contents never stick. Therefore,
whenever antirollback_write_space_firmware() is called we know there
was a change in secdata so request cr50 to immediately enable nvmem
commits going forward. This allows state changes to happen immediately.

The fallout from this is that when secdata is changed that current
boot will take longer because every transaction that writes to TPM
nvmem space will perform a write synchronously. All subsequent boots
do not have that effect.

It should also be noted that this approach to the implementation is
a pretty severe layering violation. However, the current TPM APIs
don't lend themselves well to extending commands or re-using code
outside of the current routines which inherently assume all knowledge
of every command (in conflict with vendor commands since those are
vendor-specific by definition).

BUG=b:35775104
BRANCH=reef
TEST=Confirmed disablement of dev mode sticks in the presence of:
crossystem disable_dev_request=1; crossystem
battery_cutoff_request=1; reboot;

Change-Id: I3395db9cbdfea45da1f5cb994c6570978593b944
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/18681
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins)
2017-03-09 19:15:03 +01:00
..
gnat Hook up libhwbase in ramstage 2016-11-29 23:45:40 +01:00
b64_decode.c src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
boot_device.c lib/boot_device: add RW boot device construct 2016-08-19 03:07:05 +02:00
bootblock.c arch/x86: fix cmos post logging in non romcc bootblock 2017-01-06 17:30:58 +01:00
bootmem.c lib/bootmem: allow architecture specific bootmem ranges 2016-04-21 20:46:45 +02:00
bootmode.c bootmode: Get rid of CONFIG_BOOTMODE_STRAPS 2016-07-28 00:36:22 +02:00
cbfs.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
cbmem_common.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
cbmem_console.c cbmem_console: Remove "buffer_" prefix from all structure fields 2017-02-08 20:06:41 +01:00
cbmem_stage_cache.c
compute_ip_checksum.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
coreboot_table.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
debug.c src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
delay.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
edid.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
ext_stage_cache.c soc/intel/apollolake: Implement stage cache to improve resume time 2016-10-07 18:18:14 +02:00
fallback_boot.c pc80: Move set_boot_successful() 2016-12-13 19:15:22 +01:00
fmap.c lib/fmap: provide RW region device support 2016-08-19 18:17:04 +02:00
gcc.c
gcov-glue.c src/lib: Remove braces for single statements 2017-03-09 17:29:33 +01:00
gcov-io.c src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
gcov-io.h src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
gcov-iov.h
generic_dump_spd.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
generic_sdram.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
gpio.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
halt.c src/lib: Remove braces for single statements 2017-03-09 17:29:33 +01:00
hardwaremain.c src/lib: Remove spaces after ( and before ) 2017-03-09 00:51:26 +01:00
hexdump.c lib/hexdump: Refactor to skip lines with all ones as well 2016-01-22 14:10:28 +01:00
hexstrtobin.c hexstrtobin: Add a library function to decode ASCII hex into binary 2016-05-21 05:58:51 +02:00
hw-time-timer.adb Hook up libhwbase in ramstage 2016-11-29 23:45:40 +01:00
imd.c
imd_cbmem.c arch/x86,lib: make cbmem console work in postcar stage 2016-09-19 17:02:17 +02:00
jpeg.c src/lib: Remove braces for single statements 2017-03-09 17:29:33 +01:00
jpeg.h
libgcc.c
libgcov.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
lzma.c lib: remove ulzma() 2016-07-01 23:55:16 +02:00
lzmadecode.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
lzmadecode.h
Makefile.inc ddr3 spd: move accessor code into lib/spd_bin.c 2017-02-10 18:04:33 +01:00
malloc.c
memchr.c
memcmp.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
memcpy.c
memmove.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
memrange.c lib/memrange: avoid shadow object declarations 2016-02-26 02:14:56 +01:00
memset.c
mocked_tlcl.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
nhlt.c lib/nhlt: add support for setting the oem_revision 2016-12-01 08:17:42 +01:00
primitive_memtest.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
prog_loaders.c romstage_handoff: add helper to determine resume status 2016-12-01 08:16:27 +01:00
prog_ops.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
program.ld lib/program.ld: add .sdata sections 2016-10-31 19:33:44 +01:00
ramtest.c quick_ram_check: Remove reference to RAMBASE 2016-11-08 19:16:41 +01:00
reg_script.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
region_file.c lib: add region file support 2016-12-08 16:10:28 +01:00
rmodule.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
rmodule.ld
romstage_handoff.c lib: put romstage_handoff implementation in own compilation unit 2016-12-01 08:16:47 +01:00
romstage_stack.c intel post-car: Increase stacktop alignment 2016-11-18 20:59:12 +01:00
rtc.c lib: Add real-time-clock functions 2016-06-24 20:22:05 +02:00
selfboot.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
spd_bin.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
stack.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
thread.c src/lib: Remove braces for single statements 2017-03-09 17:29:33 +01:00
timer.c src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
timer_queue.c
timestamp.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
tlcl.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
tlcl_internal.h
tlcl_structures.h
tpm2_marshaling.c vboot/tpm2: enable nvmem commits on cr50 when writing firmware secdata 2017-03-09 19:15:03 +01:00
tpm2_marshaling.h tpm2: avoid comparison between signed and unsigned ints 2016-07-13 23:58:32 +02:00
tpm2_tlcl.c vboot/tpm2: enable nvmem commits on cr50 when writing firmware secdata 2017-03-09 19:15:03 +01:00
tpm2_tlcl_structures.h vboot/tpm2: enable nvmem commits on cr50 when writing firmware secdata 2017-03-09 19:15:03 +01:00
tpm_error_messages.h src/lib: Fix checkpatch warnings 2016-09-07 22:28:00 +02:00
trace.c src/lib: Fix checkpatch warnings 2016-09-07 22:28:00 +02:00
version.c lib/version: Correct whitespace alignment 2016-07-15 00:10:50 +02:00
wrdd.c lib: Implement framework for retrieving WiFi regulatory domain 2016-03-08 18:41:33 +01:00