From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Pedro Barbuda <pbarbuda@microsoft.com>,
Mohamed Mediouni <mohamed@unpredictable.fr>,
Nicholas Piggin <npiggin@gmail.com>,
Harsh Prateek Bora <harshpb@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
Eric Farman <farman@linux.ibm.com>,
Matthew Rosato <mjrosato@linux.ibm.com>
Subject: Re: what is qemu_system_guest_panicked() for?
Date: Mon, 13 Jul 2026 09:39:52 +0100 [thread overview]
Message-ID: <alSkWHw6ryhEEaDf@redhat.com> (raw)
In-Reply-To: <CAFEAcA_zmc=Vvs38Qos_gecCmGAbRgDQF-0+x85Ja66nsqrHxA@mail.gmail.com>
On Fri, Jul 10, 2026 at 05:02:53PM +0100, Peter Maydell wrote:
> (cc list is a random mix of maintainers of code that calls this
> function, Paolo as "main loop maintainer" and a few others who
> I thought might have an opinion.)
>
> We have a qemu_system_guest_panicked() function which causes QEMU
> to report this to the user and do one of a couple of possible options
> (shutdown, pause the VM, do nothing). This seems mostly intended for
> "the guest OS told us by some mechanism that it just panicked". But
> we use it more widely than that...
>
> Cases which are "the guest told us about a panic":
> - accel/kvm/kvm-all.c handling of the KVM_EXIT_SYSTEM_EVENT SEV_TERM
> and CRASH subtypes
> - the pvpanic device
> - the spapr ibm,os-term RTAS call
> - x86 kvm: tdx_panicked_on_fatal_error()
> - x86 xen: the SHUTDOWN_crash shutdown subtype
>
> Cases which are not:
> - hw/spapr/rtas.c: if the FDT has no RTAS address during system reset
> - hw/spapr/spapr_events.c: if we wanted to deliver a machine check
> exception to the guest but the FDT has no RTAS address
> - hw/spapr/spapr_events.c: if we want to deliver a machine check
> but the guest is still dealing with a previous machine check
> - arm whpx, if we get an unknown/unexpected exit code trying to run the VM
> - x86 nvmm, for an unknown/unexpected VM exit code
> - ppc TCG, in powerpc_checkstop(), for a machine check exception I think
> - s390_handle_wait(): not sure exactly what this is
> - s390 unmanageable_intercept(): again not sure, think this is where
> the guest has gone off the rails and we can't keep running
>
> At least one or two of the above have comments to the effect that
> they don't want to use e.g. cpu_abort() because they want to give
> the user the ability to examine the VM after this unrecoverable
> guest error, rather than just exiting QEMU.
>
> So I guess my question is, is it OK to mash these two categories of
> "we can't keep running the VM" together, or should we define a new
> one for the "unrecoverable guest error" case, or do we already have
> some better thing to do that I missed?
IMHO we should NOT be abusing "panicked" for cases which are
not guest OS panics.
Adding new QMP events is cheap and we should do so. We need
at least a "MCE" event.
IMHO the "unknown / unexpected" VM exits likely deserve a
different event again.
>
> In particular, "do nothing" might be a reasonable response for the
> user to configure to a guest panic notification, since the guest will
> presumably stick the vcpu into a do-nothing loop, but "do nothing"
> doesn't make sense for "unrecoverable guest error" because we'll
> probably then sit in QEMU in a tight loop retrying whatever it
> was that failed.
>
> If we had some kind of qemu_system_unrecoverable_guest_error() then
> we could maybe convert some uses of cpu_abort() over to that (though
> uses of cpu_abort() are a very mixed bunch, some of which should be
> LOG_UNIMP or LOG_GUEST_ERROR and continue and some of which should
> be straightforward assertions, as well as some which might be this
> new exit case).
>
> (This query was prompted by a patch for arm whpx which adds a new
> qemu_system_guest_panicked() call for an unhandled VM exit situation.)
>
> thanks
> -- PMM
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-07-13 8:40 UTC|newest]
Thread overview: 20+ 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é [this message]
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-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=alSkWHw6ryhEEaDf@redhat.com \
--to=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 \
/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.