| 8cd09cfc | 17-Jun-2021 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
refactor(measured boot): move BL2 measurement to platform layer
Right now, event_log_init() does 2 things: 1) It writes all the necessary TCG data structures in the event log buffer. 2) It writes th
refactor(measured boot): move BL2 measurement to platform layer
Right now, event_log_init() does 2 things: 1) It writes all the necessary TCG data structures in the event log buffer. 2) It writes the first measurement (BL2's).
Step 2) introduces in the TCG event log driver an assumption on what is getting measured and in what order. Ideally, the driver should only be concerned about generic operations, such as initializing the event log or recording a measurement in it. As much as possible, we should design the driver such that it could be reused in another project that has a different measure boot flow.
For these reasons, move step 2) up to the caller, plat_mboot_init() in this case. Make event_log_record() a public function for this purpose.
This refactoring will also help when we make BL1 record BL2's measurement into the event log (instead of BL2). Both BL1 and BL2 will need to call the driver's init function but only BL1 will need recording BL2's measurement. We can handle this through different implementations of plat_mboot_init() for BL1 and BL2, leaving the TCG event log driver unchanged.
Change-Id: I358e097c1eedb54f82b866548dfc6bcade83d519 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| 9b0b3444 | 17-Jun-2021 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
refactor(measured boot): rename add_event2()
To a layman in TCG linguo, add_event2() is not straight forward to understand. Rename the function into event_log_record().
Change-Id: I75d53a656425cd78
refactor(measured boot): rename add_event2()
To a layman in TCG linguo, add_event2() is not straight forward to understand. Rename the function into event_log_record().
Change-Id: I75d53a656425cd78a41ebf2c4c4e4e57687adc0d Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| d89bec83 | 07-Jul-2021 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
build(measured boot): rename measured boot makefile
With the removal of the generic functions measured_boot_init()/finish(), measured_boot.mk becomes specific to the TCG event log backend. Change it
build(measured boot): rename measured boot makefile
With the removal of the generic functions measured_boot_init()/finish(), measured_boot.mk becomes specific to the TCG event log backend. Change its file name to event_log.mk. Also, the Event Log driver is one of the backend of measured boot hence created a separate folder for it under the measured_boot directory.
Alongside done some cosmetic changes (adding a comment and fixing identation).
Change-Id: I4ce3300e6958728dc15ca5cced09eaa01510606c Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| 47bf3ac3 | 06-Aug-2021 |
Manish V Badarkhe <Manish.Badarkhe@arm.com> |
feat(measured boot): move init and teardown functions to platform layer
Right now, the measured boot driver is strongly coupled with the TCG event log driver. It would not be possible to push the me
feat(measured boot): move init and teardown functions to platform layer
Right now, the measured boot driver is strongly coupled with the TCG event log driver. It would not be possible to push the measurements somewhere else, for instance to a physical TPM.
To enable this latter use case, turn the driver's init and teardown functions into platform hooks. Call them bl2_plat_mboot_init()/finish(). This allows each platform to implement them appropriately, depending on the type of measured boot backend they use. For example, on a platform with a physical TPM, the plat_mboot_init() hook would startup the TPM and setup it underlying bus (e.g. SPI).
Move the current implementation of the init and teardown function to the FVP platform layer.
Finally move the conditional compilation logic (#if MEASURED_BOOT) out of bl2_main() to improve its readability. Provide a dummy implementation in the case measured boot is not included in the build.
Change-Id: Ib6474cb5a9c1e3d4a30c7f228431b22d1a6e85e3 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
show more ...
|
| 51018a05 | 23-Jun-2021 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
refactor(measured boot): revisit error handling (3/3)
- In tpm_record_measurement():
The platform layer is responsible for providing an exhaustive list of images to measure. If it doesn't th
refactor(measured boot): revisit error handling (3/3)
- In tpm_record_measurement():
The platform layer is responsible for providing an exhaustive list of images to measure. If it doesn't then this should be treated as a programming error, as documented in [1].
Thus, turn the error test into an assertion.
[1] https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#using-assert-to-check-for-programming-errors
Change-Id: I002309c2ebdf2d348a7d12a8f7f9e82465046b8e Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| 0c83207a | 23-Jun-2021 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
refactor(measured boot): revisit error handling (2/3)
- In add_event2():
Turn the first error condition checking whether there is room for an extra event2 data structure into an assertion. The
refactor(measured boot): revisit error handling (2/3)
- In add_event2():
Turn the first error condition checking whether there is room for an extra event2 data structure into an assertion. The platform layer is responsible for choosing an appropriate event log buffer size based on the number of measurements it expects. If this assertion fires, the platform macro EVENT_LOG_SIZE should be adjusted and the firmware recompiled.
Call this assumption out in the function documentation.
Also remove the second error condition check, which is a subset of the first one and thus is redundant.
As a result of these changes, add_event2() can no longer fail. Thus, change its return type from int to void.
Also, the 'size_of_event' local variable is now unused in release builds so remove it and move its value into the assertion.
Change-Id: I113fc141de59708b20435a0c7126255561ab7786 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| ddb07a56 | 23-Jun-2021 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
refactor(measured boot): revisit error handling (1/3)
- In event_log_init():
Throughout the function, we are incrementing a pointer by some fixed amounts of bytes (corresponding to the size
refactor(measured boot): revisit error handling (1/3)
- In event_log_init():
Throughout the function, we are incrementing a pointer by some fixed amounts of bytes (corresponding to the size of some data structure or to some constant number of bytes), there is no variable-size increments in the picture. Thus it seems pointless to verify that the pointer has indeed been incremented by this fixed amount of bytes afterwards.
For this reason, remove these checks altogether. As a result, the start_ptr local variable is now unused so remove it as well.
Change-Id: I612e2278cd3a63d1417427e45d81e285503f5efe Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|