refactor(measured boot): move image measurement to generic layer
Right now, the assumption is that the platform post-load hook takes
care of measuring the image that just got loaded. This is how it's
implemented on FVP.
This patch moves the measurement into the generic code
instead. load_auth_image() now calls plat_mboot_measure_image(),
which is a new platform interface introduced in this patch to measure
an image. This is called just after authenticating the image.
Implement plat_mboot_measure_image() for the Arm FVP platform. The code
is copied straight from the post-load hook.
As a result, the FVP specific implementation of
arm_bl2_plat_handle_post_image_load() is no longer needed. We can go
back to using the Arm generic implementation of it.
Change-Id: I7b4b8d28941a865e10af9d0eadaf2e4850942090
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index 5fc21a5..bbf8ee80 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -213,6 +213,7 @@
void bl2_plat_mboot_init(void);
void bl2_plat_mboot_finish(void);
+int plat_mboot_measure_image(unsigned int image_id);
#else
static inline void bl2_plat_mboot_init(void)
{
@@ -220,6 +221,10 @@
static inline void bl2_plat_mboot_finish(void)
{
}
+static inline int plat_mboot_measure_image(unsigned int image_id __unused)
+{
+ return 0;
+}
#endif /* MEASURED_BOOT */
/*******************************************************************************