From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, mdroth@linux.vnet.ibm.com, agraf@suse.de,
borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com,
Mao Chuan Li <maochuan@linux.vnet.ibm.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH 6/6] watchdog: Add new Virtual Watchdog action INJECT-NMI
Date: Fri, 17 Apr 2015 09:52:41 +0200 [thread overview]
Message-ID: <1429257161-29597-7-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1429257161-29597-1-git-send-email-cornelia.huck@de.ibm.com>
From: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
This patch allows QEMU to inject a NMI into a guest when the
watchdog expires.
Signed-off-by: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
hw/watchdog/watchdog.c | 10 ++++++++++
qapi-schema.json | 6 +++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 54440c9..8d4b0ee 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -27,6 +27,7 @@
#include "sysemu/sysemu.h"
#include "sysemu/watchdog.h"
#include "qapi-event.h"
+#include "hw/nmi.h"
/* Possible values for action parameter. */
#define WDT_RESET 1 /* Hard reset. */
@@ -35,6 +36,7 @@
#define WDT_PAUSE 4 /* Pause. */
#define WDT_DEBUG 5 /* Prints a message and continues running. */
#define WDT_NONE 6 /* Do nothing. */
+#define WDT_NMI 7 /* Inject nmi into the guest */
static int watchdog_action = WDT_RESET;
static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
@@ -95,6 +97,8 @@ int select_watchdog_action(const char *p)
watchdog_action = WDT_DEBUG;
else if (strcasecmp(p, "none") == 0)
watchdog_action = WDT_NONE;
+ else if (strcasecmp(p, "inject-nmi") == 0)
+ watchdog_action = WDT_NMI;
else
return -1;
@@ -138,5 +142,11 @@ void watchdog_perform_action(void)
case WDT_NONE:
qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_NONE, &error_abort);
break;
+
+ case WDT_NMI:
+ qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_INJECT_NMI,
+ &error_abort);
+ inject_nmi();
+ break;
}
}
diff --git a/qapi-schema.json b/qapi-schema.json
index ac9594d..2d3bce2 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3606,10 +3606,14 @@
#
# @none: nothing is done
#
+# @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
+# VCPUS on x86)
+#
# Since: 2.1
##
{ 'enum': 'WatchdogExpirationAction',
- 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none' ] }
+ 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
+ 'inject-nmi' ] }
##
# @IoOperationType
--
2.3.5
next prev parent reply other threads:[~2015-04-17 7:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 7:52 [Qemu-devel] [PATCH 0/6] s390x: support diag288 watchdog Cornelia Huck
2015-04-17 7:52 ` [Qemu-devel] [PATCH 1/6] s390x/virtio-ccw: enable has_dynamic_sysbus Cornelia Huck
2015-04-21 19:06 ` Alexander Graf
2015-04-22 8:25 ` Cornelia Huck
2015-04-22 9:14 ` Alexander Graf
2015-04-22 11:40 ` Cornelia Huck
2015-04-22 12:21 ` Alexander Graf
2015-04-24 9:07 ` Cornelia Huck
2015-04-27 13:57 ` Alexander Graf
2015-04-27 14:19 ` Cornelia Huck
2015-04-27 15:15 ` Andreas Färber
2015-04-27 17:02 ` Cornelia Huck
2015-04-27 15:28 ` Alexander Graf
2015-04-27 16:56 ` Cornelia Huck
2015-04-28 6:50 ` Markus Armbruster
2015-04-17 7:52 ` [Qemu-devel] [PATCH 2/6] watchdog: Add watchdog device diag288 to the sysbus Cornelia Huck
2015-04-29 12:43 ` Markus Armbruster
2015-04-29 14:58 ` Cornelia Huck
2015-05-08 9:16 ` Cornelia Huck
2015-04-17 7:52 ` [Qemu-devel] [PATCH 3/6] s390/kvm: diag288 instruction interception and handling Cornelia Huck
2015-04-21 19:09 ` Alexander Graf
2015-04-22 8:32 ` Cornelia Huck
2015-04-22 9:16 ` Alexander Graf
2015-04-22 11:37 ` Cornelia Huck
2015-04-17 7:52 ` [Qemu-devel] [PATCH 4/6] watchdog: Add migration support to diag288 watchdog device Cornelia Huck
2015-04-17 7:52 ` [Qemu-devel] [PATCH 5/6] nmi: Implement inject_nmi() for non-monitor context use Cornelia Huck
2015-04-17 7:52 ` Cornelia Huck [this message]
2015-04-17 12:28 ` [Qemu-devel] [PATCH 6/6] watchdog: Add new Virtual Watchdog action INJECT-NMI Eric Blake
2015-04-20 15:23 ` Cornelia Huck
-- strict thread matches above, loose matches on Subject: below --
2015-06-11 15:53 [Qemu-devel] [PATCH 0/6] s390x/watchdog: add diag288 based watchdog Christian Borntraeger
2015-06-11 15:53 ` [Qemu-devel] [PATCH 6/6] watchdog: Add new Virtual Watchdog action INJECT-NMI Christian Borntraeger
2015-06-15 13:55 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1429257161-29597-7-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=lcapitulino@redhat.com \
--cc=maochuan@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).