feat(qemu): hand off TPM event log via TL

If TRANSFER_LIST is enabled, hand off TPM event log via TL instead
of DT; otherwise fallback to legacy way if TRANSFER_LIST is off or
errors observed.

Moreover, for updating the TL from secure to non-secure
memory before existing EL3, replace memcpy with function
transfer_list_relocate() for more accuracy.

Change-Id: I1d6bcf573f91efe99380bc89195198a8583b1def
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
This commit is contained in:
Raymond Mao 2024-12-27 07:20:25 -08:00
parent 4d8b4ca0f5
commit cc58f08fe6
2 changed files with 12 additions and 3 deletions

View file

@ -325,10 +325,12 @@ void bl31_plat_runtime_setup(void)
#if TRANSFER_LIST
if (bl31_tl) {
/*
* update the TL from S to NS memory before jump to BL33
* Relocate the TL from S to NS memory before EL3 exit
* to reflect all changes in TL done by BL32
*/
memcpy((void *)FW_NS_HANDOFF_BASE, bl31_tl, bl31_tl->max_size);
if (!transfer_list_relocate(bl31_tl, (void *)FW_NS_HANDOFF_BASE,
bl31_tl->max_size))
ERROR("Relocate TL to NS memory failed\n");
}
#endif

View file

@ -65,6 +65,14 @@ void bl2_plat_mboot_finish(void)
event_log_cur_size = event_log_get_cur_size((uint8_t *)event_log_base);
dump_event_log((uint8_t *)event_log_base, event_log_cur_size);
#if TRANSFER_LIST
if (!plat_handoff_mboot((void *)event_log_base, event_log_cur_size,
(void *)(uintptr_t)FW_HANDOFF_BASE))
return;
#endif
rc = qemu_set_nt_fw_info(
#ifdef SPD_opteed
(uintptr_t)event_log_base,
@ -101,7 +109,6 @@ void bl2_plat_mboot_finish(void)
}
#endif /* defined(SPD_tspd) || defined(SPD_spmd) */
dump_event_log((uint8_t *)event_log_base, event_log_cur_size);
}
int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data)