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()
267 struct secure_partition_desc *sp; in direct_msg_validate_dst_id() local
280 sp = spmc_get_sp_ctx(dst_id); in direct_msg_validate_dst_id()
281 if (sp != NULL) { in direct_msg_validate_dst_id()
337 struct secure_partition_desc *sp; in direct_req_smc_handler() local
385 sp = spmc_get_sp_ctx(dst_id); in direct_req_smc_handler()
386 if (sp == NULL) { in direct_req_smc_handler()
397 idx = get_ec_index(sp); in direct_req_smc_handler()
398 if (sp->ec[idx].rt_state != RT_STATE_WAITING) { in direct_req_smc_handler()
400 idx, sp->ec[idx].rt_model); in direct_req_smc_handler()
408 sp->ec[idx].rt_state = RT_STATE_RUNNING; in direct_req_smc_handler()
409 sp->ec[idx].rt_model = RT_MODEL_DIR_REQ; in direct_req_smc_handler()
410 sp->ec[idx].dir_req_origin_id = src_id; in direct_req_smc_handler()
429 struct secure_partition_desc *sp; in direct_resp_smc_handler() local
457 sp = spmc_get_sp_ctx(ffa_endpoint_source(x1)); in direct_resp_smc_handler()
458 if (sp == NULL) { in direct_resp_smc_handler()
466 idx = get_ec_index(sp); in direct_resp_smc_handler()
467 assert(sp->ec[idx].rt_state == RT_STATE_RUNNING); in direct_resp_smc_handler()
470 if (sp->ec[idx].rt_model != RT_MODEL_DIR_REQ) { in direct_resp_smc_handler()
472 idx, sp->ec[idx].rt_model); in direct_resp_smc_handler()
476 if (sp->ec[idx].dir_req_origin_id != dst_id) { in direct_resp_smc_handler()
478 dst_id, sp->ec[idx].dir_req_origin_id, idx); in direct_resp_smc_handler()
483 sp->ec[idx].rt_state = RT_STATE_WAITING; in direct_resp_smc_handler()
486 sp->ec[idx].dir_req_origin_id = INV_SP_ID; in direct_resp_smc_handler()
493 spmc_sp_synchronous_exit(&sp->ec[idx], x4); in direct_resp_smc_handler()
516 struct secure_partition_desc *sp; in msg_wait_handler() local
529 sp = spmc_get_current_sp_ctx(); in msg_wait_handler()
530 if (sp == NULL) { in msg_wait_handler()
538 idx = get_ec_index(sp); in msg_wait_handler()
541 if (sp->ec[idx].rt_model == RT_MODEL_DIR_REQ) { in msg_wait_handler()
546 assert(sp->ec[idx].rt_state == RT_STATE_RUNNING); in msg_wait_handler()
552 if (sp->ec[idx].rt_model == RT_MODEL_INIT) { in msg_wait_handler()
553 spmc_sp_synchronous_exit(&sp->ec[idx], x4); in msg_wait_handler()
559 sp->ec[idx].rt_state = RT_STATE_WAITING; in msg_wait_handler()
562 if (sp->ec[idx].rt_model == RT_MODEL_INTR) { in msg_wait_handler()
588 struct secure_partition_desc *sp; in ffa_error_handler() local
597 sp = spmc_get_current_sp_ctx(); in ffa_error_handler()
598 if (sp == NULL) { in ffa_error_handler()
604 idx = get_ec_index(sp); in ffa_error_handler()
610 if (sp->ec[idx].rt_model == RT_MODEL_INIT) { in ffa_error_handler()
611 ERROR("SP 0x%x failed to initialize.\n", sp->sp_id); in ffa_error_handler()
612 spmc_sp_synchronous_exit(&sp->ec[idx], x2); in ffa_error_handler()
1130 struct secure_partition_desc *sp = spmc_get_current_sp_ctx(); in ffa_features_retrieve_request() local
1136 if (sp->ffa_version == MAKE_FFA_VERSION(1, 1)) { in ffa_features_retrieve_request()
1145 sp->ns_bit_requested = (input_properties & in ffa_features_retrieve_request()
1149 if (sp->ns_bit_requested) { in ffa_features_retrieve_request()
1316 struct secure_partition_desc *sp; in ffa_run_handler() local
1338 sp = spmc_get_sp_ctx(target_id); in ffa_run_handler()
1340 if (sp == NULL) { in ffa_run_handler()
1345 idx = get_ec_index(sp); in ffa_run_handler()
1351 rt_state = &((sp->ec[idx]).rt_state); in ffa_run_handler()
1352 rt_model = &((sp->ec[idx]).rt_model); in ffa_run_handler()
1415 static int validate_secondary_ep(uintptr_t ep, struct secure_partition_desc *sp) in validate_secondary_ep() argument
1424 mb = &sp->mailbox; in validate_secondary_ep()
1457 struct secure_partition_desc *sp; in ffa_sec_ep_register_handler() local
1467 sp = spmc_get_current_sp_ctx(); in ffa_sec_ep_register_handler()
1468 if (sp == NULL) { in ffa_sec_ep_register_handler()
1475 if (sp->runtime_el != S_EL1) { in ffa_sec_ep_register_handler()
1481 sp_ctx = spmc_get_sp_ec(sp); in ffa_sec_ep_register_handler()
1489 if (validate_secondary_ep(x1, sp)) { in ffa_sec_ep_register_handler()
1501 sp->secondary_ep = x1; in ffa_sec_ep_register_handler()
1502 VERBOSE("%s: 0x%lx\n", __func__, sp->secondary_ep); in ffa_sec_ep_register_handler()
1513 struct secure_partition_desc *sp, in sp_manifest_parse() argument
1531 ARRAY_SIZE(sp->uuid), sp->uuid); in sp_manifest_parse()
1543 sp->runtime_el = config_32; in sp_manifest_parse()
1551 sp->ffa_version = config_32; in sp_manifest_parse()
1559 sp->execution_state = config_32; in sp_manifest_parse()
1576 sp->properties = config_32; in sp_manifest_parse()
1610 sp->sp_id = config_32; in sp_manifest_parse()
1629 sp->pwr_mgmt_msgs = config_32; in sp_manifest_parse()
1662 struct secure_partition_desc *sp; in find_and_prepare_sp_context() local
1713 sp = spmc_get_current_sp_ctx(); in find_and_prepare_sp_context()
1720 ret = sp_manifest_parse(sp_manifest, ret, sp, next_image_ep_info, in find_and_prepare_sp_context()
1728 if (sp->runtime_el != S_EL1) { in find_and_prepare_sp_context()
1729 ERROR("Unexpected runtime EL: %d\n", sp->runtime_el); in find_and_prepare_sp_context()
1734 spmc_sp_common_setup(sp, next_image_ep_info, boot_info_reg); in find_and_prepare_sp_context()
1737 spmc_el1_sp_setup(sp, next_image_ep_info); in find_and_prepare_sp_context()
1740 spmc_sp_common_ep_commit(sp, next_image_ep_info); in find_and_prepare_sp_context()
1812 struct secure_partition_desc *sp; in sp_init() local
1815 sp = spmc_get_current_sp_ctx(); in sp_init()
1816 ec = spmc_get_sp_ec(sp); in sp_init()
1820 INFO("Secure Partition (0x%x) init start.\n", sp->sp_id); in sp_init()
1826 sp->sp_id, rc); in sp_init()
1838 struct secure_partition_desc *sp; in initalize_sp_descs() local
1841 sp = &sp_desc[i]; in initalize_sp_descs()
1842 sp->sp_id = INV_SP_ID; in initalize_sp_descs()
1843 sp->mailbox.rx_buffer = NULL; in initalize_sp_descs()
1844 sp->mailbox.tx_buffer = NULL; in initalize_sp_descs()
1845 sp->mailbox.state = MAILBOX_STATE_EMPTY; in initalize_sp_descs()
1846 sp->secondary_ep = 0; in initalize_sp_descs()
2071 struct secure_partition_desc *sp = spmc_get_current_sp_ctx(); in spmc_sp_interrupt_handler() local
2076 assert(sp != NULL); in spmc_sp_interrupt_handler()
2082 if (sp->runtime_el != S_EL1) { in spmc_sp_interrupt_handler()
2089 ec = spmc_get_sp_ec(sp); in spmc_sp_interrupt_handler()
2102 VERBOSE("SP (0x%x) interrupt start on core%u.\n", sp->sp_id, linear_id); in spmc_sp_interrupt_handler()