diff options
author | Ken Liu <ken.liu@arm.com> | 2020-06-16 11:27:50 +0800 |
---|---|---|
committer | Summer Qin <summer.qin@arm.com> | 2020-07-10 14:20:14 +0800 |
commit | 39791cc4fded136f5e06a5591f2736d80ff18d33 (patch) | |
tree | e6948c4fd39a0ac243a0b4098f2420e640bd79e3 | |
parent | a6b336c1509fd5f5522450e3cec0fcd6c060f9c8 (diff) | |
download | trusted-firmware-m-39791cc4fded136f5e06a5591f2736d80ff18d33.tar.gz |
SPM: Remove unused function
Remove the unused function 'tfm_core_validate_secure_caller'
and 'tfm_spm_validate_secure_caller_handler' from SPM.
Change-Id: I4aa110798d2e0306a05ffd278163c6bd5c48932e
Signed-off-by: Ken Liu <ken.liu@arm.com>
-rw-r--r-- | secure_fw/include/tfm/tfm_core_svc.h | 1 | ||||
-rw-r--r-- | secure_fw/spm/include/spm_api.h | 5 | ||||
-rw-r--r-- | secure_fw/spm/include/tfm_secure_api.h | 2 | ||||
-rw-r--r-- | secure_fw/spm/model_func/spm_func.c | 32 | ||||
-rw-r--r-- | secure_fw/spm/model_func/tfm_core_svcalls_func.c | 3 | ||||
-rw-r--r-- | secure_fw/spm/runtime/tfm_spm_services.c | 9 |
6 files changed, 0 insertions, 52 deletions
diff --git a/secure_fw/include/tfm/tfm_core_svc.h b/secure_fw/include/tfm/tfm_core_svc.h index 03597e29db..19ebd89f92 100644 --- a/secure_fw/include/tfm/tfm_core_svc.h +++ b/secure_fw/include/tfm/tfm_core_svc.h @@ -13,7 +13,6 @@ typedef enum { TFM_SVC_SFN_REQUEST = 0, TFM_SVC_SFN_RETURN, - TFM_SVC_VALIDATE_SECURE_CALLER, TFM_SVC_GET_CALLER_CLIENT_ID, TFM_SVC_SPM_REQUEST, TFM_SVC_GET_BOOT_DATA, diff --git a/secure_fw/spm/include/spm_api.h b/secure_fw/spm/include/spm_api.h index 92e1409981..16da007ac7 100644 --- a/secure_fw/spm/include/spm_api.h +++ b/secure_fw/spm/include/spm_api.h @@ -405,11 +405,6 @@ uint32_t tfm_spm_partition_request_svc_handler( uint32_t tfm_spm_partition_return_handler(uint32_t lr); /** - * \brief Called by secure service to check if client is secure - */ -void tfm_spm_validate_secure_caller_handler(uint32_t *svc_args); - -/** * \brief Stores caller's client id in state context */ void tfm_spm_get_caller_client_id_handler(uint32_t *svc_args); diff --git a/secure_fw/spm/include/tfm_secure_api.h b/secure_fw/spm/include/tfm_secure_api.h index 818f55c0d6..206dbb2161 100644 --- a/secure_fw/spm/include/tfm_secure_api.h +++ b/secure_fw/spm/include/tfm_secure_api.h @@ -83,8 +83,6 @@ enum tfm_memory_access_e { TFM_MEMORY_ACCESS_RW = 2, }; -extern int32_t tfm_core_validate_secure_caller(void); - extern int32_t tfm_core_get_caller_client_id(int32_t *caller_client_id); extern int32_t tfm_core_get_boot_data(uint8_t major_type, diff --git a/secure_fw/spm/model_func/spm_func.c b/secure_fw/spm/model_func/spm_func.c index 65c63b54cb..923f466a91 100644 --- a/secure_fw/spm/model_func/spm_func.c +++ b/secure_fw/spm/model_func/spm_func.c @@ -694,38 +694,6 @@ int32_t tfm_spm_sfn_request_thread_mode(struct tfm_sfn_req_s *desc_ptr) return (int32_t)res; } -void tfm_spm_validate_secure_caller_handler(uint32_t *svc_args) -{ - - enum tfm_status_e res = TFM_ERROR_GENERIC; - uint32_t running_partition_idx = - tfm_spm_partition_get_running_partition_idx(); - const struct spm_partition_runtime_data_t *curr_part_data = - tfm_spm_partition_get_runtime_data(running_partition_idx); - uint32_t running_partition_flags = - tfm_spm_partition_get_flags(running_partition_idx); - uint32_t caller_partition_flags = - tfm_spm_partition_get_flags(curr_part_data->caller_partition_idx); - - if (!(running_partition_flags & SPM_PART_FLAG_APP_ROT) || - curr_part_data->partition_state == SPM_PARTITION_STATE_HANDLING_IRQ || - curr_part_data->partition_state == SPM_PARTITION_STATE_SUSPENDED) { - /* This handler shouldn't be called from outside partition context. - * Also if the current partition is handling IRQ, the caller partition - * index might not be valid; - * Partitions are only allowed to run while S domain is locked. - */ - svc_args[0] = (uint32_t)TFM_ERROR_INVALID_PARAMETER; - return; - } - - /* Store return value in r0 */ - if (caller_partition_flags & SPM_PART_FLAG_APP_ROT) { - res = TFM_SUCCESS; - } - svc_args[0] = (uint32_t)res; -} - int32_t tfm_spm_check_buffer_access(uint32_t partition_idx, void *start_addr, size_t len, diff --git a/secure_fw/spm/model_func/tfm_core_svcalls_func.c b/secure_fw/spm/model_func/tfm_core_svcalls_func.c index afa5c57186..215c460e7c 100644 --- a/secure_fw/spm/model_func/tfm_core_svcalls_func.c +++ b/secure_fw/spm/model_func/tfm_core_svcalls_func.c @@ -57,9 +57,6 @@ uint32_t tfm_core_svc_handler(uint32_t *svc_args, uint32_t lr, uint32_t *msp) case TFM_SVC_SFN_RETURN: lr = tfm_spm_partition_return_handler(lr); break; - case TFM_SVC_VALIDATE_SECURE_CALLER: - tfm_spm_validate_secure_caller_handler(svc_args); - break; case TFM_SVC_GET_CALLER_CLIENT_ID: tfm_spm_get_caller_client_id_handler(svc_args); break; diff --git a/secure_fw/spm/runtime/tfm_spm_services.c b/secure_fw/spm/runtime/tfm_spm_services.c index 25c65141b9..7b73d4ce75 100644 --- a/secure_fw/spm/runtime/tfm_spm_services.c +++ b/secure_fw/spm/runtime/tfm_spm_services.c @@ -32,15 +32,6 @@ int32_t tfm_core_get_caller_client_id(int32_t *caller_client_id) : : "I" (TFM_SVC_GET_CALLER_CLIENT_ID)); } -__attribute__((naked)) -int32_t tfm_core_validate_secure_caller(void) -{ - __ASM volatile( - "SVC %0\n" - "BX lr\n" - : : "I" (TFM_SVC_VALIDATE_SECURE_CALLER)); -} - #endif __attribute__((naked)) |