diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-03-15 12:26:19 +0100 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-03-16 17:11:05 -0300 |
commit | 4601f7b04c63072c73870d4f4db2a5c5ad5ad8d2 (patch) | |
tree | 9a480ad6a1286ca896ec4a9b785418a926ad40fe /target-i386 | |
parent | f2c1cc81c8229e8c1e26aae517d32aa534936a0c (diff) |
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')
-rw-r--r-- | 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 f7995bd877..3a07fceb2a 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) { |