summary refs log tree commit diff stats
path: root/hw/core/nmi.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-06-15 13:24:50 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-06-15 13:24:51 +0100
commit46bca5404b08201bb9df1ac32bc88fc7e6db1f74 (patch)
treed4501d9f7027a6cbe51c3ab828d6f75a8f6d5087 /hw/core/nmi.c
parentf3e3b083d4c266ea864ae3c83da49d4086857679 (diff)
parent8369e339d24f365750da456588e742674c153437 (diff)
downloadfocaccia-qemu-46bca5404b08201bb9df1ac32bc88fc7e6db1f74.tar.gz
focaccia-qemu-46bca5404b08201bb9df1ac32bc88fc7e6db1f74.zip
Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20150615' into staging
s390x/kvm/watchdog

1. Implement a diag288 based watchdog
2. Fix virtio-ccw BIOS for gcc >= 4.9

# gpg: Signature made Mon Jun 15 12:36:25 2015 BST using RSA key ID B5A61C7C
# gpg: Good signature from "Christian Borntraeger (IBM) <borntraeger@de.ibm.com>"

* remotes/borntraeger/tags/s390x-20150615:
  s390/bios: build with -fdelete-null-pointer-checks
  watchdog: Add new Virtual Watchdog action INJECT-NMI
  nmi: Implement inject_nmi() for non-monitor context use
  s390x/watchdog: diag288 migration support
  s390x/kvm: diag288 instruction interception and handling
  s390x/watchdog: introduce diag288 watchdog device
  watchdog: change option wording to allow for more watchdogs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/nmi.c')
-rw-r--r--hw/core/nmi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/core/nmi.c b/hw/core/nmi.c
index 3dff020659..5260d6c1ec 100644
--- a/hw/core/nmi.c
+++ b/hw/core/nmi.c
@@ -21,6 +21,7 @@
 
 #include "hw/nmi.h"
 #include "qapi/qmp/qerror.h"
+#include "monitor/monitor.h"
 
 struct do_nmi_s {
     int cpu_index;
@@ -70,6 +71,25 @@ void nmi_monitor_handle(int cpu_index, Error **errp)
     }
 }
 
+void inject_nmi(void)
+{
+#if defined(TARGET_I386)
+    CPUState *cs;
+
+    CPU_FOREACH(cs) {
+        X86CPU *cpu = X86_CPU(cs);
+
+        if (!cpu->apic_state) {
+            cpu_interrupt(cs, CPU_INTERRUPT_NMI);
+        } else {
+            apic_deliver_nmi(cpu->apic_state);
+        }
+    }
+#else
+    nmi_monitor_handle(0, NULL);
+#endif
+}
+
 static const TypeInfo nmi_info = {
     .name          = TYPE_NMI,
     .parent        = TYPE_INTERFACE,