From: Jack Lange Date: Mon, 16 Mar 2009 23:24:55 +0000 (-0500) Subject: added checks to only mark interrupts as taken if SVM says they've been X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=0b276ccfe1caf79b6c2752bf26d0e9933e52fb32 added checks to only mark interrupts as taken if SVM says they've been --- diff --git a/palacios/include/palacios/vmm_intr.h b/palacios/include/palacios/vmm_intr.h index 6008a66..be407c1 100644 --- a/palacios/include/palacios/vmm_intr.h +++ b/palacios/include/palacios/vmm_intr.h @@ -74,6 +74,9 @@ struct v3_intr_state { struct list_head controller_list; + uint_t irq_pending; + uint_t irq_vector; + /* some way to get the [A]PIC intr */ struct v3_irq_hook * hooks[256]; diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index b89d28c..4d5ce3e 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -71,6 +71,11 @@ int v3_handle_svm_exit(struct guest_info * info) { exit_code = guest_ctrl->exit_code; + if ((info->intr_state.irq_pending) && (guest_ctrl->guest_ctrl.V_IRQ = 0)) { + // Interrupt was taken in the guest + v3_injecting_intr(info, info->intr_state.irq_vector, EXTERNAL_IRQ); + info->intr_state.irq_pending = 0; + } @@ -362,7 +367,9 @@ int v3_handle_svm_exit(struct guest_info * info) { guest_ctrl->guest_ctrl.V_INTR_VECTOR, (void *)(addr_t)info->rip); #endif - v3_injecting_intr(info, irq, EXTERNAL_IRQ); + info->intr_state.irq_pending = 1; + info->intr_state.irq_vector = irq; + break; }