mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/6] panic, x86/vmware: Preserve crash logs before kdump
@ 2026-09-28 17:55 Zack Rusin
  2026-09-28 17:55 ` [PATCH v2 1/6] panic: Add a notifier chain for pre-kdump callbacks Zack Rusin
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Zack Rusin @ 2026-09-28 17:55 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek, Baoquan He, Mike Rapoport,
	Pasha Tatashin, Pratyush Yadav, Dave Young
  Cc: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Joel Granados,
	Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
	virtualization, bcm-kernel-feedback-list, linux-kernel,
	John Ogness, Steven Rostedt, Sergey Senozhatsky, Kees Cook,
	Jonathan Corbet, Bo Gan, Brennan Lamoreaux, kexec, linux-doc,
	Guilherme G. Piccoli, Maaz Mombasawala, Shuah Khan, Randy Dunlap,
	Stephen Brennan, Michael Kelley, Ian Forbes

A VMware guest may have no persistent storage or working userspace after
a crash. Preserve its newest kernel log tail in the host's vmware.log
before entering kdump, without enabling every panic notifier by default.

Following Petr's suggestion, add one generic panic_pre_kdump_list with
VMware as its first client. A set-once helper covers panic() and direct
crash-kexec entry. Fatal oopses can reach kdump without calling panic(),
so patch 2 adds that call after capturing the original registers under
the existing kexec lock. The late panic call follows sys_info() and
precedes the kmsg dumpers.

Patch 3 adds Guilherme's suggested escape hatch for debugging kdump
failures involving early callbacks. With panic_pre_kdump_postpone set,
the list runs before kdump only when crash_kexec_post_notifiers is also
set. This can omit hypervisor crash handling as well as diagnostics.
The late panic call remains eligible. This policy is a separate patch;
I can omit patch 3 if it is not wanted.

The logger preallocates an 8 KiB buffer and bounds its register-based
RPC transfer and retries. Michael suggested increasing the buffer
because 4 KiB can omit useful stack-trace context. Ordinary guests
enable logging by default; encrypted guests must opt in. Use
bool/proc_dobool for the sysctl as Joel requested. The potentially
terminating REPORTGUESTCRASH event remains a separate late dumper,
suppressed whenever a crash image is loaded. The v1 assignment to
crash_kexec_post_notifiers is dropped.

Tested on VMware Workstation and ESXi with ordinary guests, and on
ESXi with SEV-SNP and TDX guests.

v1:
https://lore.kernel.org/r/cover.1788414671.git.zack.rusin@broadcom.com

Zack Rusin (6):
  panic: Add a notifier chain for pre-kdump callbacks
  crash: Notify pre-kdump callbacks before switching kernels
  panic: Allow postponing pre-kdump notifiers
  x86/vmware: Add a bounded pre-kdump log sender
  x86/vmware: Add the vmware_record_panic_msg sysctl
  x86/vmware: Report guest crashes after kmsg dumpers

 .../admin-guide/kernel-parameters.txt         |  14 +
 Documentation/admin-guide/sysctl/kernel.rst   |  20 ++
 arch/x86/include/asm/vmware.h                 |   2 +
 arch/x86/kernel/cpu/vmware.c                  | 250 ++++++++++++++++++
 include/linux/panic_notifier.h                |   4 +
 kernel/crash_core.c                           |   3 +
 kernel/panic.c                                |  28 ++
 7 files changed, 321 insertions(+)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-09-28 20:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 17:55 [PATCH v2 0/6] panic, x86/vmware: Preserve crash logs before kdump Zack Rusin
2026-09-28 17:55 ` [PATCH v2 1/6] panic: Add a notifier chain for pre-kdump callbacks Zack Rusin
2026-09-28 18:04   ` sashiko-bot
2026-09-28 17:55 ` [PATCH v2 2/6] crash: Notify pre-kdump callbacks before switching kernels Zack Rusin
2026-09-28 18:08   ` sashiko-bot
2026-09-28 18:40     ` Zack Rusin
2026-09-28 17:55 ` [PATCH v2 3/6] panic: Allow postponing pre-kdump notifiers Zack Rusin
2026-09-28 18:04   ` sashiko-bot
2026-09-28 17:55 ` [PATCH v2 4/6] x86/vmware: Add a bounded pre-kdump log sender Zack Rusin
2026-09-28 18:07   ` sashiko-bot
2026-09-28 17:55 ` [PATCH v2 5/6] x86/vmware: Add the vmware_record_panic_msg sysctl Zack Rusin
2026-09-28 18:06   ` sashiko-bot
2026-09-28 17:55 ` [PATCH v2 6/6] x86/vmware: Report guest crashes after kmsg dumpers Zack Rusin
2026-09-28 18:03   ` sashiko-bot
2026-09-28 20:39 ` [PATCH v2 0/6] panic, x86/vmware: Preserve crash logs before kdump Bradley Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®