diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2020-02-03 14:20:44 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2020-02-21 09:15:03 +1100 |
commit | a4c3791ae0c4a2e1f5d91f078bc9ad6e5d58867e (patch) | |
tree | 7b88d432f2c370eb650fa3a8ee1357c4194ee5dd /hw | |
parent | 7afee874f1b27abc998b8b747d16b77cb6398716 (diff) |
spapr/rtas: Print message from "ibm,os-term"
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>
Message-Id: <20200203032044.118585-1-aik@ozlabs.ru>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/spapr_rtas.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 883fe28465..656fdd2216 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); |