* [Qemu-devel] [PATCH 3/3] ppc: spapr-rtas - implement os-term rtas call
@ 2014-06-10 7:56 Nikunj A Dadhania
2014-06-11 8:25 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
0 siblings, 1 reply; 3+ messages in thread
From: Nikunj A Dadhania @ 2014-06-10 7:56 UTC (permalink / raw)
To: qemu-devel; +Cc: aik, qemu-ppc, agraf, nikunj
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>
---
hw/ppc/spapr_rtas.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index ea4a2b2..5ed8a0e 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,10 @@ 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] ppc: spapr-rtas - implement os-term rtas call
2014-06-10 7:56 [Qemu-devel] [PATCH 3/3] ppc: spapr-rtas - implement os-term rtas call Nikunj A Dadhania
@ 2014-06-11 8:25 ` Alexey Kardashevskiy
2014-06-12 8:01 ` Nikunj A Dadhania
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kardashevskiy @ 2014-06-11 8:25 UTC (permalink / raw)
To: Nikunj A Dadhania, qemu-devel; +Cc: qemu-ppc, aik
On 06/10/2014 05:56 PM, Nikunj A Dadhania wrote:
> 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>
> ---
> hw/ppc/spapr_rtas.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index ea4a2b2..5ed8a0e 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)
Indentation is broken here, should be 1 char right to align to "(".
> +{
> + 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)
Same here, shift 5 chars to the right
> +{
> + target_ulong ret = 0;
> +
> + rtas_st(rets, 0, ret);
> +}
> +
> static struct rtas_call {
> const char *name;
> spapr_rtas_fn fn;
> @@ -392,6 +422,10 @@ 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);
While we are here, why to wrap these two?
> }
>
> type_init(core_rtas_register_types)
>
--
Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] ppc: spapr-rtas - implement os-term rtas call
2014-06-11 8:25 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
@ 2014-06-12 8:01 ` Nikunj A Dadhania
0 siblings, 0 replies; 3+ messages in thread
From: Nikunj A Dadhania @ 2014-06-12 8:01 UTC (permalink / raw)
To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, aik
Alexey Kardashevskiy <aik@ozlabs.ru> writes:
> On 06/10/2014 05:56 PM, Nikunj A Dadhania wrote:
>> 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>
>> ---
>> hw/ppc/spapr_rtas.c | 34 ++++++++++++++++++++++++++++++++++
>> 1 file changed, 34 insertions(+)
>>
>> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
>> index ea4a2b2..5ed8a0e 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)
>
> Indentation is broken here, should be 1 char right to align to "(".
Sure, will fix
>
>> +{
>> + 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)
>
> Same here, shift 5 chars to the right
Sure
>> +{
>> + target_ulong ret = 0;
>> +
>> + rtas_st(rets, 0, ret);
>> +}
>> +
>> static struct rtas_call {
>> const char *name;
>> spapr_rtas_fn fn;
>> @@ -392,6 +422,10 @@ 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);
>
> While we are here, why to wrap these two?
You are right, will fix.
Regards
Nikunj
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-12 8:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 7:56 [Qemu-devel] [PATCH 3/3] ppc: spapr-rtas - implement os-term rtas call Nikunj A Dadhania
2014-06-11 8:25 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2014-06-12 8:01 ` Nikunj A Dadhania
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).