qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH qemu] spapr/rtas: Print message from "ibm,os-term"
@ 2020-02-03  3:20 Alexey Kardashevskiy
  2020-02-03 20:51 ` Daniel Henrique Barboza
  2020-02-04  5:58 ` David Gibson
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2020-02-03  3:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc, David Gibson

The "ibm,os-term" RTAS call has a single parameter which is a pointer to
a message from the guest kernel about the termination cause; this prints
it.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/ppc/spapr_rtas.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index 883fe28465e6..656fdd221665 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -345,6 +345,13 @@ static void rtas_ibm_os_term(PowerPCCPU *cpu,
                             target_ulong args,
                             uint32_t nret, target_ulong rets)
 {
+    target_ulong msgaddr = rtas_ld(args, 0);
+    char msg[512];
+
+    cpu_physical_memory_read(msgaddr, msg, sizeof(msg) - 1);
+    msg[sizeof(msg) - 1] = 0;
+
+    error_report("OS terminated: %s", msg);
     qemu_system_guest_panicked(NULL);
 
     rtas_st(rets, 0, RTAS_OUT_SUCCESS);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH qemu] spapr/rtas: Print message from "ibm,os-term"
  2020-02-03  3:20 [PATCH qemu] spapr/rtas: Print message from "ibm,os-term" Alexey Kardashevskiy
@ 2020-02-03 20:51 ` Daniel Henrique Barboza
  2020-02-04  5:58 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2020-02-03 20:51 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, David Gibson



On 2/3/20 12:20 AM, Alexey Kardashevskiy wrote:
> The "ibm,os-term" RTAS call has a single parameter which is a pointer to
> a message from the guest kernel about the termination cause; this prints
> it.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>   hw/ppc/spapr_rtas.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>


> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 883fe28465e6..656fdd221665 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -345,6 +345,13 @@ static void rtas_ibm_os_term(PowerPCCPU *cpu,
>                               target_ulong args,
>                               uint32_t nret, target_ulong rets)
>   {
> +    target_ulong msgaddr = rtas_ld(args, 0);
> +    char msg[512];
> +
> +    cpu_physical_memory_read(msgaddr, msg, sizeof(msg) - 1);
> +    msg[sizeof(msg) - 1] = 0;
> +
> +    error_report("OS terminated: %s", msg);
>       qemu_system_guest_panicked(NULL);
>   
>       rtas_st(rets, 0, RTAS_OUT_SUCCESS);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH qemu] spapr/rtas: Print message from "ibm,os-term"
  2020-02-03  3:20 [PATCH qemu] spapr/rtas: Print message from "ibm,os-term" Alexey Kardashevskiy
  2020-02-03 20:51 ` Daniel Henrique Barboza
@ 2020-02-04  5:58 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2020-02-04  5:58 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On Mon, Feb 03, 2020 at 02:20:44PM +1100, Alexey Kardashevskiy wrote:
> The "ibm,os-term" RTAS call has a single parameter which is a pointer to
> a message from the guest kernel about the termination cause; this prints
> it.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Applied to ppc-for-5.0, thanks.

> ---
>  hw/ppc/spapr_rtas.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 883fe28465e6..656fdd221665 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -345,6 +345,13 @@ static void rtas_ibm_os_term(PowerPCCPU *cpu,
>                              target_ulong args,
>                              uint32_t nret, target_ulong rets)
>  {
> +    target_ulong msgaddr = rtas_ld(args, 0);
> +    char msg[512];
> +
> +    cpu_physical_memory_read(msgaddr, msg, sizeof(msg) - 1);
> +    msg[sizeof(msg) - 1] = 0;
> +
> +    error_report("OS terminated: %s", msg);
>      qemu_system_guest_panicked(NULL);
>  
>      rtas_st(rets, 0, RTAS_OUT_SUCCESS);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-04 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03  3:20 [PATCH qemu] spapr/rtas: Print message from "ibm,os-term" Alexey Kardashevskiy
2020-02-03 20:51 ` Daniel Henrique Barboza
2020-02-04  5:58 ` David Gibson

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).