From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wudqw-0000fO-Bl for qemu-devel@nongnu.org; Wed, 11 Jun 2014 04:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wudqn-0001pH-FX for qemu-devel@nongnu.org; Wed, 11 Jun 2014 04:25:50 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:47358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wudqn-0001oz-8T for qemu-devel@nongnu.org; Wed, 11 Jun 2014 04:25:41 -0400 Received: by mail-pa0-f48.google.com with SMTP id bj1so1652864pad.7 for ; Wed, 11 Jun 2014 01:25:40 -0700 (PDT) Message-ID: <5398127D.9020506@ozlabs.ru> Date: Wed, 11 Jun 2014 18:25:33 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1402387005-28901-3-git-send-email-nikunj@linux.vnet.ibm.com> In-Reply-To: <1402387005-28901-3-git-send-email-nikunj@linux.vnet.ibm.com> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] ppc: spapr-rtas - implement os-term rtas call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, aik@au1.ibm.com 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 > --- > 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