Lines Matching full:task
1126 static void tdx_get_quote_completion(TdxGenerateQuoteTask *task) in tdx_get_quote_completion() argument
1128 TdxGuest *tdx = task->opaque; in tdx_get_quote_completion()
1136 if (task->status_code == TDX_VP_GET_QUOTE_SUCCESS) { in tdx_get_quote_completion()
1137 ret = address_space_write(&address_space_memory, task->payload_gpa, in tdx_get_quote_completion()
1138 MEMTXATTRS_UNSPECIFIED, task->receive_buf, in tdx_get_quote_completion()
1139 task->receive_buf_received); in tdx_get_quote_completion()
1143 task->hdr.out_len = cpu_to_le64(task->receive_buf_received); in tdx_get_quote_completion()
1146 task->hdr.error_code = cpu_to_le64(task->status_code); in tdx_get_quote_completion()
1150 ret = address_space_write(&address_space_memory, task->buf_gpa, in tdx_get_quote_completion()
1151 MEMTXATTRS_UNSPECIFIED, &task->hdr, in tdx_get_quote_completion()
1157 g_free(task->send_data); in tdx_get_quote_completion()
1158 g_free(task->receive_buf); in tdx_get_quote_completion()
1159 g_free(task); in tdx_get_quote_completion()
1165 TdxGenerateQuoteTask *task; in tdx_handle_get_quote() local
1220 task = g_new(TdxGenerateQuoteTask, 1); in tdx_handle_get_quote()
1221 task->buf_gpa = buf_gpa; in tdx_handle_get_quote()
1222 task->payload_gpa = buf_gpa + TDX_GET_QUOTE_HDR_SIZE; in tdx_handle_get_quote()
1223 task->payload_len = buf_len - TDX_GET_QUOTE_HDR_SIZE; in tdx_handle_get_quote()
1224 task->hdr = hdr; in tdx_handle_get_quote()
1225 task->completion = tdx_get_quote_completion; in tdx_handle_get_quote()
1227 task->send_data_size = le32_to_cpu(hdr.in_len); in tdx_handle_get_quote()
1228 task->send_data = g_malloc(task->send_data_size); in tdx_handle_get_quote()
1229 task->send_data_sent = 0; in tdx_handle_get_quote()
1231 if (address_space_read(&address_space_memory, task->payload_gpa, in tdx_handle_get_quote()
1232 MEMTXATTRS_UNSPECIFIED, task->send_data, in tdx_handle_get_quote()
1233 task->send_data_size) != MEMTX_OK) { in tdx_handle_get_quote()
1245 task->receive_buf = g_malloc0(task->payload_len); in tdx_handle_get_quote()
1246 task->receive_buf_received = 0; in tdx_handle_get_quote()
1247 task->opaque = tdx_guest; in tdx_handle_get_quote()
1250 tdx_generate_quote(task, tdx_guest->qg_sock_addr); in tdx_handle_get_quote()
1255 g_free(task->send_data); in tdx_handle_get_quote()
1256 g_free(task); in tdx_handle_get_quote()