diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 3d1bdd334e..505f64f89c 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -520,10 +520,10 @@ static void x86_nmi(NMIState *n, int cpu_index, Error **errp) CPU_FOREACH(cs) { X86CPU *cpu = X86_CPU(cs); - if (!cpu->apic_state) { - cpu_interrupt(cs, CPU_INTERRUPT_NMI); - } else { + if (cpu->apic_state) { apic_deliver_nmi(cpu->apic_state); + } else { + cpu_interrupt(cs, CPU_INTERRUPT_NMI); } } }