X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx.c;h=2c6b573f449730f78baf4ab43db6bcfa878fcd44;hb=8f8feb4e743fa906919d43acc1e2013638837162;hp=eb79fa352c65dce90fcef02facbf41f3470341a8;hpb=9058423c8215f5abb3ad2fb789c5b16a250e7c65;p=palacios-OLD.git diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index eb79fa3..2c6b573 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -641,6 +641,13 @@ int v3_vmx_enter(struct guest_info * info) { // disable global interrupts for vm state transition v3_disable_ints(); + + if (active_vmcs_ptrs[V3_Get_CPU()] != vmx_info->vmcs_ptr_phys) { + vmcs_load(vmx_info->vmcs_ptr_phys); + active_vmcs_ptrs[V3_Get_CPU()] = vmx_info->vmcs_ptr_phys; + } + + v3_vmx_restore_vmcs(info); @@ -666,10 +673,6 @@ int v3_vmx_enter(struct guest_info * info) { check_vmcs_write(VMCS_TSC_OFFSET_HIGH, tsc_offset_high); check_vmcs_write(VMCS_TSC_OFFSET, tsc_offset_low); - if (active_vmcs_ptrs[V3_Get_CPU()] != vmx_info->vmcs_ptr_phys) { - vmcs_load(vmx_info->vmcs_ptr_phys); - active_vmcs_ptrs[V3_Get_CPU()] = vmx_info->vmcs_ptr_phys; - } if (vmx_info->state == VMX_UNLAUNCHED) { vmx_info->state = VMX_LAUNCHED; @@ -726,10 +729,15 @@ int v3_vmx_enter(struct guest_info * info) { update_irq_exit_state(info); #endif - // Handle any exits needed still in the atomic section - if (v3_handle_atomic_vmx_exit(info, &exit_info) == -1) { - PrintError("Error in atomic VMX exit handler\n"); - return -1; + if (exit_info.exit_reason == VMEXIT_INTR_WINDOW) { + // This is a special case whose only job is to inject an interrupt + vmcs_read(VMCS_PROC_CTRLS, &(vmx_info->pri_proc_ctrls.value)); + vmx_info->pri_proc_ctrls.int_wndw_exit = 0; + vmcs_write(VMCS_PROC_CTRLS, vmx_info->pri_proc_ctrls.value); + +#ifdef CONFIG_DEBUG_INTERRUPTS + PrintDebug("Interrupts available again! (RIP=%llx)\n", info->rip); +#endif } // reenable global interrupts after vm exit @@ -834,6 +842,12 @@ int v3_is_vmx_capable() { } static int has_vmx_nested_paging() { + /* We assume that both EPT and unrestricted guest mode (Intel's Virtual Real Mode) + * are mutually assured. i.e. We have either both or neither. + */ + + + return 0; }