feat(rmmd): el3-rmm ide key management interface
Patch introduces the EL3-RMM SMC Interface for Root Port
Key management as per RFC discussed here:
https://github.com/TF-RMM/tf-rmm/wiki/RFC:-EL3-RMM-IDE-KM-Interface
Three IDE Key management smc calls have been added:
- RMM_IDE_KEY_PROG()
- RMM_IDE_KEY_SET_GO()
- RMM_IDE_KEY_SET_STOP()
- RMM_IDE_KM_PULL_RESPONSE()
Due to the absence of root port support in FVP, we are
currently adding placeholders in this patch for the platform
APIs to return success irrespective of the arguments being passed
by the caller(Realms). The SMCs are guarded by
`RMMD_ENABLE_IDE_KEY_PROG` build flag and is disabled by default.
We expect that once the SMCs are stabilized, this build flag will
not be required anymore.
Change-Id: I9411eb7787dac2a207bd14710d251503bd9626ce
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
diff --git a/services/std_svc/rmmd/rmmd_main.c b/services/std_svc/rmmd/rmmd_main.c
index 19c8373..35582dc 100644
--- a/services/std_svc/rmmd/rmmd_main.c
+++ b/services/std_svc/rmmd/rmmd_main.c
@@ -561,6 +561,37 @@
case RMM_EL3_TOKEN_SIGN:
return rmmd_el3_token_sign(handle, x1, x2, x3, x4);
#endif
+
+#if RMMD_ENABLE_IDE_KEY_PROG
+ case RMM_IDE_KEY_PROG:
+ {
+ rp_ide_key_info_t ide_key_info;
+
+ ide_key_info.keyqw0 = x4;
+ ide_key_info.keyqw1 = SMC_GET_GP(handle, CTX_GPREG_X5);
+ ide_key_info.keyqw2 = SMC_GET_GP(handle, CTX_GPREG_X6);
+ ide_key_info.keyqw3 = SMC_GET_GP(handle, CTX_GPREG_X7);
+ ide_key_info.ifvqw0 = SMC_GET_GP(handle, CTX_GPREG_X8);
+ ide_key_info.ifvqw1 = SMC_GET_GP(handle, CTX_GPREG_X9);
+ uint64_t x10 = SMC_GET_GP(handle, CTX_GPREG_X10);
+ uint64_t x11 = SMC_GET_GP(handle, CTX_GPREG_X11);
+
+ ret = rmmd_el3_ide_key_program(x1, x2, x3, &ide_key_info, x10, x11);
+ SMC_RET1(handle, ret);
+ }
+ case RMM_IDE_KEY_SET_GO:
+ ret = rmmd_el3_ide_key_set_go(x1, x2, x3, x4, SMC_GET_GP(handle, CTX_GPREG_X5));
+ SMC_RET1(handle, ret);
+ case RMM_IDE_KEY_SET_STOP:
+ ret = rmmd_el3_ide_key_set_stop(x1, x2, x3, x4, SMC_GET_GP(handle, CTX_GPREG_X5));
+ SMC_RET1(handle, ret);
+ case RMM_IDE_KM_PULL_RESPONSE: {
+ uint64_t req_resp = 0, req_id = 0, cookie_var = 0;
+
+ ret = rmmd_el3_ide_km_pull_response(x1, x2, &req_resp, &req_id, &cookie_var);
+ SMC_RET4(handle, ret, req_resp, req_id, cookie_var);
+ }
+#endif /* RMMD_ENABLE_IDE_KEY_PROG */
case RMM_BOOT_COMPLETE:
VERBOSE("RMMD: running rmmd_rmm_sync_exit\n");
rmmd_rmm_sync_exit(x1);