All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Shivang Upadhyay <shivangu@linux.ibm.com>,
	Aditya Gupta <adityag@linux.ibm.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Pedro Barbuda <pbarbuda@microsoft.com>,
	Mohamed Mediouni <mohamed@unpredictable.fr>,
	Nicholas Piggin <npiggin@gmail.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Eric Farman <farman@linux.ibm.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Subject: Re: what is qemu_system_guest_panicked() for?
Date: Tue, 14 Jul 2026 14:19:37 -0300	[thread overview]
Message-ID: <87v7ah4hg6.fsf@suse.de> (raw)
In-Reply-To: <bc94506bd307f3273b199a432a4f6df8c219b212.camel@linux.ibm.com>

Shivang Upadhyay <shivangu@linux.ibm.com> writes:

> On Tue, 2026-07-14 at 15:54 +0530, Aditya Gupta wrote:
>> > guest code.
>> > 
>> > PPC folks, please confirm, it's been years since I looked at this.
>> True. The way the spec mentions it seems the OS can get control back
>> after
>> execution of ibm,os-term.
>> 
>> This difference is noticeable with `panic=15`. On an LPAR, this would
>> print the
>> following line and do a reboot after a timeout of 15s (this happens
>> in linux
>> after it has done the os-term call):
>> 
>>      [  338.186072] Rebooting in 15 seconds..
>> 
>> But on QEMU, this isn't printed, and the machine powers down:
>> 
>>      qemu-system-ppc64: OS terminated:
>> 
>> Maybe worth taking a look. Didn't notice this earlier, thanks Fabiano
>> !
>> 
>
> Hi Aditya Fabiano,
>  As we register the rtas(os-term) as the panic handler for spapr in
> linux, I think we expect the machine to be shut-down properly and not
> handle any of the work. I am not sure how else would we implement this
> function in qemu without using `qemu_system_guest_panicked`. I mean,
> the name conveys, the guest has "paniced".
>
> But then again as per PAPR, we should expected limited number of rtas
> calls from the OS (the following list).
> - nvram-fetch
> - nvram-store
> - display-character
> - power-off
> - ibm,power-off-ups
> - system-reboot
> - check-exception
>
> PAPR reffers to host as "live-halt" after it has called os-term. Not
> very sure on the meaning of this.
>
> Maybe other platforms then linux will rely on this? As Fabiano
> suggested he found some case where he needed to comment it out, That
> would be interesting scenario to explore.
>

To be clear: I don't know of anything that currently depends on a more
rigorous behavior of os-term.

If Linux, and probably other major OSes, use os-term to relay a panic
state to the hypervisor, this is fine. For the purposes of Peter's
question I think we can leave it at that.

---

PS:
The use-case I had in the past was related to this test suite:
https://github.com/legoater/pnv-test. I was looking for a way to do
clean termination of a vm from the guest OS while conveying the test
output in the message.

E.g:

$ cat slof.s
li      3,0
ori     3,3,61440       # H_RTAS
li      4,argbuf
.long 0x44000022
b .

argbuf:
.long 0x201f    # ibm,os-term
.long 0x65786974 # "exit"
.long 0 
.long . -8

$ ./qemu-system-ppc64 -bios slof.bin -d guest_errors
qemu: OS terminated: exit
Guest crashed


  reply	other threads:[~2026-07-14 17:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 16:02 what is qemu_system_guest_panicked() for? Peter Maydell
2026-07-11 15:01 ` Harsh Prateek Bora
2026-07-13  8:39 ` Daniel P. Berrangé
2026-07-13  8:57   ` Markus Armbruster
2026-07-13  9:06     ` Daniel P. Berrangé
2026-07-13 10:30       ` Cornelia Huck
2026-07-13 11:43       ` Markus Armbruster
2026-07-13 12:14         ` Daniel P. Berrangé
2026-07-13 13:57           ` Markus Armbruster
2026-07-13 15:02             ` Daniel P. Berrangé
2026-07-13 18:09               ` Markus Armbruster
2026-07-13 12:30   ` Peter Maydell
2026-07-13 10:22 ` Cornelia Huck
2026-07-13 13:53   ` Christian Borntraeger
2026-07-13 13:36 ` Fabiano Rosas
2026-07-14 10:24   ` Aditya Gupta
2026-07-14 14:47     ` Shivang Upadhyay
2026-07-14 17:19       ` Fabiano Rosas [this message]
2026-07-13 14:49 ` Fabiano Rosas
2026-07-13 15:03   ` Peter Maydell
2026-07-13 16:11     ` Fabiano Rosas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v7ah4hg6.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=adityag@linux.ibm.com \
    --cc=berrange@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=mohamed@unpredictable.fr \
    --cc=npiggin@gmail.com \
    --cc=pbarbuda@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shivangu@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.