Re: [PATCH v2 1/3] runstate: set crash_occurred on guest crashloaded
Philippe Mathieu-Daudé <[email protected]> Wed, 5 Aug 2026 13:21:10 +0200
| Newsgroups | gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 5/8/26 11:05, Zhengrong Li wrote: > Windows pvpanic driver writes PVPANIC_CRASH_LOADED (bit 1) on > bugcheck, not PVPANIC_PANICKED (bit 0). As a result, > qemu_system_guest_panicked() is never called and crash_occurred > stays false for Windows guests. > > Set crash_occurred in qemu_system_guest_crashloaded() as well, > so the faulting CPU can be identified in the guest dump. > > Signed-off-by: Zhengrong Li <[email protected]> > --- > system/runstate.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/system/runstate.c b/system/runstate.c > index 08acf801b0..c7961cc1df 100644 > --- a/system/runstate.c > +++ b/system/runstate.c > @@ -724,6 +724,11 @@ void qemu_system_guest_panicked(GuestPanicInformation *info) > void qemu_system_guest_crashloaded(GuestPanicInformation *info) > { > qemu_log_mask(LOG_GUEST_ERROR, "Guest crash loaded"); > + > + if (current_cpu) { > + current_cpu->crash_occurred = true; This is generic code, I'm surprised we need to update the vCPU thread here. Could it be the reponsibility of the caller? As you described, pvpanic so add this change in handle_event()? I'm also surprised qemu_system_guest_panicked() does that -- the change comes from commit bac05aa9a77 ("cpu: Add crash_occurred flag into CPUState") which doesn't explain much. Unfortunately the pvpanic code doesn't have any maintainer listed... Cc'ing some developers active in this code... $ git grep @ $(git ls-files|fgrep pvpanic) hw/misc/pvpanic-pci.c:7: * Mihai Carabas <[email protected]> hw/misc/pvpanic.c:7: * Wen Congyang <[email protected]> hw/misc/pvpanic.c:8: * Hu Tao <[email protected]> > + } > + > qapi_event_send_guest_crashloaded(GUEST_PANIC_ACTION_RUN, info); > qapi_free_GuestPanicInformation(info); > }