Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


correctly handle NMI exits on VMX architectures
Jack Lange [Mon, 24 Sep 2012 20:21:00 +0000 (16:21 -0400)]
palacios/src/palacios/vmx.c
palacios/src/palacios/vmx_handler.c

index 945ec50..c341982 100644 (file)
@@ -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;
 
 
@@ -1115,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();
 
index 24e2c8e..5a789db 100644 (file)
@@ -108,7 +108,6 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf
                 }
            } else if ((uint8_t)exit_info->int_info == 2) {
                // NMI. Don't do anything
-               V3_Print("NMI Exception Received\n");
             } else {
                 PrintError("Unknown exception: 0x%x\n", (uint8_t)exit_info->int_info);
                 v3_print_GPRs(info);