From 5847e772a69df4e05c25da36850115e25ac6197d Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sun, 1 Jan 2012 21:22:56 +0000 Subject: [PATCH] set async_event when injecting virq to SVM guest --- bochs/cpu/event.cc | 4 ++-- bochs/cpu/svm.cc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bochs/cpu/event.cc b/bochs/cpu/event.cc index e4deca542..ab754aac7 100755 --- a/bochs/cpu/event.cc +++ b/bochs/cpu/event.cc @@ -296,7 +296,7 @@ bx_bool BX_CPU_C::handleAsyncEvent(void) } #if BX_SUPPORT_SVM else if (BX_CPU_THIS_PTR in_svm_guest && SVM_V_IRQ && BX_CPU_THIS_PTR get_IF() && - (SVM_V_INTR_PRIO > SVM_V_TPR || SVM_V_IGNORE_TPR)) + ((SVM_V_INTR_PRIO > SVM_V_TPR) || SVM_V_IGNORE_TPR)) { // virtual interrupt acknowledge VirtualInterruptAcknowledge(); @@ -354,7 +354,7 @@ bx_bool BX_CPU_C::handleAsyncEvent(void) #endif #if BX_SUPPORT_SVM || (BX_CPU_THIS_PTR in_svm_guest && SVM_V_IRQ && BX_CPU_THIS_PTR get_IF() && - (SVM_V_INTR_PRIO > SVM_V_TPR || SVM_V_IGNORE_TPR)) + ((SVM_V_INTR_PRIO > SVM_V_TPR) || SVM_V_IGNORE_TPR)) #endif #if BX_X86_DEBUGGER // a debug code breakpoint is set in current page diff --git a/bochs/cpu/svm.cc b/bochs/cpu/svm.cc index f7ff5bb2a..a35b1d1b9 100644 --- a/bochs/cpu/svm.cc +++ b/bochs/cpu/svm.cc @@ -531,6 +531,10 @@ bx_bool BX_CPU_C::SvmEnterLoadCheckGuestState(void) if (guest.eflags & EFlagsTFMask) BX_CPU_THIS_PTR async_event = 1; + // injecting virtual interrupt + if (SVM_V_IRQ) + BX_CPU_THIS_PTR async_event = 1; + #if BX_SUPPORT_MONITOR_MWAIT BX_CPU_THIS_PTR monitor.reset_monitor(); #endif