X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_handler.c;h=1da5abd8054f9a8b5271c8a8f5b8079f690ba567;hp=ee1824facb375b8da64fa4dac94baa3fedcf8ddb;hb=ed8feff1d5dd6bf028cd5ba0960ec125505d7597;hpb=1cd2958b5eb63b2ac63ced17447ba3b45c43f51a diff --git a/palacios/src/palacios/vmx_handler.c b/palacios/src/palacios/vmx_handler.c index ee1824f..1da5abd 100644 --- a/palacios/src/palacios/vmx_handler.c +++ b/palacios/src/palacios/vmx_handler.c @@ -67,10 +67,10 @@ static int inline handle_cr_access(struct guest_info * info, ulong_t exit_qual) // PrintDebug("Control register: %d\n", cr_qual->access_type); switch(cr_qual->cr_id) { case 0: - PrintDebug("Handling CR0 Access\n"); + //PrintDebug("Handling CR0 Access\n"); return v3_vmx_handle_cr0_access(info); case 3: - PrintDebug("Handling CR3 Access\n"); + //PrintDebug("Handling CR3 Access\n"); return v3_vmx_handle_cr3_access(info); default: PrintError("Unhandled CR access: %d\n", cr_qual->cr_id); @@ -201,6 +201,19 @@ int v3_handle_vmx_exit(struct v3_gprs * gprs, struct guest_info * info, struct v } break; + case VMEXIT_VMCALL: + /* + * Hypercall + */ + + // VMCALL is a 3 byte op + // We do this early because some hypercalls can change the rip... + info->rip += 3; + + if (v3_handle_hypercall(info) == -1) { + return -1; + } + break; case VMEXIT_IO_INSTR: { struct vmx_exit_io_qual * io_qual = (struct vmx_exit_io_qual *)&exit_qual; @@ -293,12 +306,16 @@ int v3_handle_vmx_exit(struct v3_gprs * gprs, struct guest_info * info, struct v check_vmcs_write(VMCS_ENTRY_EXCP_ERR, info->excp_state.excp_error_code); int_info.error_code = 1; +#ifdef CONFIG_DEBUG_INTERRUPTS PrintDebug("Injecting exception %d with error code %x\n", int_info.vector, info->excp_state.excp_error_code); +#endif } int_info.valid = 1; +#ifdef CONFIG_DEBUG_INTERRUPTS PrintDebug("Injecting exception %d (EIP=%p)\n", int_info.vector, (void *)info->rip); +#endif check_vmcs_write(VMCS_ENTRY_INT_INFO, int_info.value); v3_injecting_excp(info, int_info.vector);