From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aik@au1.ibm.com, qemu-ppc@nongnu.org, agraf@suse.de,
nikunj@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v2] ppc: spapr-rtas - implement os-term rtas call
Date: Thu, 12 Jun 2014 17:39:31 +0530 [thread overview]
Message-ID: <1402574971-26672-2-git-send-email-nikunj@linux.vnet.ibm.com> (raw)
PAPR compliant guest calls this in absence of kdump. After
receiving this call qemu could trigger a guest dump. This guest dump
can be used to analyse using crash tool.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
v2: indentation fixes
hw/ppc/spapr_rtas.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index ea4a2b2..f030e73 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -29,6 +29,8 @@
#include "sysemu/char.h"
#include "hw/qdev.h"
#include "sysemu/device_tree.h"
+#include "qapi/qmp/qjson.h"
+#include "monitor/monitor.h"
#include "hw/ppc/spapr.h"
#include "hw/ppc/spapr_vio.h"
@@ -267,6 +269,34 @@ static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu,
rtas_st(rets, 0, ret);
}
+static void rtas_ibm_os_term(PowerPCCPU *cpu,
+ sPAPREnvironment *spapr,
+ uint32_t token, uint32_t nargs,
+ target_ulong args,
+ uint32_t nret, target_ulong rets)
+{
+ target_ulong ret = 0;
+ QObject *data;
+
+ data = qobject_from_jsonf("{ 'action': %s }", "pause");
+ monitor_protocol_event(QEVENT_GUEST_PANICKED, data);
+ qobject_decref(data);
+ vm_stop(RUN_STATE_GUEST_PANICKED);
+
+ rtas_st(rets, 0, ret);
+}
+
+static void rtas_ibm_ext_os_term(PowerPCCPU *cpu,
+ sPAPREnvironment *spapr,
+ uint32_t token, uint32_t nargs,
+ target_ulong args,
+ uint32_t nret, target_ulong rets)
+{
+ target_ulong ret = 0;
+
+ rtas_st(rets, 0, ret);
+}
+
static struct rtas_call {
const char *name;
spapr_rtas_fn fn;
@@ -392,6 +422,8 @@ static void core_rtas_register_types(void)
rtas_ibm_get_system_parameter);
spapr_rtas_register("ibm,set-system-parameter",
rtas_ibm_set_system_parameter);
+ spapr_rtas_register("ibm,os-term", rtas_ibm_os_term);
+ spapr_rtas_register("ibm,extended-os-term", rtas_ibm_ext_os_term);
}
type_init(core_rtas_register_types)
--
1.8.3.1
next reply other threads:[~2014-06-12 12:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 12:09 Nikunj A Dadhania [this message]
2014-06-17 9:13 ` [Qemu-devel] [PATCH v2] ppc: spapr-rtas - implement os-term rtas call Alexander Graf
2014-06-17 9:30 ` Nikunj A Dadhania
2014-06-17 9:53 ` Alexander Graf
2014-06-17 9:59 ` Nikunj A Dadhania
2014-06-17 10:02 ` Alexander Graf
2014-06-17 10:19 ` Nikunj A Dadhania
2014-06-25 4:36 ` Nikunj A Dadhania
2014-06-25 11:03 ` Alexander Graf
2014-06-25 11:27 ` Nikunj A Dadhania
2014-06-25 11:32 ` Alexander Graf
2014-06-26 7:55 ` Nikunj A Dadhania
2014-06-26 8:04 ` Alexander Graf
2014-06-26 9:05 ` Nikunj A Dadhania
2014-06-26 9:22 ` Alexander Graf
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=1402574971-26672-2-git-send-email-nikunj@linux.vnet.ibm.com \
--to=nikunj@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=aik@au1.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).