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>
master
Jan Kiszka 2011-03-15 12:26:19 +01:00 committed by Marcelo Tosatti
parent f2c1cc81c8
commit 4601f7b04c
1 changed files with 3 additions and 1 deletions

View File

@ -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) {