[PATCH v2 0/3] Identify faulting CPU in Windows crash dumps

Zhengrong Li <[email protected]> Wed, 05 Aug 2026 17:05:58 +0800
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
When a Windows guest crashes and generates a memory dump, the dump
file does not indicate which CPU triggered the panic. This series
adds support for recording the crash_occurred flag in the QEMUCPUState
structure and using it in elf2dmp to identify the faulting CPU.

Thanks to Akihiko Odaki for reviewing v1 and pointing out these issues.

Changes since v1:
  - Revert QEMUCPUSTATE_VERSION bump (tools check size, not version)
  - Fix -Werror=unused-variable on i386 by moving crash_occurred check outside #ifdef
  - Add size-based field detection in elf2dmp for forward compatibility
  - Set header context before best-effort guest memory operations
  - Use LIVE_SYSTEM_DUMP when BugcheckCode is zero
  - Use PRIx32 for BugcheckCode format specifier
  - Use linux.alibaba.com identity consistently

Zhengrong Li (3):
  runstate: set crash_occurred on guest crashloaded
  dump: add crash_occurred flag to QEMUCPUState
  elf2dmp: fill ContextBuffer with faulting CPU context

 contrib/elf2dmp/kdbg.h     |  9 +++++++
 contrib/elf2dmp/main.c     | 50 ++++++++++++++++++++++++++++++++++++--
 contrib/elf2dmp/qemu_elf.c | 20 +++++++++------
 contrib/elf2dmp/qemu_elf.h |  3 +++
 system/runstate.c          |  5 ++++
 target/i386/arch_dump.c    |  6 +++++
 6 files changed, 84 insertions(+), 9 deletions(-)

-- 
2.43.0