ppc: spapr-rtas - implement os-term rtas call
PATCH 3/3 ppc: spapr-rtas - implement os-term rtas call
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.
--- hw/ppc/spapr_rtas.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
hw/ppc/spapr_rtas.c +34 -0
@@ -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)
Signature · 1 line
1.8.3.1
Quoted 23 lines · Nikunj A Dadhania
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 <[email protected]>--- hw/ppc/spapr_rtas.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)hw/ppc/spapr_rtas.c +2
-0@@ -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"
hw/ppc/spapr_rtas.c static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu, · line 276
Quoted 8 lines
hw/ppc/spapr_rtas.c +5
-0@@ -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 "(".
Quoted 7 lines
hw/ppc/spapr_rtas.c +7
-0+{ +target_ulong ret =0 ; +QObject *data; + + data =qobject_from_jsonf ("{ 'action': %s }" ,"pause" ); +monitor_protocol_event (QEVENT_GUEST_PANICKED , data); +qobject_decref (data);
hw/ppc/spapr_rtas.c static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu, · line 293
Quoted 10 lines
hw/ppc/spapr_rtas.c +10
-0+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
Quoted 10 lines
hw/ppc/spapr_rtas.c +6
-0+{ +target_ulong ret =0 ; + +rtas_st (rets,0 , ret); +} + static struct rtas_call { const char *name; spapr_rtas_fn fn;
hw/ppc/spapr_rtas.c static void core_rtas_register_types(void) · line 428
Quoted 7 lines
hw/ppc/spapr_rtas.c +4
-0@@ -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?
Quoted 4 lines
hw/ppc/spapr_rtas.c +0
-0}type_init (core_rtas_register_types)
Signature · 1 line
Alexey
Quoted 27 lines · Alexey Kardashevskiy
Quoted 26 lines · Nikunj A Dadhania
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 <[email protected]>--- hw/ppc/spapr_rtas.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)hw/ppc/spapr_rtas.c +2
-0@@ -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); }
Quoted 7 lines
hw/ppc/spapr_rtas.c static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu, · line 276
Quoted 5 lines
hw/ppc/spapr_rtas.c +5
-0+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
Quoted 12 lines
Quoted 12 lines
hw/ppc/spapr_rtas.c +11
-0+{ +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); +}
Quoted 8 lines
hw/ppc/spapr_rtas.c static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu, · line 293
Quoted 6 lines
hw/ppc/spapr_rtas.c +6
-0+ +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
Quoted 11 lines
Quoted 11 lines
hw/ppc/spapr_rtas.c +6
-0+{ +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);
Quoted 8 lines
hw/ppc/spapr_rtas.c static void core_rtas_register_types(void) · line 428
Quoted 6 lines
hw/ppc/spapr_rtas.c +4
-0spapr_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