]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(drtm): take DRTM components measurements before DLME launch
authorManish V Badarkhe <Manish.Badarkhe@arm.com>
Tue, 21 Jun 2022 17:11:53 +0000 (18:11 +0100)
committerManish V Badarkhe <Manish.Badarkhe@arm.com>
Wed, 5 Oct 2022 14:25:28 +0000 (15:25 +0100)
Taken measurement of various DRTM components in the Event Log
buffer to pass it to DLME.

Change-Id: Ic56620161f42596d22bf40d5c83c041cbce0b618
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
services/std_svc/drtm/drtm_main.c

index 53aafeb4bd6a4b29a3f972fcb4a13fbadffe49bf..a96706d594ad9487f9f3fc9625b491dd7d8302b8 100644 (file)
@@ -19,6 +19,7 @@
 #include <common/runtime_svc.h>
 #include <drivers/auth/crypto_mod.h>
 #include "drtm_main.h"
+#include "drtm_measurements.h"
 #include "drtm_remediation.h"
 #include <lib/psci/psci_lib.h>
 #include <lib/xlat_tables/xlat_tables_v2.h>
@@ -392,6 +393,27 @@ static uint64_t drtm_dynamic_launch(uint64_t x1, void *handle)
                SMC_RET1(handle, ret);
        }
 
+       /*
+        * The DMA protection is now engaged.  Note that any failure mode that
+        * returns an error to the DRTM-launch caller must now disengage DMA
+        * protections before returning to the caller.
+        */
+
+       ret = drtm_take_measurements(&args);
+       if (ret != SUCCESS) {
+               goto err_undo_dma_prot;
+       }
+
+       SMC_RET1(handle, ret);
+
+err_undo_dma_prot:
+       dma_prot_ret = drtm_dma_prot_disengage();
+       if (dma_prot_ret != SUCCESS) {
+               ERROR("%s(): drtm_dma_prot_disengage() failed unexpectedly"
+                     " rc=%d\n", __func__, ret);
+               panic();
+       }
+
        SMC_RET1(handle, ret);
 }