aboutsummaryrefslogtreecommitdiff
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-03-15 12:26:19 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-03-16 17:11:05 -0300
commit4601f7b04c63072c73870d4f4db2a5c5ad5ad8d2 (patch)
tree9a480ad6a1286ca896ec4a9b785418a926ad40fe /target-i386/kvm.c
parentf2c1cc81c8229e8c1e26aae517d32aa534936a0c (diff)
downloadqemu-4601f7b04c63072c73870d4f4db2a5c5ad5ad8d2.zip
qemu-4601f7b04c63072c73870d4f4db2a5c5ad5ad8d2.tar.gz
qemu-4601f7b04c63072c73870d4f4db2a5c5ad5ad8d2.tar.bz2
kvm: x86: Do not leave halt if interrupts are disabled
When an external interrupt is pending but IF is cleared, we must not leave the halt state prematurely. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c4
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) {