Lines Matching refs:sp

78 struct sp_exec_ctx *spmc_get_sp_ec(struct secure_partition_desc *sp)  in spmc_get_sp_ec()  argument
80 return &(sp->ec[get_ec_index(sp)]); in spmc_get_sp_ec()
277 struct secure_partition_desc *sp; in direct_req_smc_handler() local
310 sp = spmc_get_sp_ctx(dst_id); in direct_req_smc_handler()
311 if (sp == NULL) { in direct_req_smc_handler()
322 idx = get_ec_index(sp); in direct_req_smc_handler()
323 if (sp->ec[idx].rt_state != RT_STATE_WAITING) { in direct_req_smc_handler()
325 idx, sp->ec[idx].rt_model); in direct_req_smc_handler()
333 sp->ec[idx].rt_state = RT_STATE_RUNNING; in direct_req_smc_handler()
334 sp->ec[idx].rt_model = RT_MODEL_DIR_REQ; in direct_req_smc_handler()
353 struct secure_partition_desc *sp; in direct_resp_smc_handler() local
381 sp = spmc_get_sp_ctx(ffa_endpoint_source(x1)); in direct_resp_smc_handler()
382 if (sp == NULL) { in direct_resp_smc_handler()
390 idx = get_ec_index(sp); in direct_resp_smc_handler()
391 assert(sp->ec[idx].rt_state == RT_STATE_RUNNING); in direct_resp_smc_handler()
394 if (sp->ec[idx].rt_model != RT_MODEL_DIR_REQ) { in direct_resp_smc_handler()
396 idx, sp->ec[idx].rt_model); in direct_resp_smc_handler()
401 sp->ec[idx].rt_state = RT_STATE_WAITING; in direct_resp_smc_handler()
408 spmc_sp_synchronous_exit(&sp->ec[idx], x4); in direct_resp_smc_handler()
431 struct secure_partition_desc *sp; in msg_wait_handler() local
444 sp = spmc_get_current_sp_ctx(); in msg_wait_handler()
445 if (sp == NULL) { in msg_wait_handler()
453 idx = get_ec_index(sp); in msg_wait_handler()
456 if (sp->ec[idx].rt_model == RT_MODEL_DIR_REQ) { in msg_wait_handler()
461 assert(sp->ec[idx].rt_state == RT_STATE_RUNNING); in msg_wait_handler()
467 if (sp->ec[idx].rt_model == RT_MODEL_INIT) { in msg_wait_handler()
468 spmc_sp_synchronous_exit(&sp->ec[idx], x4); in msg_wait_handler()
474 sp->ec[idx].rt_state = RT_STATE_WAITING; in msg_wait_handler()
477 if (sp->ec[idx].rt_model == RT_MODEL_INTR) { in msg_wait_handler()
503 struct secure_partition_desc *sp; in ffa_error_handler() local
512 sp = spmc_get_current_sp_ctx(); in ffa_error_handler()
513 if (sp == NULL) { in ffa_error_handler()
519 idx = get_ec_index(sp); in ffa_error_handler()
525 if (sp->ec[idx].rt_model == RT_MODEL_INIT) { in ffa_error_handler()
526 ERROR("SP 0x%x failed to initialize.\n", sp->sp_id); in ffa_error_handler()
527 spmc_sp_synchronous_exit(&sp->ec[idx], x2); in ffa_error_handler()
1013 struct secure_partition_desc *sp = spmc_get_current_sp_ctx(); in ffa_features_retrieve_request() local
1019 if (sp->ffa_version == MAKE_FFA_VERSION(1, 1)) { in ffa_features_retrieve_request()
1028 sp->ns_bit_requested = (input_properties & in ffa_features_retrieve_request()
1032 if (sp->ns_bit_requested) { in ffa_features_retrieve_request()
1199 struct secure_partition_desc *sp; in ffa_run_handler() local
1221 sp = spmc_get_sp_ctx(target_id); in ffa_run_handler()
1223 if (sp == NULL) { in ffa_run_handler()
1228 idx = get_ec_index(sp); in ffa_run_handler()
1234 rt_state = &((sp->ec[idx]).rt_state); in ffa_run_handler()
1235 rt_model = &((sp->ec[idx]).rt_model); in ffa_run_handler()
1298 static int validate_secondary_ep(uintptr_t ep, struct secure_partition_desc *sp) in validate_secondary_ep() argument
1307 mb = &sp->mailbox; in validate_secondary_ep()
1340 struct secure_partition_desc *sp; in ffa_sec_ep_register_handler() local
1350 sp = spmc_get_current_sp_ctx(); in ffa_sec_ep_register_handler()
1351 if (sp == NULL) { in ffa_sec_ep_register_handler()
1358 if (sp->runtime_el != S_EL1) { in ffa_sec_ep_register_handler()
1364 sp_ctx = spmc_get_sp_ec(sp); in ffa_sec_ep_register_handler()
1372 if (validate_secondary_ep(x1, sp)) { in ffa_sec_ep_register_handler()
1384 sp->secondary_ep = x1; in ffa_sec_ep_register_handler()
1385 VERBOSE("%s: 0x%lx\n", __func__, sp->secondary_ep); in ffa_sec_ep_register_handler()
1396 struct secure_partition_desc *sp, in sp_manifest_parse() argument
1414 ARRAY_SIZE(sp->uuid), sp->uuid); in sp_manifest_parse()
1426 sp->runtime_el = config_32; in sp_manifest_parse()
1434 sp->ffa_version = config_32; in sp_manifest_parse()
1442 sp->execution_state = config_32; in sp_manifest_parse()
1459 sp->properties = config_32; in sp_manifest_parse()
1493 sp->sp_id = config_32; in sp_manifest_parse()
1512 sp->pwr_mgmt_msgs = config_32; in sp_manifest_parse()
1545 struct secure_partition_desc *sp; in find_and_prepare_sp_context() local
1596 sp = spmc_get_current_sp_ctx(); in find_and_prepare_sp_context()
1603 ret = sp_manifest_parse(sp_manifest, ret, sp, next_image_ep_info, in find_and_prepare_sp_context()
1611 if (sp->runtime_el != S_EL1) { in find_and_prepare_sp_context()
1612 ERROR("Unexpected runtime EL: %d\n", sp->runtime_el); in find_and_prepare_sp_context()
1617 spmc_sp_common_setup(sp, next_image_ep_info, boot_info_reg); in find_and_prepare_sp_context()
1620 spmc_el1_sp_setup(sp, next_image_ep_info); in find_and_prepare_sp_context()
1623 spmc_sp_common_ep_commit(sp, next_image_ep_info); in find_and_prepare_sp_context()
1695 struct secure_partition_desc *sp; in sp_init() local
1698 sp = spmc_get_current_sp_ctx(); in sp_init()
1699 ec = spmc_get_sp_ec(sp); in sp_init()
1703 INFO("Secure Partition (0x%x) init start.\n", sp->sp_id); in sp_init()
1709 sp->sp_id, rc); in sp_init()
1721 struct secure_partition_desc *sp; in initalize_sp_descs() local
1724 sp = &sp_desc[i]; in initalize_sp_descs()
1725 sp->sp_id = INV_SP_ID; in initalize_sp_descs()
1726 sp->mailbox.rx_buffer = NULL; in initalize_sp_descs()
1727 sp->mailbox.tx_buffer = NULL; in initalize_sp_descs()
1728 sp->mailbox.state = MAILBOX_STATE_EMPTY; in initalize_sp_descs()
1729 sp->secondary_ep = 0; in initalize_sp_descs()
1954 struct secure_partition_desc *sp = spmc_get_current_sp_ctx(); in spmc_sp_interrupt_handler() local
1959 assert(sp != NULL); in spmc_sp_interrupt_handler()
1965 if (sp->runtime_el != S_EL1) { in spmc_sp_interrupt_handler()
1972 ec = spmc_get_sp_ec(sp); in spmc_sp_interrupt_handler()
1985 VERBOSE("SP (0x%x) interrupt start on core%u.\n", sp->sp_id, linear_id); in spmc_sp_interrupt_handler()