X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=d4a6fd79848a421d33d5966fc5e1e601024df96a;hb=65d6fc15c5a6bf951c578b8d45932a65fb1a0c63;hp=c92da0cf43f5d79afec4a10a53f04b62b2ebe55d;hpb=ea2c3508b25e832976994db6ccedb4be94137e48;p=palacios.git diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index c92da0c..d4a6fd7 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -306,7 +306,7 @@ static int update_irq_exit_state(struct guest_info * info) { // Interrupt was taken fully vectored info->intr_core_state.irq_started = 0; - } else { + } else if ((info->intr_core_state.irq_started == 1) && (guest_ctrl->exit_int_info.valid == 1)) { #ifdef CONFIG_DEBUG_INTERRUPTS PrintDebug("EXIT INT INFO is set (vec=%d)\n", guest_ctrl->exit_int_info.vector); #endif @@ -319,6 +319,12 @@ static int update_irq_exit_state(struct guest_info * info) { static int update_irq_entry_state(struct guest_info * info) { vmcb_ctrl_t * guest_ctrl = GET_VMCB_CTRL_AREA((vmcb_t*)(info->vmm_data)); + + if (info->intr_core_state.irq_pending == 0) { + guest_ctrl->guest_ctrl.V_IRQ = 0; + guest_ctrl->guest_ctrl.V_INTR_VECTOR = 0; + } + if (v3_excp_pending(info)) { uint_t excp = v3_get_excp_number(info); @@ -435,8 +441,8 @@ int v3_svm_enter(struct guest_info * info) { guest_state->rip = info->rip; guest_state->rsp = info->vm_regs.rsp; -#ifdef CONFIG_SYMBIOTIC - if (info->vm_info->sym_state.symcalls[info->cpu_id].sym_call_active == 0) { +#ifdef CONFIG_SYMCALL + if (info->sym_core_state.symcall_state.sym_call_active == 0) { update_irq_entry_state(info); } #else @@ -452,8 +458,8 @@ int v3_svm_enter(struct guest_info * info) { (void *)(addr_t)info->rip); */ -#ifdef CONFIG_SYMBIOTIC - if (info->vm_info->sym_state.symcalls[info->cpu_id].sym_call_active == 1) { +#ifdef CONFIG_SYMCALL + if (info->sym_core_state.symcall_state.sym_call_active == 1) { if (guest_ctrl->guest_ctrl.V_IRQ == 1) { V3_Print("!!! Injecting Interrupt during Sym call !!!\n"); } @@ -463,13 +469,15 @@ int v3_svm_enter(struct guest_info * info) { rdtscll(info->time_state.cached_host_tsc); guest_ctrl->TSC_OFFSET = info->time_state.guest_tsc - info->time_state.cached_host_tsc; + + //V3_Print("Calling v3_svm_launch\n"); v3_svm_launch((vmcb_t *)V3_PAddr(info->vmm_data), &(info->vm_regs), (vmcb_t *)host_vmcbs[info->cpu_id]); + //V3_Print("SVM Returned: Exit Code: %x, guest_rip=%lx\n", (uint32_t)(guest_ctrl->exit_code), (unsigned long)guest_state->rip); - v3_last_exit = (uint32_t)(guest_ctrl->exit_code); - // v3_print_cond("SVM Returned: Exit Code: %x\n", (uint32_t)(guest_ctrl->exit_code)); + v3_last_exit = (uint32_t)(guest_ctrl->exit_code); rdtscll(tmp_tsc); @@ -509,8 +517,8 @@ int v3_svm_enter(struct guest_info * info) { exit_info2 = guest_ctrl->exit_info2; -#ifdef CONFIG_SYMBIOTIC - if (info->vm_info->sym_state.symcalls[info->cpu_id].sym_call_active == 0) { +#ifdef CONFIG_SYMCALL + if (info->sym_core_state.symcall_state.sym_call_active == 0) { update_irq_exit_state(info); } #else