From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTWGc-0003xL-K7 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:52:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTWGS-0000MX-ME for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:52:14 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:47310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTWGR-0000Lg-UM for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:52:04 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Mar 2014 22:52:00 +1000 From: Alexey Kardashevskiy Date: Fri, 28 Mar 2014 23:51:49 +1100 Message-Id: <1396011112-23559-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1396011112-23559-1-git-send-email-aik@ozlabs.ru> References: <1396011112-23559-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v2 2/5] target-i386: Implement nmi() callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Paolo Bonzini , qemu-ppc@nongnu.org, Alexander Graf , Thomas Huth Signed-off-by: Alexey Kardashevskiy --- target-i386/cpu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 8fd1497..35f20e0 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2489,6 +2489,19 @@ static void x86_cpu_reset(CPUState *s) #endif } +static int x86_cpu_nmi(CPUState *cs) +{ + X86CPU *cpu = X86_CPU(cs); + + if (!cpu->apic_state) { + cpu_interrupt(cs, CPU_INTERRUPT_NMI); + } else { + apic_deliver_nmi(cpu->apic_state); + } + + return 0; +} + #ifndef CONFIG_USER_ONLY bool cpu_is_bsp(X86CPU *cpu) { @@ -2797,6 +2810,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) xcc->parent_reset = cc->reset; cc->reset = x86_cpu_reset; + cc->nmi = x86_cpu_nmi; cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP; cc->class_by_name = x86_cpu_class_by_name; -- 1.8.4.rc4