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.


updated the pci and IDE configuration.
[palacios.git] / palacios / src / palacios / svm_handler.c
index 931bb99..6d38fb7 100644 (file)
@@ -72,11 +72,13 @@ int v3_handle_svm_exit(struct guest_info * info) {
 
 
     if ((info->intr_state.irq_pending == 1) && (guest_ctrl->guest_ctrl.V_IRQ == 0)) {
-       // Interrupt was taken in the guest
+
 #ifdef DEBUG_INTERRUPTS
        PrintDebug("Interrupt %d taken by guest\n", info->intr_state.irq_vector);
 #endif
        if (!guest_ctrl->exit_int_info.valid) {
+           info->intr_state.irq_pending = 0;
+           // PrintDebug("Injected Interrupt %d\n", info->intr_state.irq_vector);
            v3_injecting_intr(info, info->intr_state.irq_vector, EXTERNAL_IRQ);
        } else {
 #ifdef DEBUG_INTERRUPTS
@@ -85,14 +87,12 @@ int v3_handle_svm_exit(struct guest_info * info) {
        }
     }
 
-    info->intr_state.irq_pending = 0;
+
   
 
     // Disable printing io exits due to bochs debug messages
     //if (!((exit_code == VMEXIT_IOIO) && ((ushort_t)(guest_ctrl->exit_info1 >> 16) == 0x402))) {
     
-    
-    //  PrintDebug("SVM Returned: Exit Code: 0x%x \t\t(tsc=%ul)\n",exit_code, (uint_t)info->time_state.guest_tsc); 
   
     if ((0) && (exit_code <= VMEXIT_EXCP14)) {
        uchar_t instr[32];
@@ -139,7 +139,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
     switch (exit_code) {
        case VMEXIT_IOIO: {
            struct svm_io_info * io_info = (struct svm_io_info *)&(guest_ctrl->exit_info1);
-               
+
            if (io_info->type == 0) {
                if (io_info->str) {
 
@@ -360,8 +360,14 @@ int v3_handle_svm_exit(struct guest_info * info) {
 
 
     // Update the low level state
+    if (info->intr_state.irq_pending == 1) {
+
+       guest_ctrl->guest_ctrl.V_IRQ = 1;
+       guest_ctrl->guest_ctrl.V_INTR_VECTOR = info->intr_state.irq_vector;
+       guest_ctrl->guest_ctrl.V_IGN_TPR = 1;
+       guest_ctrl->guest_ctrl.V_INTR_PRIO = 0xf;
 
-    if (v3_excp_pending(info)) {
+    } else if (v3_excp_pending(info)) {
        uint_t excp = v3_get_excp_number(info);
                
        guest_ctrl->EVENTINJ.type = SVM_INJECTION_EXCEPTION;