From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54757 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzcC7-0006Hr-PV for qemu-devel@nongnu.org; Tue, 15 Mar 2011 17:56:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzcB2-0003NT-0U for qemu-devel@nongnu.org; Tue, 15 Mar 2011 17:54:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzcB1-0003NE-Mw for qemu-devel@nongnu.org; Tue, 15 Mar 2011 17:53:15 -0400 From: Marcelo Tosatti Date: Tue, 15 Mar 2011 18:50:37 -0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 23/35] kvm: x86: Do not leave halt if interrupts are disabled List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Jan Kiszka When an external interrupt is pending but IF is cleared, we must not leave the halt state prematurely. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- target-i386/kvm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index f7995bd..3a07fce 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1590,7 +1590,9 @@ int kvm_arch_process_async_events(CPUState *env) return 0; } - if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)) { + if (((env->interrupt_request & CPU_INTERRUPT_HARD) && + (env->eflags & IF_MASK)) || + (env->interrupt_request & CPU_INTERRUPT_NMI)) { env->halted = 0; } if (env->interrupt_request & CPU_INTERRUPT_INIT) { -- 1.7.4