X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx.c;h=c341982e37cbf584e6212fcab4f3c0b453a41f91;hb=a7bd09077efcd826376f9c49ab97f9f9a1fbbefe;hp=3fede2b3e1677a64d5446de6ee7bf2815c87ce9d;hpb=ef99d19f9ee3ff28d07f83c240a557938b3ab0d5;p=palacios.git diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index 3fede2b..c341982 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -184,6 +184,7 @@ static int init_vmcs_bios(struct guest_info * core, struct vmx_data * vmx_state) /* Add external interrupts, NMI exiting, and virtual NMI */ vmx_state->pin_ctrls.nmi_exit = 1; + vmx_state->pin_ctrls.virt_nmi = 1; vmx_state->pin_ctrls.ext_int_exit = 1; @@ -195,10 +196,17 @@ static int init_vmcs_bios(struct guest_info * core, struct vmx_data * vmx_state) vmx_state->exit_ctrls.save_preempt_timer = 1; } + // we want it to use this when halting vmx_state->pri_proc_ctrls.hlt_exit = 1; + // cpuid tells it that it does not have these instructions + vmx_state->pri_proc_ctrls.monitor_exit = 1; + vmx_state->pri_proc_ctrls.mwait_exit = 1; + // we don't need to handle a pause, although this is where + // we could pull out of a spin lock acquire or schedule to find its partner vmx_state->pri_proc_ctrls.pause_exit = 0; + vmx_state->pri_proc_ctrls.tsc_offset = 1; #ifdef V3_CONFIG_TIME_VIRTUALIZE_TSC vmx_state->pri_proc_ctrls.rdtsc_exit = 1; @@ -1108,6 +1116,18 @@ int v3_vmx_enter(struct guest_info * info) { #endif } + + // Lastly we check for an NMI exit, and reinject if so + { + struct vmx_basic_exit_info * basic_info = (struct vmx_basic_exit_info *)&(exit_info.exit_reason); + + if (basic_info->reason == VMX_EXIT_INFO_EXCEPTION_OR_NMI) { + if ((uint8_t)exit_info.int_info == 2) { + asm("int $2"); + } + } + } + // reenable global interrupts after vm exit v3_enable_ints();