ikgt_status_t read_guest_reg(ikgt_vmcs_guest_state_reg_id_t reg_id, uint64_t *value) { ikgt_vmcs_guest_guest_register_t *reg = NULL; ikgt_status_t status; *value = 0; reg = (ikgt_vmcs_guest_guest_register_t *) ikgt_malloc(sizeof(ikgt_vmcs_guest_guest_register_t)); if (NULL == reg) { ikgt_printf("[ERROR] HANDLER: Failed to allocate memory in\ read_guest_reg()\n"); return IKGT_STATUS_ERROR; }
/* Function name: handle_msg_event * * Purpose: * Contains policy to handle agent msg events * * Input: IKGT Event Info * Return: None * */ void handle_msg_event(ikgt_event_info_t *event_info) { policy_message_t *msg = NULL; ikgt_status_t status; msg = ikgt_malloc(sizeof(policy_message_t)); if (NULL == msg) { return; } status = ikgt_copy_gva_to_hva((gva_t)event_info->event_specific_data, sizeof(policy_message_t), (hva_t)msg); if (IKGT_STATUS_SUCCESS != status) { ikgt_free(msg); return; } DPRINTF("%s: command=%d, count=%d\n", __func__, msg->command, msg->count); switch (msg->command) { case POLICY_INIT_LOG: handle_msg_init(event_info, &msg->log_param); break; case POLICY_ENTRY_ENABLE: handle_msg_policy_enable(event_info, &msg->policy_data[0]); break; case POLICY_ENTRY_DISABLE: handle_msg_policy_disable(event_info, &msg->policy_data[0]); break; case POLICY_MAKE_IMMUTABLE: handle_msg_policy_make_immutable(event_info, &msg->policy_data[0]); break; #ifdef DEBUG case POLICY_DEBUG: handle_msg_debug(event_info, &msg->debug_param); break; #endif } ikgt_free(msg); }